Skip Headers
Oracle® Fusion Applications Developer's Guide
11g Release 1 (11.1.3)

Part Number E15524-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

16 Implementing Additional Functions in the UI Shell

This chapter discusses additional functions, such as the Navigate API and how to implement the Home Page UI, that are included in the UI Shell page template used to build web pages.

This chapter includes the following sections:

For more information about the features, see:

16.1 Introducing the Navigate API

You can create a link in the task flow to open a different UI Shell page. Because navigation can occur across different web applications, a single consistent API performs browser redirect. See Table 16-1. This API is exposed as the FndUIShellController.navigate Data Control method.

Note:

When opening a new window, whenever possible, you should use the Navigate API instead of using the ADF Controller sub-flow calls. This is because the UI Shell has no information about sub flows. For instance, if you perform a search that returns clickable results and use sub flows to display the results, and if you then choose to save the page to your Favorites, the search page is saved; not the results page you want. If you use the Navigate API, however, the UI Shell knows about the opened results page and saving the page to your Favorites works as you expect.

16.1.1 How to Use the Navigate API Data Control Method

Drag and drop the Data Control method on page fragments to create links to start navigation.

  1. Expand the Data Controls and select the navigate item, as shown in Figure 16-1.

    Figure 16-1 Selecting navigate from Data Controls

    Selecting navigate from Data Controls
  2. Drag navigate and drop it onto the page fragment. When you do, the Applications Context menu shown in Figure 16-2 is displayed so you can choose one of the options.

    Figure 16-2 Selecting a Navigate Option from the Applications Context Menu

    Selecting a Nav Option from the Applications Context Menu

You can specify a task flow to load on the target page. Page level parameters also can be specified.

Table 16-1 Navigate API Parameters

Navigate API Parameter Attribute Name

viewId

navigateViewId

webApp

Attribute used to look up the host and port of the associated Workarea or Dashboard from the ASK deployment tables. These tables are populated at deployment time through Oracle Functional Setup Manager tasks.

You need to pass the deployed module name to the webApp parameter.

requestContextPath

Obsolete. Replaced by webApp.

pageParametersList

navigateParamsList

navTaskFlowId

Equates to the openMainTask taskFlowId parameter.

This is the ID of the task flow to be loaded.

The task flow ID is a concatenation of the file location for the task flow definition, and the task flow name. For example:

/WEB-INF/MyTaskFlow.xml#MyTaskFlow

navTaskKeyList

Equates to the openMainTask keyList parameter.

Important: navTaskKeyList is used with the task flow ID to identify the target tab in the Main Area. As such, navTaskKeyList is applicable only in dynamic tabs mode, and is ignored in no-tabs mode.

navTaskKeyList provides a way to identify a task flow instance. When reuseInstance is true, use the specified navTaskKeyList in addition to the task flow ID to identify the target tab.

The navTaskKeyList parameter has been implemented for the following FndUIShellController data control methods:

  • openMainTask

  • discloseRegionalTask

  • collapseRegionalTask

  • navigate

  • openSubTask

In dynamic tabs mode, when looking for a match of an existing tab, these APIs will first look for any instances of the task flow that is already open, which has the same task flow ID as the one passed into them as the parameter. In addition, it will compare the navTaskKeyList values, such that the existing task flow will be picked only if its navTaskKeyList values match the ones specified in the navTaskKeyList parameter.

It does not matter if the task flow parameters are the same or different. If the keyList is not set in the menu metadata, you can reuse a tab only if you pass in a null keyList.

navTaskParametersList

You can load the task flow specified in the navTaskFlowId parameter of the Navigate API as a dependent flow if the destination page is in no-tab mode by adding a name-value pair of "loadDependentFlow=true" to navTaskParametersList. For example: "customerId=123;loadDependentFlow=true"

navTaskLabel

Equates to the openMainTask label parameter.

Note: When passing parameters, do not leave the navTaskLabel field null. This is the label that would appear in the tab header when in a tabs page. Even if you are in a no-tabs page (see Section 14.2.3.4, "Supporting No-Tab Workareas"), do not leave it blank because this label will be used in other ways, such as Add to Favorites, or when the system tracks the Recent Items.


Certain parameters, summarized in Table 16-2, can be passed using the Navigate API's argument list.

Table 16-2 Parameters Passed Using Navigate API Arguments

Parameter Name Passed Using Description

fndNavForceRefresh

pageParametersList

Default: false

The Navigate API is used to navigate from one work space to another. If the current view ID is the same as the viewId parameter, and if navTaskFlow is null, the current page will be refreshed. If the current view ID is the same as the viewId parameter, and if navTaskFlowId is not null, the current page will not be refreshed, and the Navigate API will delegate to the openMainTask API to open the task flow in the Main Area. This can be overridden by passing in fndNavForceRefresh=true in pageParametersList to force the page refresh so that openMainTask would not be used.

Example:

pageParametersList = "fndNavForceRefresh=true;param2=value2";

Details:

pageParametersList is a semicolon delimited string of name-value pairs.

ContextualAreaCollapsed

methodParameters

Default: false

Example:

FndMethodParameters methodParameters = new FndMethodParameters();
methodParameters.setContextualAreaCollapsed(Boolean.TRUE);
methodParameters.setContextualAreaWidth(200);

contextualAreaWidth

methodParameters

