Showing posts with label OA Framework. Show all posts
Showing posts with label OA Framework. Show all posts

Friday, 14 November 2014

24. Using OADialogPage in OAF

We can display an exception as a message in a dialog page using the APIs in the oracle.apps.fnd.framework.webui.OADialogPage class and OAPageContext interface. The OADialogPage class holds properties for the generic dialog page.

Consider below example, where on clicking on 'Save' button after making changes on the page, it navigates to a dialog page.




This is just like asking for confirmation before saving.
Depending upon user's action (Yes or No) on dialog page, we can commit or rollback the transaction.

Below is sample code for implementing this functionality:

// in processFormRequest() method:

// On clicking save button, we create a dialog page and redirect there.
if (pageContext.getParameter("saveBtn") != null) {
    OAException descMesg = 
        new OAException("FND", "FND_CUSTM_SAVE_CHANGES");
    OAException instrMesg = 
        new OAException("FND", "FND_CUSTM_SAVE_CHANGES");

    OADialogPage dialogPage = 
        new OADialogPage(OAException.WARNING, descMesg, instrMesg, "", 
                         "");
    dialogPage.setOkButtonToPost(true);
    dialogPage.setNoButtonToPost(true);
    dialogPage.setPostToCallingPage(true);

    // here we are setting names of buttons of dialog page 
 dialogPage.setOkButtonItemName("SaveYes");
    dialogPage.setNoButtonItemName("SaveNo");
    
 pageContext.redirectToDialogPage(dialogPage);
}

// if user clicks Yes button, we are committing
// records and show confirmation message
else if (pageContext.getParameter("SaveYes") != null) {
    am.invokeMethod("saveRecords");
    throw new OAException("Data has been saved successfully.", 
                          OAException.CONFIRMATION);
}

// if user clicks No button, we undo the changes
// i.e. rollback the transaction
else if (pageContext.getParameter("SaveNo") != null) {
    am.invokeMethod("undoChanges");
}


// In AMImpl.java:

// these are method for committing and rollbacking the transactions:

public void saveRecords() {
    getOADBTransaction().commit();
}

public void undoChanges() {
    getOADBTransaction().rollback();
}









Monday, 28 July 2014

23. Query to Fetch Page Details (Using JDR tables)

/*
Below query can be used to fetch all the items/regions, their ID and name & value of each attribute used on a page
@:PAGE_NAME - takes name of the page as parameter (like HelloWorldPG)

   1. If there is no REGION_ITEM_TYPE of type 'customization', then there are no personalization/customization on the page.
   2. If 'customization' type is present, query would show data for standard page as well as data of personalization file. To see data of any one type, just filter out using a unique path_docid from JDR_PATHS for the particular page_name.
*/


SELECT jc.comp_element region_item_type,
           
jc.comp_id region_item_id,
           
ja.att_name attribute_name,
           
ja.att_value attribute_value

FROM   jdr_attributes ja,
           
jdr_components jc,
           
jdr_paths jp

WHERE 1           =1
AND     jp.path_docid = jc.comp_docid
AND     jc.comp_docid = ja.att_comp_docid
AND     jc.comp_seq   = ja.att_comp_seq
AND     path_name     = :PAGE_NAME
ORDER BY jc.comp_seq;


Below is result for HelloWorldPG:










Saturday, 5 April 2014

22. Profile Options related to OAF

1. Disable Self-Service Personal (FND_DISABLE_OA_CUSTOMIZATIONS) : This disables the rendering of all personalization that have been created. If this system profile option is set to Yes, the configurations made will not be applied, regardless of the level at which the configurations were made. Only the original definition of each self-service page will be displayed.

2. Personalize Self-Service Defn (FND_CUSTOM_OA_DEFINTION) : This system profile option controls access to the Personalization Framework. This profile option enables or disables the global Personalize URL link that appears on each self-service web application page for Admin-level customizations.

