Embedding ADF UI Components into OAF regions

Posted by Juan Camilo Ruiz on Oracle Blogs See other posts from Oracle Blogs or by Juan Camilo Ruiz
Published on Wed, 21 Nov 2012 03:11:06 +0000 Indexed on 2012/11/21 5:12 UTC
Read the original article Hit count: 1485

Filed under:

Having finished the 2 Webcast on ADF integration with Oracle E-Business Suite, Sara Woodhull, Principal Product Manager on the Oracle E-Business Suite Applications Technology team and I are going to continue adding entries to the series on this topic, trying to cover as many use cases as possible. In this entry, Sara created an overview on how Oracle ADF pages can be embedded into an Oracle Application Framework region. This is a very interesting approach that will enable those of you who are exploring ADF as a technology stack to enhanced some of the Oracle E-Business Suite flows and leverage your skill on Oracle Applications Framework (OAF). In upcoming entries we will start unveiling the internals needed to achieve session sharing between the regions. Stay tuned for more entries and enjoy this new post.  

Document Scope

This document only covers information that is specific to embedding an Oracle ADF page in an Oracle Application Framework–based page. It assumes knowledge of Oracle ADF and Oracle Application Framework development. It also assumes knowledge of the material in My Oracle Support Note 974949.1, “Oracle E-Business Suite SDK for Java” and My Oracle Support Note 1296491.1, "FAQ for Integration of Oracle E-Business Suite and Oracle Application Development Framework (ADF) Applications".

Prerequisite Patch

Download Patch 12726556:R12.FND.B from My Oracle Support and install it. The implementation described below requires Patch 12726556:R12.FND.B to provide the accessors for the ADF page. This patch is required in addition to the Oracle E-Business Suite SDK for Java patch described in My Oracle Support Note 974949.1.

Development Environments

You need two different JDeveloper environments: Oracle ADF and OA Framework.

Oracle ADF Development Environment

You build your Oracle ADF page using JDeveloper 11g. You should use JDeveloper 11g R1 (the latest is 11.1.1.6.0) if you need to use other products in the Oracle Fusion Middleware Stack, such as Oracle WebCenter, Oracle SOA Suite, or BI. You should use JDeveloper 11g R2 (the latest is 11.1.2.3.0) if you do not need other Oracle Fusion Middleware products. JDeveloper 11g R2 is an Oracle ADF-specific release that supports the latest Java EE standards and has various core improvements.

Oracle Application Framework Development Environment

Build your OA Framework page using a development environment corresponding to your Oracle E-Business Suite version. You must use Release 12.1.2 or later because the rich content container was introduced in Release 12.1.2. See “OA Framework - How to find the correct version of JDeveloper to use with eBusiness Suite 11i or Release 12.x” (My Oracle Support Doc ID 416708.1).

Building your Oracle ADF Page

Typically you build your ADF page using the session management feature of the Oracle E-Business Suite SDK for Java as described in My Oracle Support Note 974949.1. Also see My Oracle Support Note 1296491.1, "FAQ for Integration of Oracle E-Business Suite and Oracle Application Development Framework (ADF) Applications".

Building an ADF Page with the Hierarchy Viewer

If you are using the ADF hierarchy viewer, you should set up the structure and settings of the ADF page as follows or the hierarchy viewer may not fill the entire area it is supposed to fill (especially a problem in Firefox).

  1. Create a stretchable component as the parent component for the hierarchy viewer, such as af:panelStretchLayout (underneath the af:form component in the structure). Use af:panelStretchLayout for Oracle ADF 11.1.1.6 and earlier. For later versions of Oracle ADF, use af:panelGridLayout.

  2. Create your hierarchy viewer component inside the stretchable component.

Create Function in Oracle E-Business Suite Instance

In your Oracle E-Business Suite instance, create a function for your ADF page with the following parameters. You can use either the Functions window in the System Administrator responsibility or the Functions page in the Functional Administrator responsibility.

  1. Function

  2. Function Name

  3. Type=External ADF Function (ADFX)

  4. HTML Call=GWY.jsp?targetPage=faces/<your ADF page>

    ">You must also add your function to an Oracle E-Business Suite menu or permission set and set up function security or role-based access control (RBAC) so that the user has authorization to access the function. If you do not want the function to appear on the navigation menu, add the function without a menu prompt. See the Oracle E-Business Suite System Administrator's Guide Documentation Set for more information.

    Testing the Function from the Oracle E-Business Suite Home Page

    It’s a good idea to test launching your ADF page from the Oracle E-Business Suite Home Page. Add your function to the navigation menu for your responsibility with a prompt and try launching it. If your ADF page expects parameters from the surrounding page, those might not be available, however.

    Setting up the Oracle Application Framework Rich Container

    Once you have built your Oracle ADF 11g page, you need to embed it in your Oracle Application Framework page.

    Create Rich Content Container in your OA Framework JDeveloper environment

    In the OA Extension Structure pane for your OAF page, select the region where you want to add the rich content, and add a richContainer item to the region.

    Set the following properties on the richContainer item:

    1. id

    2. Content Type=Others (for Release 12.1.3. This property value may change in a future release.)

    3. Destination Function=[function code]

    4. Width (in pixels or percent, such as 100%)

    5. Height (in pixels)

    6. Parameters=[any parameters your Oracle ADF page is expecting to receive from the Oracle Application Framework page]

      Parameters

      In the Parameters property, specify parameters that will be passed to the embedded content as a list of comma-separated, name-value pairs. Dynamic parameters may be specified as paramName={@viewAttr}.

      Dynamic Rich Content Container Properties

      If you want your rich content container to display a different Oracle ADF page depending on other information, you would set up a different function for each different Oracle ADF page. You would then set the Destination Function and Parameters properties programmatically, instead of setting them in the Property Inspector. In the processRequest() method of your Oracle Application Framework page controller, where OAFRichContentPage is the ID of your richContainer item and the parameters are whatever parameters your ADF page expects, your code might look similar to this code fragment:

      OARichContainerBean richBean = (OARichContainerBean) webBean.findChildRecursive("OAFRichContentPage");
          if(richBean != null){
              if(isFirstCondition){
                  richBean.setFunctionName("ADF_EXAMPLE_EMBEDDED");      
              richBean.setParameters("ParamLoginPersonId="+loginPersonId
                +"&ParamPersonId="+personId+"&ParamUserId="+userId
                +"&ParamRespId="+respId+"&ParamRespApplId="+respApplId
                +"&ParamFromOA=Y"+"&ParamSecurityGroupId="+securityGroupId);
              }
          else if(isSecondCondition){
               richBean.setFunctionName("ADF_EXAMPLE_OTHER_FUNCTION");
               richBean.setParameters("ParamLoginPersonId="
                 +loginPersonId+"&ParamPersonId="+personId
                 +"&ParamUserId="+userId+"&ParamRespId="+respId
                 +"&ParamRespApplId="+respApplId
                 +"&ParamFromOA=Y"
                 +"&ParamSecurityGroupId="+securityGroupId);
                }
          } 

© Oracle Blogs or respective owner

Related posts about /Oracle/ADF