Default: 256

Example:

FndMethodParameters methodParameters = new FndMethodParameters();
methodParameters.setContextualAreaCollapsed(Boolean.TRUE);
methodParameters.setContextualAreaWidth(200);

loadDependentFlow

navTaskParametersList

Default: false

Example:

navTaskParametersList = "loadDependentFlow=true;param2=value2";

Note that the value for loadDependentFlow is case sensitive.

Details:

navTaskParametersList is a parameter list to pass in to the task flow to open in the target workspace. This is a semicolon delimited string of name-value pairs.


Note:

When passing parameters, do not leave the label field null. This is the label that would appear in the tab header when in a tabs page. Even if you are in a no-tabs page (see Section 14.2.3.4, "Supporting No-Tab Workareas"), do not leave it blank because this label will be used in other ways, such as Add to Favorites, or when the system tracks the Recent Items.

The signature and Javadoc of the method are shown in Example 16-1.

Example 16-1 Navigating from One Work Space to Another

/**
* Navigate from one work space to another. If the current view id is the
* same as the viewId parameter, and if navTaskFlow is null, the current page
* will be refreshed. If the current view id is the same as the viewId
* parameter and if navTaskFlowId is not null, the current page will not
* be refreshed. The Navigate API will delegate to openMainTask API to open the
* task flow in the Main Area. This can be overriden by passing in
* fndNavForceRefresh=true in pageParametersList to force the page refresh so
* that openMainTask would not be used.
*
* @param viewId viewId of the target workspace
* @param webApp Deployed Module Name of the target workspace.
*        It only must be set when the target workspace is in a different 
*        deployed module than the origin workspace. When this is null, it means 
*        the target workspace is in the same deployed module of the origin 
*        workspace. The webApp attribute is used to look up the host and port of
*        the associated Workarea or Dashboard from the ASK deployment
*        tables. These tables are populated at deployment time through
*        Functional Setup Manager tasks.
* @param pageParametersList Parameters list for the page. This is a semicolon 
*                   delimited String of name value pairs. For example,
*                   "param1=value1;param2=value2"
*                   If the Expression Language expression evaluates to an Object, 
*                   toString value of that Object will be passed as the value of 
*                   the parameter.
* @param navTaskFlowId ID of the taskFlow to open in the target workspace
* @param navTaskKeyList Key list to pass into the task flow to open in the
*                   target workspace. This is a semicolon delimited
*                   keys or key-value pairs. For example,
*                   "key1;key2=value2"
* @param navTaskParametersList Parameters list to pass in to the task flow to open
*                   in the target workspace. This is a semicolon delimited String
*                   of name value pairs. For example,
*                   "param1=value1;param2=value2."
* @param navTaskLabel Label for the task flow to open in the target workspace.
* @param methodParameters Construct FndMethodParameters object for setting the 
*                   width of the contextual area, and/or setting the disclosed 
*                   state of the contextual area.
* @throws IOException
*/
  public void navigate(String viewId, String webApp,
                       String pageParametersList, String navTaskFlowId,
                       String navTaskKeyList,
                       String navTaskParametersList,
                       String navTaskLabel,
                       FndMethodParameters methodParameters)

The main navigation is driven by two attributes: viewId and webApp.

  • webApp determines which web application to open.

  • viewId determines the view activity within the target web application.

pageParametersList defines custom URL parameters that you can define.

The three parameters navTaskFlowId, navTaskParametersList, and navTaskLabel, provide support for loading a task flow on the target page, in addition to the default Main Tasks of the target page.

FndMethodParameters are placed as a future extension mechanism. The parameters that can be set through FndMethodParameters are: contextualAreaWidth and contextualAreaCollapsed. Example 16-2 shows how to set up these two parameters.

Example 16-2 Setting contextualAreaWidth and contextualAreaCollapsed Parameters

FndMethodParameters methodParameters = new FndMethodParameters();
  methodParameters.setContextualAreaCollapsed(Boolean.FALSE);
  methodParameters.setContextualAreaWidth(200);

Notes:

  • The task flow to be opened in the target Work Area does not need to be pre-registered as a defaultMain or dynamicMain task for that page. The TaskFlow ID, parameters for it, and the label are all explicitly passed to the target page, and the target page does not perform any validation.

  • The webApp value that is passed into the Navigate API is used to look up the host and port of the associated WorkArea or Dashboard from the ASK deployment tables. These tables are populated at deployment time through Functional Setup tasks.

  • Because the Navigate API is based on URL redirect, only string representations of the parameter values can be passed to the target page. It is not possible to pass an object as a parameter value. For example, a Java map cannot be passed as a parameter.

  • When navigating using this API, the ADF Controller state of the source page is not cleaned up.

16.1.2 How to Implement Navigation Across Web Applications

Navigating across web applications requires the webApp parameter in the menu meta data. For this parameter to work properly, the ApplicationDB and the AppMasterDB connections must be set. The webApp parameter must be specified for each parent node in the menu meta data. Child nodes inherit the value of this parameter from the parent node if not specified. The Navigate API is also modified to add the webApp parameter. Similarly, when using the openSubTask API, you must specify the webApp parameter correctly. There are no design or compile time checks that can catch an invalid value for the webApp parameter. It will throw null pointer exceptions at runtime only.

