Advanced Table Functionalities in OAF!


1] Add A Row:

To add an ‘Add a Row’ button, in the advanced table, go to

Advanced Table > Advanced Table Components > Footer > Table Footer > New > Add A Row.

In the Structure pane, select the addTableRow item that is newly created, as shown in the figure above, and use the Property Inspector to set its following properties (* Required):

ID* – specify an identifier that uniquely identifies the addTableRow item in the page.

Add Rows Label – specify text to override the “Add Another Row” default text that appears in the Add Another Row button.

Rows to Add – specify the number of rows to add each time a user chooses the Add Another Row button. The value for this property must not be greater than the value set for the Records Displayed property on the advanced table. The default is 1. Note that this property is valid only if the Insert Rows Automatically property is set to True.

Insert Rows Automatically – specify True to indicate rows are to be added automatically when the Add Another Row button is chosen. Specify False if you want to respond to the event in your controller, so that you can, for example, set the primary keys or set some default row attributes. Note: The Insert Rows Automatically property is equivalent to the ‘autoInsertion’ property that was set in your controller using the setAutoInsertion API for classic tables.

Add a Row in OAF Advanced Table

If you want to handle the Add a Row Event in the Controller, First set Insert Rows Automatically to False and then in controller, processFormRequest method, call your AM method when user click on the ‘Add a Row’ in your advanced table – ‘AdvTblRN’.

if  ("addRows".equals(pageContext.getParameter("event")) &&
"AdvTblRN".equals(pageContext.getParameter("source")) )
{
  System.out.println("The source is :"+pageContext.getParameter("source"));
  String p_header_id = (String)pageContext.getTransactionValue("p_tx_header_id");
  Serializable[] param = {p_header_id};
  am.invokeMethod("createRow", param);
}

In AMImpl wrote the method:

public void createRow( String p_header_id)
{
  OAViewObject pervo = getPriceLinesVO1();    // Advanced Table VO
  if(!pervo.isPreparedForExecution()){
    pervo.executeQuery();
  }
  pervo.setMaxFetchSize(0);
  pervo.last();   // Go to the last Row of the VO
  String line_number =  pervo.getCurrentRow().getAttribute("LineNumber").toString();
  String description =  pervo.getCurrentRow().getAttribute("Description").toString();
  Number line_num = new Number(Integer.parseInt(line_number) + 1);
  pervo.next();
  Row row = pervo.createRow(); // Create a New Row
  // Insert the values in the row.
  Number header_id = new Number(Integer.parseInt(p_header_id));
  row.setAttribute("HeaderId",header_id);
  row.setAttribute("LineId",getOADBTransaction().getSequenceValue("XX_PRICE_LINES_SEQ"));
  row.setAttribute("Description",description);
  row.setAttribute("LineNumber",line_num);
  pervo.insertRow(row);  // Insert the row in DB
  row.setNewRowState(Row.STATUS_NEW);
  getOADBTransaction().commit();
  System.out.println("Commit Done");
}

2] Delete Multiple Rows:

Create a Transient Attribute of type String with any name (say SelectFlag) in the VO. Choose updatable always check button.

To add a Delete button, in the advanced table, go to

Advanced Table > Advanced Table Components > TableSelection > MultipleSelection > New > SubmitButton.

In the MultipleSelection, add the view attribute defined above.

Multiple delete in OAF Advanced Table

In the controller, add logic as below:

if (pageContext.getParameter("DelBtn") != null)
{
  System.out.println("In Delete Button");
  System.out.println("The source is:"+pageContext.getParameter("source"));
  OAViewObject linesVO=(OAViewObject)am.findViewObject("PriceLinesVO1");
  Row[] row=linesVO.getFilteredRows("SelectFlag","Y");
  System.out.println("Total Rows: "+linesVO.getRowCount());
  System.out.println("Selected Rows: "+row.length);
  Row row[] = linesVO.getAllRowsInRange();
  for (int i=0;i<row.length;i++)
     {
       PriceLinesVORowImpl rowi = (PriceLinesVORowImpl) row[i];
       if (rowi.getSelectFlag()!= null && rowi.getSelectFlag().equals("Y"))
       {
         rowi.remove();
       }
     }
  am.getOADBTransaction().commit();
}

3] Update Multiple Rows:

Create a Transient Attribute of type String with any name (say SelectFlag) in the VO. Choose updatable always check button.

To add a Update button, in the advanced table, go to

Advanced Table > Advanced Table Components > TableSelection > MultipleSelection > New > SubmitButton.

In the MultipleSelection, add the view attribute defined above.

In the controller, add logic as below:

if (pageContext.getParameter("UpdateBtn") != null)
{
  System.out.println("In Update Button");
  Number user_id = new Number(am.getOADBTransaction().getUserId());
  String updated_by = user_id.toString();
  OAViewObject linesVO=(OAViewObject)am.findViewObject("PriceLinesVO1");
  Row row[] = linesVO.getAllRowsInRange();
  for (int i=0;i<row.length;i++)
    {
      PriceLinesVORowImpl rowi = (PriceLinesVORowImpl) row[i];
      if (rowi.getSelectFlag()!= null && rowi.getSelectFlag().equals("Y"))
        {
          String Bucket_low = rowi.getAttribute("BucketLow").toString();
          String Bucket_high = rowi.getAttribute("BucketHigh").toString();
          Number Price = (Number) rowi.getAttribute("Price");
          Serializable[] param = {rowi.getAttribute("LineId").toString(),rowi.getAttribute("BucketLow").toString(),rowi.getAttribute("BucketHigh").toString(),rowi.getAttribute("Price").toString(),updated_by};
          am.invokeMethod("UpdateLinesRecord",param);
        }
     }
  OAViewObject volns = (OAViewObject)am.findViewObject("PriceLinesVO1");
  volns.clearCache();
  volns.reset();
  volns.executeQuery();
}

In AM method, you can call PLSQL Procedure to update the data.

public void UpdateLinesRecord(String LineId, String BucketLow, String BucketHigh, String Price, String updated_by)
{
try {
     CallableStatement cs=this.getOADBTransaction().
     getJdbcConnection().prepareCall("{call APPS.XXTEST_LINES_PKG.UPDATE_LINES(?,?,?,?,?)}");
     cs.setString(1,LineId);
     cs.setString(2,BucketLow);
     cs.setString(3,BucketHigh);
     cs.setString(4,Price);
     cs.setString(5,updated_by);
     cs.execute();
     cs.close();
    }
catch(SQLException e) {
System.out.println("the exception is"+e);
    }
}

4] Delete or Update Single Row at one time.

