Tuesday, July 19, 2011

OAF ContentContainer Region

ContentContainer region is used to display additional information on a page. Content container gives different look and feel to its content compared to other regions of OAF page.

Corresponding web bean: oracle.apps.fnd.framework.webui.beans.layout.OAContentContainerBean
UI property "Background Shade" (setBackground() method of bean) is used to set the background color.

Usage:

Though Content Container can be used anywhere in the OAF Page, it is typically placed at the side of the page in a dedicated column.

Below images are examples of usage of Content Container:



Implementation Approaches:

A) Within Page Content (Source: OAF Dev Guide)
This will not provide better look and feel. But in case if requirement is such, then go ahead and create a region with "ContentContainer" style. Create content container region like any other region for example Header etc.
  
B) At the side of your page (Source: OAF Dev Guide)
  1. Create a shared region for your content container.
  2. Programmatically add the shared region to the end area by writing following code in processRequest method:
OAContentContainerBean content = (OAContentContainerBean)createWebBean (pageContext,
    "<full path of the shared content container region>",
    null, // ignore item for regions
    true); // using OAExtension

// Get the page layout bean
OAPageLayoutBean pageLayoutBean =
    pageContext.getPageLayoutBean();

// Specify the content container as the end content.
pageLayoutBean.setEnd(content);

C) At the side of your page using TableLayout:
  1. This approach is not mentioned in Dev Guide and is very effective and very easy. This doesn't involve any Java programming.
  2. All you need to do is develop the layout of your page using the TableLayout region.
  3. Use the last column for ContentContainer.
  4. Using shared region is optional.

Wednesday, July 13, 2011

OAF Page without PageLayout Region

By default the highest level of region in OA Framework page is "pageLayout" region.
When we create a page, page gets created with PageLayout region.
I always felt PageLayout is mandatory region and has to be in all Pages.

But I was so wrong... You can create pages without PageLayout.

Sometime back, while working on a popup requirement (Custom Javascript popup) to display a table. I didn't liked the idea of popup having Corporate Logo, Global Links etc. Just tried to change the style of PageLayout region to other style and it worked.

Note: There are lot of restrictions on a page without PageLayout region, but it suited my requirements.

Table Suffix in Oracle Applications

_ALL are multi-org tables, on which org-striped views are based. Example po_headers_all and po_headers

_TL are translation tables, provide multiple language support. For each item in the table without _TL there can be many rows in the _TL table, but all with different values in the LANGUAGE column.
_VL are views for multi language tables which combines the row of the base table with the corresponding row of the _TL table where the LANGUAGE = USERENV('LANG').

_F these are date tracked tables which occur in HR and Payroll. For these there are two date columns EFFECTIVE_START_DATE and EFFECTIVE_END_DATE which together with the PK identifies a row uniquely. The date intervals cannot overlap. (This is also called Date Effectivity)

_B these are the BASE tables.
They are very important and the data is stored in the these table with all validations.
It is supposed that these table will always contain the perfect format data.
If anything happens to the BASE table data, then it is a data corruption issue.

_V are views.

_S are sequences.

_A are Audit Shadow Tables.

_AVn and _ACn are Audit Shadow Views (when data was changed, and with what values).

_DFV and _KFV: DFF/KFF table created on the base table. This is the best way to get the concatenated value of DFF/KFF. Also using this table the values can be queried based on the DFF/KFF name and not attributes column.

_X Current information table. There is no date tracking.

Monday, July 11, 2011

OAF and Function Security

A function is a piece of functionality that is assigned to, or excluded from a responsibility/menu.
A function may or may not point to a OAF page/Form.

Function Security is one of the several options for Dynamic User Interface. We can control the behavior of application depending on whether a function is granted or not.
here are two ways of implementing Function Security:

  • Declarative
  • Programmatic

Declarative Implementation:
We can control only the following item properties using this approach:
  • Rendered
  • Read Only
  • Disabled
  • Required
Set the value for any of the above properties according to the following SPEL syntax:
${oa.FunctionSecurity.<FunctionName>}
** Above value can be added via Personalization as well.

 
Property Property Internal NameExpression Test Result
RenderedRENDERED_ATTR${oa.FunctionSecurity.<myFuncName>}Returns True if <myFuncName> is granted, otherwise False.
Read OnlyREAD_ONLY_ATTR${oa.FunctionSecurity.<myFuncName>}Returns False if
<myFuncName> is granted, otherwise
True.
DisabledDISABLED_ATTR${oa.FunctionSecurity.<myFuncName>}Returns False if
<myFuncName> is granted, otherwise
True.
RequiredREQUIRED_ATTR${oa.FunctionSecurity.<myFuncName>}Returns no if
<myFuncName> is granted, otherwise
Yes.

 
Note: Most people expect the declarative syntax to return True/Yes for properties if the function is granted and false otherwise, which is not the case.

A more flexible solution is to use a transient attribute in VO. Use function security in the getter method of the transient variable (Refer Programmatic Implementation). Use SPEL to set the properties of the UI Widgets. With this approach other possible values (uiOnly or validatorOnly) for Required property as well.

Programmatic Implementation:
Following methods test if a function is accessible under the current security context:

  • OAPageContext.testFunction("<Function Name>") ;
  • OADBTransaction.testFunction("<Function Name>") ;
Above methods return True if function is granted else return False.

OADBTransaction.testFunction is used in BC4J and PageContext version is used
in OAController.

We can have lot more control Programmatically. For example, we can modify the query of a VO, control the options being displayed in a drop down.

Use of Function Security to secure access to a page:
Prior to 11.5.10, we used to set the "Function" property on the PageLayout. If user is granted that function the page will render otherwise typical error "Insufficient Priviledges for current operation" is thrown if user attempts to navigate to that page.

While setting the Function property still works the recommended approach from 11.5.10 onwards is to set the Rendered property of PageLayout with the following syntax:
${oa.FunctionSecurity.<FunctionName>}

Note: There are two ways of navigating to a page; you can navigate by passing page parameter or you can pass OAFunc parameter.
If you are navigating to a page using OAFunc=<FunctionName>, again the function security is checked. If Function is granted to the user, then navigation is successful, else "Insufficient Priviledges" error is thrown.