Showing posts with label ORACLE APPLICATION FRAMEWORK (OAF) TUTORIALS. Show all posts
Showing posts with label ORACLE APPLICATION FRAMEWORK (OAF) TUTORIALS. Show all posts

Monday, July 18, 2016

Automatic Search External LOV

Automatic Search External LOV

In this lesson we are going to see how to Create Automatic Search using External LOV and the uses of external LOV in oaf. The difference between inline LOV and External LOV is inline lov is used only inside the page where as external LOV we can use for other pages inside the project.
So therefore the use or advantage of External LOV is if we want a list of values to be used for other pages in the project then we can create External LOV region and we can use the created region in any pages of the project.
Steps to create External LOV in oaf are follows:
Step1: Create Workspace, project , AM and create one page assign AM to the page give page title and window title.
For example :
workspace name : externlallov
Project Name : ExternallovPRJ
package name : externallov.oracle.apps.po.externallovprj.webui
AM name : ExternallovAM
AM Package name: externallov.oracle.apps.po.externallovprj.server
Step2: Right Click on the project select new as shown in the below picture.
15
After selecting new option we will see a gallery window in that extract web tier in categories select OA Components  and then select Region  in items list.
16
After selecting region click on ok button so that a window will get open in that
Name : Give any user defined name
Package: Select the proper package of the project.
Style : select style as List of values.
 17
Now one .xml region will be created under webui.
Step3: Create on VO under the lov package for example select the package name as follows:
externallov.oracle.apps.po.externallovprj.lov.server
VO Name is : externalLOVVO
Query in the lov is :-
SELECT FULL_NAME FROM PER_ALL_PEOPLE_F
Step4: Attach VO to the AM.
Step5: Under the region create one item and item style as Message LOV input. In previous lesson we already seen how the Message LOV input item structure look like.
The below image shows how the Application Navigator and page structure of the project looks like:
18
Step6:  Under the Message LOV input region create on table region using wizard. In the table region select the proper package name and then as we attached our VO to the AM it will display our LOVVO so select that VO and therefore a table region will be created with one item under it.
Step7: Select the Message LOV input item and in the Property Inspector of Message LOV input select External LOV as shown in the below figure:
19
Click on the icon  87  so that the following window will get opens
20
Click on the Browse button and then select the proper package name for example see the below picture:
21
Click on the search button and then select the fully qualified name in the search results for example see the below picture:
22
Click on OK button so that JDeveloper asks for confirmation in that click on OK button.
23
Step8: Run the page and see the output. The following three images shows the output and its work process
24
Click on the search image 12  so that it displays list of values as shown below.
25

Select any value whichever you want to select. Use Quick select or radio button process:
26

Wednesday, July 13, 2016

Implement External LOV in OA Framework

Implement External LOV in OA Framework
1. Create a New Workspace and Project
Right click Workspaces and click create new OAworkspace and name it as PRajkumarLovDemo. Automatically a new OA Project is also created. Name the project as LovDemo and package as prajkumar.oracle.apps.fnd.lovdemo

2. Create a New Application Module (AM)
Right Click on LovDemo > New > ADF Business Components > Application Module
Name -- LovAM
Package -- prajkumar.oracle.apps.fnd.lovdemo.server

3. Create a New View Object (VO)
Right click on LovDemo > New > ADF Business Components > View Object
Name -- LovVO
Package -- prajkumar.oracle.apps.fnd.lovdemo.server

Note - The VO is not based on any EO so click next and go to the query section and paste the query
SELECT          employee_number, full_name
FROM             per_all_people_f
WHERE           SYSDATE BETWEEN effective_start_date AND effective_end_date

4. Add View Object to Root UI Application Module

5. Create a New Page
Right click on LovDemo > New > Web Tier > OA Components > Page
Name -- LovPG
Package -- prajkumar.oracle.apps.fnd.lovdemo.webui

6. Select the LovPG and go to the strcuture pane where a default region has been created

7. Select region1 and set the following properties:  
ID -- PageLayoutRN
AM Definition -- prajkumar.oracle.apps.fnd.lovdemo.server.LovAM
Window Title -- List of values Demo Window
Title – List of values Demo

8. Right click PageLayoutRN and  click new Region
ID -- MainRN
Region Style – messageComponentLayout
Note - Style is given as messageComponentlayout because we are going to create only message components that is messageLovInput item in that region

9. Create a New Region
Right click on LovDemo > New > Web Tier > OA Components > Region
Name -- EmployeeLovRN
Package -- prajkumar.oracle.apps.fnd.lovdemo.webui
Region Style -- listOfValues
Scope -- Public

Note - The property Scope is the key property which makes the LOV region public and makes it usable in multiple pages

10. Select EmployeeLovRN. Right click on EmployeeLovRN in Structure pane and click table using wizard. In the wizard choose the prajkumar.oracle.apps.fnd.lovdemo.server.LovAM and select the LovVO1. Click Next
Region Id -- LovRN
Region style -- table

