Showing posts with label Bindings. Show all posts
Showing posts with label Bindings. Show all posts

June 20, 2017

Issue: REST web services are created in AppModule but disappeared

[JDev 12.1.3]

Issue:

I have created an ADF application in JDeveloper 12.1.3 in which I created restful web services in the app module for the business components. I created another ViewObject by custom sql query and added to app module and created rest services for it. Suddenly all my existing rest services are disappeared from the app module window and + button under REST tab is also disabled as shown in the below image. There is no error or alert shown.


I can see the xml files in the project structure but are not appeared in the AppModule window.

Solution:

While creating my new view object by sql , I have not given any key attribute and added it to app module. I rolled back my changes and created the same view object with a key attribute and created rest service for the same view object now and it worked. It added to the list of rest services in the app module and all are appeared.

When you create rest service to any VO, an xml file like below is created.
 "AppModule_<ResourceName>Resource.xml"

When you delete the REST service, this file will not be deleted. If you try to create REST service again with the same name, then also you face the above issue. So, check if this xml file is deleted from the project before creating new one.

February 14, 2017

Error: Calling the constructor for class oracle.jbo.server.SequenceImpl is not permitted

[JDev 12.1.3]

I have created an EntityObject in the Model project and assigned a DB sequence to the key attribute of it. While running the project, I got the below error.

[Static type checking] - [ADF security error] Calling the constructor for class oracle.jbo.server.SequenceImpl is not permitted.


To avoid this issue,
  • Go to the source of the entity object xml file
  • Search for the tag "TransientExpression"
  • Check the attribute trustMode. It may have the value "untrusted"
  • Change the value to "trusted". Save and run the app
Now the issue should be solved.

Note: The same solution is given in my previous post for the below error. This solution worked for both the issues.




December 6, 2016

Error: [ADF security error] The method getDBTransaction on class oracle.jbo.server.EntityImpl is not permitted

[JDev 12.2.1.0]

I have created an EntityObject from database table and assigned an expression to its key attribute to get the value from a database sequance (See this post to know how to assign a db sequence to a property in entity object ). But while building the project, I got the below error.

Error(11,53): [Static type checking] - [ADF security error] The method getDBTransaction on class oracle.jbo.server.EntityImpl is not permitted.
 @ line 11, column 53. Locations.bcs D:\Application2\Model\src\model Model.jpr


Which means that the entity is not trusted the expression changes. To avoid this issue,

  • Go to the source of the entity object xml file 
  • Search for the tag "TransientExpression"
  • Check the value of the attribute "trustMode"
  • If it is "untrusted", change it to "trusted"
  • Now rebuild the project
The above change solved my issue .






October 29, 2015

How to refresh a binding iterator through program

I have a data control created for a java class and using this I have created a table on a jspx page. On click of a button, I am doing some data changes in the bean and want to reflect them on the screen. Generally, we give partialTrigger to the table on the button which is alone not suffecient to update the content of the table on the page. The binding iterator has to be refreshed from the bean.

Below code snippet helps to refresh a binding iterator programmatically from ADF where "listRequestsIterator" is my binding iterator name on the page.          
   
BindingContext bctx = BindingContext.getCurrent();
BindingContainer bindings = bctx.getCurrentBindingsEntry();
DCIteratorBinding iter = (DCIteratorBinding)
bindings.get("listRequestsIterator");
iter.clearForRecreate();

February 6, 2013

Data Source connection to AppModule


By default AppModule is configured to database through the connection created in JDeveloper. But if we want to change the connection type to “JDBC DataSource” from “JDBC URL”, it expects a Datasource name as an input. But we need to pass the JNDI name to this field instead of data source name.

January 16, 2013

Fetching values of a list object of ADF bindings from Java


Before giving the solution, let me explain my scenario. I have JSF binding object “internalProfile” which is a list of a class. The definition of the object is like below.

List<KeyValue> internalProfile=new ArrayList<KeyValue>();

KeyValue is a bean with two String properties key and value.
A binding is created for the “internalProfile” and input fields are created for its values as below in JSF page.

//code in the JSF
<af:forEach items="#{bindings.internalProfile.rangeSet}" var="row" varStatus="sdiIndex">
<af:inputText value="#{row['value']}" label="#{row['key']}"                            id="it_${sdiIndex.index}"></af:inputText>
            </af:forEach>

We can see the bindings of the page below.





Now, I need to fetch all these text fields in my bean which is achieved by using the below code snippet.

BindingContainer bc =BindingContext.getCurrent().getCurrentBindingsEntry();
            oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding list = (oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding)bc.get(BINDING_INTERNAL_PROFILE);
            Row[] allRowsInRange = list.getAllRowsInRange();