Some April 2015 Notes/Tips

1. detailStamp seems still not working well in af:table with autoHeightRows set, it’s causing slowness in page rendering or even page freezing

Env: jdev 11.1.2.4; issue: in IE8 & Chrome, sometimes the page is rendered very slowly or freezed or when scrolling on the af:table with middle mouse, the height of af:table is changing. I didn’t try to find a reproducible minimum test case, the problematic page structure looks like following:

<af:showDetailItem>
  //some more af:panalGroupLayout
  <af:panelCollection>
    <af:table autoHeightRows="20" ...>
     <f:facet name="detailStamp">
     ...
     </f:facet name="detailStamp">
     ... //columns
    </af:table>
  </af:panelCollection>
</af:showDetailItem>

In the end, I used the workaround of not using autoHeightRows and keep detailStamp, though it seems to be different with following issue but I think it’s quite relevant:

http://vtkrishn.com/2010/05/04/autoheightrows-along-with-detailstamp/

2. Oracle ALTA UI – I guess this is not a news anymore

http://www.oracle.com/webfolder/ux/mobile/style.html

http://www.oracle.com/usableapps

Reference: http://technology.amis.nl/2014/10/26/oracles-new-road-user-experience-launch-alta-ui-oracle-openworld-2014/

3. New in ADF 12c

3.1 writeXML, readXML method and xslt stuff, in VO & VORow class: I feel this is gonna be useful

3.2 embed groovy in error/warning/info messages:

The {ShipDate} must be before {SysDate}

where ShipDate and SysDate are groovy expressions, reference url, which contains grammar to access view accessor current row, attrs as well

4. To improve AM DB connection usage, for shared AM config, it’s better to set a common transaction name (Key: jbo.shared.txn)

Reference: http://docs.oracle.com/middleware/1213/adf/develop/adf-bc-am-shared.htm#ADFFD22201

5. Handle Access to Secured Task Flows in Region by Unauthorized Users:

In adf-config.xml, use <unauthorized-region-taskflow> tag to define a taskflow to be displayed when unauthorized users access:

<adf-controller-config xmlns="http://xmlns.oracle.com/adf/controller/config">
    <unauthorized-region-taskflow>/WEB-INF/task-flow-definition.xml
       </unauthorized-region-taskflow>
  </adf-controller-config>

Reference: http://docs.oracle.com/middleware/1213/adf/develop/task-flow-regions.htm#ADFFD23491

6. Render unknow number of regions (though better <= 10 regions in one page)

Reference: http://docs.oracle.com/middleware/1213/adf/develop/task-flow-regions.htm#ADFFD23072

7. An interesting API on AdfFacesContext class:

getEndUserMonitoringServices()

Will explore if this is can be used for client side performance tracking

8. ADF Security: (for some special reasons) I have to use only URL pattern protection instead of full ADF security features, this is how to do:

In adf-config.xml, change to:

authorizationEnforce="false"      //change to false
<!--CredentialStoreContext.../--> //comment out

In web.xml,


//This simply protect listed url resource for login users
<security-constraint>
 <web-resource-collection>
  <web-resource-name>adfAuthentication</web-resource-name>
  <url-pattern>/adfAuthentication</url-pattern>
 </web-resource-collection>
 <web-resource-collection>
  <web-resource-name>protectedPages</web-resource-name>
   <url-pattern>/faces/PageA</url-pattern>
   <url-pattern>/faces/PageA.jsf</url-pattern>
   <url-pattern>/faces/PageB</url-pattern>
   <url-pattern>/faces/PageB.jsf</url-pattern>
   <url-pattern>/faces/Welcome</url-pattern>
   <url-pattern>/faces/Welcome.jsf</url-pattern>
  </web-resource-collection>
 <auth-constraint>
  <role-name>valid-users</role-name>
 </auth-constraint>
</security-constraint>

9. Set resource (like image, js files) expire period in web.xml (12c), config different resource extension names:

Reference: http://docs.oracle.com/middleware/1213/adf/develop/appx-adf-xml-files.htm#ADFFD1435

Sample:

//Expires all static resources in 30 days
 <init-param>
   <param-name>expires</param-name>
   <param-value>60*60*24*30</param-value>
 </init-param> 

//Expires static resources with the .js file extension in 1 day
 <init-param>
   <param-name>expires.js</param-name>
   <param-value>60*60*24</param-value>
 </init-param> 

//Turns off staleness setting. Use for testing
 <init-param>
   <param-name>expires</param-name>
   <param-value>OFF</param-value>
 </init-param> 

//Specify file extensions for a number of different file formats
 <init-param>
   <param-name>extensions</param-name>
   <param-value>.png.jpg.jpeg.gif.js.css.</param-value>
 </init-param> 

//Specify visibility for cache control, for example
 <init-param>
   <param-name>visibility</param-name>
   <param-value>Public</param-value>
 </init-param>

If I am not wrong, similar setting was in adf-setting.xml insead of web.xml before ADF 12c.

10. Some useful Java API:

oracle.adf.view.rich.util.LoggerUtils
oracle.adf.controller.binding.BindingUtils

11. List of 12c deprecated classes and methods

http://docs.oracle.com/middleware/1213/adf/api-reference-faces/deprecated-list.html