Vous êtes sur la page 1sur 35

OA FRAMEWORK-1

Java Concepts

Class/Interface
Package
Member Variables
Member Functions
Access Specifiers
Inheritance
Overloading/Overriding

Framework Goals & Benefits


Declarative application development
Rapid development environment
Consistent & compelling UI
Built-in durable Personalization Support
Extensible UI and business logic
100% Java & XML on Oracle platform
Commitment to MVC architecture

Model-View-Controller (MVC)
Architecture
A component-based design with clean interfaces
among model, view, and controller objects
The controller responds to
user actions and directs
Controller
application flow
Model

The model encapsulates


underlying data and
business logic of the
application

View

The view formats and


presents data from a
model to the user

Keywords

BLAF Browser Look and Feel


CLAF Custom Look and Feel
OC4J Oracle Containers For Java
BC4J Business Components For Java
MDS Meta Data Services
LOV List of Values
JDBC Java Database Connectivity

Flexible Architecture
UIX

View Common UIX-based HTML


components used throughout
Applications

OA Controller

Controller OA Controller
responds to user actions,
directs application flow

BC4J

Model Business logic


encapsulated in Business
Components for Java view
objects and entity objects

Technology Stack
Browser

Web Server

Data Server

Oracle9iAS
HTTP Server and J2EE Container
Apache

OC4J

UI
Meta Data
Repository

Common Services
Portal

SSO

LDAP

BC4J:
UIX:
XML & Java
XML & Java
for data model &
for user interface
Business Logic
OA Controller:
Java for flow and action events

Applications
Schema

Tech Stack Components


BC4J - Java business components for
representing business logic
UIX - Java components for representing UI
OA Extension Build declarative data for UIX
Extension to JDeveloper
Metadata resides in database or XML files

OA Framework - Programmatic glue that


integrates these technologies

Encapsulation: Layered
Reusability

Each layer only knows about


the layers below it.
This encapsulation allows
reuse at any of the layer
boundaries.

dataflow up stack (pull)


dataflow down stack (push)

OA
Controllers
Application
Modules
View
Objects
Entity
Objects
DB

Model: Business Components


for
Java
There are three basic component classes
The Application Module a container for
related BC4J objects
<AMName>.xml, <AMName>Impl.java

Entity objects encapsulate business rules


<EOName>.xml, <EOName>Impl.java

View objects present data to the


Framework page
<VOName>.xml, <VOName>Impl.java,
<VOName>RowImpl.java

Model: Business Components


for Java
BC4J OBJECTS
Entity Objects (EO)

View Objects (EO)


Application Module
(AM)

DML
Validations
Defaulting

.XML

Database
Tables,Views
PL/SQL

Application Module
(AM)

ide
S
w
Vie

UIX
Bean Hierarchy

View - Components
OA Framework Design time

OA Framework Runtime

Page Hierarchy
UIX
Bean Hierarchy

JSP/HTML

Browser

Cache

Meta Data

UIX
Renderers

.XML

View: OA Framework-Based
Page

View: Java Objects in a Page


Each UI widget corresponds to one or more Java
objects (beans)
The Java objects are assembled declaratively
with the Oracle 9i JDeveloper OA Extension tool
The Java beans are defined hierarchically

The Java objects are used to create HTML at


runtime

View: A Framework Example


Header Bean

Submit button
Bean

Results table
Bean

View: Page Hierarchy


This is the page structure
as seen in OA Extension
at
design time.
The Framework uses the
order of the items to
determine their position
within a page or region UI
at runtime.

Controller: Controlling UI
Behavior
Controller classes define how your Java Beans behave.
You can override controller classes to:
Manipulate the UI at runtime
Manually initialize data items
Intercept and handle user events like button clicks
Controller classes subclass OAControllerImpl.
OAPageBean is the main OA Framework page
processing class.
There are methods in the Controller class to handle GET
and POST requests.

Controller: Handling a GET


Request

The OAPageBean calls the processRequest method


when a browser issues a GET request.
The OAPageBean uses this method to build the bean
hierarchy.
The processRequest method is called for each bean
in the page hierarchy.
You can override this method on any of the container
beans in the hierarchy.
The processRequest() method can be used to
Customize page layout at runtime
Perform manual data initialization
Perform an autoquery

Controller: Handling a POST


Request
The OAPageBean calls processRequest for
each Bean in the hierarchy (similar to a GET).
The OAPageBean then calls
processFormData for pages that insert or
update data.
The processFormData method reads form
field data to apply it to underlying view object
attributes (invokes attribute- and entity-level
validations).
The Framework calls the
processFormRequest method next.
Override the processFormRequest method
to add special event handling logic.

Controller: The OAPageContext


Object
The Framework creates an OAPageContext
object for each request received
The methods that handle GET and POST
requests accept OAPageContext as an argument
This object contains parameters from the
requesting page
It also contains form fields if the request is a
POST

Controller: The OAPageContext


