OAF Training
OAF Training
OAF Training
By Sridhar Yerram
2/18/2014
Outline
Introduction to OA Framework
Definitions General Principles Understanding the basics of Model
View Objects View Links Entity Objects Entity Experts Validation AM Validation VO
MVC Architecture
2/18/2014
Outline
Implementing Server Side Features Debugging OA Framework Applications
Calling PL/SQL procedures and functions Error Handling
Finding out the right version of Jdeveloper IDE List of OAF Files Generated and their importance Directory Structure of Application Server Deploying OA Framework Applications OA Framework Personalization Concepts
Personalization Extension Substitution
SPEL JDR(Table/Packages)
2/18/2014 3
Overview
Oracle Application Framework(OA Framework) is a proprietary framework developed by Oracle Corporation for application development within the Oracle E-Business Suite. Available to customers for personalization, customizations and customapplication development. The OA Framework is a Model-view-controller (MVC) framework built using J2EE (Java 2 Platform, Enterprise Edition)technologies. Historical Perspective
Very first HTML screen in oracle apps was created using PLSQL code, using PL/SQL toolkit. AK Developer, repository for storing structure and definition of the WebPages.
2/18/2014
Overview (Cont)
OA Framework is based on JSP technology, which executes in a servlet engine. When the browser issues an OA.jsp request for one of the Self-Service pages, page processing takes place within a servlet engine which, in turn, can access the application data as well as user interface metadata from the database.
2/18/2014
Overview (Cont)
Browser Support
Firefox IE
Session
ICX:Session Timeout ICX:Limit Time
2/18/2014
Overview(Cont)
User selects a responsibility and a function MDS Tables(JDR_*) XML representation cached in memory Web Bean hierarchy is instantiated, top level bean is pageLayoutBean and then for each component of the page there is a webbean
2/18/2014 7
OA Framework Features
Advantages Enterprise-Grade Performance and Scalability Improved End User Productivity Highly extensible architecture Browser Look and Feel (BLAF terminology) for all applications Open industry Standards such as XML, HTML, Java, JSP, SQL and Web Services.
2/18/2014 8
OA Framework Architecture
OA Framework architecture is based on Model-View-Controller (MVC)design pattern.
2/18/2014
2/18/2014
10
2/18/2014
2/18/2014
12
2/18/2014
13
2/18/2014
14
Two types
1. SQL based 2. EO based
Represents a query result. Is used for joining, filtering, projecting, and sorting your business data. Can be based on any number of entity objects (EOs) and provides access to EOs.
2/18/2014 15
View Links
View link defines a relationship between two view objects that BC4J uses to automatically query and coordinate the destination view object based on the current source view object.
View links can be based on an association or a declarative join relationship between two view objects.
For example, suppose two tables have a master-detail relationship based on a foreign key. The corresponding entity objects are related via an association, and view objects based on those entity objects can be related by a view link based on the association.
2/18/2014 16
Container for VOs. Every page must have a root application module. Handles transactions.
2/18/2014
17
Each OA Framework web bean also implements a group of interfaces whose implementations collectively define the behaviors that the OA Framework adds to the base UIX beans. oracle.appps.fnd.framework.webui.beans.OAWebBean - defines core behavior common to all web beans (for example, among other key behaviors, this defines the processRequest, processFormData and processFormRequest methods that individual beans implement for themselves) oracle.apps.fnd.framework.webui.OAWebBeanConstants - a collection of constants used in the view/controller modules oracle.apps.fnd.framework.webui.beans.OAWebBeanData - defines common personalization definition and data source management behavior oracle.apps.fnd.framework.webui.beans.OAWebBeanContainer - defines the characteristics of all web beans that can act as containers for other web beans. For instance, all the layout web beans implement this interface. Only beans which implement this interface can have associated controllers. OAWebBean<Type> - defines a bean's inherent behaviors within the context of the OA Framework. For example, the OATableBean implements the oracle.apps.fnd.framework.webui.beans.OAWebBeanTable interface.
2/18/2014
18
2/18/2014
19
2/18/2014
20
2/18/2014
21
processFormData(OAPageContext, OAWebBean):
processFormRequest(OAPageContext, OAWebBean):
User makes changes on the pages and posts back the page Does validations and moves changed values to VO/EO cache Calls validation methods Fires when user submits the page.(Ex: clicking SUBMIT button) Gets called after PFD returns without raising any exceptions place to do database commits
2/18/2014
22
Controller Class
2/18/2014
23
OA Framework can be extracted into a series of concentric layers, like an onion. Each layer only knows about the layers below it.
2/18/2014
24
MVC Architecture
2/18/2014
25
Key Terms
Installation
Setting up E-BS from distribution media to the host OS
Configuration
Process of setting proper parameters, needs SME from various business domains
Personalization
Process of declaratively altering page's UI to meet business needs
Extension
Process of altering page's functionality programmatically(using PL/SQL, java)
Customization
Process of creating new pages
Deployment
Process of moving personalization/extension/customization from development instance to test/prod instance.
2/18/2014
26
2/18/2014
27
2/18/2014
28
XML
DB
Applicati <clientName>.oracle.apps.fnd.<APPL_TOP>. on server Module Entity Object View Object <clientName>.oracle.apps.fnd.<APPL_TOP>. schema.server <clientName>.oracle.apps.fnd.<APPL_TOP>. server
Middle tier
EO VO
2/18/2014
jpr
NA
jpr
NA
2/18/2014
30
OAF UI Objects
CheckBoxes Pop Lists Simple List of Values Exception Handling Advanced Tables
2/18/2014
35
2/18/2014
36
Step 7: (optional) If the poplist should read/write its selected value from an underlying data source, set the View Instance and View Attribute values accordingly as you would for any other data entry component. The View Instance value should not be same as the Picklist View Instance value.
Step 6: Map the poplist to its view object display and developer key attributes. Set the Picklist Display Attribute to the view object attribute whose value you want to display in the poplist. Set the Picklist Value Attribute to the view object attribute whose value you want to use as the internal developer key. To use our lookup code example above, we would set the Picklist Display Attribute to Meaning, and the Picklist Value Attribute to LookupCode.
2/18/2014
37
2/18/2014
38
2/18/2014
39
2/18/2014
40
Dialog Pages
Messaging can be introduced into application flows when an Error, Information, Warning, Confirmation, or Processing Message needs to be displayed. There are two basic kinds of messaging flows:
Inline Message - The message appears inline on a page around the region item that requires attention. The inline message is also repeated in the message box on top of the page. Dialog Page - The message appears on it's own dialog page in the flow.
2/18/2014
41
Dialog Pages
Warning dialog page.
Example: Redirect to a Basic Warning Page You can include the following code example in your controller processFormRequest method to redirect to a basic warning page: OAException descMesg = new OAException("FND", "FND_CANCEL_WARNING"); OAException instrMesg = new OAException("FND", "FND_CANCEL_ALERT"); String okUrl = APPS_HTML_DIRECTORY + "OA.jsp?OAFunc=FND_REQUISITIONS_PAGE"; String noUrl = APPS_HTML_DIRECTORY + "OA.jsp?OAFunc=FND_REQUISITIONS_PAGE&retainAM=Y"; pageContext.redirectToDialogPage(OAException.WARNING, descMesg, instrMesg, okUrl, noUrl);
2/18/2014
42
Dialog Pages
The short hints render immediately below the item as shown in Figure 1 (see the Purchase Order field). The long hints render as a selectable information icon next to the item (see the Created poplist in Figure 1). When the user selects the information icon, a dialog window opens as shown in Figure 3 below.
43
2/18/2014
44
Error Handling
The OA Framework handles three basic types of exceptions: general, validation and severe.
General Exception : Errors in the BC4J framework are handled by throwing an implicit (runtime) exception of the type oracle.jbo.JBOException. Validation Exceptions : Validation exceptions are thrown from entity objects and view objects for both row and attribute level validation failures.
oracle.apps.fnd.framework.OAAttrValException - specialization of OAException used for attribute level validation failures oracle.apps.fnd.framework.OARowValException - specialization of OAException used for row (entity) level validation failures
Severe Exceptions : Severe (or "fatal") exceptions include unexpected system-level errors (like a NullPointerException) and selected JBOExceptions like NoDefException. You can also deliberately throw a severe exception in your code.
2/18/2014
45
2/18/2014
46
2/18/2014
47
D:\RUP6\jdevhome\jdev\myclasses\tempel\oracle\apps\xxtm g\pdms\msd\webui\MultiSpeedPG.xml
-username <DB user name> -password <DB password> -rootdir
D:\RUP6\jdevhome\jdev\myprojects\
2/18/2014
48
2/18/2014
Attach the function with a menu and then run from the respective responsibility.
49
Personalization
Profile options :
persnoalize Self-Service Defn FND:personalization region link enable Disable Self-Service personal
2/18/2014
51
Personalization(Cont)
How it is done
Personalize Page link Functional-Administration responsibility Import/Export
Common Types
Changing labels, prompts Hiding or adding table columns Re-ordering UI elements Adding buttons, labels, flexfields 2/18/2014 Adding regions
52
Personalization(Cont)
Involve Some Programming
Controller
Instantiate custom VO Add UI elements which cant be done via personalization
VO Extension
This is needed when value to displayed to the user on the screen is not available in underlying VO
2/18/2014
53
2/18/2014
54
JDR Tables
JDR_PATHS Stores document paths, packages and there parent child relationship. Primary Key: PATH_DOCID
JDR_COMPONENTS
Stores components on documents and OA Framework pages. Primary Key: COMP_DOCID, COMP_SEQ
Stores attribute/properties of components on documents and OA Framework pages. Primary Key: ATT_COMP_DOCID, ATT_COMP_SEQ, ATT_SEQ
JDR_ATTRIBUTES
JDR_ATTRIBUTES_TRANS
Stores translated attribute values of document components or OA framework pages. Primary Key: ATL_COMP_DOCID, ATL_LANG, ATL_COMP_REF, ATL_NAME
2/18/2014
55
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.
2/18/2014 56
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>; /
2/18/2014
57
2/18/2014
58
jdr_utils.listdocuments('/learning/oracle/apps/', TRUE);
JDR Packages
2/18/2014
63