If you want to add update and delete icons per rows do the followings:

  1. Create Columns in the advanced table say ‘Delete’ and ‘Update’.
  2. In the Delete Column, add an image item (deleteicon_enabled.gif). For all image names go to $OA_MEDIA folder.
  3. Set Action type to fire action.
  4. Give any name to Event (Say – ‘deleteLine’)
  5. In the parameter, pass the identifier of the row which user wants to delete. You can use SPEL for that.

Example>> p_header_id: ${oa.QotDtlVO1.HeaderId}

In the controller, handle the event – ‘deleteLine’.

if ("deleteLine".equals(pageContext.getParameter(EVENT_PARAM)))
{
//Handle delete logic here. You can call AM methods which eventually calls PLSQL Procedures to delete the data.
}

Similarly you can add image link for update also.

Do not forget to reset the VO after operation to reflect the new data.

Naming Standards of Commonly Used OAF Components


1] Naming Standards for a Custom Package:

If you want to create new pages, business logic, or whole applications and deploy your code with existing Oracle E-Business Suite applications, you must define a new application and use its short name for any related package and seed data definitions. For example, if you want to create a new, custom Procurement application, you might create a product with the short name XXPO (the “XX” prefix ensures that your selected product short name never conflicts with any future Oracle E-Business Suite product names).

Any objects that you create — either by extending (subclassing) existing Oracle E-Business Suite objects or by creating new objects from scratch — must be added to a package that starts with your company’s identifier:

<myCompanyName>.oracle.apps….

  • If you are creating new objects from scratch, you should put them in a package that also includes your custom application short name as follows:

<myCompanyName>.oracle.apps.<customProductShortName>….

For example, assuming your company is called ABC Corporation and your custom product short code is XXPO, any new classes and OA Components that you create should be added to the following package:

abc.oracle.apps.xxpo….

  • If you are extending existing Oracle-Business Suite objects, you may add your files to a package that corresponds directly to the original Oracle package (in this case, you don’t need to add your files to a package including a custom application short code).

2] Naming Standards for a Page (File Extension: .xml):

The page name should convey the object it presents (an employee, a supplier, an item, a purchase order, an applicant, and so on), and the function being performed (search, promote, hire, approve, view). For some pages, the object is sufficient.

<Object><Function>PG or <Object>PG

Examples:

  • SuppliersPG.xml (Supplier update)
  • SupplierCreatePG.xml (differentiated only if update and create are separate tasks)
  • SupplierViewPG.xml (view supplier info)
  • SupplierSearchPG.xml (search for supplier)
  • SupplierHomePG.xml (Supplier home page)

3] Naming Standards for a Region (File Extension: .xml):

The region name should convey the object it presents (an employee, a supplier, an item, a purchase order, an applicant, and so on), and the function being performed or the structure (search, promote, hire, approve, view, table, HGrid, Tree and so on).

<Object><Function-Structure>RN or <Object>RN

Examples:

  • SupplierDetailsRN.xml
  • PoApproveRN.xml
  • CustomerContactsRN.xml
  • ItemTypeHGridRN.xml 

4] Naming Standards for an Entity Object (File Extension: .xml, .java):

The EO should be named for the objects stored in its underlying entity. For example, the entity FWK_TBX_PO_HEADERS stores purchase order headers, so the associated EO name is PurchaseOrderHeaderEO.

<EntityName>EO

Examples:

  • EmployeeEO.xml
  • EmployeeEOImpl.java
  • SupplierEO.xml
  • SupplierEOImpl.java
  • SupplierSiteEO.xml
  • SupplierSiteEOImpl.java
  • PurchaseOrderHeaderEO.xml
  • PurchaseOrderHeaderEOImpl.java
  • PurchaseOrderLineEO.xml
  • PurchaseOrderLineEOImpl.java

5] Naming Standards for an Entity Association Object (File Extension: .xml):

The AO name should convey the relationship between a parent and its child entities.

<Parent>To<Child>AO

Examples:

  • PoHeaderToLinesAO.xml
  • SupplierToSitesAO.xml
  • EmployeeToContactsAO.xml

6] Naming Standards for a View Object (File Extension: .xml, .java):

The VO name should convey the nature of the query. VO names are always plural as they model a collection of rows.

<DescriptiveName>VO

Examples:

  • AllEmployeesVO.xml
  • AllEmployeesVOImpl.java
  • AllEmployeesVORowImpl.java
  • NewCustomersVO.xml
  • NewCustomersVOImpl.java
  • NewCustomersVORowImpl.java

7] Naming Standards for a View Link (File Extension: .xml):

The VL name should convey the relationship between the master and detail VOs.

<Master>To<Detail>VL

Examples:

  • EmployeeToDepartmenstVL.xml
  • PoHeaderToLinesVL.xml
  • ItemToApprovedSuppliersVL.xml

8] Naming Standards for an Application Module (File Extension: .xml, .java):

The AM name should convey the purpose of the UI module it services.

<ModuleName>AM

Examples:

  • EmployeesAM.xml
  • EmployeesAM.java (optional interface)
  • EmployeesAMImpl.java
  • ItemCatalogAM.xml
  • ItemCatalogAMImpl.java
  • PoSummaryAM.xml
  • PoSummaryAMImpl.java
  • ApprovedSupplierListAM.xml
  • ApprovedSupplierListAMImpl.java

OAF MVC Architecture


OAF is a java based application framework to develop web based applications that link to Oracle Applications instance while maintaining all the security features of that apps instance. A framework is a specialized set of related classes designed to make application development easier.  In effect, a framework implements part of an application so developers don’t have to write all of its code from scratch; they can use the framework as the basis for their work and while focusing on the additional code required to implement their specific application requirements.

OA Framework follows Model, View and Controller (MVC) Architecture as described below:

1] Model

Model contains the components which handles data directly from Database. It Includes Business Components for Java (BC4J Objects) which mainly are:

Entity Objects (EO):

Entity Objects are generally based on one table which encapsulate the business rules. These objects are used by OAF page to perform update/insert/delete operations. You can join two EOs using Entity Associations.

View Objects (VO):

These objects contain a SQL query that queries the data from database and present it in the OAF page. VOs can be based on one or many EOs or a SQL query. Two VO can be linked together through a View Link.

Application Module (AM):

It is a container for related BC4J objects and provides the database connection. It also provides Transaction Context (OADBTransaction) or Transaction Management. An AM can have more nested AM contained in it along with other BC4J components. But it is mandatory to have an AM for an OAF page.

2] View

View contains the actual page items on page which user can see. The view in OAF comprises of various page level items like text fields, buttons, regions, links etc. These items are visible on any OAF page. These items can either be tied to VO attribute or having a constant value or populated at run time based through controller logic.

Please note that- View Layer is altogether different than View Object!!!!!

3] Controller

