Wednesday 13 March 2019

OAF vs ADF

OAF in Oracle E-Biz vs ADF in Fusion Apps:
OAF is the only JDeveloper tool oracle has supported for all Oracle Apps releases till R12. ADF is the JDeveloper tool oracle has supported for the Fusion apps releases.
This means, for doing any change to the standard application screens/functionalities in Oracle Apps 11i or R12, we need OAF. We call them custiomizations and personalizations. Anything with Fusion Apps, we use ADF.
OAF with Oracle Apps Server vs ADF with Web Logic Server:
OAF can be deployed to Oracle Application Server, ADF can be deployed to Web Logic Server.
In Fusion apps, the web logic comes by default.
If we need to deploy an ADF application in Oracle Apps releases till R12, We need to address the additional cost associated with web logic licensing.
OAF with single Apps/Database Server vs ADF with Multi Server compatibility:
When we are with Oracle apps upto R12 and need to customize standard applications, we need OAF. To create custom application without web logic server, we should go with OAF.
When we are with Fusion apps, mobile UI for Apps or working with one or more Oracle application server and/or database server, we must go with ADF.
ADF Future-centric:
Advantage of ADF in Oracle Apps is the developed applications can be migrated to Fusion Apps as they are Fusion apps compatible. Any Application developed in R12 release using ADF and Web Logic can be migrated to Fusion Apps.
OAF seamless integration with Oracle Apps:
Advantage of OAF is we enjoy seamless integration of Oracle Apps with OAF. Usage of Oracle Apps features like Menus, Function Security, Flexfields, Messages, Profiles,etc. gives a big advantage which doesn’t come with ADF.
Developer viewpoints:
As a developer, the following things can be noticed.
Though both are based on mvc framework, ADF encourages modular approach and reuse using taskflows. Also, ADF provides more rich and interactive interfaces using ADF Faces.

Tuesday 19 February 2019

OAF Model & Architecture

1. Model View Controller

image1
OA Framework is based on the industry-standard J2EE MVC design pattern. The MVC architecture is a component-based design pattern with clean interfaces between the Model, View, and Controller. The Model is where the application implements its business logic. The View is where the application implements its user interface and the Controller is where the application handles user interaction and directs business flow
2. Object Oriented reuse – onion
image23.OAF 3. OAF Components
EO, VO, CO, AM and Pages
3.1: Entity Objects
  • The entity objects are used if one wishes to do some insert/update operations.
  • Entity Objects represents a Data Base Row of a table.
  • Entity Objects 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 the EO
3.2: View Objects
  • View Objects are used when we want some data to be displayed on page.
  • View Objects are used just for displaying purpose.
  • View Objects 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
3.3: Application Module
  • It is very important component in the Model.
  • Every Oracle Application Framework (OAF) page should be attached to some Application Module.
  • It is the interface between the Client transactions and Data Base transactions.
  • All the application module objects end with AM.
3.4: Controller
  • Controller will take care of the web browser activities.
  • The controller manages the flow between pages.
  • Controller responds to the user actions and directs application flow.
  • The controller will request from HTTP get and HTTP post.
  • All the controllers end with the CO
4. EBS Directory structure
    1. EO-related (business logic) .class and .xml files in oracle.apps.<application shortname>. <module>.schema.server
    2. AM and VO (UI-related logic) .class and .xml files in oracle.apps.<application shortname>. <module>.server
    3. CO and PG in oracle.apps.<application shortname>. <module>.webui
    4. Poplist- and LOV-related VO and AM .class and .xml files in oracle.apps.<application shortname>.<module>.poplist.server  and oracle.apps.<application shortname>. <module>.lov.server
Note: For custom implementations follow the structure as <company>.oracle.apps.<application shortname>.<custommodule>…
On EBS server, application structure starts from $JAVA_TOP
How to find EBS version and relevant JDEV patch
Login to the Applications.
image3
Once we navigate to About this Page. we can find OAF versions ( from Technology Components) section and as well as DBC file location from Java System Properties.
image6
Finding the correct version of Jdeveloper for EBS in Metalink Note ID 416708.1
image5

