Tuesday

Assign DBSequence to a property in Entity Object

I want to add a sequence to the user_id field in user_info table of my database. For which I have followed the below procedure.
  • Create a db sequence named “userid”
Create sequence userid start with 10000000001

  • Open the Entity Attribute, “user_id” in the Entity Object of the application
  • Select Type as Integer and  click on Value type “Expression” radio button
  • Enter the below expression in the value field
 (new oracle.jbo.server.SequenceImpl("USERID",adf.object.getDBTransaction())).getSequenceNumber()

Where “USERID” is the sequence name which is created already
  • Click on Ok

Thursday

Import ADF Taskflow into a Portal as a library


To import a ADF task flow into a web center portal application as a library, follow the below procedure

  • Create a deployment profile for the ADF task flow project as “ADF library jar”
  • Deploy and make adf library jar for the ADF task flow
  • Open the Resource Palette on right side of the JDev
  • Right click on “File System” and select the option “New File System Connection”
  • Provide a name to the connection and directory path where the adf task flow jar file is copied
  • The created connection will be added to the Resource Palette
  • Open the Portal application and select the project to which the task flow should be added
  • In the Resource Palette, expand the connection created and right click on the jar file, select the option “Add to Project”. It will ask for the confirmation to which project it will be added
  • Now expand the jar file and drag and drop the task flow listed in a jsf page as a region in which we want to show the task flow

Friday

f: loadBundle tag


To implement localization in ADF applications, we create property files with the fields and their values in different languages. For example, I have below property file with some fields and their values in Danish language. I want to display these values in the jsf page to the user.

BODY              =Hoveddel
ITEM               =Varepost
SUBMIT          =Indsend
SUMMARY     =Oversigt
COPY               =Kopier

To use these property fields and to display on the jspx/jsff page, we were provided a tag called “loadBundle” whose syntax is as below.

<f:loadBundle basename="application" var="app"/>

Where “application” is the basename of the property file and “app” is the variable name to be used in the jspx/jsff page to invoke these fields of the property file. If you are using more property files for different language like French,English and Danish, then the property file names should be as follows.

application_fr.properties
application_en.properties
application_da.properties

So, whenever the browser language is changed, the corresponding property file will be picked up to display the fields.
And to use the fields in the page, we use el expression syntax like #{app.BODY}
In the loadBundle tag, for the basename attribute, we can also pass the ResourceBundle class instead of property file name.