Controller handles all the user actions done on the page. OAF requires a java controller class to be defined for a page/region which handles various page level actions. The important methods in this class are:

A] ProcessRequest

     This request is called when page is rendered. Any logic to be executed during page initialization is kept here.

B] ProcessFormRequest

Any page submit action causes ProcessFormRequest to be executed. The logic put here typically is that which needs to be executed after actions like button click or any other page submit action.

The Controller class is mostly used to put logic for actions on page such as button clicks, navigation to other pages. The two objects that are passed to controller methods are OAPageContext and OAWebBean. OAPageContext provides access to objects like AM class, page parameters, session values, navigation methods. OAWebBean is generally used to get a handle of page items.

In coming posts, I will try to write more details about these components and how they works….so stay tuned!

Logging in OAF Pages – A Technical Note!


The Logging Framework in Oracle Apps provides the ability to store and retrieve log messages for debugging, error reporting, and alerting purposes. We can use it for any OAF Page development and Customization.

Using Oracle AOL Profile Options to Configure Logging

You can configure logging by setting Oracle Application Object Library (FND) profile options.

The available levels are Site, Application, Responsibility, and User. User settings override Responsibility settings, Responsibility settings override Application settings, and Application settings override Site settings.

Here is a summary of the impacts of the different profile option levels:

  • User: Affects only the given user.
  • Application: Affects all users for the specific application.
  • Responsibility: Affects all users in any application for that responsibility.
  • Site: Affects all users, applications, and responsibilities.

Note: When setting up logging at the Site level, Oracle strongly recommend that you set the logging level to UNEXPECTED. ERROR or EXCEPTION. Also remember to return the profiles to their usual values after debugging has been completed.

Where is the debug message stored, once the logging is turned on?

Debug messages are stored in a table called FND_LOG_MESSAGES.

If you want to have logging from your concurrent program, you can write as below in your PL/SQL Code.

fnd_log.STRING(log_level => fnd_log.level_statement
                             ,module => 'xxpcm.packagename.procedurename'
                           ,message => 'You debug message here');

From OAF java code, you can write like

pageContext.writeDiagnostics(“xxpcm.oracle.apps.pa.ci.webui”, “Your debug message here”, 1);

Using Logging to Screen

In addition to the above methods where log messages are written to a file or the database, Logging to Screen provides:

  • The ability to enable logging on a per HTTP request or per HTTP session basis.
  • Dynamic configuration which does not require restarting any servers or changing any log profiles.
  • A convenient lightweight mechanism to diagnose performance issues. Each message is timestamped to the millisecond.

If Logging to Screen is enabled, then the Java log messages generated for a particular HTTP Request-Response are buffered in memory and appended to the end of the generated HTML page. However this feature does not affect any existing configurations of file or database logging. File or database logging continues to behave per the configured middle tier log properties and/or log profile values.

Note that this mechanism currently provides only Java layer messages. Regular file or database logging should be used if messages from other layers (e.g., PL/SQL) are needed.

Enabling Logging to Screen in Oracle Application Framework Pages

For security reasons, oracle has made this feature only accessible if the “FND: Diagnostics” Profile is set to “Yes“.

1] First go to the page and click the Diagnostics button.

After you select the Diagnostics button to navigate to the Diagnostics page, you can select:

  • Show Log – It directs you to the Oracle Applications Manager where you can view a “snapshot” of your Oracle E-Business Suite system.
  • Show Log on Screen – It allows you to specify a log level and display Java log messages for a particular HTTP Request-Response at the end of the current page.
  • Set Trace Level – It displays the Set Trace page where you can specify the level of information to collect in a database trace.
  • Show Pool Monitor – It displays the Application Pool Monitor where you view different aspects of runtime and configuration information about the JVM.

2] Select Show Log to Screen from the drop-down list.

Caution: If you set the default site-level logging level to STATEMENT or PROCEDURE, a decrease in system performance could result. Under that configuration, the large amount of generated log messages might significantly slow down the system. Furthermore, if the site-level logging level is set to a low severity for a long time, then the FND_LOG_MESSAGES table could potentially run out of space.

For High Volumes

For high load, high volume scenarios, you can log middle-tier messages to a local file, which is faster than logging to a remote database.

Purging Log Messages

You should periodically delete old log messages to account for the space limitations of the database table. In addition, you should periodically rotate log files.

There are several ways to purge log messages. They are described below:

1] Using a Concurrent Program

The concurrent program “Purge Debug Log and System Alerts” (Short name: FNDLGPRG) is the recommended way to purge messages. This program purges all messages up to the specified date, except messages for active transactions (new or open alerts, active ICX sessions, concurrent requests, and so on). This program is by default scheduled to run daily and purge messages older than 7 days. Internally this concurrent program invokes the FND_LOG_ADMIN APIs, which are described below.

2] Using PL/SQL

You can use the FND_LOG_ADMIN PL/SQL package to delete log messages.

fnd_log_admin apis:

Name Type Description
delete_by_date_i Procedure This routine is used as a concurrent program. Nobody besides the concurrent manager should call it.
delete_by_user Function Delete all log messages for a particular user
delete_by_session Function Delete all log messages for a particular session
delete_by_user_session Function Delete all log messages for that match both user and session
delete_by_module Function Delete all log messages that are “like” module
delete_by_date_range Function Delete all messages between the specified dates. passing null means unlimited; null for both deletes all rows.
delete_by_max_level Function Deletes messages at level and all levels below.
delete_all Function Delete all messages
delete_by_sequence Function Delete all log messages based on sequenceid

For example:

SET SERVEROUTPUT ON
declare
    l_del_rows_cnt NUMBER;
BEGIN
l_del_rows_cnt := fnd_log_admin.delete_all;
DBMS_OUTPUT.PUT_LINE(l_del_rows_cnt || ' rows deleted');
END;

OAException Message and Dialog Page in OA Framework


You can use OAException (or any of its subclasses) to display a message on an OA Framework page and the OA Framework automatically displays an error message at the top of the current page.

You can display the following standard kinds of messages at the top of a page:

  • Error
  • Warning
  • Confirmation
  • Information

You can explicitly display a message box of any type using the following code in your controller.

OAException message = new OAException("You cannot create a new change order when a Draft version already exits.",OAException.ERROR);
pageContext.putDialogMessage(message);

Here you need to construct an oracle.apps.fnd.framework.OAException object and set the kind of message you want (other options are OAException.WARNING, OAException.INFORMATION and OAException.CONFIRMATION). Then you can simply identify this exception for display when the page renders by calling the OAPageContext.putDialogMessage() method.

If — after you call putDialogMessage() in your processFormRequest() method — you want to forward to the current page or another page and display the message at the top of the new target page, you need to call the appropriate oracle.apps.fnd.framework.webui.OAPageContext forwardImmediately*() method. The OA Framework immediately stops processing the page and issues a forward before displaying the messages.

