|Receive Email for New Articles|
|MDS in OA Framework -What exactly it is?||| Print ||
|Written by Anil Passi|
|Sunday, 25 March 2007|
We know it means MetaData Service. We also know that it has something to do with web page displayed in OA Framework. Lets try to understand the basics of MDS.
Meta:- In technical world, meta work symbolizes dictionary. Think of a web page broken into small units which are fields, buttons, list boxes. These small individual units[fields, buttons etc] are stored in a dictionary, in the database. These units when combined together, they become a webpage that gets rendered on the browser.
Data:- Those meta pieces are not stored as binary files, but as data in tables. Those tables begin with jdr, for example JDR_ATTRIBUTES, JDR_ATTRIBUTES_TRANS, JDR_COMPONENTS & JDR_PATHS. The definition and relationship of each field/region/component is stored in these JDR tables. OA framework reads that data when you request a page. The page structure is then built based on MetaData.
Service:- Meta Data is available as a service(plain service not webservice). The data is there in JDR tables, but all such data has to be co-related, all fields, regions,buttons etc have to be clubbed into a meaningful manner to make a web page. You can say that MDS provides service to store & return page definitions. MDS collates those definitions in components/fields in a meaningful manner to build a page.
In jDeveloper, when I build a page and its regions, it looks I am building an XML file. Is page definition stored as XML file in OA Framework?
The storage page definition happens in JDR tables, where page components are not stored as XML. But MDS provides API's to build XML definition from the data in JDR tables.
Hence there are two provisions
1. When you design a page, you store "page definiton" in XML format on your pc. When deploying to your system/server, you load this XML file into JDR tables by using command xmlimporter(see this link for example of XML Importer).
2. When a user runs the page, OA Framework does the following steps:-
Step a. OA Fwk Requests page definition/structure from (MDS) --note its cached too
Step b. MDS engine returns a xml file to OA Framework
Step c. Each node/component in XML(of Step b) is translated into a web bean object. Let's say your page has
In this case, four web beans objects will be instantiated by OA Framework. A bean object is nothing but an object representation components like fields, buttons, regions etc. A bean object also has methods like setRendered, setRequired, getRequired etc.
Step d. Not only we have beans created for that page, those beans are nested as well, in exactly the same sequence of components within Region-Main. Hence parent child relationship is retained.
Step e. After rendering the page,OA Framework then calls the controller class for that MDS page. The page is displayed to user after processRequest in Controller is completed.
Fine the web page is rendered by OA Framework, but what happens next?
Before we answer the question, lets take a step backwards.
Lets recollect how we defined that page.
In OA Framework, when you define a page, there are two key things that you do:-
1. Specify/define a controller class for that page.
2. Specify/define an application module attached to that page.
Keeping that in mind, we can now answer this question. When the page gets rendered/displayed on browser, then following things happen
A. Framework builds a web bean hierarchy[based on XML from MDS] to represent the structure of the page in memory
B. An object instance of ApplicationModule is created. You may recollect that application module manages the database state of the page.
C. A method named processRequest in controller class is executed.
What parameters are passed to method processRequest of the controller?
What are the usages of OAPageContext parameters?
The main usages are:-
1. To get and set values of the fields, using oapagecontext.getParameter and oapagecontext.putParameter
2. For redirecting to the current page or another page. For example to redirecting to current page itself use oapagecontext.forwardImmediatelyToCurrentPage. Or you may use oapagecontext.sendRedirect(snewpage)
3. To get a handle to application module(remember we attached AM to page)
4. Write debug messages, using oapagecontext.writeDiagnostics
5. Get message text from FND Message dictionary, using oapagecontext.getMessage
What are the usages of parameter OAWebBean?
Remember that webbean represents the hierarchy/structure of components in the page. Hence using this paremeter object, you can get a handle to any bean/component in that page hierarchy. Once you have a handle to that bean(say field bean or button bean), you can then invoke methods like setRendered etc to change the behaviour of page at runtime.
Some examples are
1. OAWebBean LastName = oawebbean.findIndexedChildRecursive("personLastName");
Note: In this example, our page must have just one field whose name is personLastName
2. Get a handle to region
OAStackLayoutBean oastacklayoutbean = (OAStackLayoutBean)oawebbean.findIndexedChildRecursive("stackRegionName");
3. As seen above, the generic bean object returned by findIndexedChildRecursive can be typcasted to corresponding bean object.
So the page gets rendered/display after the processRequest finishes its execution?
Correct, the processRequest finishes and then the page renders.
Does this mean I can programatically create new bean components and render those on a page at runtime using controller?
Absolutely, you can literally add any component to the page at runtime.
For example, using oawebbean.addIndexedChild(oawebbean1);
However but I suggest you shouldn't follow this approach. If you wish to display fields conditionally, then you can include those into MDS, and turn their rendering off in controller or use SPEL.
Note: you can also create any additional bean for a page using "Create/Add New Item" feature of personalization. This is the prefered approach when adding display components to any standard Oracle OA Framework page.
I have nested regions in page, and each region is attached to its own controller. Will processRequest in each controller fire when page gets rendered?
Absolutely, the controllers of inner regions fire first and then outer/higher level regions. This is a very common practice, when you include shared regions into your main page, whereby each shared region may have its own controller.
Is the MDS page definition cached?
Yes, hence any changes that you make to MDS in database, you then need to bounce the mid-tier.
This is not applicable if you are testing the pages from jDev itself. jDev will first look at local XML files[local MDS]. If the page file is not found on your local PC, then Fwk gets the page definition from MDS in database.
When I do personalization, where is the personalization metadata stored?
This too is stored in the database in MDS, but the path of that document is prefixed by customizations.
For example if you personalize oracle/apps/per/irc/candidateSearch/webui/empSearchPG at site level,
then its corresponding customized document will be in oracle/apps/per/irc/candidateSearch/webui/customizations/site/0/empSearchPG
Are personalizations in MDS cached too? and need mid-tier bounce?
Not really, the MDS personalization layer are applied at runtime to the page, and hence mid-tier bounce is not required when you modify personalizations.
Where are the MDS files kept on File System?
Although MDS for runtime is loaded into the Database, but the MDS definitions can also be found by navigating to $MODULE_TOP/mds.
Sometimes the OA Framework form function reference AK Region. Is AK still being used?
AK is the MDS of old methodology, whereby regions and items were stored in tables namely AK_REGIONS and AK_REGION_ITEMS. The old pages[jsp or xml or pl/sql based] used to reference the AK regions. Hence the old form function definitions are pointing to AK Region names. During migration from AK to OA Framework, each such region was mapped with OA Framework page. Those mappings are stored in $MODULE_TOP/mds/regionMap.xml
Is regionMap.xml read from the file server when a form function is invoked?
Not really, its loaded using xmlImporter just like any other OA Page.
How to I identify those modules for which migration from AK to OA Framework took place?
You will notice that all those applications that have profile option "FND: Migrated To JRAD" set to Yes [at application level]
written by Shreekar , March 25, 2007
written by Kiran , March 26, 2007
written by Stalin , April 05, 2007
written by souvik mukherjee , April 20, 2007
written by souvik mukherjee , April 22, 2007
written by souvik mukherjee , April 24, 2007
written by Shreekar V , April 29, 2007
written by Sai , June 21, 2007
written by Anil Passi , June 21, 2007
written by Mohammed Anas OSmani , August 16, 2007
written by Jerry , November 29, 2007
written by Jerry , November 30, 2007
written by Sandra , December 05, 2007
written by Sandra , December 06, 2007
written by Sandra , December 08, 2007
written by Sandra , December 09, 2007
written by Mohammed Abd El Wahab , December 11, 2007
written by karan777 , January 17, 2008
written by Vishwanath S , February 14, 2008