3. FND: Personalization Region Link Enabled (FND_PERSONALIZATION_REGION_LINK_ENABLED) : Enables the "Personalize Region" links on a page if the Personalize Self-Service Defn profile is set to Yes. Enabling the "Personalize Region" links allows users to also personalize regions that are dynamically added to the page from custom code in the controller.

4. Fnd Xliff Export Root Path (FND_XLIFF_EXPORT_ROOT_PATH) : Use this profile option to set the root path used to generate the full path where the Xliff files are exported to when users extract their translated personalizations using the Extract Translation Files page.

5. Xliff Import Root Path (FND_XLIFF_IMPORT_ROOT_PATH) : Use this profile option to set the root path used to derive the full path from where the Xliff files are uploaded when users use the Upload Translations page to upload translated personalizations.

6. FND: Personalization Document Root Path (FND_PERZ_DOC_ROOT_PATH) : Use this profile option to define the root path where personalizations documents are exported to or imported from when users use the Database page or the File System page of the Functional Administrator responsibility's Document Manager, respectively.

7. FND: Disable Partial Page Rendering (FND_PPR_DISABLED) : Controls whether partial page rendering is disabled. If set to Yes, PPR is disabled. In this case, UIX automatically renders a Go button next to each item with a partialAction enabled.

8. Enable PPR Debugging (FND_ENABLE_PPR_DEBUGGING) : Controls the PPR debugging feature. When this profile option is enabled, the partial targets are displayed at the top of the screen as the page renders. 

9. FND: View Object Max Fetch Size (VO_MAX_FETCH_SIZE) : By setting the value for this profile option, we can determine how many records are fetched by View Objects in all of the EBS applications. The profile value is set at site level to 200 by default, so it may need to be changed to a more appropriate value depending on requirements. Setting a large value can effect performance. The higher the value, the longer pages will take to load. So it is best to set it at application level e.g. Projects.

10. FND: Personalization Seeding Mode (FND_PERSONALIZATION_SEEDING_MODE) : When the profile 'FND: Personalization Seeding Mode' is set to "Yes", it sets the developerMode flag to "Yes" for any function level or user level personalization. These personalizations are then protected against update/delete. That personalization then can only be deleted from back end using JDR_UTILS.deleteDocument.

11. FND: Passivation Level (PASSIVATION_LEVEL) : indicates whether passivation is enabled, and if so, at what level of frequency. (Resource Threshold/Request)

12. FND: Session Timeout Recovery Enabled (SESSION_TIMEOUT_RECOVERY_ENABLED) : It indicates whether servlet session time-out recovery is enabled for the application.

13. ICX: Limit Time (ICX_LIMIT_TIME) : Indicates the amount of time after which the user, regardless of their level of activity, will be asked to validate their credentials in order to continue working.

14. ICX:Session Timeout (ICX_SESSION_TIMEOUT) : Maximum idle time for an Oracle Applications user session (specified in minutes).

15. FND: Disable Configurable Home Page (FND_CONFIG_HOMEPAGE_DISABLED) : This profile is for retaining backward compatibility. It basically determines whether the Configurable Home page is enabled or disabled.

16. FND: Disable Look Ahead LOV (FND_DISABLE_LOOK_AHEAD_LOV) : Determines whether the Look Ahead LOV feature is enabled or disabled at the Site or Application level. However, the value of Look Ahead Enabled property set on the messageLOVInput item overrides this profile option value.

17. Corporate Branding Image for Oracle Applications (FND_CORPORATE_BRANDING_IMAGE) : To globally override the Oracle corporate branding image with your own corporate branding image, set this profile option to the name of an image file (GIF) that contains your corporate image. This image file should be placed under the $OA_MEDIA directory.

18. ICX: Date format mask (ICX_DATE_FORMAT_MASK) : This profile specifies the format used when displaying date fields. When a field displays both date and time, the date component is displayed in the format specified here.