Note that you need to pass the DEPLOYED_MODULE_NAME in the ASK_DEPLOYED_MODULES table as the webApp parameter. The DEPLOYED_MODULE_NAME, by standard, should be the same as the context root of the application you are trying to open.

16.2 Warning of Pending Changes in the UI Shell

When there are pending changes in the UI Shell Main Area, and the user is leaving the page, or is refreshing the tab or task flow, or is closing the tab, the UI Shell will provide a modal confirmation dialog to the user. If confirmed, the operation will be allowed to proceed. Otherwise, the user will remain on the original page or tab.

Cases where pending changes are checked in the UI Shell Main Area include:

Search Panel and Warning of Pending Changes

Search is treated as a special case and no warning for pending changes is shown when a user enters some data in a query panel provided by the Oracle Application Development Framework. But, from the search results page, drilling down to a sub flow and making the flow dirty marks the sub flow as a candidate for warn about changes.

16.2.1 How to Implement Warning of Pending Changes

To implement warning of pending changes, developers need to follow these steps.

  • All the main taskflows that render in MainArea should have the data-control-scope set to isolated.

    <data-control-scope id="dc">
      <isolated/>
    </data-control-scope>
    
  • Make changes to the Main Area.

    Note that inner taskflows and regions inside the main flow can have the data-control-scope set to shared.

    Other than tasklist, if developers are using Data Control APIs, such as openMainTask, closeMainTask or navigate, to relaunch or close a flow in the MainArea, they should add the clientListener to post the changes. Adding the clientListener on a commandButton that is bound to closeMainTask to post pending changes before the currently focused tab/flow is closed is shown in Example 16-3.

    Example 16-3 Adding the clientListener on a commandButton

    <af:commandButton actionListener="#{bindings.closeMainTask.execute}"
                 text="closeMainTask- with - CL"
                 disabled="false"
                 id="cb1">
          <af:clientListener method="queueActionEventOnMainArea" type="action"/>
    </af:commandButton>
    

    When a command link/button invokes Data Control APIs programmatically, developers should add a client listener on the command link/button, as shown in Example 16-4.

    Example 16-4 Adding a client listener when a command link/button invokes Data Control APIs programmatically

    <af:commandButton text="Calling datacontrol api programmatically"
             binding="#{backingBeanScope.backing_Navigateviaprogramatically.cb1}"
             id="cb1" action="go">
      <af:clientListener method="queueActionEventOnMainArea" type="action"/>
    </af:commandButton>
    

    In addition to adding the clientListener, when Data Control APIs are executed from within the MainArea, developers must add the methodAction shown in Example 16-5 to their main page fragment's pageDef whose taskflow is attached to the tab in MainArea.

    Example 16-5 Adding the checkDataDirty methodAction

    <methodAction id="checkDataDirty"
         InstanceName="FndUIShellController.dataProvider"
         DataControl="FndUIShellController" RequiresUpdateModel="true"
         Action="invokeMethod" MethodName="checkDataDirty"
         IsViewObjectMethod="false"
         ReturnName="FndUIShellController.methodResults.checkDataDirty_FndUIShellController_dataProvider_checkDataDirty_result"/>
    

    The Data Control API shown in Example 16-5 lets you check for data dirty from within the child region and identify any pending changes in the child region.

    After adding above API to the main page fragment's pageDef, developers should let the UI Shell know about that by sending the parameter "fndCheckDataDirty=true" in the parametersList or navTaskParametersList.

16.2.2 How to Suppress Warning of Pending Changes

Developers can suppress warning of pending changes for a particular flow by sending the parameter "fndWarnChanges=false" to the parametersList or navTaskParametersList, as shown in Example 16-6.

Example 16-6 Suppressing warning of pending changes for a flow

<methodAction id="openMainTask" RequiresUpdateModel="true"
              Action="invokeMethod" MethodName="openMainTask"
              IsViewObjectMethod="false" DataControl="FndUIShellController"
              InstanceName="FndUIShellController.dataProvider"
              ReturnName="FndUIShellController.methodResults.openMainTask_FndUIShellController_dataProvider_openMainTask_result">
  <NamedData NDName="taskFlowId" NDValue="/WEB-INF/task-flow-definition.xml#task-flow-definition" NDType="java.lang.String"/>
  <NamedData NDName="keyList" NDType="java.lang.String"/>
  <NamedData NDName="parametersList" NDValue="fndWarnChanges=false" NDType="java.lang.String"/>
  <NamedData NDName="label" NDValue="Suppress Warn About Msg" NDType="java.lang.String"/>
  <NamedData NDName="reuseInstance" NDValue="true" NDType="java.lang.Boolean"/>
  <NamedData NDName="forceRefresh" NDValue="true" NDType="java.lang.Boolean"/>
  <NamedData NDName="loadDependentFlow" NDType="java.lang.Boolean"/>
  <NamedData NDName="methodParameters"
  NDType="oracle.apps.fnd.applcore.patterns.uishell.ui.bean.FndMethodParameters"/>
</methodAction>

16.3 Implementing the Oracle Fusion Home Page UI

The Oracle Fusion Home Page UI consists of a series of JSPX pages, each of which provides product- or role-specific content, that are visually tied together using a tabbed navigation interface.

Terms

Home page: any one of these JSPX pages.

Oracle Fusion Home: the overall Oracle Fusion Home Page UI.

16.3.1 Supported Behavior

