Friday, January 10, 2014

Create a Simple Search Page


After doing the initial setup we will now create a simple search page.

1> Create a database Connection EX: AKDEV
      > Connections Navigator
      > Connection > New Database Connection
       > It will launch Create Database Connection Wizard
          > Click on Next and give the Connection Name


       > Provide the database access details and check 'Deploy Password'

 
       > Provide connection details from dbc file

 
       > Test the connection

       > Create a new workspace
          > Applications Navigator
          > Applications > New OA Workspace...


       > Workspace name (Ex: AKOAWorkspace.jws)
    Note: Directory name will be defaulted based on your JDEV_HOME environment variable setting


          > Provide the Project name and default package name
            (Ex: XXHWOAProject
                  : xxhw.oracle.apps..per.nic.schema.server -- please follow the naming convention)
 

          > Choose the database connection created above


        > Select appropriate dbc file.


        > Provide the application user access details and application short name and responsibility key.
Note: Responsibility should be attached to the user.


   
          > Done with Project wizard

         > Update Project property
            > Oracle Applications > Run Options > OaDeveloperMode and OADiagnostic

           > Now we will create an Entity object to the project created
              > New > Business Tier > ADF Business Components > Entity Objects



          > Provide entity name (xxhwhrnicEO), package (xxhw.oracle.per.nic.schema) and
             database  Object (hw_custom.xxhw_hr_nic_data)

***Sometimes database schema name and schema object field is not enabled.
Do the following steps:
1. Before trying to create the EO, first open New > Business tier > ADF Business Components > Business Components from Tables.
2. Click OK and it will ask you to connect.
3. Connect and then cancel out of the wizard and try again.

         > Next

        > Make any column as primary key else by default it will make rowid as primary key


           > Select Generate Java File under Entity Collection and Entity Object class
              and Accessors, create method and Remove Method

         > Lets create a View object (xxhwhrnicVO) in this wizard only in
            package xxhw.oracle.apps.per.nic.server

           > Done with EO




                > Adding an Application Module (xxhwhrnicAM)
                   > Project > New > Business Tier > Application Module

                     Package as same as the VO xxhw.oracle.apps.per.nic.server

                   > Attach the above created VO to the AM



              > Select Generate Java Class for AM Class and done with AM



                 
 >> We will create a search page now
          > Project > New > Web Tier > OA Components > Page

          > Page name (xxhwhrnicPG) under package (xxhr.oracle.apps.per.nic.webui)




                  > Change ID (PageLayoutRN) and AM definition (Above Created AM),
                      Window Title and Title (Ex: National Insurance Contribution) of the page


            > Now add Query region and Result table
               > Page > New > Region


                > Change ID(QueryRN) Region Style(query) and Construction Mode(ResultsBasedSearch)

                > Create New region using wizard to the QueryRN

          > Select AM and VO

          > Select region style as 'Table'


           > Select appropriate columns from table



             >  Change Prompt and style
                  >> Change style to messagestyledtext if you want to make the column
                        un-updatable, else messageTextInput


               > Finish




            > Make the changes for columns for search Allowed/sort allowed


                > Now compile the page



            > It may give error for who columns methods missing in EOImpl class like below

Error(17,14): class xxhw.oracle.apps.per.nic.schema.xxhwhrnicEOImpl should be declared abstract; it does not define method setLastUpdateLogin(oracle.jbo.domain.Number) of class oracle.apps.fnd.framework.server.OAEntityImpl


          > Add below codes to EOImpl java file (xxhwhrnicEOImpl.java)

public void setLastUpdateLogin( oracle.jbo.domain.Number n ) {}
public void setLastUpdateDate( oracle.jbo.domain.Date n ) {}


            > Save all and run the page again
            > Click on 'Go', it should show all the relevant data


>> Lets add some update functionality to this page Create a simple update page
 

Getting started with OAF

I am writing some basic OAF related articles for beginners.

Lets get start with Jdeveloper installations and setup required to build/extend OAF page.

1> How to know which version of Jdeveloper patch to download.
    > Login to your Oracle application.
    > On Homepage at bottom left click on 'About this Page'
    > Click on tab 'Technology Components'

    > Note down the OA Framework and Oracle OA Components Versions.
    > Download the related Jdev patch from Oracle metalink.
2> Now unzip the downloaded patch it should have three subfolders jdevbin, jdevdoc and jdevhome  and a file OAEXT_README.txt.
3> Rename the parent folder as per your convenient.(Ex: Jdeveloper).
4> Configure the JDEV_USER_HOME Environment Variable
     > Select My Computer, right-click and select Properties.
     > In the System Properties dialog, select the Advanced tab.
     > In the Advanced page, select the Environment Variables... button.
     > In the Environment Variables dialog, select the New... button at the User variables      for <username> box.
    > In the New User Variable dialog, enter JDEV_USER_HOME in the Variable Name field. Set the Variable Value field to path of jdev folder.
      (Ex: C:\Jdeveloper\jdevhome\jdev)
5> Get the database connection file (.dbc) from $FND_SECURE directory.
     
     > Put this file to <Path of Jdeveloper install directory>\jdevhome\jdev\dbc_files\secure directory   
        (Ex : C:\Jdeveloper\jdevhome\jdev\dbc_files\secure)
6> Create a shortcut at desktop and launch Jdeveloper
     > Jdeveloper should be launched from <Path of Jdeveloper install  directory>\jdevbin\jdev\bin\jdevw.exe.
7> Double check the OA Framework and Oracle OA Components Versions
     > Help > about > Version

 >> Now we will create a simple search page Create a simple search page