DBC File Location
image6
Setting up Jdev and Creating database connection
  1. Look for correct patch in Metalink Note ID 416708.1
  2. JDEV10 for R12 (p9879989_R12_GENERIC).
  3. Unzip it to a folder and create an environment user variable JDEV_USER_HOME to point to <jdevinstalledpath>\jdevhome\jdev
  4. Jdev exe will be in D:\OAFR12\jdevbin\jdev\bin. If there are any previous jdev versions in system it will prompt whether to migrate changes from previous version. Select NO
  5. Get the dbc file from server for database connectivity from client
  6. It will be in FND_SECURE and this will be used by application to connect to database. You can place it in jdevhome\jdev\dbc_files\secure
  7. Create New Database connection
image7

image8
image9
image10
image11
Note: Either you can select SID or Service name as per your tns definition
Workspace & Project
In JDeveloper, the source code files that make up your programs can be organized into projects. A project can contain one or more files representing different “tiers” of a multi-tier application, or different subsystems of a very complex application. Projects, in turn, are organized into workspaces. A workspace might consist of multiple projects, all of which make up an entire application. You can have as many workspaces as you like open at one time
Creating workspace
In Application Navigator, right click on Applications and select New OA Workspace.
image12
Specify the name of workspace and path to store it. Workspace files will have extension of jws. Generally they will be saved under JDEV_USER_HOME\myprojects
Note: Here “Add a New OA Project” is by default checked so project will be automatically get created. Here it is unchecked because we will create project manually in next step
image13
Creating project
In Application Navigator, right click on workspace trng2 created in above step and select “New OA Project”
image14
image15
Default package specify where the custom application objects should reside
image16
Note: This is not mandatory to check “Use Repository for Design Time” until you don’t want to design anything related to DB objects
image17
DBC File name: Select the dbc file having connection properties of the server to which you want to connect from your client. You can get this from server under $FND_SECURE
User Name/Password: Should be EBS application user name and password
Application Short Name: Should be application short name in which your custom code to register
Responsibility Key: EBS responsibility key. This responsibility should exist for the application user you specified otherwise you cannot run the application from client
Setting Project Properties
image18
image19
Select OADeveloperMode and OADiagnostic, and move them to the On Options List. OADeveloperMode provides extra code checking and standards checking at runtime. 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

Oracle Application Framework(OAF) - Overview

This tutorial gives you an overview and talks about the fundamentals of Oracle Applications Framework.
Oracle Application Framework (OA Framework) is the Oracle Applications development and deployment platform for HTML-based business applications.

Simple Web Application Architecture ( Servlet / JSP  ):

Initially Web Application was very simple ( developed in 1990s )
Application Tier Contains a Web Server, which maintains the components such as Servlet, JSP
Component : Component is piece of code, which implements well defined interface.
A Single Component is not an Application.
An Application consists many no.of components working together.
Component handles complete task, such as Business Logic, Database Transactions Logic and Presentation Logic.
Disadvantages :
1. Only One Application developer has to develop the complete component
2. Application developer has to concentrate on Business Logic, Database Transactions Logic as well as Presentation Logic.
3. Application Developer Must have the Multiple Skills
4. Development Time is more
5. Lot of confusion with Business Logic, Database Transactions Logic and Presentation Logic since they are being developed as single component.
To overcome the above disadvantages MVC1 Architecture was introduced

MVC1 Architecture:

