Tuesday 27 March 2012

Oracle Forms / OraFormsFaces and Automated Testing

Automated testing tools rely on some key software attributes to enable the automatic testing of functionality in software. One of these attributes I recently had to deal with was field or object names for elements which reside in a web page / html page. Well, to be more specific, by default Oracle Forms return numbered record identifiers to the Forms Applet rendering the forms. By setting the record property to the value of "names" it will behave differently by returning the names by which the records are identified.
So, it is as simple as adding a request parameter to the Forms Servlet URL like below:
http://host:9001/forms/frmservlet?config=MyConfig&record=names
Then I would like to conclude in saying I was happy to discover that the OraFormsFaces framework does in fact pass on all request parameters to the Forms Server. Hence, if you append the same record parameter to the OraFormsFaces Forms URL (the one returning the JavaScript Functions) then it eventually sets the record parameter on the Forms Request and subsequently the record names are evident in the final response!!

Wednesday 14 March 2012

Oracle ADF Query Component : Executing custom code before or after process query

This is more a kind of note to myself. I had to execute custom code specifically after the query component finished querying and returning its results; i.o.w. after the search button was clicked on the ADF query component and subsequently after the processQuery-method was execute. I did it as follow:

  • I added the following method to my backing bean
   public void processQuery(QueryEvent queryEvent) {   
      
// over here you can put your PRE-processQuery custom code.      

       // call the usual method as part of default query processing.
       JSFUtils.resolveMethodExpression("#     {bindings.DefaultMyVOCriteriaQuery.processQuery}",
      null, new Class[]{QueryEvent.class}, new Object[] {queryEvent});   
      

       // over here you can put your POST-processQuery custom code.      
    }

  • I changed the queryListener attribute's value, of my query component to have the value of (referencing backing bean):
 queryListener="#{viewScope.myBackingBean.processQuery}