The following key requirements are supported by the Oracle Fusion UI Shell:

  • To conform to Oracle Fusion Applications modularity requirements, the Oracle Fusion Home provides a common entry point across multiple Java EE web applications. A given home page can be hosted on any one of these distinct Java EE web applications. A tab click on a given home page therefore must issue a request for another home page that may be hosted on a different web app. When the new page is displayed, its tab must be visually selected.

  • Each home page should display content that includes navigation means to resources that may be hosted on a different web application. For example, a command navigation link on a home page may target a bounded task flow located on a different web application and designed to run on a Workarea or Dashboard page located on that web application.

  • A given home page may include content from a bounded task flow (presumably displayed within an ADF region or portlet) that has command navigation links within its view activities. These links or other navigation means must work correctly on the home page. For example, on click, navigate to the correct Workarea page and launch the intended task flow.

  • The Home link in the Global Area will be disabled on all home pages.

  • By default, the Home link will go to the Welcome tab and, if a different tab is selected, the Home link will go back to the last tab that was selected for that session. If, however, the user navigates to any Oracle Fusion page through a direct URL navigation, such as an email that contains a link to a Workarea, the Home link will again return to the Welcome tab. By default, the Welcome tab will be the first itemNode defined.

  • A home page will display the same layout and content in the Global Area and for the page footer as other pages that extend the UI Shell page template. Unlike a Workarea page, however, the intervening content and its layout between the Global (top) and footer (bottom) sections of the page will be determined and provided by product teams.

16.3.2 How to Create a Home Page

To create a home page, follow these basic steps.

  1. Create a JSPX page that extends UIShell.jspx.

  2. From the JSPX page, select the <af:pageTemplate> tag. On the property inspector, set the isHomePage attribute to true. Note that when isHomePage is set to true, the Regional, Local and Contextual Areas of the UI Shell will not be rendered.

  3. Add content to the HomePageContent facet, following the ADF Layout Basics guideline for laying out the components.

  4. Drop the JSPX to adfc-config.xml.

  5. Repeat Steps1 through 4 for all home page JSPX pages.

  6. Create the Home Page menu. See Section 14.5, "Working with the Global Menu Model."

  7. When running a home page JSPX, the page should look similar to Figure 16-3.

Figure 16-3 Home Page Example

Home Page example

16.3.3 Getting the URL

There are two APIs located in the UIShellContext class that you can use to return a URL without actually performing the navigation to the URL:

  • getURL : getURL is the same as a navigate call, but it returns the URL as a string instead of doing the navigation. See Example 16-7.

    Example 16-7 Example Use of getURL

    public java.lang.String getURL(   java.lang.String    viewId,
       java.lang.String webApp,
       java.lang.String pageParametersList,
       java.lang.String navTaskFlowId,
       java.lang.String navTaskKeyList,
       java.lang.String navTaskParametersList,
       java.lang.String navTaskLabel,
    FndMethodParameters methodParameters)
    throws  java.io.IOException
    
  • getURLForCurrentTask : getURLForCurrentTask, shown in Example 16-8, is good for getting the URL of the Main Area flow in focus so you could send it in an email to someone else. When clicked, it would open the correct workarea (.jspx page) and the correct flow with the correct parameters. If you did have other dynamic tabs open when you called getURLForCurrentTask, it would not open those when clicked.

    Example 16-8 Example Use of getURLForCurrentTask

    public java.lang.String getURLForCurrentTask( )
    throws  java.io.IOException
    

16.4 Using the Single Object Context Workarea

The Single Object Context Workarea is a facet that defines an area between the Global Area and the Main and Regional areas into which developers can add what they want. If the facet is empty, the area does not appear. You also can create a view scope parameter so other flows on the page can get the context. See Figure 16-4.

Figure 16-4 Context Area Example

Context Area example

This area is useful for creating Single Object Workareas, which are particularly useful in tabbed page mode. A Single Object Workarea is a page that is devoted to one object so the information of that one object can be put above the Workarea.

Single Object Workareas provide a context for addressing the tasks and processes for the business process of a single complex object instance at a time. Usually, single object workareas will use multiple defaultMain flows. Each flow can be about a different aspect of the same object. For instance, you could have one tab showing recent activity, and another tab showing payments.

16.4.1 Implementation Notes

The SingleObjectContextArea facet has been added to the UI Shell template for Context Area task flow.

A managed bean entry, shown in Example 16-9, has been added to adfc-config.xml for viewScope Hashmap.

Example 16-9 Managed Bean viewScope Hashmap Entry in adfc-config.xml

<managed-bean>
    <managed-bean-name>fndPageParams</managed-bean-name>
    <managed-bean-class>java.util.HashMap</managed-bean-class>
    <managed-bean-scope>view</managed-bean-scope>
  </managed-bean>

Support for URL parameters defined in the view activity for the page (JSPX) in adfc-config is to be set in the fndPageParams Hashmap defined in viewScope. This Hashmap is also passed onto the pageFlowScope of the task flows in the context area, Regional Area and Main Area.

This is accomplished by enabling the Bookmarkable property on the view activity for the page and specifying the URL parameter names with the value set to be added to the fndPageParams Hashmap defined in viewScope. See the "How to Create a Bookmarkable View Activity" section in the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