You can register or throw multiple exceptions; the OA Framework combines them into a single message box using the following rules:

  • Since an error is more important than a warning, the message box is titled “Error” if both errors and warnings exist.
  • Confirmations and errors cannot be shown together. In this case, the OA Framework simply ignores the confirmation message(s).
  • You can, however, show confirmations with warnings. The message box is titled “Confirmation,” and it contains both types of messages.

Show the Exception Message on a Dialog Page

You can display an exception as a message in a dialog page using the APIs in the oracle.apps.fnd.framework.webui.OADialogPage class and oracle.apps.fnd.framework.webui.OAPageContext interface.

The OADialogPage class holds properties for the generic dialog page. To create a dialog page object, first use the constructors to instantiate the basic properties, then use the setter methods provided in the class to set additional properties.

To navigate (redirect) to a dialog page, use the OAPageContext.redirectToDialogPage methods. The OAPageContext interface contains the context and state information specific for a client request.

// To Diaplay the Exception on a Dialog page
OAException message = new OAException("You cannot create a new change order when a Draft version already exits.");
OADialogPage dialogPage = new OADialogPage(OAException.ERROR, message, null, "",null);

dialogPage.setOkButtonToPost(true);
dialogPage.setOkButtonLabel("Ok");

dialogPage.setPostToCallingPage(true);
java.util.Hashtable formParams = new java.util.Hashtable(1);
dialogPage.setFormParameters(formParams);
pageContext.redirectToDialogPage(dialogPage);

If you want 2 buttons (Say Cancel and Ok), then put “” instead of null in the OADialogPage dialogPage = new OADialogPage line.

How to customize a LOV in OAF (VO Extension)?


OA Framework provides robust support for personalizing and extending the E-Business Suite user interface and underlying business logic. The capabilities are largely achieved by leveraging the OA Framework’s declarative architecture, and the object-oriented features of Java.

This post describes how to customize a LOV in an OAF Page and also make the LOV dependent on a parent LOV. It can be done through a VO Extension and Personalization in R12. View Objects are the queries that provide the data seen on a Self Service web page. Oracle offers many attributes in each View Object, but often an additional attribute is needed. Oracle allows developers to extend the delivered View Objects to meet this need. 

The following iProcurement Requisition Page will be used for demonstration, but any page developed using the OAF architecture is a candidate for this exercise.

Here we are about to customize the Expenditure Type LOV so that when creating an iProcurement requisition and entering project related information, the Expenditure Types list of values will present the user with a subset of expenditure types, instead of all expenditure types.

Analysis:

1] Check ‘About this page’:

To find all dependent objects of the base Oracle Application page you wish to extend, use the About this page link shown at the bottom-left corner of the base page. The link renders the About page which displays page definition, current session, and technology stack information for that base page. (If you do not see the About this page link, verify that the FND_DIAGNOSTICS profile option is enabled.)

2] Find the VO Object Name:

3] Fnd the SQL query behind the VO:

Implementation:

Now that we have identified the VO we need to extend, ExpenditureTypeNoAwardLovVO. we need to setup our JDeveloper environment so that we can create a new View Object that contains our extended code.

1] Setup Jdeveloper:

You can refer the below articles for this:

Initial Setup in JDeveloper for OAF Development

2] Create a New OA Workspace:

In the Applications Navigator right click the Applications Node and select “New OA Workspace”.

Give a suitable name. Leave the directory path as your default myprojects folder in your JDev Home, ensure that the “Add a New OA Project” check box is selected. Select “OK”. 

3] Create a New Project:

Give a suitable project name. Leave the default directory as your myprojects folder in the JDev Home. For a VO substitution the default package name will need to represent the VO file path on JAVA_TOP with the exception that it must be prefixed with your custom application shortname, the prefix can actually be anything you like however it is recommended that the custom application shortname is used.

Click “Next”  and complete the remaining steps.

4] Copy the required files from JAVA_TOP:

Next we need to copy the existing VO component from the apps server and import it into our local file system. In order to do this we must setup a file structure on our local machine in our project folder so we can copy the VO into it. Log onto the applications server and navigate to $JAVA_TOP, change into the oracle/apps/icx/ directory (Or which ever product top you are working with).

For that do the following:

  1. cd $JAVA_TOP/oracle/apps
  2. tar -cvf icx_top.tar icx .. repeat for as many modules as you might need.
  3. FTP each .tar file to \jdevhome\jdev\myclasses.
  4. Extract each .tar file in the \jdevhome\jdev\myclasses directory
  5. Also extract each .tar file in the \jdevhome\jdev\myprojects directory.

Click the “Refresh” button on the Applications Navigator tab of JDeveloper, you should notice that a new business components package under oracle.apps.pa has now appeared. 

5] Create a new VO Object:
Now that we have the existing projects business components in our environment we need to create our new VO object that will be used in place of the existing one.
Please note- We do not customize existing components in OA Framework. We extend the existing ones which means creating a new object that extends the original and we notify the framework that we want to use the new object rather than the seeded one. 
5.1] Test the seeded VO:
We now need to test that the VO we want to substitute does not contain any java errors following the download. Navigate to the VO in the applications navigator window right click the VO and click edit. 
If the VO opens without error then we are ready to move onto the next step. If you get an error message saying that java errors exist in either the voNameImpl.java file or the voNameRowImpl.java file then do the following:
  1. Get the .class files.
  2. Download a java deconpiler (ex:’CAVAJ’) and decompile the files to .java files and put it in myprojects folder.
  3. Remake the project.
5.2] Lunch the create new VO Object wizard:

Right click on the project node and select “New”. Select “View Object” under Business Tier > ADF Business Components and click “OK”.

5.3] Give the details:

Specify the package as xxscm.oracle.apps.icx.lov.server (This component package will hold our extended object so we need the custom application prefix). Specify the VO name as the name of the custom application concatenated with the orginal VO name i.e. XxScmExpenditureTypeNoAwardLovVO. Select the original VO in the “extends” box using the browse button and select the original VO i.e. oracle.apps.icx.lov.server.ExpenditureTypeNoAwardLovVO.

5.4] Modify the SQL Query:
On step 2 of the VO wizard you can see the SQL statement that we first saw when we were analysing the page. Here add your modified query.Please note that you should add your additional columns at the end.
In our example the initial query was:
SELECT et.expenditure_type,
  et.sys_link_start_date_active,
  et.sys_link_end_date_active,
  1 AS dummy_number