19. Restrict Text Input (FND_RESTRICT_INPUT) : If you develop code that fails to perform adequate input validation, there is always the risk that an attacker may be able to inject dynamic scripting content such as Javascript/vbscript, into Oracle E-Business Suite, and run the script(s) in the context of a legitimate Oracle E-Business Suite user. This is referred to as cross-site scripting. Oracle Framework provides a feature called Cross-Site Script scanning (XSS scanning), that provides added security to mitigate cross-site scripting attacks. When requests are made to get a value or values for a parameter by calling OA Framework methods, the XSS scanning feature performs an automatic scan of the value or values for scripting content. If scripting content is found, an exception is thrown, otherwise the value or values are returned. To enable XSS scanning, set this profile option to Yes at the Site level.







Monday, 11 November 2013

21. Record History on OAF Page

Sometimes, there is a requirement when a user wants to see data about a particular record, such as who created the record and when, and who most recently updated the record and when (For example, a manager wants to check when and by whom an invoice line was last updated).

This feature can be enabled on OAF page, which adds the record history icon to the component (Header, Table or Advanced Tables). Clicking the icon opens a popup window that displays the WHO column values of the current row.

Note: This feature works only for non-PL/SQL based updateable ViewObjects. Also, to use this feature, profile option 'FND: Record History Enabled' must be set.

Record history information is generally saved in the "WHO columns" of the database tables and are linked to an OAF page through BC4J Entity Objects (EOs). These WHO columns are as follows:
Name of the user who created the row (CREATED_BY)
Date of creation (CREATION_DATE)
Name of user who updated the row (LAST_UPDATED_BY)
Date when row was last updated (LAST_UPDATED).

The Header, Table and Advanced Table components have a property - Record History Enabled which can be set to true or false. We can set this either from JDeveloper or from 'Personalize Page' link from front end as shown below:



Now when we open the page, it will show 'Record History' icon as show below:


On clicking the icon, a popup will open showing WHO column values of the current row:


The Record History window displays the OARecordHistoryRN.xml region. The region also has an associated controller - OARecordHistoryCO.java.
When Record History window is called, the root application module of the calling page is retained and then from processRequest() method of OARecordHistoryCO, WHO column values are read from the EnityObject using history methods (like eo.getAttribute("CreatedBy");).












Saturday, 28 September 2013

20. OAF Related Migrations from one Instance to Another

Migration of fully custom OAF page

Assuming that the custom page is created and running fine from JDeveloper, we need to perform below steps for migrating the same to any instance:

1) From JDeveloper, rebuild the parent package corresponding to the page(s). This will compile all the files and will be stored at <JDEV_USER_HOME>\myclasses. For example in below screenshot, on compiling emprec package, corresponding class files get generated at <JDEV_USER_HOME>\myclasses\xxcus\oracle\apps\fnd\emprec :


2) Connect to unix server and move files from classes folder to $JAVA_TOP.
Note: <JDEV_USER_HOME>\myclasses folder on local is equivalent to $JAVA_TOP on unix box.
So all files at <JDEV_USER_HOME>\myclasses\xxcus\oracle\apps\fnd\emprec will be moved to $JAVA_TOP/xxcus/oracle/apps/fnd/emprec. If this folder structure is not present at $JAVA_TOP, we have create those manually else we can simply move .class and .xml files.
3) Once all the files are moved, final step is to import the pages. Either we can import using Command Prompt from local or we can do this on unix server as well.

Here are commands for both: Page Import Commands

For migration from one instance to another, only difference is that we need to copy files from $JAVA_TOP of one instance and then move to $JAVA_TOP of other instance.

Migration of Personalization

1) Firstly do the personalization (like create item, change prompt, attach custom CO.. etc) on the page using 'Personalize page' link.
2) Copy path of the page from 'About this page' link. (for ex: /oracle/apps/fnd/framework/toolbox/tutorial/webui/PoSearchPG)
3) Once you are done with personalization,  go to 'Functional Administrator -> Personalization -> Import/Export'
4) Expand the directory structure upto /oracle/apps/fnd/framework/toolbox/tutorial/webui.
Under webui, if personalization is done at site  level, its personalization file will be there at customizations/site/0.
At responsibility level -> customizations/responsibility/<resp_id>.
At function level -> customizations/function/<function_code>


