Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 63

Oracle Application Framework

By Sridhar Yerram

12/01/20 1
Outline
• Introduction to  OA Framework
– Definitions
– General Principles
• MVC Architecture
– Understanding the basics of Model
• View Objects
• View Links
• Entity Objects
• Entity Experts
• Validation AM
• Validation VO
– Understanding the basics of View
– Understanding the basics of Controller
• Jdeveloper Structure and configuration in your desktop
• Fundamental OA Framework UI Objects
– Checkboxes
– Pop Lists
– Simple List of Values
– Exception Handling
– Advanced Tables
– Partial Page Refresh
– Dialog Pages
– Passive Criteria List of Values

12/01/20 2
Outline
• Implementing Server Side Features  
– Calling PL/SQL procedures and functions 
– Error Handling
• Debugging OA Framework Applications 
– Debugging OA Framework Applications using Jdeveloper
– Logging Infrastructure in OA Framework
• 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)

12/01/20 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 custom-
application 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.
Current Technology OAF with MDS

12/01/20 4
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.

12/01/20 5
Overview (Cont)
• Browser Support
– Firefox
– IE
• Session
– ICX:Session Timeout
– ICX:Limit Time

12/01/20 6
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 web-bean

12/01/20 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.
12/01/20 8
OA Framework Architecture
• OA Framework architecture is based on
Model-View-Controller (MVC)design pattern.

12/01/20 9
12/01/20 10
Components of MVC Architecture
• Model:
– Data
– Implemented using Oracle Business Components for Java (BC4J).
• 1.EO (Entity Object)
• 2.VO (View Object)
• 3.AM (Application Module)
– AM is a container for EO, VO, viewLink and entityAssociation.
– AM retention
» Get request not retained by default
» Multipage transactions have same rootAM, Use retainAM=Y
» Post request by default, it is retained
» Originally Bc4j was named jbo(Java Business Objects)
• View:
– User Interface.
– Implemented using an Oracle technology called UIX. (UIX = User Interface XML).
• Controller:
– Code
– User actions are handled by the OA Controller. (Ex: Clicking SUBMIT button)

12/01/20 11
Components of MVC
Architecture(Cont)

12/01/20 12
Interaction between model, view and controller

12/01/20 13
Entity Object (EO)

• Entity Object is based on database table or


other data source.
• Entity Object contains attributes which
represent database columns.
• All insert/update/delete (DML Operations)
transactions go through EO to database.

12/01/20 14
View Object (VO)

• 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.
12/01/20 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.

12/01/20 16
Application Module (AM)

• Container for VOs.


• Every page must have a root application
module.
• Handles transactions.

12/01/20 17
Web Bean Architecture
• 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.

12/01/20 18
Web Bean Architecture

12/01/20 19
MDS – Meta Data Service
• 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.

12/01/20 20
View in MVC Architecture

12/01/20 21
Controller (CO) in MVC Architecture

 Responds to user actions and directs application flow.


 Model objects like EO and VO can't be accessed directly from
theController Class, except AM.
 Contains methods such as
◦ processRequest(OAPageContext, OAWebBean):
◦ Fires when OAF page loads for the first time.
◦ Can create all UI components
◦ processFormData(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
◦ processFormRequest(OAPageContext, OAWebBean):
◦ Fires when user submits the page.(Ex: clicking SUBMIT button)
◦ Gets called after PFD returns without raising any exceptions
◦ place to do database commits

12/01/20 22
Controller Class

12/01/20 23
Onion Architecture of OA Framework

• OA Framework can be extracted into a series


of concentric layers, like an onion.
• Each layer only “knows” about the layers
below it.

12/01/20 24
MVC Architecture

12/01/20 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.

12/01/20 26
JDeveloper Structure (Cont.)

12/01/20 27
Finding out the right version of
Jdeveloper IDE
ATG Release 12.1 Version JDeveloper 10g Patch

12.1 (Controlled Release - only


included for completeness) Patch 7315332 10G Jdev with OA Exten
sion ARU for R12.1 (Controlled Release)
12.1.1 (rapidInstall or patch 7303030) Patch 8431482 10G Jdeveloper with OA
12.1.2 (patch 7303033 or patch Extension ARU for R12.1.1
7651091) Patch 9172975 10G JDEVELOPER WITH
12.1.3 (patch 9239090 or patch OA EXTENSION ARU FOR R12.1.2
8919491) Patch 9879989 10G JDEVELOPER WITH
OA EXTENSION ARU FOR R12.1.3
12.1.3.1 (patch 11894708) Patch 9879989 10G JDEVELOPER WITH
OA EXTENSION ARU FOR R12.1.3

12/01/20 28
OAF File Types & Extensions
File Descrip Java Package Structure Files File Stored in
Types tion Generat DB/Middle
ed Tier
PG Page File <clientName>.oracle.apps.fnd.<APPL_TOP>. XML DB
File webui
CO Controll <clientName>.oracle.apps.fnd.<APPL_TOP>. Java Middle tier
File er File webui

RN Region <clientName>.oracle.apps.fnd.<APPL_TOP>. XML DB


File webui

AM Applicati <clientName>.oracle.apps.fnd.<APPL_TOP>. XML Middle tier


on server Java
Module
EO Entity <clientName>.oracle.apps.fnd.<APPL_TOP>. XML Middle tier
Object schema.server Java
VO View <clientName>.oracle.apps.fnd.<APPL_TOP>. XML Middle tier
Object server Java
12/01/20 29
OAF File Types & Extensions(Cont)
File Descrip Java Package Structure Files File Stored in
Types tion Genera DB/Middle
ted Tier
Jws Java NA Jws NA
Worksp
ace
jpr Java NA jpr NA
Project

12/01/20 30
OAF UI Objects
• CheckBoxes 
• Pop Lists
• Simple List of Values
• Exception Handling
• Advanced Tables

12/01/20 35
OAF UI Objects- Checkbox

12/01/20 36
OAF UI Objects- Pop Lists
• Step 1: Create a view object to be used by your poplist. • Step 7: (optional) If the poplist should
Per the OA Framework Package / File / Directory
standards, you should create this object in a read/write its selected value from an underlying
*.poplist.server package. data source, set the View Instance and View
• Step 2: Create an item whose Item Style is
messageChoice . Assign an ID in accordance with the OA Attribute values accordingly as you would for
Framework Package / File / Directory standards. any other data entry component. The View
• Step 3: Apply an attribute set as required by the OA Instance value should not be same as the
Framework View Coding Standards.
• Step 4: Specify the Prompt (if not specified by the
Picklist View Instance value.
attribute set).
• Step 5: Specify the view object that you created in Step
1.
◦ set the Picklist View Instance property (for example,
PoplistVO1). In this case, remember to add your poplist
view object to the root UI application module for the page
(or application module for the shared regions) that will
include this poplist.
• 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.

12/01/20 37
OAF UI Objects- Simple List of Values

12/01/20 38
OAF UI Objects- Advanced Tables

12/01/20 39
OAF UI Objects- Partial Page Rendering
• example of PPR refresh behavior for the Hide/Show component.

12/01/20 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.

12/01/20 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);

