Wednesday, August 18, 2010

Oracle Applications Framework

Oracle Applcation Frame Work

Java Introduction :-->

j2me--> Micro edition (Reliance incorporated it first)

Class--> Blueprint of specifications

Object--> Instance of class

Package--> Collection of classes...etc

Design Patterns :-> Specification to prepare project using best practices.

EX: Model View Controller (Oaf is using this), Struts,

Framework :->

Fills the gape (EX:b/w c++ vs forms)

Oracle Application Framework :-->

It is a java based, 3Tier web based application, which has linked to oracle application ebiz instance
And have all the security features of oracle apps.


Components or Parts of OAF-->
-----------------------------

1) BC4J Basic Components for j2ee

2) OC4j --> J2EEE Server (Container)

3) UIX --> User Interface in XML (to design the pages, the source will be in xml Ex: Text filed source)

It was developed by Cabo Company,
Oracle acquired cabo and changes the name.

HTTP is wrap server developed by apache and it is acquired and named as oracle http.

4) AOL/J

Application Object Library / J2EE.
To get the security at ebiz level and implements it in oaf.(function and data security)

5) OA Framework --> Acts as a coordinator, it allows to integrate all the first 4 components.

6) OA Extensions--> Jdeveloper is used to develop extensions.

Jdeveloper--> Allows design, developing, debug and deploys software’s

Types of Jdeveloper :-->
-----------------------
1) Normal and advanced java applications along with oaf (OA Extensions) --> downloaded from only metal ink patch
2) Only java and j2ee --> download from otn.


MVC



End user web server middle server  database
HTTP 10.1.2(Forms, reports) 11i
10.1.3(Bpel, webservices, soa)
R12 both 2 and 3 series.

Middle tier has some layers.
1) Specifically 1 layer for interacting with database

i.e called as Model layer

Model Layer:
--------------
It encapsulates all the features to interact with database.
Technologies used:
1) BC4J
2) Top Link  sun
3) EJB  sun
4) POJO  Plain old java objects
5) ADFBC  only for adf oracle

Some times web server may be in middle tier server.

Layer  wing of sw services.


View Layer:

Part of my applications which is mostly used by my end user.

Interface Technologies in Non Microsoft form
1) HTML
2) JSP
3) JSF
4) UIX  we are using it in oaf.
5) PHP
6) PSP

OA.jsp is the global jsp page we can access uix.

Controller

Controls the execution of any Application.
Coordinates view and model.

Controllers in Form based applications:
1) Triggers


Controller Technologies in JAVA:

1) Struts Apache Jakarta
2) JSF SUN
3) OA Controller  we are using it in oaf.


JSF allows us to develop both the view and controller.





BC4J:

Components of BC4J:
1) EO - Entity Object
2) VO – View Object
3) Am – Application Module
4) VL – View Link
5) AO – Association Object
6) VAM – Validation Application Module.
7) VVO – Validation View Object
8) EE – Entity Expert
9) PVO – Property View Object

OAF Architecture is more complex than forms.

*************************---------------------------************************

Entity Object :

 This object must be based on table/view/synonym

 EO must be based on the replica of tables.i.e including all the columns are suggestible.

 It must contain a primary key.( If the main table has primary key column then it will automatically made as primary key in eo, if there is no primary key defined in the table then eo makes rowed as primary key column

 Always, it should contain who columns for auditing purpose.

 We can’t create EO based on multiple tables. To overcome this we create a view and we can use it in EO.

 Multiple EO objects can be associated using AO.

 Whenever the eo is created then it creates 2 files

1) XML  Mandatory Definition file, we can’t update is directly. It contains the table name, columns, data types, mapping of data types, keys info, size etc…

Ex: EmpEO.xml

2) Implementation File  Optional File( To write custom business applications)

Generate this file only when some customization needed, otherwise leave it.

It contains accessor methods (get/set methods in java)

Ex: EmpEoImpl.java

Void setSalary ()
{
}


Number getSalary ()
{
}


Each set/get method is mapped with each and every column in EO.

*****************************--------------************************



View Obejct:

 Encapsulates the database query.
 View can be compared with cursor.
 Primarily based on EO.
 We can create VO directly based on table/query.
 Can be created manually neither based on table nor on EO. I.e. static VO. I.e. called as transient view object.
 Must contain the primary key column
 Multiple VO can be created based on single EO.


Case:
If you want to add some table / column coming from eo then we need to go to export mode to modify the query and parameters ( oracle style col1, col2, col3 or jdbc style ????)