M ⇒ Model     V ⇒ View       C ⇒ Controller
Model :   Model Represents data object. Model is what is being manipulated and presented to the user
View :  Serves as Screen representation of Model. It is the object that presents the current state of the data objects.
Controller :  Defines the way user interface reacts to the user’s input. The Controller component is the object that manipulates the model or data object.
In MVC1 Architecture
→ Servlet / JSP acts as View as well as Controller.
→ Java Bean acts as Model Component.
Disadvantages :
  • Only One Application developer has to develop the component with Business Logic, as well as Presentation Logic.
  • Application developer has to concentrate on Business Logic as well as Presentation Logic.
  • Application Developer Must have the Multiple Skills
  • Resources such as Java developers and Web developers can not be used effectively
  • Development Time is more
  • Lot of confusion with Business Logic, Presentation Logic since they are being developed as single component.
To overcome the above disadvantages MVC2 Architecture has been introduced

MVC2 Architecture :

Struts Frame work follows the MVC2 Architecture
→ Servlet acts as Controller
→ JSP acts as View
→ Java Bean acts as Model
Controller: It is java Servlet called as Action Servlet. It receives request from the web client and stores data into the Java Bean called as Form Bean (Model) and receives response (success / fail) from the Form Bean. Based on the response from Form Bean, Action Servlet decides, which page (view) to be presented to the client.
Model: It is Java Bean called as Form Bean. It will receive the client data through the Controller and performs the data validations or data base transactions such DML and DQL operations. After performing database transactions it provides the data for the view.
View: It is a JSP. It populates the data from the Form Bean ( Model ) and Present to the user.

Oracle Application Frame Work Architecture:

Architecture of Oracle Application Frame Work is similar to the Struts Frame Work but some difference are there.
AM ⇒ Application Module             VO  ⇒ View Object             EO ⇒ Entity Object
Controller:
→ It is a Java Class.
→ OAControllerImpl is a  parent of all Controller  Classes.
→ Controller performs data base transactions through the Application Module interface.
→ It will get the data through the Application Module and Push into the View.
View:
→ It is JSP with GUI Components.
→ It populates data into it’s GUI components from VO.
Model: 
→ It is to interact with Database through the BC4J Components.
→ It is a combination of Application Module, View Object and Entity Object.
Application Module:
  • It is an interface given to the Controller Classes.
  • It is Mandatory for OAF Applications
  • It can be shared by multiple controllers.
  • It performs DQL operations through the View Object
  • It performs DML operations through the Entity Object.
  • OAApplicationModuleImpl ( Generic AM ) is a parent of Application Module Class.
  • It is mandatory for all applications
View Object:
  • SQL Query ( SELECT statement to project the data in the form  )
  • It should be stored in .server package
  • View Object can be developed manually or BC4j wizard
  • OAViewObjectImpl : is the parent of all view objects
  • All APIs starts with OA
Entity Object:
  • It is database object such as table, view and etc
  • DML operations will be performed on the Entity Object
  • It should be stored in schema.server package
  • OAEntityImpl : is the parent of all Entity Objects
Onion Architecture of OA Framework
  • OA Framework can be extracted into a series of concentric layers, like an onion.
  • Each layer communicates with it top and bottom layers.
Key Features of MVC Architecture
  • Integrated development environment
  • Durable personalizations and extensions
  • Consistent and compelling user interface
  • User interface interactivity
  • Object oriented reuse
  • Oracle portal interoperability
  • Built-in security
  • Deployment environment
Comparison of D2k ,  OAF  and ADF
D2kOAFADF
Desk Top ApplicationIt is Frame with MVC ArchitectureIt is a Frame work with MVC Architecture
It is a Client and Server ArchitectureIt is a 3-Tier ArchitectureIt is a N-Tier Architecture
From Builder used to develop the applicationsJDeveloper is used to develop the applicationsJDeveloper is used to develop the applications
PL/SQLJAVAJAVA
Drag and Drop featuresNo Drag and Drop featuresDrag and Drop features
Client and  Server ApplicationWeb ApplicationEnterprise Application
JDeveloper Installation and Setting Environment
1. Get the JDeveloper software ( ZIP File : p4141787_11i_GENERIC.zip )
2. Copy into required drive ( folder ) / ( C:)
Eg: C: JDEV  ( create JDEV ( name can be any one ) folder in C-drive
3. Extract the ZIP file name p4141787_11i_GENERIC.zip )
Right click ⇒ WinZip ⇒ ExtractToHere
    After extracting it generates following