5) So expand the appropriate folder under webui, select the file and click on 'Export to File System' button. It should show a confirmation message as below:

6) This generates xml file on unix server with the same name as that of page having all details of personalization on that page.
(Path on unix comes from profile 'FND: Personalization Document Root Path')
7) In order to migrate, move this file to unix server of another instance at path <profile 'FND: Personalization Document Root Path'>/ followed by same directory structure.
8) Now login to another instance and go to 'Functional Administrator -> Personalization -> Import/Export -> Exported Personalizations'.
9) Again expand the directory structure as we did in step4, select the file and this time click on 'Import from File System' button.

Note: If the personalization is done at responsibility level, resp_id may vary from instance to instance. So we have to change to folders and xml file accordingly.

Migration of Controller Extension

1) Assuming that controller is extended and compiled in JDeveloper. Also the custom controller is attached to the page using personalization. (Controller Extension)
2) Firstly, move the class file of custom controller from <JDEV_USER_HOME>\myclasses to $JAVA_TOP followed by similar path.
3) Then migrate the personalization part of attaching the custom controller to the page. (Same steps as mentioned above in Migration of Personalization).

Migration of Substitutions

1) Extend BC4J component like VO, AM.. in JDeveloper and rebuild the same.
2) Once done with extension, go to project properties -> Business Components -> Substitutions
3) Select the base BC4J component on Available side and extended component on Substitute side and click on add as shown below:


4) This will be added in the <proj>.jpx file.
5) In order to migrate this to instance, first move the xml and .class file related to extended BC4J component from <JDEV_USER_HOME>\myclasses to $JAVA_TOP.

6) Import substitution using this jpx import command.

This is only one time process and for further migration from instance to instance, we can do this from 'Functional Administrator -> Personalization -> Import/Export'.

If the migration is done first time to any instance, there is no need to bounce the server. However, if we are remigrating files at $JAVA_TOP, we have to bounce OA core and apache server using below commands:

   cd $ADMIN_SCRIPTS_HOME
   adapcctl.sh stop
   adoacorectl.sh stop
   adapcctl.sh start
   adoacorectl.sh start












Tuesday, 10 September 2013

19. Embedding ADF Region into OAF Page

Here, I have created an ADF read-only form on Deapartments table having navigation buttons and then embedded that region on Standard OAF Hello World page.
(Note: Before creating this, you must have JDeveloper 11g(for building ADF page) and correct JDeveloper patch for Oracle E-Business Suite version.
Also, it must be release 12.1.2 or later as rich container is not available in previous versions.)

Building ADF Page

1) Using 'New gallery', create a Fusion Web Application(ADF). This will create two projects (Model and ViewController).
2) Right click on Model and create new 'Business Components from tables'. Here, as we are creating only read-only form, we can skip step1 & 2 of this wizard and on step3 & 4, create read-only VO and AM receptively.

3) Similarly, right click on ViewController and create a new Page under JSF/Facelets category (RightADFDepartmentsPG.jspx)

4) Now, from data controls, drag DepartmentsVO1 and drop on the page created as ADF Read-Only Form.

5) Also, in web.xml, make the following change (change the param-value to never):
  <context-param>    
  <param-name>oracle.adf.view.rich.security.FRAME_BUSTING</param-name>
  <param-value>never</param-value>
  </context-param>
If this is not done, browser will not allow ADF region to appear on OAF page and will show an error message like 'This content cannot be displayed in a frame'.
6) Now right click on the page and run.

Creating function for the above ADF page in EBS