FROM pa_expenditure_types_expend_v et
WHERE et.system_linkage_function = 'VI'
AND (TRUNC(SYSDATE) BETWEEN ET.EXPND_TYP_START_DATE_ACTIVE AND NVL(ET.EXPND_TYP_END_DATE_ACTIVE, TRUNC(SYSDATE+1)))
AND (TRUNC(sysdate) BETWEEN et.sys_link_start_date_active AND NVL(et.sys_link_end_date_active, TRUNC(sysdate  +1)))

Now the modified query is:

SELECT DISTINCT
et.expenditure_type,
et.sys_link_start_date_active,
ET.SYS_LINK_END_DATE_ACTIVE,
1 AS dummy_number,
P.PROJECT_ID,
BV.BUDGET_VERSION_ID
FROM
PA_PROJECTS_ALL P,
PA_BUDGET_VERSIONS BV ,
PA_FIN_PLAN_TYPES_B PT,
PA_RESOURCE_ASSIGNMENTS RA,
PA_EXPENDITURE_TYPES_EXPEND_V ET
WHERE  BV.PROJECT_ID = P.PROJECT_ID
AND BV.FIN_PLAN_TYPE_ID = PT.FIN_PLAN_TYPE_ID
AND BV.BUDGET_VERSION_ID = RA.BUDGET_VERSION_ID
AND PT.PLAN_CLASS_CODE='FORECAST'
AND BV.CURRENT_FLAG='Y'
and ET.EXPENDITURE_TYPE = RA.EXPENDITURE_TYPE
AND ET.SYSTEM_LINKAGE_FUNCTION = 'VI'
AND (TRUNC(SYSDATE) BETWEEN ET.EXPND_TYP_START_DATE_ACTIVE AND NVL(ET.EXPND_TYP_END_DATE_ACTIVE, TRUNC(SYSDATE+1)))
AND (TRUNC(sysdate) BETWEEN et.sys_link_start_date_active AND NVL(et.sys_link_end_date_active, TRUNC(sysdate  +1)))

5.5] Generate the Java files:

Once we have clicked through to the end of the wizard the final step is to create the relevant java files.

Now click “Finish” and the new business components package will be created containing our new extended VO. Right click on the custom business components package and select “Make”, this will compile the Impl and RowImpl java files. 

6] Create a Substitution:

Now that we have our newly extended VO, we need to create a substitution file. This substitution file will be an xml based file that will contain a mapping from the old VO to the new VO, we will use this file to tell Oracle Application to use our newly extended VO rather than the old one by uploading it to the MDS repository using the JPX Import tool. 

Right click on your project node and select “Project Properties”, click “Substitutions” under the “Business Components” menu. In the “Available” pane select the original VO , and in the right hand “Substitute” pane select the new VO. Once you have done this click the “Add” button and select “OK”. 

In your JDev home in the myprojects folder you will see a file called projectName.jpx. This is your substitution file and we will use this later when we deploy the substitution.

Deployment:

1] Deploy the the relevant java and xml files to java top:

Right click on the project node and select “New”, select “Jar File” under the General > Deployment Profiles menu. Name the profile as something meaningful. Leave the directory set as the default myprojects folder and click “OK”. 

In the deployment profile properties deselect the “Include Manifest File” option. On the filters menu deselect the root folder and navigate to the xxscm.oracle.apps.icx.lov.server directory, select all the files in this directory and click “OK”.

You will see in JDeveloper that you now have a deployment profile listed under you application sources node, right click the .deploy file and select “Deploy to JAR file”, You will see a deploy tab appear next to the compile log and this will confirm that the deployment was successful. If you experience issues with compilation i.e. there are issues with some of the files in your project that are not connected to your custom files then simply remove them from the project by selecting the top level component package i.e. oracle.app.pa and click the “Exclude Project Content” button (Little file symbol with a red cross on it) and re-try the deployment. 

Inspect your myprojects folder and you will see you now have a “Deploy” directory, in this directory will be your jar file ready for deployment to the apps server. FTP the jar file in binary format to a convienient directory on the apps server. Then run the below command:

jar -xvf /$JAVA_TOP/XxScmRestrictExpTypes_Deploy.jar

2] Deploy the Substitution file:

You can run a script something like below to deploy the substitution file:

echo  "--------------------------------------------"
echo  "Please enter the following details :"
echo  "--------------------------------------------"
echo Enter APPS Password :
read apps_pw

echo "Enter Host TNS DATABASE Server name:>"
read v_host

echo "Enter Host Database TNS Port Number:"
read v_port

echo "Enter Host Database SID name:"
read v_sid

########################################################################
echo "Importing VO Extension..."
########################################################################

java oracle.jrad.tools.xml.importer.JPXImporter \
$XXSCM_TOP/install/XxScmRestrictExpTypes.jpx -username apps -password $apps_pw \
-dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=TCP)(HOST=$v_host)(PORT=$v_port)) (CONNECT_DATA= (SID=$v_sid) ) )"

echo "Importing VO Extension successful!!!!..."

Finally restart the webserver (bounce Apache) so that you can see your changes in the application.

Creating Personalizations:

1] Add a new attribute:

Go to ‘Functional Administrator’ responsibility and go to the path ‘/oracle/apps/icx/lov/webui/ExpenditureTypeLovRN’ 

Create a new Item and Give the below details:

Item Style Message Styled Text
Id XxScmProjectId
Datatype Number
Rendered False
View Attribute ProjectId
View Instance ExpenditureTypeNoAwardLovVO

2] Add a LOV Mapping to make the LOV dependent ( Here Expenditure Type LOV is dependent to the Projects LOV):

Go to ‘Functional Administrator’ responsibility and go to the path ‘/oracle/apps/icx/por/req/webui/CheckoutSummaryPG’

Create a new Item and Give the below details:

Item Style Lov Map
Id XxScmProjectIdLovMap
Criteria Item ProjectIdExpense
* LOV Region Item XxScmProjectId

Great!!…Its over now. Go to iProcurement Requisition Page and check the new Expenditure Type LOV.

Reference Article: oaf-modifying-sql-behind-framework-pages (keithturley.wordpress.com)

Deploying OAF Personalizations Using the Import/Export Command Line Tools


After personalizing and testing framework pages in a Development instance, you may wish to automate the transfer of these changes to another instance, rather than manually re-doing them all again. This objective can be achieved by exporting the personalizations from the Development instance, then importing them to a different instance or instances

You can either use the GUI interface in “Functional Administrator” (Personalization tab) to transfer personalizations, or can invoke the XMLImporter/XMLExporter commands directly from the command line. The Export tool allows you to export a package or xml file (along with translation information) from the MDS repository of a database instance to a .xml file (or .xlf file for translations). The command line Export tool is necessary if you wish to perform bulk translations of personalization documents.

