Friday, August 19, 2011

Oracle Fusion Was Released in May-2011

Oracle Fusion was released in May 2011. It was released without much publicity.
As of now it is under controlled availability.

Lets all wait for the big bang announcements and updates from Oracle on the NEXT-GEN ERP Suite.

Auto Repeating Layout

This can be used to repeat the content of a region based on the number of rows in VO (data source) attached to the region.

You can implement an auto-repeating layout in one or two levels:

One Level - you create a container web bean and attach a view object to it, which results in the replication of the container children based on the rows in the view object.

Two Levels - you create a master-detail relationship between two lists and create a view link to join them. The outer list replicates its container children based on the master view object and the inner list replicates its container children based on the detail view object.

ARL can be read only or updatable. In case of updatable (with form elements), ARL should be based only on a single view object. A layout with form elements allows you to update any row and submit your changes to update the underlying view object

Limitations:
  • You cannot implement a two-level auto-repeating layout with a list containing Form Elements.
  • OA Framework does not support view objects (for the Child View Usage) with composite primary keys. The view object should have a single-column primary key.
  • The items under an Auto Repeating Layout should not be made hidden/rendered on a Partial Page Refresh (PPR) event.If such a scenario exists, on a PPR event, the page should be re-rendered by calling pageContext.setForwardURL().
  • LOV's are not supported in Auto Repeating Layouts (ARLs).
  • ARL cannot implement in the following container regions directly or indirectly:
    • Table
    • Advanced Table
    • Hide/Show
    • Switcher
    • HGrid
    • SubTabLayout
Properties for Implementing this:
  • Child View Instance
  • Child View Attribute
  • View Link Instance (in case of two levels)
Due to these limitations its use is limited :).

Saturday, August 6, 2011

MDS in Oracle Applications, OAF



Like all popular frameworks available in market today, OAF encourages use of declarative objects. The declarative objects are stored in XML. Following XML files are created in OAF:

  1. UIX Pages and Regions.
  2. OAF Personalizations
  3. BC4J Substitutions (EO, VO Substitutions)
  4. BC4J Components (Eo.xml, VO.xml, AM.xml, AO.xml, VL.xml)
First 3 types of xml files are stored in separate database called MDS.
4th type is directly deployed in BC4J Container.

MDS stores all information about the UI and Personalizations. Substitution is equivalent to Site level Personalization.


Metadata is data about data, data describing data.
Service is unit of work as part of business process written to a specification.

MDS stands for Meta Data Services and it is the declarative metadata repository used with OA Framework applications. It replaced the older AK Repository.

MDS is normal Oracle Database which contains metadata related to all seeded OAF pages in Oracle Applications. By storing Pages and Regions information in database, framework allows page attributes and properties to be changed easily via Personalization.

Why is it called a Service?
MDS is delivery of XML on demand.
OA Framework Page, Personalizations, and BC4J substitutions are stored and managed in MDS.


The meta data for Personalizations and Custom Pages/Regions can either be in the form of XML files on the file system or stored in the MDS repository. All the seeded UI components are present in MDS directory on product top. By exporting meta data into XML files on the file system, you can easily move those files to another system or simply login to a different environment and import those XML files to a new database instance.

Please note: OAF UI and substitution declarative components are retrieved from the MDS. Even though the xml files may exist in the EBS file system, they are not the objects that gets executed.

JDR_UTILS is a PL/SQL package that allows you to evaluate the list of personalization documents that are in your MDS repository.

Following are 4 tables in the MDS Repository:


TableDetails
JDR_PATHSStores document paths, packages and there parent child relationship.
Primary Key: PATH_DOCID
JDR_COMPONENTSStores components on documents and OA Framework pages.
Primary Key: COMP_DOCID, COMP_SEQ
JDR_ATTRIBUTESStores attribute/properties of components on documents and OA Framework pages.
Primary Key: ATT_COMP_DOCID, ATT_COMP_SEQ, ATT_SEQ
JDR_ATTRIBUTES_TRANSStores translated attribute values of document components or OA framework pages.
Primary Key: ATL_COMP_DOCID, ATL_LANG, ATL_COMP_REF, ATL_NAME