1) Set the value of 'External ADF Application URL' profile option at appropriate level (Site, Application, Responsibility, User) as shown below:
(ex: http://localhost:7101/ADFDemo-ViewController-context-root)

2) Go to 'Functional Administrator -> Core Services -> Functions -> Create Function' and enter the details as shown below:

3) Click Continue and enter page path as shown below:

4) Also, attach this function to the menu of responsibility from where you want to access this ADF Page.

Personalizing the Hello World page to embed the ADF Region

1) Go to Hello World page -> 'Personalize Page' link.
2) Create a new item of type 'Rich Container' as enter details as below:

3) Click on Apply and return to main page. Now the ADF region will appear on Hello World page:













Saturday, 27 July 2013

18. Using Code Templates in JDeveloper

While coding in JDev, we often use code templates. For example, for writing 'System.out.println();', we can write 'sop' then press ctrl+Enter.
We can also create our own code templates and then when required, instead of writing the complete code, we can simply use custom shortcuts for our code.

Here I have shown how to create and use these custom code templates.

Mostly we face a requirement to navigate from one page to another on button click and also passing some parameters along with that. Below are steps for creating template for this:

1) Go to 'Tools --> Preferences...'


2) On Preferences window, expand 'Code Editor --> Code Templates'.


3) Click on Add, enter shortcut and description. In the code tab, write the code which you want on that shortcut as shown below:


4) Also, if we want to import some classes for that code, we can write those in 'Imports' tab.


5) Now we only need to write this shortcut 'navOnBtn' then press ctrl+Enter. This will automatically replace that shortcut name with the complete code.








Wednesday, 19 June 2013

17. Calling JSP Page from OAF Page

1) Create a new JSP page. I have created the same in JDeveloper.
Right click on project --> new --> web tier --> JSP as shown below:


2) I created simple Hello World page as shown below in JSP :


3) To run the page from jDeveloper itself, we have to change the path of HTML root directory. This should point to the directory where JSP files are stored.
We can change this from project properties --> Project Content --> Web Application. 


4) Once the JSP page is created, migrate the same on server at $OA_HTML.

5) Compile the same using below command:
$FND_TOP patch/115/bin/ojspCompile.pl --compile -s <file_name>.jsp
This will compile the file on server.


6) Now we can either directly open the JSP page using this link:
http://<instancename>.<port>/OA_HTML/XXTest.jsp

or, we can call JSP page from any OAF page by simply setting destination URI of item like link or button.
for example, I created an item of type link on OAF page and set its destination URI property to /OA_HTML/XxJspTest.jsp:


Below is how the link will work:


Click on 'Open JSP' link. This will open our JSP Page:









Saturday, 4 May 2013

16. Controller Extension in OAF

Here is a simple example to show personaliztion and controller extension.

I have extended the functionality of HelloWorldPG .
(oracle/apps/fnd/framework/toolbox/tutorial/webui/HelloWorldPG.xml)

Seeded functionality of this page is:
User will enter his name or any text and on press of 'Go' button, the page will show a message by append 'Hello, ' in front of the name entered. If user click on button without entering anything in text field, still page will show a message 'hello, '.
Below is screenshot for the same:


Now we do these changes:
1) Using personalization, we will modify the prompt of text field (from 'name' to 'Enter Your Name: ').
2) Using controller extension, we will modify the message as : 'hello, ' + name + 'The message is from custom controller.'. Also we put a validation that name filed should not be empty while clicking on 'Go' button.

Below are steps for the same:

1) Create a new java class extending from standard controller.
Right click on xxcus --> new --> java class.
Enter the details as shown below:


The package for custom controller must follow standard conventions as:
oracle.apps.fnd.framework.toolbox.tutorial.webui.HelloWorldMainCO
xxcus.oracle.apps.fnd.framework.toolbox.tutorial.webui.XxcusHelloWorldMainCO

2) Write the below code in custom controller:

package xxcus.oracle.apps.fnd.framework.toolbox.tutorial.webui;

import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.toolbox.tutorial.webui.HelloWorldMainCO;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;