This post provides the below detailed steps how to transfer personalizations from one instance to others using the XMLImporter/XMLExporter tool.

1. Get Document Name

Go to the page you want to copy the personalization from and click the “about this Page” link at the bottom of the page. You will see the page name with full path which starts with /oracle/apps/<prod>.

Ex: /oracle/apps/icx/por/wf/webui/ReqLinesNotificationsRN

2. Get the Personalization Document info

Run the following command in TOAD or other tools as APPS user   

set serveroutput on
exec jdr_utils.listCustomizations('<full document name from step 1>');

Example:

set serveroutput on
exec jdr_utils.listCustomizations('/oracle/apps/icx/por/wf/webui/ReqLinesNotificationsRN');

Output:

anonymous block completed

/oracle/apps/icx/por/wf/webui/customizations/site/0/ReqLinesNotificationsRN

Note: If there are multiple records returned by this command, you will need to use export/import each item individually that you wish to export. You may also find there are records returned for seeded personalizations provided by Oracle which do not need to be exported.

3. Use XMLExporter to export personalization document

java oracle.jrad.tools.xml.exporter.XMLExporter <personalization document from step #2>  \
-username "<username>" -password "<password>"  \
-dbconnection "(description=(address_list=(address=(protocol=tcp)(host=<host>)(port=<port)))(connect_data=(sid=<sid>)))" \
-rootdir "<output directory>"

Example:

java oracle.jrad.tools.xml.exporter.XMLExporter \
/oracle/apps/icx/por/wf/webui/customizations/site/0/ReqLinesNotificationsRN -username apps -password w3lcome123 \
-dbconnection "(description=(address_list=(address=(protocol=tcp)(host=myhost)(port=12345)))(connect_data=(sid=dev)))" -rootdir "$XXSCM_TOP/install" \

Here one file named ReqLinesNotificationsRN.xml will be created in the below path:
XXSCM_TOP/install/oracle/apps/icx/por/wf/webui/customizations/site/0. Open the file and you will able to view the personalizations that you have done.

4. Use XMLImporter to import personalization document

Run the below command in the Instance where you want to import your personalization.

java oracle.jrad.tools.xml.importer.XMLImporter \
<full path of the file you want to import> \
-username "<username>" -password "<password>"  \
-dbconnection "(description=(address_list=(address=(protocol=tcp)(host=<host>)(port=<port>)))(connect_data=(sid=<sid>)))" -rootdir "<top level directory>" \
-rootPackage "/oracle/apps/<prod>"

Example:

java oracle.jrad.tools.xml.importer.XMLImporter \
$XXSCM_TOP/install/ReqLinesNotificationsRN.xml \
-username apps -password w3lcome123 \
-dbconnection "(description=(address_list=(address=(protocol=tcp)(host= myhost)(port=12345)))(connect_data=(sid=dev)))" -rootdir "$XXSCM_TOP/install" \
-rootPackage "oracle/apps/icx/por/wf/server"

Build a Create Page in OAF!


Here I am posting a step by step tutorial to build a simple CREATE page in OAF. It is a continuation of an earlier tutorial and so you need to go through that first before going through this.

Here is the link: Build Simple Search Page in OAF

Step1: Build a Create Button

  • Select the view EmpSearchPG, right click and select New > TableActions. One region (region1) will be created with region style as ‘FlowLayout’.
  • Change the ID of the above newly created region to ButtonLayoutRN.
  • Right click ButtonLayoutRN and create a new Item.
  • Set the below details for the Item
    • ID :Create
    • Item Style : submitButton
    • Attribute Set: /oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxEmployees/CreateEmployee
    • Action Type: fireAction
    • Event: create

Step 2: Set a Controller

  • Right click PageLayoutRN and select ‘Set New Controller’.
  • Give the package name as ‘xxhci.oracle.apps.custom.LabExamples.webui’.
  • Give the class name as EmpSearchCO.

Add the following logic to processFormRequest of EmpSearchCO.java after super.processFormRequest method.