Every Metadata definition of Page or Region is called document.



Following are few queries to understand the above tables:

Query1:
select distinct path_type 
from JDR_PATHS;
/
Result:
DOCUMENT (for pages and regions)
PACKAGE (for packages/directories path)

Query2:
select * 
from JDR_PATHS 
where path_name = 'HelloWorldPG' ;
/
-- Get familiar with the table structure, path_type will be 'DOCUMENT' for this record.

Query3:
select * 
from JDR_PATHS 
where path_docid = <path_owner_docid from query2>;
/
-- This record will point to the parent package/directory.

Query4:
select * 
from JDR_COMPONENTS 
where comp_docid = <path_doc_id>;
/
-- This will query components of the DOCUMENT. There are no records for a PACKAGE type.

Query5:
select * from JDR_ATTRIBUTES
where att_comp_docid = <path_doc_id>
and att_comp_seq = <sequence id of component whose properties you wish to check>;
/

Query6:
SELECT   jdr_mds_internal.getdocumentname (paths.path_docid) document_full_path,
               -- Fully Qualified personalized document name
               paths.path_name, -- Actual name of xml file
               --paths.path_docid,
               --paths.path_owner_docid, 

               -- Since All Personalized document reside in a package
               -- path_owner_docid will always point to a PACKAGE.
               --paths.path_type, 
               -- Path type is of two types PACKAGE and DOCUMENT
               -- PACKAGE indicates directory, DOCUMENT indicate xml file.
               -- This query will always retrieve DOCUMENT
               paths.path_seq,
               --attrs.att_comp_docid,
               --attrs.att_comp_seq, -- Always 0 because we are retrieving only page (top level)
               --attrs.att_name, -- Name of Attribute in personalization xml file
               -- Here we are querying for att_name = 'customizes'
               --attrs.att_seq, -- sequence at which attribute is occuring
               attrs.att_value -- value of the attribute here it'll be path of actual page

from        JDR_PATHS paths,
              JDR_ATTRIBUTES attrs
where      paths.path_docid = attrs.att_comp_docid
              -- This query will not fetch path_type= 'PACKAGE'
              -- As there are no jdr_attributes records for packages
              and attrs.att_comp_seq = 0 -- sequence value 0 indicates parent
              and attrs.att_name = 'customizes' -- indicates personalized documents,
              att_name = 'customizes' will always have att_comp_seq = 0
              and paths.last_update_date > to_date('01-JAN-11','DD-MON-RR')
                                                 -- Personalizations done in 2011
              and jdr_mds_internal.getdocumentname (paths.path_docid) like '%/function/%'
                                                 -- All Function Level Personalizations;
/

/*
because ATT_COMP_SEQ = 0; Result will ATT_NAME, ATT_VALUE pairs as mentioned in the first xml tag of the file.
Below is first xml tag from the HelloWorldPG from R12:
<page xmlns="http://xmlns.oracle.com/jrad" xmlns:ui="http://xmlns.oracle.com/uix/ui" xmlns:oa="http://xmlns.oracle.com/oa" xmlns:user="http://xmlns.oracle.com/jrad/user" version="9.0.3.9.1_1573" xml:lang="en-US" file-version="$Header: HelloWorldPG.xml 120.8 2006/05/25 13:15:58 atgops1 noship $">
*/

/*
For att_name = 'customizes' Att_seq is always 3, please check the 4rd attribute (count starts with 0 like arrays in our programming languages) from the below xml tag (This xml tag is from the personalization file of HelloWorldPG) :
<customization xmlns="http://xmlns.oracle.com/jrad" version="9.0.6.0.0_26" xml:lang="en-US" customizes="/oracle/apps/fnd/framework/toolbox/tutorial/webui/HelloWorldPG">
*/