Product team task flows running in the Single Object Context Workarea must be designed to take in the appropriate context values as input parameters. The pageFlowScope values must be passed to the appropriate input parameters through the parametersList for the item node in the menu or the openMainTask API.

Product teams can cause URL navigation (using the navigate data control method provided by UI Shell by passing required parameters in the pageParametersList) for changing context or updating context information. This will cause the entire page to be refreshed based on new context parameter values.

Product teams can also check for the input parameter values (the context) within the context area task flow. If invalid, a modal dialog can be launched for the end user to choose a context (rendered as links based on the navigate data control method provided by UI Shell) before proceeding.

16.4.1.1 Developer Implementation

Enable the Bookmarkable property on the view activity for the single object context page and specify the URL parameter names with the corresponding fndPageParams viewScope Hashmap key where the value should be stored. See the "How to Create a Bookmarkable View Activity" section in the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

Example 16-10 shows a sample entry in adfc-config.xml for such a view activity.

Example 16-10 Sample Entry in adfc-config.xml for a View Activity

<view id="SingleDeptContextPage">
 <page>/oracle/apps/empdeptdemo/ui/page/SingleDeptContextPage.jspx</page>
 <bookmark>
  <url-parameter>
   <name>Deptno</name>
   <value>#{viewScope.fndPageParams.Deptno}</value>
  </url-parameter>
 </bookmark>
</view>

Product teams must create a bounded task flow for the Context Area that appears at the top of the page. This task flow must accept the context values as input parameters. This task flow is dropped as a static region onto the Context Area facet in the JSPX page based on the UI Shell template. In the task flow binding, set the input parameter values to the corresponding key in fndPageParms viewScope Hashmap.

Example 16-11 shows a sample entry in the page definition for the JSPX file for passing the viewScope values into the Context Area task flow as input parameter.

Example 16-11 Sample Page Definition for Passing viewScope Values into Context Area Task Flow

<taskFlow id="ContextDeptSummary1"
              taskFlowId="/WEB-INF/oracle/apps/empdeptdemo/ui/flow/ContextDeptSummary.xml#ContextDeptSummary"
              xmlns="http://xmlns.oracle.com/adf/controller/binding">
      <parameters>
        <parameter id="Deptno" value="#{viewScope.fndPageParams['Deptno']}"
                   xmlns="http://xmlns.oracle.com/adfm/uimodel"/>
      </parameters>
    </taskFlow>

The UI Shell code passes this viewScope Hashmap onto the pageFlowScope of the Main Area and Regional Area task flows. Product team task flows, which are initialized in the Regional Area and Main Area, can access this in pageFlowScope (of a Main Area or Regional Area container task flow owned by Applications Core) for the appropriate input parameters through the menu model and openMainTask API.

Example 16-12 shows a sample entry for a child item node for defaultMain task in the menu.xml to pass the appropriate deptno in the single object context to a task flow that is initialized based on this input value.

Example 16-12 Sample Child Item Node for defaultMain Task

<itemNode id="SingleDeptContextPage_EmpListingDefaultTab"
              focusViewId="/SingleDeptContextPage"
              label="#{adfBundle['oracle.apps.empdeptdemo.ui.test_menuBundle'].EMPLOYEE_LISTING}"
              taskType="defaultMain" reuseInstance="false"
              taskFlowId="/WEB-INF/oracle/apps/empdeptdemo/ui/flow/ContainerTF.xml#ContainerTF"
              parametersList="Deptno=#{pageFlowScope.fndPageParams['Deptno']}"/>

Product teams can cause URL navigation (through the navigate data control method provided by UI Shell) for changing context or after updating context information. This will cause the entire page to be refreshed based on new context parameter values.

Product teams can also check for the input parameter values within the pageFlowScope of the context area task flow. If invalid, a modal dialog can be launched for the end user to choose a context (by providing links based on the navigate data control method provided by the UI Shell by passing required parameters in the pageParametersList) before proceeding. This can be achieved by defining an invoke action executable in the page def for the context area page fragment which checks for existence of the pageFlowScope value and programmatically shows a modal dialog for the user to choose the context. The other alternative is to use this approach to cause navigation to a completely different page where the user can select the context.

Also, it is important to note that all the bounded task flows that will be initialized in the Single Object Context Workarea need to check for input parameter values and show/query data ONLY if the input parameter values are passed. Basically, if the input parameter values are empty, the task flows handle that, such as in a router activity, and avoid showing any transaction data to the end user.

16.5 Implementing the Third-Party Component Area

The Third-Party Component Area, shown in Figure 16-5, is a facet in the UI Shell template for showing content just above the Single Context Workarea in the global area. Although originally designed to contain a Call Telephony Interface (CTI) showing incoming calls in a call center operation, the facet can contain anything.

Figure 16-5 Third Party Component Area Facet Containing A CTI

Third Party Facet Containing a CTI

16.5.1 How to Implement the ThirdPartyComponentArea Facet Developer