if (pageContext.getParameter("event").equalsIgnoreCase("create")) {
System.out.println("EmpSearchCO: processing create/update");
pageContext.setForwardURL("OA.jsp?page=/xxhci/oracle/apps/custom/LabExamples/webui/EmployeeCreatePG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null, null, true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}

You might get red lines under java classes which are not imported. Bring the cursor on these red-lined text and click Alt+Enter (JDev automatically tells you to import the class using Alt+Enter when you move cursor over these lines).

Step 3: Build the Create Employee Page (EmployeeCreatePG)

  • Right click on Project >New >Web Tier >OA Components à Page.
  • Set the Page name as EmployeeCreatePG
  • Set the package name as xxhci.oracle.apps.custom.LabExamples.webui
  • Select the pageLayout region of EmployeePG and assign the properties as below
    ID : PageLayoutRN
    AM Definition : xxhci.oracle.apps.custom.LabExamples.server.XxhciOafTrngEmpTabAM
    Window Title : Employee Window
    Title: Employee
    Warn About Change: True

Step 4: Add items to Create Employee Page

  • Create a region under PageLayoutRN and assign ID as PageButtonsRN.
  • Set the region style as pageButtonBar

Now we need to create two buttons in this region as APPLY and CANCEL.

For Apply Button:

  • Right click on PageButtonsRN > New > Item.
  • Set the properties as
    ID :Apply
    Item Style :submitButton
    Attribute Set : /oracle/apps/fnd/attributesets/Buttons/Apply
    Additional Text :Click to save the transaction
  • Action Type: fireAction
  • Event: Apply

For Cancel Button:

  • Right click on PageButtonsRN > New > Item.
  • Set the properties as
    ID : Cancel
    Item Style : submitButton
    Attribute Set :/oracle/apps/fnd/attributesets/Buttons/Cancel
    Additional Text : Click to cancel the transaction
  • Action Type: fireAction
  • Event: Cancel

For text items in page: Right click on PageLayoutRN à New à Region using wizard. Enter data as shown in below screenshots

Step 4.1: Select AM and VO instance created during search page

Step 4.2: Give Region ID as MainRN and Region Style as defaultSingleColumn

Step 4.3: Select attributes as below (EmpNo, EmpName and Department)

Step 4.4: Change the prompts of items as shown below (messageInputText)

Click on finish for step 5.

Change the Region Style for MainRN to messageComponentLayout. This is done now as above region wizard, doesn’t have support for messageComponentLayout. Click on Yes button when the confirm window pops for change of region style.

Step5: Adding Model Layer Code

Add following code to XxhciOafTrngEmpTabAMImpl.java. Add import statements at the start and rest of the methods with the class definition.

import oracle.jbo.Row;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.jbo.Transaction;
import oracle.jbo.domain.Number;
import oracle.jbo.RowSetIterator;

       // Creates a new employee.

        public void createEmployee()
        {
        OAViewObject vo = (OAViewObject)getXxhciOafTrngEmpTabEOView1();
        // Per the coding standards, this is the proper way to initialize a
        // VO that is used for both inserts and queries. See View Objects
        // in Detail in the Developer's Guide for additional information.
        if (!vo.isPreparedForExecution())
        {
        vo.executeQuery();
        }
        Row row = vo.createRow();
        vo.insertRow(row);
        // Required per OA Framework Model Coding Standard M69
        row.setNewRowState(Row.STATUS_INITIALIZED);
        } // end createEmployee()

         // Executes a rollback including the database and the middle tier.

         public void rollbackEmployee()
         {
         Transaction txn = getTransaction();
         // This small optimization ensures that we don't perform a rollback
         // if we don't have to.
         if (txn.isDirty())
         {
         txn.rollback();
         }
         }

        //Commits the transaction.

        public void apply()
        {
        getTransaction().commit();
        }

Add the following import statement and modify the create method in XxhciOafTrngEmpTabEOImpl as follows:

Add this as a part of import statements

import oracle.apps.fnd.framework.server.OADBTransaction;

Modify the create method as below

    public void create(AttributeList attributeList) {
        super.create(attributeList);
        OADBTransaction transaction = getOADBTransaction();
        Number employeeId = transaction.getSequenceValue("FWK_TBX_EMPLOYEES_S");
        setEmpNo(employeeId.toString());
    }

Step6: Add Controller logic for Create Employee Page

Right click on PageLayoutRN of EmployeeCreatePG > Set New Controller.

Give the values as
Package : xxhci.oracle.apps.custom.LabExamples.webui
Class Name : EmployeeCO

Add the below code to the new CO

Import Statements:

import java.io.Serializable;
import oracle.apps.fnd.common.MessageToken;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OADialogPage;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;

processRequest (after super.processRequest):

            if (!pageContext.isBackNavigationFired(false)) {
                OAApplicationModule am =
                    pageContext.getApplicationModule(webBean);
                am.invokeMethod("createEmployee");
            } else {
                // We got here through some use of the browser "Back" button, so we
                // want to display a stale data error and disallow access to the
                OADialogPage dialogPage = new OADialogPage(STATE_LOSS_ERROR);
                pageContext.redirectToDialogPage(dialogPage);
            }

processFormRequest (after super.processFormRequest):

      OAApplicationModule am = pageContext.getApplicationModule(webBean);
          // Pressing the "Apply" button means the transaction should be validated
          // and committed.
      if (pageContext.getParameter("event").equalsIgnoreCase("Apply")) {
                   OAViewObject vo =
                      (OAViewObject)am.findViewObject("XxhciOafTrngEmpTabEOView1");
                  String employeeName =
                      (String)vo.getCurrentRow().getAttribute("EmpName");
                  String employeeNum =
                      (String)vo.getCurrentRow().getAttribute("EmpNo");
                  am.invokeMethod("apply");
                  MessageToken[] tokens =
                  { new MessageToken("EMP_NAME", employeeName),
                    new MessageToken("EMP_NUMBER", employeeNum) };
                  OAException confirmMessage =
                      new OAException("AK", "FWK_TBX_T_EMP_CREATE_CONFIRM", tokens,
                                      OAException.CONFIRMATION, null);
                  pageContext.putDialogMessage(confirmMessage);
                      pageContext.forwardImmediately("OA.jsp?page=/xxhci/oracle/apps/custom/labExamples/webui/EmpSearchPG",
                                                     null,
                                                     OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                                     null, null, true,
                                                     OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
              }
      // If Cancel button is pressed, rollback the transaction
       else if (pageContext.getParameter("event").equalsIgnoreCase("Cancel")) {
                  am.invokeMethod("rollbackEmployee");
                      pageContext.forwardImmediately("OA.jsp?page=/xxhci/oracle/apps/custom/labExamples/webui/EmpSearchPG",
                                                     null,
                                                     OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                                     null, null, false,
                                                     OAWebBeanConstants.ADD_BREAD_CRUMB_NO);

              }

Step 7: Save all and Run the EmpSearchPG to test the page

Flow Diagram

The Final Output:

Build simple search page in OA Framework


Here are the steps to create a simple search page in OA Framwork. I have used OAF Version 12.1.1 for this exercise. There are many ways to do this and here I have followed one of these.

Step 1: Create a Package

All BC4J model components must belong to a Business Components (BC4J) package. So create a package with a name like xxhci.oracle.apps.custom.LabExamples.server.


Step2: Create an Entity Object (EO)

Entity objects encapsulate business logic and DML operations for application tables.

To create a new entity object in the above defined Business Components (BC4J) package:

1. In the JDeveloper Navigator, select the BC4J package where you want to create your entity object.

2. Right click and select ‘New Entity Object’

3. Do the following steps to create an EO.

2.1 Specify a Schema Object (the exact name of the table for the entity object)

2.2 In the Attributes page (Step 2 of 5), you should see all the columns in the table that you specified in the Name page.

Select New… to create a transient attribute that is used in the business logic, such as a calculated OrderTotal in a purchase order that is used for approval checking.

2.3 In the Attribute Settings page (Step 3 of 5), verify or set the following information for each of the entity object’s attributes:

The Attribute and Database Column Name and Type properties default correctly from the table definition. For primary key columns, ensure that the Primary Key and Mandatory checkboxes are selected. For columns that are never updateable, or updateable only when new, select the appropriate Updateable radio button. For columns whose values change after database triggers execute, select the Refresh After update or insert as appropriate.

2.4 In the Java page (Step 4 of 5) page:

  • Check the option for generating an Entity Object Class. In the Generate Methods box, opt to generate Accessors, a Create Method and a Remove Method.

2.5 Click on ‘Generate default view object’ to create a VO. Select Finish to save your entity object definition and implementation. BC4J will create an XML definition file and a Java implementation file for your entity object.

Step3: Create an View Object (VO)

If you click ‘Generate default view object’ tab as mentioned above, you don’t have to create a VO separately. If you forgot this, you have to create a VO. Click on the VO to test the SQL Statement generated by the EO and check in the ‘Expert Mode’.

Step4: Create a New Application Module (AM)

To create a new application module in a Business Components (BC4J) package:

1. In the JDeveloper Navigator, select the BC4J package where you want to create your application module.

2. From the main menu, choose File > New to open the New Object Gallery.

Select the view object.

In the Java page (Step 4 of 5), deselect the Generate Java File(s) checkbox ONLY if you are certain that you won’t be writing any code for your application module (you can always delete the class later if you find that you don’t need it, so it’s probably best to simply generate it at this point unless you are creating a simple container for LOV view objects).

Select Finish to create your application module. BC4J will create an XML definition and implementation file.

Step5: Create a Page (EmpSearchPG)

Create the EmpSearchPG page as follows

  • Right click on project à New à Web Tier à OA Components à Page
  • Give the Page Name as EmpSearchPG and package as “xxhci.oracle.apps.custom.LabExamples.webui”
  • Select region1 page from Structure Window and change its properties as
    ID à PageLayoutRN
  • Select the AM Definition as ‘xxhci.oracle.apps.custom.LabExamples.server.XxhciOafTrngEmpTabAM’
  • Give a Window Title as ‘Employees Search Window’
  • Give a Title as ‘Employees’

Step6: Add a Query region and Results table

  • Right click on PageLayoutRN à New à Region. Set the properties of the new region as
    ID à QueryRN
  • Select the Region Style as ‘query’ and Construction Mode as ‘resultBasedSearch’.
  • Right click on QueryRN region on structure navigator à New à Region using wizard.
  • Select the AM and VO which we have created in earlier steps as shown in below figure.


Set the Region Style as Table

Change the Prompt and Style for all three items.

Step7: Changes the Item Properties

Go to EmpNo item and set the Search Allowed property to true. Similarly do the steps for EmpName and Department also.

Step8: Save all changes (Save All).

Step9: Run the Page (EmpSearchPG)

Creation of search page is complete. Run the EmpSearchPG to test the page. If everything works fine for you, you should able to view an output like below:

Few Note:

Understanding Query Regions

When you add a query region to a pageLayout region, OA Framework automatically generates an oracle.apps.fnd.framework.webui.beans.layout.OAQueryBean which, depending on its configuration, works in concert with a child table, advanced table or HGrid to implement any combination of simple search, advanced search and view panels. OA Framework automatically generates buttons as appropriate for toggling between the applicable regions.

Construction Modes:

There are three construction modes available. In the above example we have used ‘resultBasedSearch’ construction mode. Here is a brief comparison of the three modes.

1] resultsBasedSearch:

  • OA Framework automatically renders both the Simple and Advanced search regions based on the designated queryable items in the associated table.
  • The search regions automatically include both a Go and a Clear button.
  • OA Framework automatically executes the underlying search when the user selects the Go button.

2] autoCustomizationCriteria:

  • OA Framework automatically renders both the Simple and Advanced search regions based on the corresponding Simple search and Advanced search regions that you define and specify as named children of the query region.
  • The search regions automatically include a Go button. In addition, the Advanced search region includes a Clear button.
  • OA Framework automatically executes the underlying search when the user selects the Go button. However, developers must explicitly define mappings between items in the Search panel and items in the table region.

3] none

  • The Search regions are rendered based on the Simple Search and Advanced Search regions that you define and specify as named children of the query region.
  • You must implement your own Go button in this mode.
  • The underlying search must be executed by the developer.

