Tuesday, 11 December 2018

Deploy OA Framework

How to Deploy OA framework in the Instance

Deployment of OA framework consists of 5 steps.
  • Deploying Class files and VO/EO/AM xml files
  • Deploying PG/RN xml files
  • Deploying jpr files for Substitution
  • Setup AOL to access the page
  • Restart the server

Let's look at these one by one.

Deploying Class files


The files such as
  • Controllers *CO.class
  • Application modules *AM.class
  • View Objects *VOImpl.class, *VORowImpl.class, *VO.xml
  • Entity objects *EO.xml, *EOImpl.java

should be deployed in the $JAVA_TOP/<path of your file>.

For eg:
if your files path in jdeveloper is
$jdev_home/myprojects/oracle/apps/ap/setup/webui/setupCO.java
then place your class files in the following path in the instance
$JAVA_TOP/oracle/apps/ap/setup/webui/setupCO.class


Deploying Page and Region files


The Page xml files(*PG.xml) and region xml(*RN.xml) files resides in the database. So you have to import the file into the database to make it work in the instance. Oracle application provides XMLExporter/XMLImporter to export and import page files from and to the database.

Deploy the files to the Instance

java oracle.jrad.tools.xml.importer.XMLImporter /home/prasanna/pages/SetupPG.xml -username <data base user name> -password <data base password> -dbconnection "(description = (address_list = (address = (community = tcp.world)(protocol = tcp)(host =<hostname> ) (port = <port id>)))(connect_data = (sid = <sid>)))"

This command will import the SetupPG.xml file into the database.


Extracting from instance

If you have done your personalizations in the developement instance and you want to deploy the personalizations into the production instance, then you can extract the personalization using XMLExporter command from the developement instance and Import the extracted xml file into the production instance in the same way you did for PG.xml files.

java oracle.jrad.tools.xml.exporter.XMLExporter /oracle/apps/ap/setup/webui/customizations/site/0/SetupPG -rootdir <destination path> -username <data base user name> -password <data base password> -dbconnection "(description = (address_list = (address = (community = tcp.world)(protocol = tcp)(host =<hostname> ) (port = <port id>)))(connect_data = (sid = <sid>)))"

The above command will export the SetupPG from the data base to your file system at the destination path as XML file (SetupPG.xml)


Deploying jpr files for Substitutions, if any


If you have extended EO, VO or AM and created substitutions in your project. Then you have to deploy your .jpx file into the instance.

java oracle.jrad.tools.xml.importer.JPXImporter $AP_TOP/xxx/Setup.jpx -username <data base user name> -password <data base password> -dbconnection "(description = (address_list = (address = (community = tcp.world)(protocol = tcp)(host =<hostname> (port = <port id>)))(connect_data = (sid = <sid>)))"


Setup AOL to access the page


In case your page is referred in existing pages of Oracle applications you can skip this step. But if you want to access the page as a new Function then follow these steps.


Create Function as
ID: XX_SETUP
Name: SETUP
Function type(HTML tab) : SSW
URL: OA.jsp?page=/oracle/apps/ap/XXX/SetupPG&parameter1=xx&parameter1=xx


Attach the function to a Menu
Attach the menu to a Responsibility

Restart the server


After deployement you cannot see the page immediately on the server instance. This is because your Pages and class files would be cached in the middle tier. So you have to bounce the apache.

$COMMON_TOP/admin/scripts/adapcctl.sh stop
$COMMON_TOP/admin/scripts/adapcctl.sh start

After this process, clear the cache from the functional administrator responsibility and this step is optional.

Some times we may need to restart the whole middle tier to see the depolyed pages in the instance.
To Restart the instance use following command

Stop the instance
cd $INST_TOP/admin/scripts
adstpall.sh apps/apps

Start the instance
adstrtal.sh apps/apps

UIX (User Interface XML) Framework

Oracle EBS uses:

  • UIX for UI Components (i.e. View part)
  • BC4J for business components (i.e. Model part)
  • And what OAF does is the programmatic binding among all these.

UIX framework is J2EE-based framework for building web applications and is based on MVC design pattern.
The main focus of UIX is the user presentation layer of an application. UIX is platform independent as it is implemented in the Java programming language. UIX development can be declarative, using uiXML, an XML language for creating UIX pages.

