Monday 18 March 2024

OAF Forms

 *)What is the Architecture of the OAF.

-------------------------------------------------------

OAF is based on the Model View Controller Architecture.


Model:

---------

The "Model" is where we handle the business logic. All the BC4J components in OAF comes under Model 

like AM (Application Module), VO (View Object), EO (Entity Object), VL (View Link) & AO (Association Object). 


View:

-------

The "View" is where application handles the user interface. 


Controller:

--------------

The "Controller" where application handles the user interaction. When we create a controller a java class file has been created. 


*)What are the Components of OAF Page?

-------------------------------------------------------------

EO: - "Entity Object" encapsulate business rules associated  with a row in a table. 

Entity object has direct link with Data base table. Application interact with Database with the help of EO.


VO: - "View Object" helps the application to deal with the EO. 

View Object may base on EO or it could be based on independent sql query which has no relation with the EO.


AM: -"Application Module" is a container which provide or manage access to the BC4J model object.

Application module has complete control on the Application page.

An OAF page cannot be run without the Application module. And we cannot access any object in the Page without the AM.


CO: -"Controller" responds user action and maintain application flow. Controller contains two Blocks.

We write our business logic in the controller. It helps to put validation and to meet out our business logic.


*)What are the Methods available in the Oracle Controller?

--------------------------------------------------------------------------

Process Request:

----------------------

When the page loads process request will fire. So, if we want to initialize some default values when the page load put this under Process Request.


Process form Request:

------------------------------

When we press the button, Process form request executed. So, if we want to execute some code after user press the Submit button we will put under this block.


*)What is SPEL in OAF?

------------------------------------

In Personalizations, we have two ways to change properties of the OAF Page Components like Rendered or Read Only or Required.


1.  One Way to hardcode a value of True/False during personalization. This is Static Personalization

2.  Second Way to do the personalization more dynamic with the help of 'SPEL'.

we can use a SPEL syntax to these properties via personalization. SPEL is nothing but an expression that returns TRUE or FALSE.


*)Can we run the OAF Page without the Application Module?

----------------------------------------------------------------------------

No, we cannot run the OAF page without the application Module. Application module is most important object in the OAF page to run in the Application. We can run the OAF page without VO, EO but cannot run without from AM.


*)How to Debug and See Log Messages in OAF Pages?

-------------------------------------------------------------------------

Step1:- You have to Enable 'FND: Diagnostics ' Profile option for the User in which you want to see these Log messages.

 

Step2:- If you want to Put the Custom Messages in your Controller then you can put these messages like below.

 

public void processRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)

    {

/*This is the Custom Message which will be show in OAF page in Oracle Application*/

      paramOAPageContext.writeDiagnostics(this, "XX Start PR ", 1); 

Step3:- After Enable the Profile Option Go to the Home page of your Application and go to 'Diagnostics' as below.


Step4:-  Then You need to Choose Diagnostic Option 'Show Log on Screen' as below.


*)What is Auto Customization Criteria in OAF ?

--------------------------------------------------------------------

Auto Customization is one of the property of the OAF search page Query Region.

When we create the Search Page in OAF through Query Region then Auto Customization is one of the Property of this Region ,

which decides how the Search Criteria will be created for the OAF Search Page. 

Auto Customization Criteria Sets through Construction Mode Property of the Query Region.


Query Region Construction Mode has three List of Values

1. Result Based Search

2.Auto Customization Criteria


*)How to do the Exception Handling in OAF?

-------------------------------------------------- ----------

There are 3 types of exceptions can be thrown on OAF pages (java).

 

a)Warning  : This will display the custom message and no effect in the oaf page execution

b)Information  : This will display the custom message and no effect in the oaf page execution

c)Error : This will display the custom message and has effect in the oaf page execution.

 

It stops the page execution by throwing message as an exception

 

Exception handling in oaf page has done through Try and catch block syntax.

 

Try Block :- All logic should be kept in a try block to handle exceptions.

In this block we do all our coding part , so that if any exception raised in the logic or coding part then it will be handled through catch block.

Catch Block – Once control find any exception in the try block, it goes to catch block. Catch block will be used to handle the raised exception.


*)How to get the Name of the Oaf Page Components?

----------------------------------------------------------------------

We need to put this Below code in the Controller Process Request Method and this will give the name of the components of the OAF page.



// This below code will get the name of all the objects of OAF page as a Parameter.


 Enumeration e = pageContext.getParameterNames();

// This below code will print the name of the objects and their values in sequence


      while(e.hasMoreElements())

      {

              parameterName = (String)e.nextElement();

        System.out.println( "Parameter Name=>" + parameterName + " Parameter Value=> " + pageContext.getParameter(parameterName));   

     

*)How to check the Value of View Object(VO) all Columns during Run Time of OAF Page ?

--------------------------------------------------------------------------------------------------------------

You must just put you code in the controller against the View object for which you want to know its complete details.


With the help of System.out.println() & Pagecontext.writediagnostics() function you can print everything

about the view object in the oaf page and you will get a good understanding of the object and you can do extension in right way.


OAApplicationModule am = pageContext.getApplicationModule(webBean);

   ViewObject vo = am.findViewObject("SupplierVO");


          if (vo!=null) {

vo.executeQuery();


              while (vo.hasNext()) {

                      Row row = vo.next();

          String rowDataStr = "";


 // To Check How many attributes (columns) is the View Object using?


                      int numAttrs = vo.getAttributeCount();

                      // Column /Attributes numbers start with 0, not 1.


                      for (int columnNo = 0; columnNo < numAttrs; columnNo++) {

                        // See also Row.getAttribute(String name).

                        Object attrData = row.getAttribute(columnNo);

                        rowDataStr += (attrData + "\t");

                      }

                      pageContext.writeDiagnostics(this,rowDataStr,2);

                       System.out.println( "Data of View Object SupplierVO:"+rowDataStr);

                   }}

 

*)How many Types of Search Pages we can Create in the OAF ?

-----------------------------------------------------------------

In OAF , We can create Three Types of Search Pages in OAF Page to search the Page in the Result type table formats.

These are the Below search Types available in the OAF.

1.Query Based Search Page.

2.Advanced Search Page.

2.Manaul Search Page.

 

*)What are the Steps of the VO Extension in OAF ?

------------------------------------------------------

 VO Extension Steps

1.Indentify that Which VO we need to Extend

2.Download the VO from Oracle Java_Top Location to Your Local Desktop under My Projects folder of Your JDev setup.

3.Then We create New view Object(VO) which extends the Standard View Object.

4.Then We substitute the New Custom View Object with the Standard View Object.

5.Then we upload the New Custom View Object to Oracle Java_Top Location.

6.Then we Register the New View Object in the Oracle application Through XML Importer script.

8.After Import/Register , We add the new field in the OAF page through Personalization

   and then give reference in this Field for the New Custom View Object(VO).


  

   

No comments:

Post a Comment