Wednesday, February 22, 2012

ADF application running on clustered environment - High Availability

In order for an ADF application to support High Availability in clustered environment with server fail over. The below steps must be followed in developing an ADF application.
  • All Manage Beans must implement Serializable.
  • UI component bindings must be declared in a bean with shorter scope (backing bean scope or request scope).
  • If it needs to be declared in Manage Bean with PageFlowScope (Not recommended), please ensure you declare the binding as transient.
  • Any objects that are declared as an attribute in Manage Bean must be Serialized.
The following files must be modified to make an ADF application High Available in clustered environment.

adf-config.xml


<adf-controller-config xmlns="http://xmlns.oracle.com/adf/controller/config">
     <adf-scope-ha-support>true</adf-scope-ha-support>
</adf-controller-config>

weblogic.xml


<session-descriptor>
      <persistent-store-type>replicated_if_clustered</persistent-store-type>
</session-descriptor>

For testing, please add the below parameter in your weblogic domain 
setDomainEnv.cmd
-Dorg.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION=all

Run each use case in UI application. Verify that you don’t see below highlighted errors in Domain console log.

[2012-02-22T13:29:25.383-06:00] [manageserver1] [ERROR] [] [oracle.adfinternal.controller.state.SessionBasedScopeMap] 
java.io.NotSerializableException: com.ram.mytest.manage.TestMB


Sunday, February 19, 2012

Programmatically resetting the ADF components

oracle.adf.view.rich.util.ResetUtils - An util class to reset the components.

ResetUtils.reset(javax.faces.component.UIComponent startComponent)

All values submitted will be reset to null or empty, so that editable components will pull their values from the model.

Sunday, December 12, 2010

Display validation messages on top of the page instead of popup

Validation messages can be displayed either as popup or on top of the page. 
To diplay the messages on top of the page. Add below tag at start of the page.
<af:messages id="m1" inline="true"/>

Monday, November 15, 2010

ADF Memory Scopes

Scopes in the context of pages(jspx)


Scopes in the context of fragments(jsff)



Sunday, November 14, 2010

Building ADF Jar using maven

You can build ADF jar using maven.
Steps:
In order to build ADF application using maven you need to add 2 plug-ins to the POM file
1. compiler plugin
2. ant plugin.
    Ant plugin is used to run the ojdeploy build xml file.
    ojdeploy build xml should have the deployment profile information.

Declarative way to allow an action to set value before navigation

On Actions like CommandButton, CommandLink,.. you can allow them to set value before navigating to another page by using <af:setActionListener>

Example:
<af:commandLink text="#{row.formattedName}" id="cl1" action="toSavePage">
 <af:setActionListener from="phoneNumber" to="#{pageFlowScope.phoneNum}"/>
 <af:setActionListener from="#{row.empId}" to="#{pageFlowScope.selectedEmployeeId}"/>
 </af:commandLink>

Default jsff/jspx page in Source Mode rather than WYSIWYG design editor

[picFileTypes.png]

To change default setting of opening jsff/jspx page in WYSIWYG editor to source mode:
Tools --> Preferences -->File Types --> select Default Editors --> select jsff page --> select default editor to source.