Intro_to_OAF
Intro_to_OAF
Intro_to_OAF
We can use ADF to develop the business application; it’s just that it ADF is not yet
tightly coupled with Oracle EBS. The OA Framework Model is implemented using
Oracle Business Components for Java (BC4J). The OA Framework View is
implemented using UI XML (UIX). And the Controller is implemented using a simple
plain old java class.
The Model: -
The model component is implemented using the BC4J. BC4J consists of three
components:-
-->Entity Object and Associations.
-->View Object and View Link objects.
-->Application Module.
Entity Object: -
public void create() - add any defaulting/initialization code, such as getting the
value of a sequence and then assigning it to the corresponding attribute.
public void remove() - If you need to implement any special delete behavior (like
checking to see whether the delete action is allowed, or implementing cascade-
delete), you should add code to your entity's remove() method.
View Object:-
View Object accesses the result set of a SQL statement. It can be either based on
the Entity Object or on plain SQL query. A view object is a business component that
encapsulates
SQL code and metadata that maps columns in the select statement to the attributes
of one or more entity objects, if it is based on the Entity Object. A view object use
SQL to join, filter or sort business data or to shape it for presentation. View objects
provide row sets that can be viewed or used to update the underlying entity objects.
You can define multiple view objects per entity object or a view object can select
data from multiple entity objects. View Object can be created declaratively or
programmatically. Which ever way you create it, you need an application module to
contain it. View objects are not an appropriate home for business logic; we should
not be writing validation rules in our view objects or view rows. All view objects that
you createsubclass the oracle.apps.fnd.framework.server.OAViewObjectImpl
class.
Application Module: -
A logical container that manages and provides access to "related" BC4J model
objects. It represents the data model that client uses. To create the data model, the
application module contains business components, including instances of view
objects and view links. An application module may be a root application module or a
nested application module. A root application module is not contained in another
application module. It provides transaction context for all objects it contains. Root
application module also maintains the database connection. All application modules
that you create subclass the oracle.apps.fnd.framework.server.OAApplicationModu
leImpl class.
The View:-
The View formats the data and presents the data to the user. In OAF View is
implemented using the UIX. UIX uses XML to describe the components and
hierarchy that make up an application page. UIX also provides runtime capabilities
to translate that metadata into HTML output so that it can be shown on a Browser or
a mobile device.
The metadata used to describe the UI is loaded into a database repository, called
Meta Data Services (MDS), at deployment time and optionally at design time as
well. Pages are developed declaratively using the Oracle 9i Jdeveloper OA
Extension. Pages are made up of hierarchy of regions and items. Each UI widget
corresponds to one or more Java objects (beans). And these java beans are used to
create the HTML at runtime. When you design a page, you store "page definition" in
XML format on your local machine. When deploying to our system/server, we load
this XML file into MDS repository using the xml import statements. When the user
run the page in the browser, the page definition is fetched from the MDS repository
and is converted into the XML file by the MDS engine.
Each component in XML is translated into the Java web bean object. And this web
bean is rendered by the OA Framework. Page definition is cached in to the memory,
and if it is there, framework will not go to MDS repository to get the page definition.
The Controller:-
The Controller responds to user action and direct application flow. It provides the
wiring between the UIX web bean and the middle-tier. All the controllers that we
create subclass the oracle.apps.fnd.framework.webui.OAControllerImpl. When the
browser issues an OA.jsp request:-
Process Form Data - This phase is invoked upon a browser 'Post'. During this phase
the framework will automatically applies form changes back to the underlying view
objects. Rarely is custom code required in this phase. If exceptions are thrown
during this phase, the Process Form Request phase is skipped and the page is
redisplayed.
Process Form Request - This phase is invoked upon a browser 'Post', assuming no
exceptions were thrown during the Process Form Data phase. This is were custom
code can handle the form submit events and call the application module to process
the event.
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.
OAStackLayoutBean oastacklayoutbean =
(OAStackLayoutBean)oawebbean.findIndexedChildRecur sive("stackRegionName");