4. Take the shortcut of C:JDEVjdevbinjdevbin jdevW.exe  to desktop
5. Copy the dbc file form Oracle Apps Server to JDeveloper
Source Oracle Apps path:   D:oraclevisapplfnd11.5.0secureVIS_appsvis.dbc
JDevelopre Path: C:JDEVjdevhomejdevdbc_filessecure
6. Set the Environment variables of O/S
My Computer → Advanced → Environment Variables → New →
Variable Name : JDEV_USER_HOME
Variable Value : C:JDEVjdevhomejdev
OK → OK → OK
Testing Functionality of Jdeveloper
1. go to connection à Right Click à New database connection à Next à
Connection Name : test ( as desired )
Connection Type : Oracle ( JDBC )
Next :
2. User Name : apps
Password    : apps
     Next
3. Driver : thin
Host Name : localhost ( if database is on the local system, else URL of DB server )
JDBC Port : 1521
SID            : VIS
For details see the vis.dbc located in the folder :
D:oraclevisapplfnd11.5.0secureVIS_apps
     APPS_JDBC_URL=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=YES)(FAILOVER=YES)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=APPS.ora.com)(PORT=1521)))(CONNECT_DATA=(SID=VIS)))
     Next
4. Test Connection
Result : success
     Next
5. Finish
The packages, which are used in the OA Frame Work Applications.
There are six package used in the OA Frame Work Applications.
1) <3rd party identifier > .oracle.apps...[] .webui
2) <3rd party identifier > .oracle.apps...[] lov.webui
3) <3rd party identifier > .oracle.apps...[] .server
4) <3rd party identifier > .oracle.apps...[] lov.server
5) <3rd party identifier > .oracle.apps...[] poplist.server
6) <3rd party identifier > .oracle.apps...[] Schema.server

Steps to Develop the Application

Eg:
Hello Page
1. Create the work space
2. Create the project
3. Create the package
4. Create the application module
5. Create the page
6. Set the properties of the page
AM Definition
Window Title
Title
1) Creation of Work Space
WorkSpace → Right Click → New OA work space
Directory Name : C:JDEVjdevbinjdevmyprojects
File Name : xxclinet.jws   ( jws → Java Work Space )
Select Add a  New OA Project
2) Creation of a project
Directory Name : C:JDEVjdevbinjdevmyprojects
Project name : First.jpr
Package Name : first.oracle.apps.po.hello.webui
Syntax : for Pack name
<3rd party identifier > .oracle.apps...[].webui
In the above
<3rd party identifier > → mycompany
→ po
→ requisition
[] → it is an optional ( as desired )
Next
Use Responsibility for design time
Supply the name of connection : test
Here New → to create new connection
Edit → to change the name of the connection
Next   
DBC File Name : C:JDEVjdevhomejdevdbc_filessecurevis.dbc
User name : operations ( front end user )
Password : welcome
Application short Name : PO
Responsibility key : PURCHASING_OPERATIONS
Next – Finish
3) Create of a package
Right click on .jpr file → New Business Component Package → Next
Package Name : first.oracle.apps.po.hello.server
Select Entity object mapped to database schema objects )
Next →
Connection Name : test
Sql Flavour : oracle
Type Map : oracle
Next →
User name : apps
Password : apps
Next → finish
Note : it generates test Connection
4) Create Application Module
Right Click on package → New Application Module → Next →
Name : TestAM
Package : first.oracle.apps.po.hello.server
Next →  Next → Next → Next → finish
Note : It generates following files
1) TestAM.xml    
2) TestAMImpl.java
5) Creation of a Page
Right Click on .jpr file → New → Web Tier → OA Components → Page → OK
Name : HelloPG
Package : first.oracle.apps.po.hello.webui
Note : It generates   the file called : HelloPG.xml
6) Set the Properties of the page
Select the page → Structure →
Region1
Properties :
Id : mainRN
AM Definition : click on the list box and select the AM ( TestAM )
Window Title : Hello Page
Title     :  Hello This is my First Page
( at least one of the above two 1) Window Title  2) Title   is required  )
7) Build the Application 
Right click on .jpr → Re-build
8) Run the Page Go to xml  → Right Click → Run Page