// here we are extending from HelloWorldMainCO
public class XxcusHelloWorldMainCO extends HelloWorldMainCO {

    public void processFormRequest(OAPageContext pageContext, 
                                   OAWebBean webBean) {

     if (pageContext.getParameter("Go") != null) {
         String name = pageContext.getParameter("HelloName");
         if (!("".equals(name.trim()))) {
           String message = 
            "Hello, " + name + " This message is from custom controller.";
           throw new OAException(message, OAException.INFORMATION);
        }
     } else {
        throw new OAException("Please enter your name.", 
                             OAException.ERROR);
     }
   }
}

3) Compile and move to server:
Compile the file and move the class file to unix box at 
$JAVA_TOP/xxcus/oracle/apps/fnd/framework/toolbox/tutorial/webui/

4) Attach this custom controller to your page:
Open HelloWorld page and click on 'Personalize Page' at the top right. This will show a page as below. Click on personalize pencil against the 'Message Component Layout: (MainRN)':



Change the controller property as shown below and click on apply:



5) Change prompt of text field:
Click on personalize pencil against Message Text Input: Name.


Here change the prompt property to 'Enter Your Name: ' at site level as shown below and click on 'Apply':


Finally, click 'Return to Application' link and all is done. Enter your name and press 'Go' button. It will show our custom message :



Also, the page will show error message if Go button is pressed when the field is empty:











Wednesday, 30 January 2013

15. Personalization, Extension & Customization in OAF

While dealing with Oracle EBS html based pages, we can modify or create completely new page using any of the below methods:

Personalization
======================
Personalization is the process of making changes to the User Interface (UI) from within an Oracle E-Business Suite Page.
Using 'Personalize Page' link or from 'Functional Administrator' responsibility, we can perform personalization.
'Personalize Page' link shows all the regions and items used in the page in hierarchical form for example as shown below:


















From here, we can modify/personalize almost any items/region using 'Personalize' icon. We can modify properties such as Prompt, Rendering of item, making fields Required and others as shown below:




















All the personalizations get stored in MDS (i.e. JDR_% tables) by creating a new document ID for the page. Thus any patch will modify the original document ID (standard one) and unlike forms these personalizations will not get removed.

Extenion
======================

There are not many things we can do using personalization such as changing the logic or control settings of the page. For these modifications we use extension. It is the process of making changes to the programmatic elements of an E-Business Suite form/page. It is possible to extend OA Framework-based pages either using controller extension or AM extension or by performing VO substitutions.

Controller extension
Oracle does not recommend to extend controller objects associated with regions in seeded EBS product pages. One reason is that controller code is subject to change at any time, and Oracle cannot guarantee that extended controller code will work after the updates.
However, we extend controller code quite regularly. For example, we need to create a web beans programmatically on the fly in the controller code instead of declaratively, which is not possible through personalization.
To extend a controller, first we create a new class file that extends the original controller’s Java class. Next, using personalization, we personalize the region to which the original controller is attached. Once in the personalization screen for the region, replace the existing controller with the newly created extended controller.
If in the extended CO class we override processRequest(), then OA Framework will invoke the overridden method in the custom class. OA Framework will not execute the method in the original controller class unless super.processRequest() is called in the extended class.

View Object Extension
Sometimes there is requirement to display additional information on screens that display data fetched from view objects. To do this, we need to do three things:
  • First, we need to create an additional field on the page using personalization.
  • Then, create a new view object. This new view object extends the existing view object, which is why it inherits all the features and columns of the existing view object. This is referred to as view object extension.
  • Later we create a substitution in JDeveloper; the substitution contains the directive to replace the existing view object with the new view object at runtime.
Entity Object Extension
We extend entity objects to add extra validation to some fields/records. We can also extend entity objects to assign default values to the attributes. Steps for extending the entity object are similar to those for extending view objects.