OAF vs ADF 10g


With the emergence of next generation Fusion technology middleware stack there is confusion between the technologies OA framework and ADF among Oracle developers especially for the people who are developing extensions for Oracle Applications 11i/R12. Both are Oracle technologies for developing web based User Interface with Jdeveloper. Here is a detailed overview of OA framework and ADF.

OA Framework:

OAF (Oracle Applications Framework) is used to create the web based Oracle Application extensions and it is the default web technology for 11i and R12 development. It is closely integrated with Oracle Apps hence it is meaningless outside apps context. OAF is a model-view-controller technology stack which comprised of OA framework View (regions and pages) and BC4j respectively as view and model layers.

OAF and Oracle Applications 11i/R12

  • OAF includes AOL which provides e-business functionality like functions, menus, responsibility, functional security, data security, messages, profiles, flexfields, and concurrent programs.
  • List of Values – validation, auto complete, auto clear is available in OAF.
  • Transactional Search – Query Bean is available in OAF.
  • Data export, Configurable pages and Rich text editor is available in OAF.
  • OAF supports translatable table (TL tables).
  • Who columns like created by, modified by, creation date, modified date are supported in OAF.
  • Since OAF is tightly integrated with E-Business session management is done automatically.
  • Menu that appears at the top of the page is integrated with AOL menus. Hence the menus can be configured dynamically by manipulating AOL menus and no coding is required.
  • Functional security is available in OAF which allows you to configure the responsibility dynamically for the user.
  • User authentication is done from SSO. So no need to configure or write any code.
  • Data security is available.
  • Secured against cross site scripting attack.
  • OAF page access can be tracked.
  • Standards and guidelines are available for developing extensions in OAF which is the most important thing.
  • Reusable regions are available in OAF.
  • UI cannot be migrated to ADF 11g (may be in the future Oracle will come up with migration utility for UI but even then only declarative pages would be migrated and the UI pages should have followed the coding standards strictly).
  • BC4J can be migrated with minimal code change.
  • Controller cannot be migrated hence you have to rewrite all the logics in the controller if you want to migrate it to ADF 11g.

ADF 10g

ADF 10g (Application Development Framework) is the core technology for Fusion Applications and uses lot of open standards and technologies. ADF can also be used for common J2EE applications because ADF technology stack allows you choose between various options. ADF is primarily comprised of ADF Faces, ADF model and ADFbc (which is previously known as bc4j in OAF)

ADF 10g and Oracle Applications 11i/R12

  • ADF 10g does not include any support for AOL
  • List of Values and its associated features like validation, auto complete and clear does not exists in ADF.
  • No Transactional search, Data Export, Configurable pages or Rich text editor.
  • No support of Translatable Table and who columns.
  • No support for E-business suite session management.
  • No support for integration with Oracle Workflow.
  • E-business security features are totally unavailable in ADF 10g. (security features include Data security, functionally security, SSO etc)
  • Page access cannot be tracked in ADF 10g.
  • No support of for menus in ADF.
  • Reusable regions cannot be created in ADF 10g.
  • ADF 10g can be easily migrated to ADF 11g.
  • And most of all you cannot extend or personalize the existing page with the help of ADF.

And the advantage of ADF 10g over OA framework is that your investments would be protected when you want to migrate to ADF 11g.

ADF has many advantages starting from the underlying architecture, the level of support for Web Services and SOA development and going all the way to the actual development experience of UIs using visual editor and drag and drop binding. 

Conclusion

Consider following points when choosing technology.

  • If you want to build few pages with close integration of e-business suite then opt for OA framework. Remember if you want to migrate your code to ADF 11g in the future, you have to follow the coding standards strictly and code all the business logic in bc4j rather than handling the logic in controller.
  • If you don’t want a close integration e-business suite or your building entirely new application then go for ADF 10g. 
Reference: prasanna-adf.blogspot.com