Types of Files in VO:

1) Mandatory XML File
EX: EmpVO.xml

2) Implementation File : EmpVOImpl.java (when_validate_block )
3) ROW Implementation File : EmpVORowImpl.java (when_validate_row / record)

Business logic is saved in database and other files will be saved in Metadata Repository.

We use XML Importer, import. bat in windows, JPX importer.sh to import data to MDS.

1) EmpVO.xml
2) IBMEmpVO.xml  custom file which has custom validations

JPX contains both the old and new page names/ business logic.


Case 1)

If customer wants to display Sal col

1) if the vo is based on query then we can create vo using oaf personalization
2) If the VO is based on EO, then we need to create to another VO including the sal column.


JPX Right click  substitute  2 screens  old col & new col.


We need to import the changes to mds using jpx importer.



**********************------------------------------***************************


Application Module:

 Container of related BC4J Objects(container of am’s , vo ,vl).
 Database connection b/w database and page.
 Initiates the transactions.
 Every page must have the reference to AM.
 We pass retainAM=’Y’ as parameter to the other page whenever we are moving from one page to another page.
1 2 3


Types of AM:
1) Root Am  Which is associated to Page & Responsible for initiating the transaction. For every page there will be only one Root AM.

2) Nested Am  To distribute the transactions.


Files:

1)Mandatory File  EmpAM.xml
2)EmpAMImpl.java



*******************------------------------***************************


View Link:

 Master Detail Form
 View Object of a database.


Association Object:
Join


VAM / VVO / EE:

 Validation helper to write validations programmatically.

 Declarative validations are treated as client side validations.
And they are created in eo and vo.


PVO:

 It is used for partial page rendering (PPR)
 Transient transactions


*********************************-**-**-**-**********************************


Controller:

 OAControllerImpl is the base class for every controller.

 Every method of controller takes 2 parameters.


Methods of Controller:

1) ProcessRequest (OAWebBean, OAPageContext) get
2) ProcessFormRequest (OAWebBean, OAPageContext)  post
3) ProcessFormData (OAWebBean, OAPageContext)  we can’t change the definition of this method.



OAWebBean:
 Text filed
 Button
 Submit Button


OAPageContext:

Default scope of page is Request.

 Application
 session
 Request
 Page


Ways to call page:

 Hyperlink get
 Type URL  get
 Submit Button  post

HTTP Methods:

 Get:  Information will be seen on address bar and max 256 characters are sent.

 Post:  Information is secured and if it exceeds 32767 characters then it will create new packet.

When the page is rendered then processRequest method will be called.

Instead of JPX ,we have to use controller class property to substitute the new controller in place of old controller.

















Onion Structure:







E







WML





JAVA_TOP:

Contains Classes, definition bc4j components, look and feel


OC4jJ2EE Server.


Package:

Oracle.apps is mandatory

 Oracle.apps...schema. server
EO, AO, VA, VVO, EE

 Oracle.apps...server
VO,VL,AM

 Oracle.apps...webui
controllers, page

Custom Package:

Custom.oracle.apps. ..schema. server

Class2:

Jdeveloper Versions:

11i  9.0.3.2  Patch Number: p_4045639

R12  10.1.3  p_5856648

Oracle 11i Jdeveloper is installable. Oracle 10g is not installable, we have to unzip it to use.


Folder Structure:

 JdevHome
 JdevBin  It contains all the binary information
 JdevDoc  It contains all the documentations and tutorials, ex, api for all the uix,jpx….
Index.html will contain all the information.


Jdeveloper Setup:

We must set JDEV_USER_HOME in environmental variable.

JDEV_USER_HOME=/JDEVHOME/JDEV

Workspace may contain many projects.

Workspace  OA Workspace (JWS) Project (JPR – Jdeveloper Project)

 Design time database connection
 Runtime Database connection  we need to place the .dbc file from FND_TOP.


DBC must contain the following variables.

 To_task
 JDBC URL
 JDBC Driver
 Host name
 Sid
 Db port

We need to go the property of projects

 Dbc_file_name location
 Application user name
 Password
 Responsibility key




Note:

 The responsibility must be assigned to that particular user.

 In OAF, error will come from the stack, first 3 lines are sufficient to understand the error.

 If you miss oracle.apps it will give some other meaningless error i.e internal error.

 If the server and Jdeveloper are not in the same n/w it will take more time to execute the page.