11. Shuttle the two attributes to the right side.That is EmployeeNumber and FullName

12. Click next, check the mapping and then finish

13. Select the field FullName and set the following properties:
Search Allowed -- True
Selective Search Criteria – True

Note - The first property lets users search on these values in the LOV, and the second property ensures that the users specify search criteria for at least one of these values to avoid a blind query

Attaching External LOV to Page:

14. Click on LovPG and right click the MainRN and click new messageLovInput
External Lov -- /prajkumar/oracle/apps/fnd/lovdemo/webui/EmployeeLovRN
Lov Region Item -- FullName
Return Item -- item1
Criteria Item -- item1
Prompt -- Employee Name

15. Congratulation you have successfully finished. Run Your page and Test Your Work 
 






Tuesday, July 12, 2016

Error: oracle.apps.fnd.framework.OAException: Application: FND, Message Name: FND_GENERIC_MESSAGE. Tokens: MESSAGE = java.lang.NullPointerException;
Solution :
Set profile “Sign-On:Notification” to “No” at site level.

OAF Errors and Resolutions

OAF Error

oracle.apps.fnd.framework.OAException: Application: ICX, Message Name: Could not find the specified responsibility. (Could not lookup message because there is no database connection)

Resolution

Check the following properties are set correctly.

Go to Project Settings. Expand Common and then Oracle Applications.

1) Database Connection 
  • Check if database setup is created.
2) Runtime conneciton 
  • DBC file name. ( this is the connection used when your run it . The database connection is only for the desing time)
  • Application short name such AK.
  • Responsiblity key
  • User name (Apps user name)
  • Password (Apps user password).
3) Check if responsibility(from responsibility key used above) is assigned to your apps user   
     name that is used in runtime connection.

Monday, July 11, 2016

About Controller

About 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.
  • When we create controller on subclass will generate.
one
Controllers have three methods:
  1. Process Request (HTTP get).
  2. Process Form Request (HTTP post).
  3. Process Form Data.
HTTP get:This is used while loading the page.
HTTP post: After loading the page if we want changes.
Process Request: This method will handle HTTP get example while loading the page displaying the default items.
Process Form Request: This method will handle HTTP post.After loading the page if we want to perform any actions then we go for process form request.
Process Form Data: This page is invoked upon a browser ‘post’. During this phase the framework will automatically applies changes back to the underlying view objects. Rarely custom code is required in this phase. If exceptions are thrown during this phase the phase is skipped and the page redisplays with the error message.
There are two parameters in the controller:
1) OAPageContext
2) OAWebBean
OAPageContext:
  • To get and set values of the fields using the OAPageContext.getparatmeter and OAPageContext.putparameter.
  • To call one page to another page OAPageContext.setforwardURL.
  • To redirect the current page itself use OAPageContext.forwardImmediatelyToCurrentPage (or) OAPageContext.sendRedirect and many more.
OAWebBean:
  • Each and every field we have properties and the properties define the behavior of item.
  • OAWebBean represents the Hierarchy/Structure of the components in the page.
  • WebBean represents the properties of item.
As we discussed what Model, View, and Controller is, look at the below figure which shows that how they generally interact with each other or how the data flow between them is.
two

About View

About View

  • View is the actual output OAF page what an end user can able to see.

  • In Oracle Apps Framework View is implemented using UIX technology, whereas UIX means User Interface XML.

  • Whenever we run the page in JDeveloper then automatically UIX will generate web.xml file.

  • The power of UIX is that allows metadata to be translated to an HTML page for a web browser or mobile device browsers.

  • The generated web.xml file will be converted into HTML format of OAF page.

  • Since web.xml file here will work as a cache memory.

  • Whenever we want to move the web.xml file into the server side then MDS repository is used to move the web.xml file into the server.

  • MDS stands for Meta Data Service and in the application top we will be having MDS folder.

  • When we deploy all the OAF page destination paths, regions then the files will be stored into the MDS tables.

  • The MDS table are like:

JDR_Paths:Stores the path of the documents, OA Framework pages and their parent child relationship.
JDR_Components:Stores components on documents and OA Framework pages.
JDR_Attributes:Stores attributes of components on documents and OA Framework pages.
JDR_ATTRIBUTES_TRANS:Stores translated attribute values of document components or OA framework pages.
JDR_DOCUMENT_ID_S:  This is a sequence generator table.

  • MDS can be managed using standard database procedures and tools.

View Objects and View Links

View Objects and View Links

View Objects
  • View Objects are used where 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
Example: employeeVO
  • When we create the View Object (VO) one subclass will generate with setters and getters method.entati2
We have four types of View Objects and they are:
1) Manual VO
2) Automatic VO
3) Validation VO
4) Property VO

Manual VO: If we are writing our own SQL query then it will be called as Manual VO.

Automatic VO: Automatic VO is when we select an Entity Object automatically it will select the Query.