The ThirdPartyComponentArea facet should be added within a flexible layout component that will allow you to control the amount of screen real estate that the content added to the facet can consume.

  • A facet reference is under the global area content with its width set to 100 percent.

  • Add content to this facet.

  • You should create a bounded task flow with page fragment for the content and drop it into this facet as a static region. This supports personalization through web composer since the content is within a page template.

  • The height property of the panelStretchLayout in the UI Shell template defaults to 33 px. To view or enable the third party component area (see the dark blue area at the top of Figure 14-1), specify the globalAreaHeight property as auto in the pageTemplate property Inspector.

    When the height of the top facet is specified as a CSS length or as auto, this facet will no longer be stretched and instead will consume the initial offsetHeight given to its children by the browser. It is important to note that in an average page, a switch to a layout using automatic heights exhibited a 5- to 10-percent degradation in initial layout speed. Also, an automatic height will cause the facet child to not be stretched both vertically and horizontally.

  • You can set the height of the root layout component within the facet to auto to ensure auto-resizing of contents within the facet. Consider a showDetailHeader that is the root element within the facet (in the default view activity for the bounded task flow dropped in as a region). If the height property for this showDetailHeader component is set to auto, collapsing the header would resize the contents and open more real estate in the screen for showing other components in the page.

16.6 Developing an Activity Guide Client Application with the UI Shell

The Oracle UI Shell can be used to develop an Activity Guide client application.

Before you begin:

Copy the file oracle.bpm.activityguide-ui_11.1.1.jar to a local directory from the following location in the bpm-jdev-extension.zip file:

jdev_install/jdeveloper/soa/modules/oracle.bpm.activityguide-ui_11.1.1.jar

To develop an activity guide client application using Oracle UI Shell:

  1. Create a new application. In the Application Package Prefix field, enter oracle.ag.

    Figure 16-6 Filling-in the Application Package Prefix Field

    Enter oracle.ag in the Application Package Prefix field.

    When prompted to create a new project, click Cancel.

  2. In the new application, create a new project using the Web Project template by right-clicking the application and selecting New Project > Project > Web Project. Select Servlet 2.5/JSP 2.1 (Java EE 1.5). Click through the wizard, accepting all default values.

  3. Add the ADF Faces and ADF Page Flow technologies to the client application project. Right-click the project and select Project Properties > Technology Scope. Shuttle ADF Faces and ADF Page Flow from the Available Technologies list to the Selected Technologies list.

    Make sure the following technologies are also selected: HTML, Java, JSP and JSF and Servlets.

    Figure 16-7 Adding the ADF Faces and ADF Page Flow Technologies to the Client Application

    Add ADF Faces and ADF Page Flow to the client application.
  4. Right-click the client application and select Project Properties > JSP Tag Libraries. Select the Distributed Libraries folder and click Add. In the Choose Tag Libraries window, select the tag library Applications Core (ViewController) 11.1.1.0.0 and click OK.

    Figure 16-8 Select the Tag Library Applications Core (ViewController) 11.1.1.00

    Select tag library Applications Core.
  5. In the Project Properties window, select Libraries and Classpath and click the Add Library button. From the window that is displayed, select the Applications Core library and click OK.

    Figure 16-9 Add the Applications Core Library to the Project

    Add the Applications Core library to the project.
  6. In the Project Properties window, click the Add JAR/Directory button and browse for the file oracle.bpm.activityguide-ui_11.1.1.jar. The file is located under jdev_install/jdeveloper/soa/modules/oracle.bpm.activityguide-ui_11.1.1.jar.

    Click Select to add the JAR to the project classpath.

  7. Add Activity Guide runtime libraries or JAR files to the classpath. Use either shared libraries or JAR files; do not use both.

    1. Using shared libraries for Activity Guide runtime JAR files

      Add the shared library references oracle.soa.bpel and oracle.soa.workflow.wc to the weblogic-application.xml file.

      <library-ref>
         <library-name>oracle.soa.bpel</library-name>
      </library-ref>
      <library-ref>
         <library-name>oracle.soa.workflow.wc</library-name>
      </library-ref>
      
    2. Using JAR files for Activity Guide runtime

      Add the following JAR files to the classpath:

      FMW_home/AS11gR1SOA/soa/modules/oracle.soa.workflow_11.1.1/bpm-services.jar
      FMW_home/AS11gR1SOA/soa/modules/oracle.soa.bpel_11.1.1/orabpel-common.jar
      FMW_home/AS11gR1SOA/soa/modules/oracle.soa.bpel_11.1.1/orabpel.jar
      FMW_home/AS11gR1SOA/soa/modules/oracle.soa.fabric_11.1.1/bpm-infra.jar
      FMW_home/AS11gR1SOA/soa/modules/oracle.soa.fabric_11.1.1/fabric-runtime.jar
      FMW_home/oracle_common/modules/oracle.webservices_11.1.1/wsclient.jar
      FMW_home/oracle_common/modules/oracle.xdk_11.1.1/xml.jar
      
  8. Create a file called Config.jar using the wf_client_config.xml file and add it to the application classpath. The wf_client_config.xml file should include the host name and port of the WLS instance running the Activity Guide instances.

  9. Create a JSF page. Right-click the application name and click New. In the New Gallery, select JSF > JSF Page and click OK. Use UIShell as a page template and select the checkbox Create as XML Document (*.jspx).

    If a dialog box displays the message "Confirm Add Form Element," click No.

  10. Create Application menu metadata. See Section 14.3, "Implementing Application Menu Security.".

