Documente Academic
Documente Profesional
Documente Cultură
Framework
- By Dinesh Kumar S
Preface
In this book I have highlighted on basics of OAF. By reading this you will get idea on
what is OAF.
Email: Dineshcse86@Gmail.Com
Introduction
Overview of OA Framework
Architecture of OAF
Model Interaction
jDeveloper IDE
Creation of Page
Java OOPS
Framework:
J2EE:
The platform provides an API and runtime environment for developing and running
enterprise software, including network and web services, and other large-scale, multi-
tiered, scalable, reliable, and secure network applications.
GWT Google Widgets Speed development. Easy to develop well, neat and
Browser independent Ajax applications.
Spring MVC SpringSource MVC architecture The Spring MVC Frameworks architecture and
design are in such a way that every piece of logic and
functionality is highly configurable.
Struts2 Apache MVC architecture No more ActionForms! Use any JavaBean to capture
form input or put properties directly on an Action
class.
Wicket Apache Component Centric Swing-like OO Component Model. This feature
approach separates Wicket from all other frameworks
Why they did not use an existing java frameworks, which is based on MVC
architecture?
Application layer is the highest most layer in OSI and TCP/IP layered model. This layer
exists in both layered Models because of its significance which is interacting with user
and user applications.
This layer is for applications which are involved in communication system.
8 Oracle OAF - by Dinesh Kumar S
Software frameworks are available for use in each application layer:
user interface, business process & logic, and data access.
Software Development:
Advantages of Framework:
Types of Framework
Presentation Layer :The application presentation layer works as a bridge that connects the clients with
the application logic layer i.e. Graphical user interface (GUI).
Persistence Layer :It is to use a session at run time to associate mapping metadata and a data source in
order to create, read, update, and delete persistent objects using the TopLink cache.
Why Servlet?
Shortly after the Web began to be used for delivering services, service providers
recognized the need for dynamic content. Applets, one of the earliest attempts
toward this goal, focused on using the client platform to deliver dynamic user
experiences. At the same time, developers also investigated using the server platform
for the same purpose.
Initially, Common Gateway Interface (CGI) server-side scripts were the main
technology used to generate dynamic content. Although widely used, CGI scripting
technology had many shortcomings, including platform dependence and lack of
scalability.
To address these limitations, Java Servlet technology was created as a portable way to
provide dynamic, user-oriented content.
Manage state information that does not exist in the stateless HTTP protocol, such
as filling the articles into the shopping cart of the appropriate customer
Servlet Advantage:
It helps in creating Self Service pages in Oracle EBS and It controls the flow of the
application.
This framework works on the basis of Java EEprinciples and it also supports various
standards like HTML, XML, SQL, and JSP.
We can view OA Framework pages in mobile phones which contain Internet browsing
feature.
Pre Requisites:
We must know the Basics of Core Java and Java OOPS Concepts to learn and
incorporate OAF.
OAF
MVC Design:
6. Application Customizability.
Architecture OAF Follows MVC and Client Server Forms Follows only Client Server
Architecture Architecture
Components These pages are light weight These are not light weight
components i.e. Implementing Look & Feel components
using Java rather than delegating to native
peer (OS).
Mobile Supported by all mobiles. Does not support mobile.
Compatibility
Look & Feel High Standard Low Standard
Application top Integrated with Java Top Integrated with Application Top
MVC Architecture
Structure in OAF
Onion Structure of OAF
q MVC was first introduced by Trygve Reenskaug, a Smalltalk developer at the Xerox
Palo Alto Research Center in 1979.
q It is a widely used design pattern, especially popular in graphical user interface (GUI)
programming.
q JDK & MVC combining together allows for a generic implementation of the MVC
design pattern, freeing the programmer from,
1) Model
2) View
3) Controller
View
Controller
User Model
Note** Model contains total of six components which includes BC4J components &
additional three components.
The entity objects are used if one wishes to do some insert/update operations.
It represents a Data Base Row of a table.
EO will be based on the View (Oracle View), Synonyms or Snapshots.
We need to create Entity Object if we want to perform DML operations on the
OAF Page.
All the Entity Objects end with EO.
RequisitionEO
POHeadersEO POLinesEO
30 Oracle OAF - by Dinesh Kumar S
View Object (VO)
BC4J Components
View Objects:
View Objects are used when we want some data to be displayed on page.
They are used just for displaying purpose.
VO access the result set of a SQL statement, it can be either based on the Entity
Object or plain SQL query.
All the view objects ends with the VO.
When we create the View Object (VO) one subclass will be generated with Setters and
Getters method.
RequisitionVO
If we are writing our own SQL query Validating data in DB i.e. using
then it will be called as Manual VO. WHERE condition in the SELECT
statement.
Note** when we create VO (View Object) all the table columns will be converted into attributes,
hence all columns will be referred as attributes.
BC4J Components
When we create the Application Module (AM) one subclass will be generated.
RequisitionAM
33 Oracle OAF - by Dinesh Kumar S
Types of AM
Root AM Nested AM
If we are attaching AM to the If we are attaching AM to the
Main Region of the page it is called Child Region of the page it is called
Root AM. Nested AM.
MyRequisitionVO
Nested AM Child Region2
MyNotificationVO
Nested AM Child Region3
Note**
VO associated to Root AM is Global and can be used across any regions within the page.
VO associated to Nested AM is Local i.e. can be used only to Child Region it is mapped.
OADB Transactions:
Each OAF page associates with Root AM. It contains the OADB transaction.
This OADB transaction responsible for storing the data across EO and VO's.
When a OA Page is
Requested
ReqCheckoutPageCO
OAPageContext OAWebBean
To get and set values of the fields using, Each and every field we have
OAPageContext.getparatmeter properties and the properties define
OAPageContext.putparameter the behavior of item.
<Identifier>.oracle.apps.<application_short_name>.<component>.
AM & VO
Database_Connection_Name.Oracle.Apps.PO.Use_Client_Name.Server
EO
Database_Connection_Name.Oracle.Apps.PO.Use_Client_Name.Schema.Server
LOV
Database_Connection_Name.Oracle.Apps.PO.Use_Client_Name.LOV.Server
Poplist
Database_Connection_Name.Oracle.Apps.PO.Use_Client_Name.poplist.Server
CO & Page
Database_Connection_Namee.Oracle.Apps.PO.Use_Client_Name.webui
Child Regions
Widgets
Widget 1
Widget 2
Widget 3
Widget 4
OAF Page
Each OAF page has containers called "Regions" for maintaining these widgets.
An OAF page contains single parent region called Page Layout Region and it
points to the Application module (AM) linked to that page.
Every region has a property of containing other regions and web beans.
A controller object may be defined for every region that exists on the page.
Region 1 CO
Connection n
Transaction Context established
3
Request
Type
4 Check
5 Based on Request Type Request
OAPageBean Calls Code GET Type
OA Page bean in Controller to initiate each
bean & set properties
POST Based on
1. Valid Login
2. Request Parameter
2 The chosen AM picks a JDBC connection, from the JDBC Connection Pool, to
establish a transaction context for the page.
4 Depending on the valid login and request parameters, it is decided whether the
request is a POST or a GET.
5 During both kinds of requests, the OAPageBean calls the code in the controller
to instantiate each of the beans, along with setting of their appropriate
properties. Certain methods which are not defined in the controller are also
called for instantiating complex web beans.
1
1 Model
User Action Performed Communication b/w
on View Registers as
View Listener
: Model View
:View CO Model
Controller
Data Push
Data Pull 0
Provides,
Transaction Context
OAF Page
JDBC Connection
OAF Page
Root AM
Associated with
Automatically Caches,
Note** The use of the browser Back button can cause the loss of application module state.
q OA Framework provides methods that you can use to store, retrieve and remove
custom application values to/from a transaction.
q Since a single transaction can be accessed from both controller (client) and model
(server) code, these utilities are provided in both,
For Controller:
Oracle.apps.fnd.framework.webui.OAPageContext
For Model:
OADBTransaction classes.
OAF Page
Root AM
Associated with
Instance 1
Page1
Root AM
Note** OA Framework never releases application modules during form submit (POST) requests unless you
explicitly release the application module in a controller.
However, it is not appropriate for a multi-page flow that implements a single task, or a
series of related pages participating in a virtual transaction.
In these cases, the different pages should be associated with the same root application
module instance.
Page1
Root AM
Instance 1
To Achieve this :
There are also times when you will want to explicitly release a root application module
before OA Framework would normally do this. This can be done by using method,
OAPageContext.releaseRootApplicationModule()
A session may be initiated at any time by the application, and terminated by the
application by the user closing the browser or by a period of user inactivity.
You have the option of caching small, serializable objects on the servlet session; any
data that you cache is accessible to all pages rendered within the session.
Servlet Session
Initiated
Cache by
Creates
AOL/J oracle.apps.fnd.common.WebAppsContext
Objects
Browser Session Cookie
OA Framework
OAF Creates a
page context
User Request
OAPageContext
OAF Page
Any URL parameters, regardless of whether the browser issued a POST or a GET
request.
All form field data is stored in a hidden field during POST request.
The web bean and event names associated with a user's selection of action/control
components for example when a button is clicked.
1
G
Controller
Search Field O
2
Root AM
Initiates Query
3
SupplierVOIMPL
Database
Web Bean 4
SupplierVORowIMPL 6
5 EO Instance
SupplierEOIMPL
Created
Note** For the "calculated" attributes like Summary / Formula Column, the
view 64
object row retrieves the value from its own cache.
Oracle OAF - by Dinesh Kumar S
Controller
G
Search Field O 2
Root AM
3
DB
Table
Web Bean
4
6
5 EO Instance
Created
1 The user selects the "Search" region's "Go" button to populate search results in the
"Suppliers" table.
The "Search" region's controller handles the button press by invoking a search
2 method in the root application module, which in turn delegates to the
SuppliersVOImpl class so it can query itself.
Within the executeQuery method, the SuppliersVOImpl view object performs its
3 SQL SELECT in the database.
For each row returned in our example result set, the view object creates an
4 instance of a SupplierEOImpl entity object and sets its attribute values with the query
results.
Web bean will be defined for each View object Data binding. With the help of Web
5 bean it calls corresponding SuppliersVORowImpl object's getAttribute() method
is invoked..
Personalize Self-Service Defn Yes Allow Personalize page link @ right top of
each page.
FND: Personalization Region Link Yes Displays personalize links for all the regions
Enabled available in OAF page.
Disable Self-Service Personal Yes Disables all OAF personalization in all pages
based on the profile level.
Main features
Step 2:
http://www.oracle.com/technetwork/developer-tools/jdev/downloads/index.html
Navigation:
For UNIX
For Windows
Download the DBCFILE from oracle Server and Copy it into below folder,
6. Create a Page
Note** this step can be performed during jDeveloper configuration (or) after project creation.
102 Oracle OAF - by Dinesh Kumar S
Oracle apps username &
password
OADiagnostic enables the Diagnostics button in the global buttons at the top of the
page, overriding any corresponding profile option set for the application.
You should always have these two modes turned on during development.
Design time connection is used while building model BC4J components like EOs,VOs, AMs
etc.
Application Sources
Resources
Components
Each time you make changes to your layout (by adding regions or items, modifying properties, or
changing code), you must run your page again to see your changes. If the Run process seems to hang for
several minutes after you have already run your page previously, you may need to terminate the OC4J
server using
Run > Terminate > Embedded OC4J Server main menu option, and then run again.
128 Oracle OAF - by Dinesh Kumar S
129 Oracle OAF - by Dinesh Kumar S
Java OOPS
Variables F1( 1)
F1(1,2)
Methods
Inheritance F1(1,2,3)
Class 2
(Can be declare but Same method
not implemented) & definitions
Child like Parent
J Private Fields class methods
a
v F1( 1)
a F1(1,2)
O F1(1,2,3)
O Encapsulation
P Overriding
S
Abstraction Hid Class n
Imp ing Me
lem t
enta hod
Package tion
Methods
Java packages are a mechanism to groupJava
classesthat are related to each other, into the same Sub Class
"module.
Java classes are a mechanism used to group data and Java code together into modules".
Class
Obj
Fields
Constructor
Methods
Constructors:
Class They are methods that initialize an instance
Obj of the class. Typically a constructor sets the
Fields values of fields in the given instance.
Constructor
Methods
Methods:
They are operations that the class or
instances of that class can perform. For
Objects: instance, a method may perform an
Objects are instances of Class. operation like validation, update/change
Object has state and behavior in Java. values etc.
State is represented using instance variable and
static variable in Java class and behaviors are
implemented using methods in Java.
Actual cars which will be produced based upon those blueprints they are called
objects.
Class (Blue Print)
Objec
t
For example,
The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file
then open the file again. If the red x still appears, you may have to delete the image and then insert it again. again. If the red x still appears, you may have to delete the image and then insert it again.
Private Fields
Encapsulation is to hide the class members from the class user for the reason of prevention of
unauthorized use and change.
In other words, we would hide all class variables and other piece of code to prevent someone to
access it directly.
Only thing we would expose to the user will be a public methods which he can be able to see
and use. These methods are also called as Application Programming Interface or API. An user only
needs to know how to use the class and does not need to know how that class works.
The subclass can add its own set of fields and methods
to the set it inherits from its parent.
Types of Inheritance:
1. Single
2. Multi Level
3. Hierarchical
Parent
F1( 1)
F1(1,2)
Inheritance F1(1,2,3)
Child
Same method
F1( 1) & definitions
F1(1,2) like Parent
F1(1,2,3) class methods
When a method in a sub class has same name and definitions as the method in its
super class, it is known as overriding.
It is also referred as runtime polymorphism.
Note** static method cannot be overridden, because the static method is bound to class,
whereas instance method is bound to object.
Abstract Class:
o If a Class contains any Abstract Method then the class is declared as abstract Class.
o It is never instantiated i.e. an instance of an object is not created.
Abstract Method:
o Methods that are declared without any body within abstract class is know as abstract method.
o The body of the method is defined in its Sub Class.
o Abstract Method can never be final or static.
o Any Class that extends an abstract class must implement all the abstract methods declared by the
super class.
Interface
Class Implements
Variables
Methods
(Can be declare but
not implemented)
Packages are used in Java in order to prevent naming conflicts, to control access, to
make searching/locating and usage of classes, interfaces, enumerations and annotations
easier, etc.
Package Forms:
1. Built-in
2. User Defined
Import Package:
Thanks for the websites from which I have referred Java Concepts.