Object
The OAPageContext object provides:
Access to the server Application Module Class
Methods to perform JSP forwards and client
redirects
Access to session level Application context for

User name
Id
Current responsibility
and so on

Client and Server


Client Tier

Middle Tier
Client Side

Server Side

OAPageContext

OADBTransaction

Find AM
Invoke Method

AM finds VO

webui

server

Server Tier

Setting Up JDeveloper
OA Framework/JDeveloper patch to use
About this page link >Technology Components Tab> OA Framework

https://metalink.oracle.com/metalink/plsql/showdoc?
db=NOT&id=416708.1

DBC File
About this page link >Page Context Tab> Database

RESP_KEY
FND_RESPONSIBILITIES
FND_APPLICATIONS

Login Credentials
UserName/Password
Please use the user who has the responsibility assigned to him.

Directory Structure

Packages

oracle.apps.fnd.multiorg.lov.server
oracle.apps.fnd.multiorg.server
oracle.apps.po.document
oracle.apps.po.document.agreement.server
oracle.apps.po.document.agreement.webui
oracle.apps.po.document.order.webui
oracle.apps.po.document.server
oracle.apps.po.lov.webui
oracle.apps.po.poplist
oracle.apps.po.poplist.server
oracle.apps.po.schema.server

General Naming Rules


Name length:
File names are limited to 30.3 characters for OA
Extension XML files (50.java for Java files).
For performance reasons, object names (internal
IDs) are limited to 30 characters.
Use the shortest possible names that are readable.
Consider abbreviating repeating object names.

BC4J Components
Entity Objects
The Object should have EO at the end. For e.g PoHeadersEO.

View Objects
The Object should have VO at the end. For e.g PoLinesVO.

Associations
The Object should have AO at the end. For e.g
PoHeadersToLinesAO.

View Links
The Object should have VL at the end. For e.g
PoHeadersToLinesVL

Application Module
The Object should have AM at the end. For e.g PurchasingAM

Package Naming
XML file or a sub-directory signify a single functional unit (subcomponent) of the application
Sub-directory package name should clearly indicate the name
of the sub-component and be in lowercase letters.
Example:
oracle/apps/per/selfservice/emppersonalinfo/webui
XML file package name should clearly indicate the name of
the sub-component and follow the Java class name
standards.
Example:
oracle/apps/per/selfservice/webui/PerEmpPersInfo.xml

Page Naming

A page represents a step in a task flow. Pages are associated


with an object and a function.
Object examples: employee, purchase order
Function examples: view, search, home page
The page name (both embedded and XML filename) takes the
form ObjectFunctionPG and should follow the Java class name
standard
Create and Update functions are considered the default and
dropped from the page name
Examples: UsrInfoPG, UsrContactsPG, UsrEnrollmentsPG,
UsrInfoViewPG, UsrSearchPG

Region Naming
The top page region (pageLayout style) should
always be named PageLayoutRN
Region name (both embedded and XML filename)
should take the form takes the form
ObjectFunctional-structureRN and should follow
the Java class name standard.
Object examples: employee, contact
Examples: EmployeeRN, EmpMasterRN,
EmpContactsDetailRN, EmpSearchRN,
EmpTableRN

Checking Oracle Standard


Code
UI Components

XML Components
$PRODUCT_TOP/mds/<package structure>
Java Components
$JAVA_TOP/<package structure>
BC4J Components
XML Components
$JAVA_TOP/<package structure>
Java Components
$JAVA_TOP/<package structure>
XML files are in ASCII format and can be read.
Java files are compiled in to class files and need to be
decompiled to be read.

Custom Controllers

For example we will customize Customer Standard Search Page.


Find out the standard controller you want to override.
Create a Custom Controller in appropriate package.
Compile the Custom Controller.
Personalize the page and place the Custom Controller.
Test the page.
Note: The Controller Java/Class file and the Personalization file
should be shipped as delivery bundle.
The Personalization file can be generated using Functional
Administrator responsibility.
Functional Administrator Resp->Personalization(Tab)>Import/Export(SubTab)

Compiling Custom Extension


Controllers
Login to Unix Box
lxs3er06.solutions.glbsnet.com
r10user/pass12,.

Set the Environment Variable


Execute the Env Initialization Script $APPL_TOP/APPS<INSTANCE_NAME>.env
. /data/R12VIS/apps/apps_st/appl/APPSR12VIS_lxs3er06.env

Update the $PATH variable.


export PATH=/data/R12VIS/apps/tech_st/10.1.3/appsutil/jdk/bin/:$PATH

FTP files to unix box home directory


Compile the Java Code
javac d $JAVA_TOP <filename>.java

Verify the Class file

Build OAF Page

Create an Entity Object


Create a View Object
Create an Application Module
Build a Hello World Page
Browse JavaDoc

Resources
Further reading:
OA Framework Developer's Guide:
Anatomy of an OA Framework Page
OA Framework Javadoc

Vous aimerez peut-être aussi