Ouvpn url: https://ouvpn-in.oracle.com
Uername : 2565894.user06
Pwd: Se7veSB


Remote Desktop for development:

eg6191.us.oracle.com


Windows user name and password

Student1/student1


Ebs instance :

http://eg5260.us.oracle.com/OA_HTML/AppsLocalLogin.jsp


























Sample Project:




Setup Environmental Variable:






















































Open Jdeveloper:






































Creating Database Connection:



































Working on a already developed Page:

FileOpen
































fwktester
Fwkdev




To Test the application short name :

















We need to Rebuild the code…

















We n


We need to zip the class files in my classes folder instead of myprojects to promote it to some other destination.






Once you rebuild the code , then we can see my classes.
Now myclasses will be created






























































Run the project



















Project2:



Create new workspace:

Choose OAWorkspace.if you select workspace, we can’t find the necessary attributes to develop the page.



Give meaningful projet name.





If you check the checkbox then it will automatically create the new project.

Here we are un cheking it to create it manually.





Creating New OA Project:
f













We need to choose the dbc file path and we need to submit the necessary credentials.



Once it is done, the jpr file will be created.




To create New Page:















If the page is a oa component in webtier we need to place the file in webui. Sp that we need to provide the full package name.



Once you created a page then it will create an xml file.



We can change the name of the region and other details as per scenario.











Page Layout components are used for storing images.













Creating Nested Region:



































In Message component layout , button will not be displayed.

















To Apply Common Property:



























Run the Page:










Controller must be defined to go to the next page when clicking on go button.

Even if the contoller is defined , and the page is not opening then we need to check the below conditions.


Debug:
1) Button must be submit button
2) Procedure must be processFormRequest.
3) Controller class must be attached to proper region.


Creating controller:


We need to create the controller for main region.



















Now HelloCo.java is created.


















Project 3:






















































SERVER.XML IS USED FOR CUSTOMIZATION AND EXTENSIONS.






















Passivation:

It Is the process where the Application status can be stored in a table / database.

ICX_SESSION
Passivation can be activated on a bc4j component i.e AM.

Retention_level:

Values of retention :

1)RESERVE_FULL
2)MANAGE_STATE




SYSTEM PROFILE :

If we want to activate passivation it should be set in “FND PASSIVATION LEVEL”.
If fnd passivation level is set to null/none then it is reserve full otherwise it is manage state.


OAF finds the threads which are idle and assign it’s to new user request and if that thread is activated then it assign the resource back. This is called as activation.

These concepts are inherited from ejb and it added security to it.


SPML  Simple Possible Expression Language

We use it in writing email code in OAF.


AM Can’t hold more than one Transient view object (PVO).





Deploying on Server

Fresh Deployment:

Required:

1)Class
2)XML BC4J
3)XML Region , Page  MDS
4)JPX (* based on requirement)


We need to pass xml to mds using the import.bat

Jdev Home / Import.bat  xml importer

We need to pass parameters while calling import.bat

1) Root Directory
2) Location
3) DB Name / Host String
4) DB User
5) DB Password

We need to zip myclasses and we need to place it in server JAVA_TOP.

Then we need to bounce the server.


SSWAJSP Function  OA.jsp? function name or page name=/chandu/oracle/apps/ak/Employee/webui/EmpSearchPG&addBreadCrumb=Y&retainAM=Y


Attach the function to Menu.

Add Menu to responsibility

Add Responsibility to User.




Breadcrum To see visited pages.





Not Required:
1)JWS
2)JPR
3)JAVA
4)XFG




Custom deployment:
6) Class Y
7) JWS N
8) JPR N
9) XML(BC4J) Y
10) JPX (programmatically / non programmatical changes in the project)






Zip my classes folder  connet to putty  go to JAVA_TOP 

Mv zip file to java_top
And unzip the file unzip fil enam e

Mds

C:\> import.bat

Cd jdev\jdevbin\bin\import.bat


Import


Import jdev\jdevhome\myclasses\chandu\oracle\apps\ak\employrr\webui\EmployeePG.xml -rootdir: C:\..classes username a[[s = [assword apps –dbconnectin eg5260.us.oracle.com :1521:eg5260


And we have to do the same procedure for all the other xml files,


Sysadmin functionaladmin function 

Jpximport.bat to import jpx files in custom deployment.




Personalization:


User LevelQuery Level,


Admin Level->

Programatical changes can’t be change by admin also.

No comments:

Post a Comment