UIX includes a set of UI components and classes for rendering them:

UI Components: These are implemented as Java Beans. They include page layouts and simple UI objects that map to standard HTML controls, such as buttons, forms, and checkboxes. There are other complex components, such as trees, hide-show controls, LOV etc.

Renderers: These are Java classes for rendering the UI components to target clients/devices. For example, components are rendered as HTML for use in web browsers or as WML for use in mobile devices.
Classes for UIX Components are in the oracle.cabo.ui package.

uiXML: This is an XML language for programming UIX applications. uiXML provides a declarative way of creating web applications programmatically using UIX Java APIs. The pages, events, and any other items defined with uiXML elements are all transformed into Java objects behind the scenes. Below is an example of a uiXML element (button):


uiXML documents are written in a text format, where document represents page or a region.
Classes supporting uiXML are located in oracle.cabo.ui.xml andoracle.cabo.servlet.xml packages.

Pages in UIX
===================
On the browser, "page" is just collection of HTML elements. However, while in developing phase, concept of "page" can be more complex, depending upon the declarative way used to create the page and renderers used.

A UIX page consists of a hierarchical set of components known as UI nodes. Some nodes define visible components, such as buttons, images, text fields, while others organize the layout and appearance of other nodes.
Nodes can have parents and children, and multiple nodes together form a tree-like structure used to represent a page's logical structure.

For example, left part below figure shows a logical hierarchy of UI nodes and right part shows the same hierarchy rendered as an HTML page.













Now in UIX, there is a java class for each UI nodes. These classes implement the UINode interface in the oracle.cabo.ui package. The UINode interface contains methods for the characteristics of nodes, such as:
public int getIndexedChildCount(RenderingContext context);
public UINode getIndexedChild(RenderingContext context, int childIndex);
public Enumeration getAttributeNames(RenderingContext context);
public Object getAttributeValue(RenderingContext context, AttributeKey attrKey);

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, 27 June 2018

Time Card Layout Modification [Enablig New Field]


  1.    Time Card Layout Modification: -

1. Download the Seeded Layout File to Custom File.
2. Rename the Seeded Layout Name to Custom Layout Name
3. Create New Element
4. Create Element Link
5. Create Element Set of Type (Run Set)
6. Run Generate Flex field and Mapping Information
Summary for Adding New LOV Field in Payroll Timecard
7. Verify the DFF “OTL Information Types”
8. Define AK Attributes for State Prompt
9. Create Region Item in HXC_CUI_TIMECARD to map Attribute for State Prompt
10. Define AK Attributes for Columns and Prompts in LOV page
11. Create Custom AK Region for LOV and map Attributes for LOV Page
12. Migrate Regions in SQL Plus
13. Modify View hxc_cui_custom_lov1_v
14. Modify the CustomLov1VO.xml
15. Add Modified Code to .ldt
16. FNDLOAD the file
Add Element to Alternate Names
Change the Timecard Layout Preference to the new Layout
17. Create/Submit/Approve Timecard
18. Run “Transfer Time from OTL to BEE”
19. Run “BEE Batch Process”
20. Verify the Element Entries Created and its Input Values


S.NO
Layout Name
Display Layout Name
Oracle Standard LDT Names
1
PAYROLL-TIMECARD
XXCS US Payroll Timecard Layout
hxczzhxclayt0000.ldt
2
PAYROLL-CONFIRMATION
XXCS US Payroll Confirmation Layout
hxczzhxclayt0001.ldt
3
PAYROLL-HE-REVIEW
XXCS US Payroll OTLR Details Review Layout
hxczzhxclayt0005.ldt
4
PAYROLL-HE-NOTIFICATION
XXCS Payroll OTLR Details Notification Layout
hxczzhxclayt0051.ldt

    How to find the Layout File?

• How to find the Layout file for (.ldt) for “XXCS US Payroll Timecard Layout”
Layout files are stored in the following Path in UNIX.

$HXC_TOP/patch/115/import/US/

• Find Corresponding Layout (.ldt) File for “XXCS US Payroll Timecard Layout”

                         find -type f -exec grep -il "Payroll Timecard Layout" {} \;



-Please refer attached attachment .