Working with items:

Adding Items to region
Before the creating items take a header region ( as desired )
Naming Convention for Region :
Name Starts with purpose
Name ends with RN
Right Click on Region1(RootRN)/ (HeaderRN) → item
Text Field:
properties:
Id : UserId
Item Style : messageTextInput
Prompt : User Name
Data Type : VARCHAR2 ( As desired )
Comments : Created for Login User Id
Required : Yes ( Yes → Mandatory field, No → Optional )
Read only : True  ( to make it as read only filed, we can not edit the filed )
False → we can edit the filed.
( use for Id generating automatically , used with database sequence )
Disable : true ( to avoid the cursor focus into the text filed )
Maximum Length : the maximum that can be entered into the text filed.
Initial Value : default value
Additional Text : text to be displayed when muse over the item.
Rendered : false → to hide the text filed from the user.
CSS Class : setting back ground colors.
Length : Width of the text field, that can be visible to user
Height : 1 ( it will not generate multiple lines )
> 1 to generated the multiple lines automatically
Vertical Alignment : Top/Middle/Bottom ( Prompt alignment )
Tip Type : to display some hint message just below the text filed
Access Key : it is short cut key ( Alt + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 )
Secret : true ( password ***** )
To create next item click any item → new → item (or) right click on Region
Submit Button:
Id : Go
Item Style : submitButton ( it will have default action)
Prompt : Go
resetButton:
Id : Clear
Item Style : resetButton ( to clear the form)
Text : Clear ( prompt )
Access Key ( Short Key )
Normal Button:
Id : go
Item Style : Button
Prompt : as desired
Action Type : fireAction ( like a trigger to get the action )
It will be handled inside of controller class.
Images:
Copy the required Image into
C:JDEVjdevhomejdevmyhtmlOA_MEDIA
Item Style : Image
Image URI : ( imagefile.gif)
Additional Text : Mouse over message.
Link:
Id : lnk
Item Style : link
Text : Oracle Apps Home
Destination URI : HTTP://APPS.ORA.COM:8000
To Connect to Gmail site use :  HTTP://WWW.GMAIL.COM 
Check Box:
Id : job
Item style : messageCheckBox
Checked Value : MANAGER
Unchecked Value :
Initially Checked : true
The difference between Checkbox and Radio Button is that, Checkbox allows only single selection where as Radio Button allows Multiple Selection.
Radio Buttons :
First create RadiGroup
Next create Radio Buttons
Radio Group
Id : gender
Item style : messageRadioGroup
Data Type : VARCHAR2
Radio Button
Id : male
Item Style : messageRadioButton
Group Name : gender
Initial Vale : Male
Value Checked : Male
Prompt : MALE
Spacer: to provide the space between two components
Id : space
Height / Width  ( as desired )
Raw Text:  → to display some text
Id:
Item Style: rawText
Text : Oracle Apps Frame Work ( as desired )
Separator: to place the separator between components
Text Editor:
Id: address
Item Style: richTextEditor
Vertical alignment: Top
Spacer:  → to provide the space between two components
Date:
Id : hireDate
Item Style : messageTextInput
Data Type : DATE
Prompt : Date Of Joining
tipType : dateFormat
TipMessage (Hint Message): First store message into the database table called: FND_NEW_MESSAGES with the help of Apps front end.
Navigation:
Application Developer → Application → Messages