To add a task flow to the Oracle UI Shell client application:

  1. Open the menu metadata menu XML file created in "To develop an activity guide client application using Oracle UI Shell:".

  2. Right-click itemNode_<JSF page name> and select Insert inside itemNode_<JSF page name> > itemNode.

  3. In the Common Properties window, browse for the name of the JSF page and enter a unique ID for the itemNode using the standard format <pageID>_<taskFlowName>. For example: ItemNode_MainArea_TaskFlow.

  4. Click the Browse button to the right of the focusViewId field. In the Edit Property window that is displayed, select the focusViewId of the page under which you are registering the task flow. Click OK.

  5. In the Property Inspector, select the Applications tab and enter a label for the itemNode such as Main Taskflow.

  6. From the Project Navigator, select the menu metadata XML file. In the Structure view, select the task flow itemNode – Main Taskflow. In the Property Inspector, enter the following values under the Advanced section:

    • Task Type: defaultMain

    • Task Flow ID: Click the Browse button to display the Select Task Flow ID window and select the location of the task flow definition: /WEB-INF/oracle/bpel/activityguide/ui/taskflows/ag-humantask-task-flow.xml#ag-humantask-task-flow. This is the ID of the Main Area task flow.

    • Disclosed: Optionally, set this value to false. This property enables opening a new tab when clicking the relevant task link at run time. For tabs, the first defaultMain with disclosed=true is the one that will be in focus.

  7. Repeat Steps 1 through 6 for the regional task flow, naming the label and ID accordingly. Provide the following values for the regional task flow in step 6:

    • Task Type: defaultRegional

    • Task Flow ID: Click the Browse button to display the Select Task Flow ID window and select the location of the task flow definition: '/WEB-INF/oracle/bpel/activityguide/ui/taskflows/ag-tasktree-task-flow.xml#ag-tasktree-task-flow. This is the ID of the Regional Area task flow.

    • Disclosed: Set this value to true for the regional task flow. This property enables opening a new tab when clicking the relevant task link at run time.

  8. Create a file called activityguide.properties. See the table of Activity Guide properties, and the sample properties file, in the "Developing a Guided Business Process Client Application with Oracle ADF" section of Oracle Fusion Middleware Modeling and Implementation Guide for Oracle Business Process Management.

    If using identity propagation to secure the Activity Guide, the properties WorkflowAdminUser and WorkflowAdminPassword are not required.

  9. In the page definition of Oracle UI Shell JSF fragment page, navigate to pageTemplateBinding and set the Refresh property to ifNeeded.

  10. Open the file adfc-config.xml.

  11. Edit the file adfc-config.xml to include the location of the activity.properties file. This should be the absolute path to the activityguide.properties file.

    An example adfc-config.xml is shown in Example 16-13.

    Example 16-13 adfc-config.xml File with Reference to activityguide.properties File

    <managed-bean>
    <managed-bean-name>agProps</managed-bean-name>
    <managed-bean-class>
       oracle.bpel.activityguide.ui.beans.model.AGProperties
    </managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>absAgPropsFileName</property-name>
    <property-class>java.lang.String</property-class>
    <value> <!---absolute path on your machine should be given here-->/activityguide.properties</value>
       <!-- For example:
       Windows: C:\AG\activityguide.properties
       Linux: /scratch/<user>/AG/activityguide.properties
       -->
    </managed-property>
    </managed-bean>
    
  12. To enable a task flow popup with summary information, add the property AGTasksPopupTaskFlowID to the activityguide.properties file.

    Use this parameter to display a task flow summary in dynamic regions. Enter the relevant task flow ID. If this parameter is not set, the value of OutputText is shown as the default task summary.

  13. Create a Workflow Service client configuration file. An example is shown in Example 16-14.

    Example 16-14 Workflow Services Client Configuration File

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <workflowServicesClientConfiguration xmlns="http://xmlns.oracle.com/bpel/services/client">
      <server default="true" name="default">
          <localClient>
              <participateInClientTransaction>false</participateInClientTransaction>
          </localClient>
          <remoteClient>
              t3://host:port
              <initialContextFactory>weblogic.jndi.WLInitialContextFactory</initialContextFactory>
              <participateInClientTransaction>false</participateInClientTransaction>
          </remoteClient>
          <soapClient>
              http://host:port
              <identityPropagation mode="dynamic" type="saml">
                  <policy-references>
                      <policy-reference enabled="true" category="security" uri="oracle/wss10_saml_token_client_policy"/>
                  </policy-references>
              </identityPropagation>
         </soapClient>
      </server>
    </workflowServicesClientConfiguration>
    
  14. Deploy the Acitivity Guide client application with Oracle UI Shell as described in "To deploy an Activity Guide client application with Oracle UI Shell to the integrated Oracle WebLogic Server:" or in "To deploy an Activity Guide client application with Oracle UI Shell to a standalone Oracle WebLogic Server:".

To secure the Activity Guide Oracle UI Shell client application:

Securing the Activity Guide client application ensures that only users with proper credentials can complete the tasks outlined in the Activity Guide. Security features include authentication, authorization, realm verification and policy enforcement.

Follow the instructions for securing a Web application as described in the "Enabling ADF Security in an Oracle Fusion Web Application" chapter of the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

To deploy an Activity Guide client application with Oracle UI Shell to the integrated Oracle WebLogic Server:

You can deploy an Activity Guide client application with Oracle UI Shell directly from JDeveloper or to the standalone Oracle WebLogic Server.

From the Application Navigator, right-click the JSF page created in "To develop an activity guide client application using Oracle UI Shell:" and select Run.