Difference between Manual and Automatic VO is:

  •  If we want to perform DML operations then we can go for VO that should be based on Entity Object.
  •  We go for Manual VO if we are using simple SELECT statement.

NOTE: Note that when we create VO (View Object) all the table columns will be converted into attributes, hence here we call columns as attributes.

Validation VO:Validating the data in the Data Base, example using WHERE condition in the SELECT statement.
Property VO:Attributes / columns without Data Base columns comes under property VO. These attributes are also called as Transient attributes.

Example: Suppose there is a table which holds student marks so therefore it contains 6 columns to hold six subject marks for each student. There is no total column in the table to store the total marks of the student separately. Now in the output for display purpose we are taking TOTAL attribute hence which is not from Data Base table and this TOTAL attribute is called Transient attribute.

View Links
Relationship between two View Objects having one common column in both the VO’s is called View Link. All the View Link objects end with the VL
Example: DeptEmpVL
Note that if we want to display Master Detail data then we go for View Links, where as if we want to perform DML operations on Master Detail data we go for Entity Association.
The below figure shows that how View Objects and View Links are interacting with Data Base, VO interacts with Data Base Directly or VO interacts with Data Base through the EO.
view link

Entity Objects and Entity Association

Entity Objects and Entity Association

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.

Example:  employeeEO
  • When we create Entity Object (EO) one subclass will generate.
Employee

We have two types of Entity Objects
  1. PL/SQL based Entity Objects
  2. Java based Entity Objects

Note that we have two types of tables in Oracle Apps they are Custom Tables and Seeded Tables.
If we want to perform the DML operations on the standard (Seeded) table then we go for PL/SQL based Entity Object and if we want to perform the DML operations on the custom table then we go for Java Based Entity Object.

Entity Association
  • Entity Association is the relationship between two Entity Objects having one common column.
  • All the Entity Association ends with the AO (Association Object).
Example:  EmpDeptAO
  • If we want to perform DML operations on Master Detail page then we go for Entity Association.
  • If we want to common know column between two tables then we will go for Entity Association.

About Model..

About Model..

The entire Database related transactions in OAF pages will be taken care by the MODEL.
  • Model is where the application implements business logic.
  • Model will implement all the Data Base transactions.
  • Model component is implemented using BC4J where BC4J is Business Component for Java.
  • BC4J consists of three components:
      • Entity Object and Entity Associations
      • View Objects and View Links
      • Application Module
Model contains six components including BC4J components, additionally the other three components are:
    • Callable Statement
    • Prepare Statement
    • OADB Transactions
Callable statement is used to call a PL/SQL statements, Prepare statements are used if we are using single SELECT statement, and OADB transactions will take care of Oracle APPS related Data Base transactions.
model

Advantages & Disadvantages of OAF

Advantages & Disadvantages of OAF

The advantages of OAF are as follows:
1) End user Productivity
2) Enterprise Grade Performance and Scalability
3) Highly extensible Architecture
4) Browser Look and Feel of all the pages in application.
5) Open Standards such as XML, HTML, Java, JSP, SQL, and Web Services.
6) Application Customizability.
7) Developer Productivity.
The disadvantages of OAF are:
i) Cannot see the layout at design time.
ii) OAF Pages are integrated / compatible only with the Oracle Apps.
iii) Drag and Drop options are not available.
iv)  More R&D is required to design a form layout which is time consuming.

Structure of OAF

Let us discuss about the structure of OAF.
OAF follows J2EE Architecture and J2EE follows MVC architecture so therefore ultimately OAF follows MVC Architecture.
The abbreviation of MVC is Model View Controller.
MVC is the clean design interface between Model, View, and Controller.
Structure of OAF
Model will take care the Data Base related Transactions, Model contains the following:

Entity Object (EO)
View Object (VO)
Callable Statement (PL/SQL Statement)
Prepare Statement (Single Select Statement)
OADB Transactions (Oracle Apps Data Base Transactions)

View is nothing but the OAF Page Output. View is implemented by UIX (User Interface XML).

Controller will take care of web browser activities like HTTP Get and HTTP Post
Controller have got three methods:
Process Request
Process Forms Request (HTTP Get)
Process Form Data (HTTP Post)
HTTP get: While loading the Page we use HTTP Get.
HTTP Post : After Loading the page if we want any changes the we use HTTP Post.
We will discuss in detail about MVC architecture in the next chapters.
The Below figure shows the interaction between Model, View, and Controller.

controller

Onion Structure of OAF
Another structure of OAF is called Onion structure.
The OA Framework can be extracted into a series of concentric layers.
Each layer knows only about the layers below to them.
The below figure shows the Onion Structure, in which AM interacts with the VO and VO interacts with EO and finally EO interacts with Database.

OAF

Oracle Fusion - Cost Lines and Expenditure Item link in Projects

SELECT   ccd.transaction_id,ex.expenditure_item_id,cacat.serial_number FROM fusion.CST_INV_TRANSACTIONS cit,   fusion.cst_cost_distribution_...