12/01/20 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
Calling PL/SQL procedures and functions

 According to Oracle Standards whenever it is


possible we should use View Objects for
Database operation but in some situations we
have to call PL/SQL Procedures and Functions
using JDBC
1. Create a JDBC CallableStatement with the PL/SQL block
containing the stored procedure invocation
2. Register OUT Parameter if any
3. Bind any variables.
4. Execute the statement.
5. Retrieve the values of any OUT parameters if any
6. Close the statement

12/01/20 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.

12/01/20 45
Directory Structure of Application Server

12/01/20 46
Deploying OA Framework Applications

• The Folder Structure for xml pages and respective Controllers


are as below
D:\RUP6\jdevhome\jdev\myclasses\tempel\oracl
e\apps\xxtmg\pdms\msd\webui

D:\RUP6\jdevhome\jdev\myclasses\te
mpel\oracle\apps\xxtmg\pdms\msd\serv
er

12/01/20 47
Deploying OA Framework Applications

• This was the development of files in our localhost m/c.


• The next step will be to move the files into the JAVA_TOP.
{/home/tempel10/cdev35appl/xxtmg/java/tempel/oracle/apps/xxtmg/pdms/msd}
• Just drag and dropped the msd folder from local m/c to Apps Java top
path.
• Importing the XML files:
• Run the import scripts for the PG and LOVRn files.
• The import command is
import
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\ -dbconnection "
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<host IP>)(PORT=<port
no.>))(CONNECT_DATA=(SID=<SIDNAME>)))"

12/01/20 48
Deploying OA Framework Applications

• Registering the Main Page as a function


• Enter the Function Name, User Function Name and
Description.
• Enter Properties (Tab) Type as SSWA jsp function In
Web HTML(tab)
• Enter the Main xml page path OA.jsp?
page=/tempel/oracle/apps/xxtmg/pdms/msd/webui/MultiSpeedPG (Don’t append .xml with the

path, it results in error)

• Attach the function with a menu and then run from the
respective responsibility.
12/01/20 49
OA Framework Personalization Concepts

• Personalization : refers to the ability to


declaratively alter the UI to suit user or business
needs.
• Extension : refers to the ability to
programmatically extend an application's
functionality.
• Substitution: refers to add adding additional
View Object Attributes, it is done by defining a
substitution, so your new view object is used in
place of the parent at runtime.
12/01/20 50
Personalization

• Profile options :
– persnoalize Self-Service Defn
– FND:personalization region link enable
– Disable Self-Service personal
12/01/20 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
– Adding regions

12/01/20 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

12/01/20 53
Partial Page Rendering and SPEL
• PPR: Ability to partially render the page
• SPEL : Simplest Possible Expression Language
• ${oa.xxCustomerVO.isNameReadOnly}
• ${oa.FunctionSecurity.NAME_READ_ONLY}

12/01/20 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

JDR_ATTRIBUTES Stores attribute/properties of components on documents and OA Framework


pages.
Primary Key: ATT_COMP_DOCID, ATT_COMP_SEQ, ATT_SEQ
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

12/01/20 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.
12/01/20 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>;
/

12/01/20 57
12/01/20 58
jdr_utils.listdocuments('/learning/oracle/apps/', TRUE);
jdr_utils.printdocument(p_document => '/learning/oracle/apps/fnd/webui/DeptPG');
JDR Packages
• JDR_CUSTOM_INTERNAL
• JDR_DOCBUILDER
• JDR_MDS_INTERNAL
• JDR_UTILS

• SELECT * FROM ALL_OBJECTS WHERE object_name like 'JDR_%' AND OBJECT_TYPE IN ('PACKAGE') ;

12/01/20 63

You might also like