To deploy an Activity Guide client application with Oracle UI Shell to a standalone Oracle WebLogic Server:

  1. Create a connection to the standalone Oracle WebLogic Server.

  2. From the Application Navigator, right-click the project created in step 2 of "To develop an activity guide client application using Oracle UI Shell:"

  3. Select Project Properties.

    From the Project Properties dialog, select Deployment.

  4. Create a new WAR deployment profile.

  5. Right-click the project and select Deploy. Deploy the project to the standalone Oracle WebLogic Server connection created in step 1.

  6. Launch the client page from a browser.

16.7 Troubleshooting UI Shell Issues

This section presents the more-common problems, with their solutions, that may be experienced by Oracle Fusion applications developers. Also see the Oracle Fusion Applications Administrator's Troubleshooting Guide and "Troubleshooting Customizations" in the Oracle Fusion Applications Extensibility Guide.

16.7.1 ApplSession Is Not Created

Problem

When ApplSession is not created, these problems occur:

  • User Language settings are not set.

  • Data security policies are not applied.

  • Webservice requests are run as anonymous users instead of named users.

Solution

To resolve this problem:

  • Check that the JpsFilter section is correct in web.xml: Applcore Session code depends on the JPS subject. The entry must appear exactly as shown in Example 16-15.

  • Check that the ApplSessionFilter section is correct in web.xml: ApplSession must be configured immediately after JpsFilter. The entry must appear exactly as shown in Example 16-15.

    Example 16-15 ApplSessionFilter and JpsFilter Configuration in web.xml

    <filter-mapping>
        <filter-name>JpsFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <filter-mapping>
        <filter-name>ApplSessionFilter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
    </filter-mapping>
    
  • If the issue is with the ApplSession not being created over a web service request using SOA, check how the ApplSession context interceptor is configured.

    ApplSession information is preserved over SOA/Web Service requests through the use of context interceptors that fire when requests are sent and received. The ApplSessionContext interceptor, in particular, will handle propagating all session attributes from the caller to the web service, and will even attempt to reuse the same session ID if running against the same database. To enable the context interceptor, the weblogic-application.xml on both the caller and the called should include the oracle.applcore.config shared library:

    <library-ref>
        <library-name>
          oracle.applcore.config
        </library-name>
      </library-ref>
    

    If the context interceptor has not been enabled, the prepareSession() of the root application module call should still be able to create the session as the right user, so long as the Subject has been established correctly in the Oracle Web Services Manager layer. But in that case, no other session attributes will be propagated, and the session cannot be reused.

  • Obtain the session ID from the cookie. The cookie is located in the browser's cookies folder.

    The session cookie is obtained so that subsequent queries can be run to verify the session's existence and obtain additional info about the session. Note that it is the session cookie that is stored in the browser cookie location, not the session ID. They represent the same session, but the actual session ID is internal.

    Cookie name: ORA_FND_SESSION_<db_instance_name>

    The session cookie value will appear similar to: DEFAULT_PILLAR:wvlu8CUiH4FYjySCPQtwaEphBOyiUTZwexYd1fYXh5VwV9i9koUL8L3Qhm0bNrZ8:1282160020177

    To retrieve the actual session id, run this SQL statement: select session_id from fnd_sessions where session_cookie=value_obtained_from_cookie_value.

    Note: The value_obtained_from_cookie_value is the alpha-numeric string between the two colons. In the example, it is wvlu8CUiH4FYjySCPQtwaEphBOyiUTZwexYd1fYXh5VwV9i9koUL8L3Qhm0bNrZ8. This value will always be different.

16.7.2 Navigator Shows a Little White Box

Problem

Clicking the Navigator in the global area shows a little white box.

This is an issue that developers would see.

Solution when in a production environment

  • Make sure that you are signed in as a user that has access to some pages in the Navigator menu. You can type the full URL of the page directly into the browser and see if the user can access it.

  • Make sure there is a valid connection to the LDAP server. This is needed to check the policies of each entry in the Navigator menu.

  • Use Enterprise Manager to make sure the Applications are registered in the topology tables.

  • Make sure the Applications Core Setup application is deployed. (From JDeveloper, run .../atgpf/applcore/applications/FndSetup/FndSetup.jws.) This contains the Navigator menu file and usually is deployed to the Oracle Fusion Applications Global domain.

  • Check that the menus are in MDS. Check for entries with the path oracle/apps/menu.

Solution when in a development environment

  • You usually should run without menu security. The first thing to check is if you have started your web server with this parameter to turn off security checking:

    -DAPPLCORE_TEST_SECURED_MENU=N

  • Then check steps 3 through 5 in the solution for a production environment.

16.7.3 Navigator Shows Unfiltered Entries

Problem

The Navigator menu is showing all entries, rather than being filtered by what the user has access to, and the Welcome page has all tabs exposed.

Solution

This is caused by menu security being turned off. This should happen only in development environments.

Because menu security is on by default, check that the web server was not started with -DAPPLCORE_TEST_SECURED_MENU=N.

16.7.4 Other Navigation Issues

Problem

Customizers and developers may encounter a URL that is not working.

Solution

Make sure the URL does not end with ".jspx."

Problem

A message such as "webApp <value> not defined" is displayed. This means the application is not listed in the topology tables.

Solution

Check that the application is registered.