Application Module Extension
In AM, Oracle seeded code initiates PL/SQL JDBC calls. Sometimes, there is a need to enhance that PL/SQL call by some additional PL/SQL calls. In such cases, we can extend the Application Module. Steps for extending the AM are similar to those of extending a view object and entity object.
For example an Application Module has following methods:

public String method1(parameters) {....}
public boolean method2(parameters) {....}
public String method3(parameters) {....


Lets say we need to raise some business event if method2 returns false. So, we will code the extended Application Module as shown below:

public boolean method2(parameters) {

   if !(super.method2(parameters)) {
       // business logic comes here
   }

Customization
======================

Customization is the process of creating new OAF pages. While Oracle does provide tools to do this (i.e., JDeveloper 10g with OA Extension), this is the only and least supported option.






Thursday, 10 January 2013

14. Creating Graph in OAF

Here is an example of how to create a Bar Graph in OAF. Graphs are created with the graphTable region style.

1) Create a new OA page:
=========================
Right click on project (xxcus) --> New --> Web Tier --> OA Components --> select 'Page' item. Click OK. (This will open a popup window)
          Name: XxcusGraphDemoPG
          Package: xxcus.oracle.apps.fnd.graphdemo.webui

2) Create a new view object (VO):
=========================
Right click --> New View Object (This will open a wizard having 7 steps).

Step 1
Package: xxcus.oracle.apps.fnd.graphdemo.server
Name: XxcusEmpGraphVO
Choose the radio button 'Read-only Access' (as we are not performing any DML operation). Click Next.

Step 2
Enter the below query in 'Query Statement':
    select ename, sal from employee

Step 3
Generate Impl class for the view object.

Keep defaults for step 4, 5, 6 & 7 and click Finish. Save All.


3) Create a new Application Module (AM):
=========================

Step 1
Package: xxcus.oracle.apps.fnd.graphdemo.server
Name: XxcusGraphDemoAM. Click Next.

Step 2
Here we will add an instance of the VO created in (2). Select XxcusEmpGraphVO from 'Available View Objects' and shuttle it to 'Data Model' using ">" button.
Keep defaults for all other steps (3, 4). Click Finish.

4) Create a new Controller (CO):
=========================
Right click on pageLayout region and create a new controller
Name: XxcusGraphDemoCO
package: xxcus.oracle.apps.fnd.graphdemo.webui


5) Creating the Page Layout & Setting its Properties
=========================
1) Create a new region under pageLayout of type graphTable. This will automatically create a default graphs container. Also, it will add a graph to the graphs container along with two default graphData columns.

Now change the properties for each field from property inspector as shown below:

pageLayout:
     ID: pageLayoutRN
     AM Definition: xxcus.oracle.apps.fnd.graphdemo.server.XxcusGraphDemoAM
     Window Title: Employee Salary Graph Page
     Title: Employee Salary Graph

graphTable:
ID: graphTableRN
Graph render style: graph

set these properties for the graph:
ID: empSalGraph
Graph Type: vertical clustered bar
Title: Employee Name vs Salary
Size: Medium
X-axis label: Employee Name
set properties for graphData1:
ID: xAxisData
View Instance: XxcusEmpGraphVO1
View Attribute: Ename
Purpose in Graph: groupLabels (it represents data on X-axis)

set properties for graphData1:
ID: yAxisData
View Instance: XxcusEmpGraphVO1
View Attribute: Sal
Purpose in Graph: data (it represents data on Y axis)
Prompt: Salary

The declarative page structure in jDev will be similar to as shown below:


In PR method, we call a method of AM to intiate query:
public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
    super.processRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getRootApplicationModule();
    am.invokeMethod("initQuery");
}

Code for initQuery method in XxcusGraphDemoAMImpl.java file:
public void initQuery() {
    try {
        XxcusEmpGraphVOImpl vo = getXxcusEmpGraphVO1();
        vo.setMaxFetchSize(-1);
        vo.executeQuery();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

Below is how the page will appear: