callable statement

217
Callable Statement & Prepared Statment in OAF oaf ================== https://blogs.oracle.com/prajkumar/entry/oaf_developer_guide Callable Statement in OAF To Call a Procedure : OADBTransactionImpl txn = (OADBTransactionImpl)pageContext.getApplicationModule(web Bean).getOADBTransaction(); CallableStatement cs = txn.createCallableStatement("begin :1 := check_Approval_Status(:2,:3); end;", OADBTransaction.DEFAULT); try { cs.registerOutParameter(1, Types.VARCHAR); cs.setString(1, "retStatus"); cs.setInt(2, scoreCardId);

Upload: nagarajuvcc123

Post on 27-Jan-2016

270 views

Category:

Documents


4 download

DESCRIPTION

Callable Statement

TRANSCRIPT

Page 1: Callable Statement

Callable Statement & Prepared Statment in OAF

 

oaf==================https://blogs.oracle.com/prajkumar/entry/oaf_developer_guide

 

 

 

 

 

 Callable Statement in OAF

To Call a Procedure :

        OADBTransactionImpl txn =            (OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction();

        CallableStatement cs =            txn.createCallableStatement("begin :1 := check_Approval_Status(:2,:3); end;",                                        OADBTransaction.DEFAULT);

        try {            cs.registerOutParameter(1, Types.VARCHAR);            cs.setString(1, "retStatus");            cs.setInt(2, scoreCardId);            cs.setInt(3, personId);            String outParamValue = null;            cs.execute();            outParamValue = cs.getString(1);

Page 2: Callable Statement

            cs.close();            if (outParamValue.equals("N")) {                OASubmitButtonBean oas =                    (OASubmitButtonBean)webBean.findChildRecursive("MgrTransfer");                oas.setDisabled(true);            }

        } catch (SQLException sqle) {            throw new OAException("Error in Staffing Query",                                  OAException.ERROR);        }        Example 2 :

OADBTransactionImpl OADBTxn =                                (OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction();                            String query_String = new String();                            query_String =                                    "BEGIN insert_into_table(:1,:2,:3,:4,:5);END;";

                            OracleCallableStatement stmt =                                (OracleCallableStatement)OADBTxn.createCallableStatement(query_String,                                                                                         -1);                            try {                                stmt.setInt(1, jObjectiveId);                                stmt.setString(2, jName);                                stmt.setInt(3, jScorecardId);                                stmt.setString(4, jGroupCode);                                stmt.setInt(5, jOwningPersonId);                                stmt.execute();                                stmt.close();                            } catch (SQLException e) {                    throw new OAException("Error in Staffing Query : " +                                          e, OAException.ERROR);                            }       

Page 3: Callable Statement

  To call a Function            OADBTransactionImpl txn = (OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction();                        CallableStatement cs =                           txn.createCallableStatement("begin :1 := xx_pra_func(:2); end;",OADBTransaction.DEFAULT);                         try {                           cs.registerOutParameter(1, Types.VARCHAR);                           cs.setString(1, "ValuesI");                   cs.setInt(2, 100);                           String outParamValue = null;                           cs.execute();                           outParamValue = cs.getString(1);                           cs.close();                   throw new OAException("Function us "+outParamValue);                        } catch (SQLException sqle) {                   throw new OAException("Error in Staffing Query", OAException.ERROR);              }   

 Prepared Statment in OAFOADBTransactionImpl OADBTxn =                                (OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction();                try {                    Connection conn =

Page 4: Callable Statement

                        pageContext.getApplicationModule(webBean).getOADBTransaction().getJdbcConnection();                    String Query =                        "select nvl((SELECT approval_status from apps.XX_SAMPLE_TABLE" +                        " where objective_id=:1),'Approved') status from dual";                    PreparedStatement stmt = conn.prepareStatement(Query);                    stmt.setInt(1, objectiveId);                    for (ResultSet resultset = stmt.executeQuery();                         resultset.next(); ) {                        pageContext.writeDiagnostics(this, "Query Executed",                                                     1);                        String result = resultset.getString("status");//Get the result of the query and store in the string result                    }                } catch (Exception exception) {                    throw new OAException("Error in Staffing Query" +                                          exception, OAException.ERROR);                }     

 

Execute sql script in OAF

Saturday, August 27, 2011

Execute sql script in OAF

 

// Required import packages import oracle.apps.fnd.framework.server.OADBTransaction;import oracle.apps.fnd.framework.webui.OAPageContext;import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;import oracle.apps.fnd.framework.OAException;import oracle.apps.fnd.framework.OAApplicationModule;

Page 5: Callable Statement

import oracle.apps.fnd.framework.webui.beans.OAWebBean;    import oracle.jbo.domain.Number;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.ResultSet;//

try   {    Connection conn = paramOAPageContext.getApplicationModule(paramOAWebBean).getOADBTransaction().getJdbcConnection();

    String Query ="SELECT empId resultId,empName resultName,empPosition resultPos from XXXXX_TABLE WHERE DeptId=:1";                                        PreparedStatement stmt = conn.prepareStatement(Query);                

    stmt.setInt(1, departmentId);                                        

                                        for (ResultSet resultset = stmt.executeQuery(); resultset.next(); )    {            int employeeId = resultset.getInt("resultId");        String employeeName  = resultset.getstring("resultName");        String employeePosition = resultset.getString("resultPos");    }

    stmt.close();                                               

Page 6: Callable Statement

   }catch(SQLException sqle)   {       throw new OAException("Exception Block"+sqle);   } 

 

Real time Project OAF

Real time Project

 

PROJECT:1

Create a customer search page as shown and then link to create customer page

Page 7: Callable Statement
Page 8: Callable Statement

Create Header Table     CREATE TABLE po.xxcustomer_rebate_header   ( header_id                    NUMBER   , contract_number            VARCHAR2(80)   , division                VARCHAR2(80)   , party_name                varchar2(100)   , contact_person            VARCHAR2(80)   , level1_from            NUMBER   , level1_to                NUMBER   , level2_from            NUMBER   , level2_to                NUMBER   , level3_from            NUMBER   , level3_to                NUMBER   , level4_from            NUMBER   , level4_to                NUMBER

Page 9: Callable Statement

   , advertising_rebate        NUMBER   , freight_deduct            NUMBER   , cash_discount            NUMBER   , updated_flag            VARCHAR2(3)   , accrued_flag            VARCHAR2(3)   , creation_date            DATE   , created_by            NUMBER   , last_update_date            DATE   , last_update_login            NUMBER   , last_updated_by            NUMBER   , commments                VARCHAR2(1000)   , contract_start_date        DATE   , contract_end_date            DATE   , contract_expiry_date        DATE   , delivered_by            VARCHAR2(80)   , received_by            VARCHAR2(80)   , contract_attachment        BLOB   , bill_to_location                    varchar2(100)   , ad_payment_type            VARCHAR2(40)   , ad_payment_period            VARCHAR2(40)   , vr_payment_type            VARCHAR2(40)   , vr_payment_period            VARCHAR2(40)   , paid_flag                VARCHAR2(3)   , file_name             VARCHAR2(80)            );    1. Create synonym apps. xxcustomer_rebate_header for po.xxcustomer_rebate_header2. Create sequence po. xxcustomer_rebate_header_con_seq start with 100003. Create synonym apps. xxcustomer_rebate_header_con_seq 

for po.xxcustomer_rebate_header_seq4. Create sequence po. xxcustomer_rebate_hdr_seq start with 1005. Create synonym apps. xxcustomer_rebate_hdr_seq for po. xxcustomer_rebate_hdr_seqCreate Line table      CREATE TABLE po.xxcustomer_rebate_line

    ( line_id                NUMBER   , header_id                NUMBER   , product_code            VARCHAR2(80)   , level1_amt            NUMBER   , level1_break            VARCHAR2(3)   , level2_amt            NUMBER

Page 10: Callable Statement

   , level2_break            VARCHAR2(3)   , level3_amt            NUMBER   , level3_break            VARCHAR2(3)   , level4_amt            NUMBER   , level4_break            VARCHAR2(3)   , creation_date            DATE   , created_by            NUMBER   , last_update_date            DATE   , last_update_login            NUMBER   , last_updated_by            NUMBER     ); 

1.Create synonym apps. xxcustomer_rebate_line_seq for po.xxcustomer_rebate_line_seq2. Create sequence po. xxcustomer_rebate_line_seq start with 103.Create synonym apps.xxcustoemr_rebate_lilne_seq for po.xxcustomer_rebate_line_seq               

INSERTDEVELOP SEARCH PAGE Name   As: XxcustomerSearch PageStep1

1) Create Page (.jws,.jpr,bc4j,Am,Page,Attacht Am to Page) (window title, Title)

2) Rt click on Main RN---- New RN— Style—MsgCompnent, properties: Row 1, Coloum 3   Rt click Msg Compent RN—Create 3 ItemsItem1 -   id &prompt: Party Name,Item2 -   id &prompt: Division,Item3 -   id &prompt: Contract Number,3) Rt click MainRN –NewRN –Style ---RowlayoutRNItem1 - id & Prompt—Go                     Style: Submit ButtonItem---Style: Spacer               Width: 10Item3-   Id & Prompt –Clear           Style: Submit ButtonItem---Style: Spacer               Width: 10Item2 - id & Prompt—Create Rebate    Style: Submit Button4) Rt click Main RN –New RN—Style: TableItem1 -   id &prompt: Party Name,          Properties: ViewInstacne & View Attribute     

Item2 -   id &prompt: Division,         Properties: ViewInstacne & View Attribute     Item3 -   id &prompt: Contract Number Properties: ViewInstacne & View Attribute

Page 11: Callable Statement

Step-2Create VO In. Server for Search Page Name as: XxcustomerSearchVO                              Attach VO to AM—By Using this Query      (Select party_name, division, contract_number from po.xxcustomer_rebate_header Where party_name like nvl (:1, party_name)And division like nvl (:2, division)And contract_number like nvl (:3, contract_number))ignore now

If you want Deleting the Customer Information from Data Base permanently use the Code

(We can modify in same XxcustomerSearchVO)                        

a. Expand...Schema Server – Send to xxcustomer_rebate_header (It’s  created for HeaderEO)b. Select Attribute and Suffield like   -- Party_Name (xxcustomer_rebate_headerEO:Party_Name)   -- Division (xxcustomer_rebate_headerEO: Division)   -- Contract _Number (xxcustomer_rebate_headerEO: Contract _Number)   -- Headerid (xxcustomer_rebate_headerEO: Headerid)c. Select Query  Select xxcustomer_rebate_headerEO. Party _Name,             xxcustomer_rebate_headerEO. Division             xxcustomer_rebate_headerEO. Contract _Number             xxcustomer_rebate_headerEO. Headerid  From  xxcustomer_rebate_header xxcustomer_rebate_headerEO Where xxcustomer_rebate_headerEO.Party _Name like nvl(:1,                                                                            xxcustomer_rebate_headerEO. Party _Name)            xxcustomer_rebate_headerEO.Division like nvl(:1,                                                                            xxcustomer_rebate_headerEO. Division)            xxcustomer_rebate_headerEO. Contract _Number like nvl(:1,                                                                            xxcustomer_rebate_headerEO. Contract _Number)            xxcustomer_rebate_headerEO. Headerid like nvl(:1,                                                                            xxcustomer_rebate_headerEO. Headerid)

Step-3             Expand AM Node –Double click on AMImpl..Java –write the code ( To Mapping the VO Attribute To Regions Items )     Import these Statements from Controller (copy & Past)

Page 12: Callable Statement

   import oracle.apps.fnd.framework.webui.OAPageContext;

   import oracle.apps.fnd.framework.webui.beans.OAWebBean;

 public int searchparams(OAPageContext pc,OAWebBean wb)

{String cusname="";String divison="";String contractno="";int flag=0;XXSunCustomerSearchVOImpl vo=getXXSunCustomerSearchVO();

if(pc.getParameter("CName")!=null&&!pc.getParameter("CName").equals("")){ cusname=pc.getParameter("CName"); vo.setWhereClauseParam(0,cusname); flag=1;}else{ vo.setWhereClauseParam(0,null);} if(pc.getParameter("Division")!=null&&!pc.getParameter("Division").equals("")){ divison=pc.getParameter("Division"); vo.setWhereClauseParam(1,divison); flag=2;}else{ vo.setWhereClauseParam(1,null);}

 if(pc.getParameter("ContractNumber")!=null&&!pc.getParameter("ContractNumber").equals("")){ contractno=pc.getParameter("ContractNumber"); vo.setWhereClauseParam(2,contractno); flag=3;}else{

Page 13: Callable Statement

 vo.setWhereClauseParam(2,null);}

System.out.println("print flag value"+flag);return flag;}

Step-4Create Controller for XxcustomerSearchPage    Rt Click On Main RN –Set New Controller   Name As: XXcustomerSearchCOWe have to import one statementxxdel.oracle.apps.po.xxcustomer_rebate_project.server.Xxcustomer_Rebate_projectAMImpl;Write this code After Process Form RequestXXSunCustomerRebatesAMImpl  am=(XXSunCustomerRebatesAMImpl) pageContext.getApplicationModule(webBean);   if(pageContext.getParameter("Go")!=null)   {     am.searchparams(pageContext,webBean);     am.getXXSunCustomerSearchVO().executeQuery();   }

Page 14: Callable Statement

Step-7If we Want to Create LOV’s, Drop Down List’s, Entity Object’s - Should Create BC4J’sUnder .jpr  1) Rt click on .jpr---New Business Component ---Bc4j…..poplist.server      a. Rt Click On …poplist.Server –New View Object  Name As: DivisionVO ---Next—Next  b. Select Query   Select 'IT' division from dual  Union  Select 'Accounting' division from dual  Union  Select 'Finance' division from dual   -----Next---Finish  c. Attach VO to AM

 2) Rt click on .jpr---New Business Component---Bc4j…Lov.Server

Page 15: Callable Statement

  Rt Click On …poplist.Server –New View Object Name As: CustomerNameLOVVO     ---Next—Next     Select customer name from RA_customers -----Next---Finish  Attach VO to AM  3) Rt click on .jpr---New Business Component---Bc4j…Schema. Server   Create EO for Header   Rt click on...Schema bc4j –create new Entity Object ---Next--     A. Check on synonym     B. Copy the Synonym from header table & past into the               Schma Object: xxcustomer_rebate_header     C. Place the cursor on Name field table Name Automatically will generate          We should end with    EO—Next—Next     D. Check the Primary Key in Check Box Next     E. under Generate Method— checks the all check boxes –Next—next—finish  Create EO   for Line  Rt click on …Schema bc4j –create new Entity Object  ---Next--     a. Check on synonym     b.Copy the Synonym from header table & past into the            Schma Object: xxcustomer_rebate_line     c.Place the cursor on Name field table Name Automatically will Generate        We should end with    EO—Next—Next     d.Check the Primary Key in Check Box  Next     e.Under Generate Mehod—we should check the all check boxes –Next—Next—Finish

Step-8Create VO Based On EO for Header  Right Click on ….Server Bc4j Create VO Name As:Xxcustomer_Rebate_hdrVO  ----NextExpand the Schema Node Chose the Header EO and Send the Select page, nextChose the all Columns and Send the Select Page --- Next---Next----Finish.Step-9Create VO Based On EO for LineRight Click on ….Server Bc4j Create VO Name As: Xxcustomer_Rebate_lineVO ----Next

Expand the Schema Node  Chose the Header EO and Send the Select page,  NextChose the all Columns and Send the Select Page --- Next---Next----Finish.

Page 16: Callable Statement

Develop One Create Page Name As: XxcustomerCreatePage

Step-5

1. Create Page (.jws,.jpr,bc4j,Am,Page,Attacht Am to Page) (window title, Title)

 Select  XxcustomerCreatePage   For Header   2) Rt click on Main RN –New RN-Style—Table Layout       Rt click on Table Layout RN—New Row Layout       Rt click on Row Lay out RN—New—Cell Format       Rt click on Cell Format RN—New—Region Using Wizard       Select HeaderVO—Next—Region Style: Default Double Column—Next

Page 17: Callable Statement

       As per our Requirement Choose the Columns.

  3) Rt click on Row Layout RN—New Cell Format       Rt click on Cell Format RN—New-Region Using Wizard       Select Header VO Region Style: Default Single Column As per our Requirement Choose the Columns.

                  

4) Under Cell Format RN—Select Default Single Column RN   In Properties Visual Text: Qualifying Sales ($) Levels

   Under Cell Format RN –create Item Id & Prompt: Comments

                     Properties: Maximum Size: 1000                     Length: 100                      Height: 3

Page 18: Callable Statement

Step-5 Contn………………..Select XxcustomerCreatePage   inRegion4 (Default Double Column)   Under Region4 Select the Item: Party Name Change Style As: Message lovinput  Under Party Name 1 Region will be created   RT click on Region—New—table using wizard—Select CustomerNameLOVVO—Next  Next—Send the Customer Name –Next---Finish  In Customer Name Properties Mapping         Lov Region item: Customer Name        Return item       : Party Name        Criteria item       : Party Name           Follow the Same Steps for BilltoLocation

For Lines5) Rt click Main RN –New RN Style: Advance Table   View Instant: Select Line VO   Rt click on Advance Table RN—New—Column   Rt click on Column—New—Item                 properties: View Attribute   Rt click on Column Header—New---Sort able Header     Create Prompt    (Create more Columns, Items & Column Headers for Rest of Things)

Page 19: Callable Statement

     6) Rt click on Main RN—New RN Style: Page Button Bar         Under this RN—Create 3 Items         Item1---Id & Prompt             save                      Style: Submit Button         Item2----Style----Spacer        Item3—Id&Prompt         Go To Search           Style: Submit Button

Contd. Select XxcustomerCreatePage   inRegion4 (Default Double Column)   e. under Region4 Select the Item: Division Change Style As: Message Choice      In Properties Pick list View Instance: DivisionVO (Copy from AM)              Pick list Display Attribute: Division          (Column Name)                 Pick list Value Attribute: Division           (Column Name)

Page 20: Callable Statement

Step-6         In OAF call one Page to another Page – Use this Parameters  

(Link B/W Search Page and Create Page)Open: XxcustomerSearchCOImport one statement   import oracle.apps.fnd.framework.webui.OAWebBeanConstants;

   Write this code after form Request      if (pageContext.getParameter("CreateRebate")!=null)   {   pageContext.setForwardURL("OA.jsp?page=/xxdel/oracle/apps/po/xxcustomer_rebate_project/webui/Xxcustomer_Rebate_CreatePG",( Here Take the Crate Page URL)                         null,                         OAWebBeanConstants.KEEP_MENU_CONTEXT,                         null,                         null,                         true, // Retain AM                         OAWebBeanConstants.ADD_BREAD_CRUMB_NO,                                OAWebBeanConstants.IGNORE_MESSAGES);   }

Step-10

Create Sequence for the Header Table Write Code in AMImpL..Java Expand the AM Node Write the code in AMImpL..Java

Import 3 statements       import oracle.apps.fnd.framework.server.OADBTransaction;       import oracle.jbo.Row;      import oracle.jbo.domain.Number;

public void customerheader() {  Xxcustomer_Rebate_hdrVO Impl vo=get  Xxcustomer_Rebate_hdrVO  ();    OADBTransaction tr=getOADBTransaction();  if(!vo.isPreparedForExecution())  {    vo.executeQuery();  }  Row row=vo.createRow();  vo.insertRow(row);

Page 21: Callable Statement

  Number ctno=tr.getSequenceValue("xxcustomer_rebate_seq");  vo.getCurrentRow().setAttribute("ContractNumber", ctno); String hid=tr.getSequenceValue("xxcustomer_rebate_header_seq").toString();  vo.getCurrentRow().setAttribute("HeaderId", hid);  }Step-11Create Controller for Create Page Name As: XxcustomerCreateCOTo Generate Sequence for HeaderUder this call the header method from AMImpl    Import one statementimport xxdel.oracle.apps.po.xxcustomer_rebate_project.server.Xxcustomer_Rebate_projectAMImpl;

Write the Code in Process Request   Xxcustomer_Rebate_projectAMImpl am=(Xxcustomer_Rebate_projectAMImpl)pageContext.getApplicationModule(webBean);   am.customerheader(); 

Step-12Create Add Button for LinesSelect Create Page In Advance Table RN—New—FooterRt click on Footer—New—AdtableRow      Properties: Add Rows Lable: Add Another Row              Rows to Add: 1              Insert Rows Automatically: FalseStep-13To Create Sequence for Lines, Write the Code in AMIpmL.Javapublic void customerline()  {    Xxcustomer_Rebate_lineVO Impl vo= get  Xxcustomer_Rebate_lineVO  ();    Xxcustomer_Rebate_hdrVO Impl  vo1=get  Xxcustomer_Rebate_hdrVO  ();    OADBTransaction tr=getOADBTransaction();    vo.setMaxFetchSize(0);    Row row=vo.createRow();    vo.insertRow(row);    Number lineid=tr.getSequenceValue("xxcustomer_rebate_line_seq");    vo.getCurrentRow().setAttribute("LineId",lineid);    String headerid=vo1.getCurrentRow().getAttribute("HeaderId").toString();    vo.getCurrentRow().setAttribute("HeaderId",headerid);   

Page 22: Callable Statement

  }

Step-15In XxcustomerCreatePage after Enter the Customer Information we have to saveOpen XxcustomerCreateCOWrite the code After Process Form RequestXxcustomer_Rebate_projectAMImpl am=(Xxcustomer_Rebate_projectAMImpl)pageContext.getApplicationModule(webBean);  if(pageContext.getParameter("Save")!=null) {     am.getOADBTransaction().commit();     throw new OAException ("record saved successfully",OAException.CONFIRMATION);   }

Step-14Code for Add Button & Generate Sequence for Lines Write the Code inXxcustomerCreateCOAfter Process Form Request if(ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))   {     am.customerline ();   }

Step-16Link B/W XxcustomerCreatePage to XxcustomerSearchPageWrite the code In XxcustomerCreateCO Import one statemetimport oracle.apps.fnd.framework.webui.OAWebBeanConstants;After Form Requestif(pageContext.getParameter("GoTOSearch")!=null)    {       pageContext.setForwardURL("OA.jsp?page=/xxsun/oracle/apps/po/newrebates/webui/XxcustomerCreatePage ",                              null,                              OAWebBeanConstants.KEEP_MENU_CONTEXT,                              null,                              null,                              false, // Retain AM                             OAWebBeanConstants.ADD_BREAD_CRUMB_NO, 

Page 23: Callable Statement

                              OAWebBeanConstants.IGNORE_MESSAGES);     }

Step-17Develop One Update Page Name As: XxcustomerUpdatePageFollow the Same Steps for Update Page Which is using in XxcustomerCreatePageAs per Our Requirements

UpdateStep-18Select XxcustomerSearchPage    In Table Region—Create 1 Item      Id & Prompt: Edit    Style: ImageIn Properties:    1) Image URL: Updateicon-enable.gif (take from path OA-Media)        2) Action Type: Fire Action (ones create Action Type Event will be Create)        3) Event: update (if we want we can change the Event Name)         4) Parameters: click here one window will open (it will Pass Value Dynamically)

Name                             ValuePheaderid (Variable)            ${oa. XxcustomerSearchVO1.HeaderId}      --- OK                            (SearchVO-take from AM) (Attribute Name)

Check VO and add HeaderId **Step-19Create Controller for XxcustomerUpdatePage Name as:  XxcustomerUpdateCO Follow the Same Steps where in XxcustomerCreateCOFor Update the customer Information write this code inXxcustomerUpdateCO

In Process request    {         String headerid=pageContext.getParameter("pheaderid").toString();               (variable)                (Spell variable)     String wherecondition="HEADER_ID='"+headerid+"'";                (DataBaseColumnName)     am.getXxcustomer_Rebate_hdrVO1().setWhereClause(wherecondition);     am.getXxcustomer_Rebate_hdrVO1().executeQuery();     am.getXxcustomer_Rebate_lineVO1().setWhereClause(wherecondition);           am.getXxcustomer_Rebate_lineVO1().executeQuery();   }

Page 24: Callable Statement

DeleteStep-20Select XxcustomerSearchPage    In Table Region—Create 1 Item      Id & Prompt: Delete        Style: ImageIn Properties:    1) Image URL: deleteicon_enable (take from path OA-Media)        2) Action Type: Fire Action (ones create Action Type Event will be Create)        3) Event: delete (if we want we can change the Event Name)         4) Parameters: click here one window will open (it will Pass Value Dynamically)

Name                                 ValuePdelete (Variable)                ${oa. XxcustomerSearchVO1.Headerid}      --- OK                              SearchVO-take from AM) (Attribute Name)Step-21In AMImpL.Java    import this packageimport oracle.jbo.RowSetIterator;import oracle.apps.fnd.framework.webui.OADialogPage;import java.util.Hashtable; import java.io.import oracle.apps.fnd.framework.OAViewObject;import xxdel.oracle.apps.po.xxcustomer_rebate_project.server.Xxcustomer_Rebate_projectVORowImpl;

public void deleteHederslines(String headerId){int programToDelete = Integer.parseInt(headerId);OAViewObject vo = (OAViewObject)getXxcustomer_Rebate_projectVO1();Xxcustomer_Rebate_projectVORowImpl row = null;

 int fetchedRowCount = vo.getFetchedRowCount();

RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");

if (fetchedRowCount > 0) { deleteIter.setRangeStart(0); deleteIter.setRangeSize(fetchedRowCount);for (int i = 0; i < fetchedRowCount; i++){row = (Xxcustomer_Rebate_projectVORowImpl)deleteIter.getRowAtRangeIndex(i);Number primaryKey = row.getHeaderId();if (primaryKey.compareTo(programToDelete) == 0){

Page 25: Callable Statement

row.remove();getTransaction().commit(); break;       }     }   }deleteIter.closeRowSetIterator();}Step-22

Create Message in Apps to Handle Exceptions in OAFLogin into Oracle Applications

Responsibility: Application Developer Navigation: Application—MessageName: XX_CUSTOMER_WARNING Language: USApplication: iSupplier PortalCurrent Message Text: Are you sure want to delete the Selected Item (save)After creating the Message we have Run Standard Concurrent ProgramConcurrent Program: Generate Message

Step-23Write Code In XxcustomerSearchCOto Delete Continuous  Import this packagesimport oracle.apps.fnd.framework.webui.OADialogPage;import java.io.Serializable;import java.util.Hashtable;

In Process Form Request

if ("delete".equals(pageContext.getParameter(EVENT_PARAM))){  String HeaderId1=  pageContext.getParameter("pdelete");  OAException mainMessage = new OAException("pos","XX_CUSTOMER_WARNING");  OADialogPage dialogPage = new OADialogPage(OAException.WARNING,                                                                                                           mainMessage, null, "", "");  String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);  String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);

  dialogPage.setOkButtonItemName("DeleteYesButton");

Page 26: Callable Statement

  dialogPage.setOkButtonToPost(true);  dialogPage.setNoButtonToPost(true);  dialogPage.setPostToCallingPage(true);

  dialogPage.setOkButtonLabel(yes);   dialogPage.setNoButtonLabel(no);

  Hashtable formParams = new Hashtable();   formParams.put("HeaderId",HeaderId1); // vo atrribute , variable    dialogPage.setFormParameters(formParams);   pageContext.redirectToDialogPage(dialogPage); }

else if (pageContext.getParameter("DeleteYesButton") != null){   String HeaderId= pageContext.getParameter("HeaderId");  Serializable[] parameters = { HeaderId};    am.invokeMethod("deleteHederslines", parameters); OAException message = new OAException("pos","XX_DELETE_CONFORMATIONS",                                                                           null,OAException.CONFIRMATION,null);  pageContext.putDialogMessage(message);  }}Deployment from OAF to Oracle Apps

1) Move all Class files to Java-Top   Source Path     :    E:\OAF\jdevhome\jdev\myclasses   Dispatch Path    :    E:\oracle\viscomn\java           (In Real Time $ Appl-Top & $ Java-Top)2) Run the xml import Script in Javabin   In Dos Prompt E:\OAF\jdevbin\jdev\bin (past here below path)import D:\p4141787_11i_GENERIC\jdevhome\jdev\myprojects\xxpa\oracle\apps\po\consumerrebate\webui\ConsumerRebatePG.xml -rootdir D:\p4141787_11i_GENERIC\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)

Page 27: Callable Statement

(HOST=apps.ora.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=VIS)))"

(Run same the import script for create page & update page)3) Navigate to Oracle Apps – In Application Developer Responsibility   a. Create Function (Nav:Application—Function)       In Description Tab       Function: xxxxxxxxxxxxxxx       UserFunctionName:xxxxxxxxxxxxxxx       In Properties Tab       Type: SSWA servlet function            In web HTML       HTML call:URL of the Search Page   (Save & Close)   b. Create Menu Attach Function to Menu       (Place the Menu in Respective Responisibility        Ex: PO:Menu: Purchasing SuperUser GUI)       Open Menu In Query Mode Paste the (Res:Menu) where User Name menu   c. Bounch the Apche Server ( first close all Applictions)       Open the Services Rt click on Apche server---Restart

EO & AM & VO & CO & Regions and items

BC4J Package Structures

 

BC4J Package Structures

 

1.    Entity Object

 

Syntax: 

<thirdparty>.oracle.apps.applshortname.componentname.<subcomp>.schema.server

 

Ex: xyz.oracle.apps.xxcust.empmgmt.schema.server

 

2. View Object & Application Module

 

Syntax:  <thirdparty>.oracle.apps.applshortname.componentname.<subcomp>.erver

 

Ex: xyz.oracle.apps.xxcust.empmgmt.server

 

3.    page & Controller

 

Page 28: Callable Statement

Syntax:  <thirdparty>.oracle.apps.applshortname.componentname.<subcomp>.webui

 

Ex: xyz.oracle.apps.xxcust.empmgmt.webui

 

4.    LOV VO & LOVAM

                  

Syntax:  <thirdparty>.oracle.apps.applshortname.componentname.<subcomp>.lov.server

Ex: xyz.oracle.apps.xxcust.empmgmt.lov.server

 

5.    Lov Regions

 

Syntax:  <thirdparty>.oracle.apps.applshortname.componentname.<subcomp>.lov.webui

Ex: xyz.oracle.apps.xxcust.empmgmt.lov.webui

 

 

6.     Pick List VO

 

Syntax: 

<thirdparty>.oracle.apps.applshortname.componentname.<subcomp>.picklist.server

Ex: xyz.oracle.apps.xxcust.empmgmt. picklist.server

 

 

Create Page in OA Framework

 

Create page Steps:

 

1)      Create the page as the normal way like create jws, jpr, bc4js, AM, page etc…. .

2)      EO should be mandatory to develop the create the page.

3)      Create the EO which table you want to insert the records through page.

4)      Create the BC4J for EO and develop the EO.

      Ex: xxaam.oracle.apps.po.autosearch.schema.server and xxxEO.

5)      Then create VO based on EO. Create new VO under particular(VO) BC4J, there you

can         

       Shuffle the EO (which you created in 2nd step) into selected side

6)      Add above VO into AM.

7)      Then design the page for appropriate records insert into table and create two buttons

for pressing in page.

8)      Then select AMimpl class file to develop the logic below.

 

public void CreateDept()

  {

     DepartmentCreationVOImpl vo= getDepartmentCreationVO1();

 

Page 29: Callable Statement

     OADBTransaction Tr=getOADBTransaction();

 

     if(!vo.isPreparedForExecution())

     {

       vo.executeQuery();

     }

        Row row1=vo.createRow();

        vo.insertRow(row1);

       row1.setNewRowState(Row.STATUS_INITIALIZED); 

 

       Number deptid=Tr.getSequenceValue("DEPT_DEPT_ID_SEQ");

 

//       vo.getCurrentRow().setAttribute("DeptId",deptid);

       vo.getCurrentRow().setAttribute("DeptId",deptid);

  }

 

9)      Create Controller under pageLayouot region to handle the go button events and call

the logic from AM. Follow logic below.

Process Request :

 

DeptAMImpl am=(DeptAMImpl)pageContext.getApplicationModule(webBean);

am.invokeMethod("CreateDept");

 

Process Form request:

 

If (pageContext.getParameter("Save")!=null)

    {

      am.getOADBTransaction().commit();

    }

 

************************************************************************************************************

Application Module & its types

 

Application Module :it is the interface between database transactions and UI

transactions .

All the application model objects end with AM ex- Employee AM. 

 Types of application Modules: 1)root application module 2) Nested application module

Page 30: Callable Statement

 1)root application module:attaching AM to the root region we call as root AM ,where root

region is the page layout region.

2)Nested application module:Attaching AM to the nested region we call as the nested

application module where nested region are like child regions.

**If we declare vo at Root AM we can use it any where , but if we declare VO at region level

we can use only for the particular region**

 

Controller Methods:

 

Controller Methods:

1) Process request(http get) 2) process form request (http post)3) process form data(http

post )

1) Process request(http get):a) while loading the page to display default items we will

use process request b) this phase is invoked upon browser http get.

 2) process form request (http post): a)After Loading the page performs any actions will

use process form request b)this phase is invoked upon browser http post .

3) Process form data: if exceptions are thrown during this phase process requests or

process form request phases are skipped & the page is re displayed ( error page).

 

View links

 

View links : 

1) relationship between 2 VO’s 

2) All View links end with VL ex- Dept Emp VL 

 *If we want to perform DML operation on master detail data then we need to have entity

Association *if we need to just display master detail data on the page then go for view links.

 

Types of View Objects

 

Page 31: Callable Statement

Types of View Objects:

1) Automatic VO-when DML operations required

2) Manual VO-just to view no EO required

 3) Property VO –no need of DB attributes ex- for displaying some of attributes ( with out DB

table – transient attributes )

4) Validation VO- Validates the data entered and throws a message.

View Objects and View Links:

 

View Objects and View Links:

View object accesses the result set of sql statement either it can be based on EO or a plain

sql query .all the view objects end with VO ex- Employee VO

2) when you create VO one subclass will generate

*oracke.apps.fnd.framework.server.OA.viewobjectImpl.*

 

Entity Assosiates :

 

Entity Assosiates :

  (Association objects –AO) :

1)Establish the relationship between 2 EO’s ex: Dept EO , Emp EO –Dept no –common

column shud be there. All the association objects end with [AO] ex- Dept Emp AO

 

Types of EO:

 

Types of EO:

 1) Java Based EO –to perform DML operations on custom tables

2) PL/SQL based EO-to perform DML operations on seeded tables

 

Entity Object

 

• Entity Object –

EO is like table in the middle tier . we cannot use table directly in OF so we create EO.

2)if we need DML operation then go for EO

3) EO represent DB row in the middle tier

 4) EO based on tables, synonyms, views and snapshots ex- employee EO

Page 32: Callable Statement

5) when you create the EO one subclass is going to generate

Path:oracleapps.fnd.framework.server.OAentityimpl

 6) when you create an EO framework will provide a java class with setter and getter

methods corresponding to each column of the table which your EO is based on.

 

Automatic Search Page:

 

 

Automatic Search Page:

 

Automatic Search Page Steps:

 

1)     Create the page as the normal way like create jws, jpr, bc4js, AM, page etc…. .

2)     Right click of the .jpr, Create the bc4j for VO.

EX: xxaam.oracle.apps.po.autosearch.server  

3)     Create VO under BC4J,  and attach VO to the AM.

Ex:AutosearchVO  -> add this into AM.

4)     Select  the page, Under page Layout RN,create one Region, region style as Query.

5)     Then select query region -> right click  -> Region using wizard ->dialogbox -> you can

select your VO which you created in 3rd step.

6)     Click next to continue -> there you can select region style is table region, because we

are going to display results in table region.

7)     Click next to continue ->Shuttle the items which you want to display in page and table

region.

8)     Then right click query Region-> select simple search panel & simple search query

region

9)     In simple search panel –create what ever you want to create the items means

message text inputs, it will display in top of the Automatic search PG.

10)  In simple search mappings -> you have create mappings. Map all the fields to query

columns to created message text inputs in simple search panel.

11)  Then run the automatic search PG.

 

 

Regions and items 

Regions and items:- Region is a portion of a page and it can hold multiple items (region is

mandatory).

 

Types of regions :-

Page 33: Callable Statement

1)       Message component layout : its exclusively has a property of rows and columns

so that we can place items in matrix form. And it don’t have n option of text (name or

header).

2)       Header region:its exclusively meant of placing heading in this text option will be

there and no option of rows and column..as this region only used for header.

3)       Row layout region:this is used for alignment of the items  where we can place

items accordingly.

4)       Default double column : this is same as message component layout where it will

display two columns  by default  ( we have an option of text and no option for row and

columns )

5)       Default single column :this is also same as message component layout where it

will display single column by default (( we have an option of text and no option for row and

columns)

6)       Page button bar: this is meant for keeping buttons..(buttons will be present 2 times

one at top and one at bottom )

 

 

How to change/add the logo in the OF page:

 

How to change the logo of oracle in the OF page:

Keep the image which you want to display as logo in

patch/oraclehome/myhtml/oamedia/images folder as GIF file.

Now after creation of region-go to region properties –corporate branding –image url-give the

name of the GIF file which you want to display as logo. And execute run & rebuild and the

new logo appears ..

 

How to insert image below page name: Region-New-create item properties –item style

is the image and in image uri give the name of the gif . then execute .

 

types of parameters in the controller

 

Types of parameters in the controller :

 1) OA Page context & OA Webbean 1)Usage of OA Page context: To get & Set values of the

fields

2)OA Webbean: Structure of the items in the OF page ex: set required, set rendered, width,

height :

Page 34: Callable Statement

 

 

Configure jdev in oracle apps Environment & pick list or poplist

Configure jdev in oracle apps Environment

 

Configure jdev in oracle apps Environment 1)Identify the oracle apps version suitable , go to

any OAF page ->about the page ->technology components **if about the page is not there

then set the profile option called fnd_diagnostics to yes (sys admin-sys profile-query profile

fnd:Dia%- set yes) . Download the patch from oracle meta link by giving the OAF version .

After downloading unzip the patch : it contains 3 folders 1)Jdev bin: contains all the

import,export files and jdev tool.2)Jdev doc:contains all the documentation OAF , Index.3)

Jdev Home : Will contain all the project files (/Jdev/myprojects.

  

2)Set the Environment variables for windows : My computer Right click system properties-

advanced-Environenment variables-new-variable_name JDEV_USER_HOME variable

value :jdevhome/dev

 3)Copy the dbc file from fnd top: from D:/Oracle/visappl/fnd/11.5.0/secure/vis_apps to D:\

p123423_11i_generic\jdevhome\jdev\dbc_files\secure ** DBC files contains TNS names and

its used for connecting to the data base.

4) make the shortcut jdev in desktop jdevw.exe where w indicates windows os (copy &

pasteto desktop).

5) create the data base connection 1)Open Jdev expand connections DB-New connection –

connection name –Dev-connction type oracle JDBC –NEXT username: apps PWD: apps }like

toad Open DBC file DBA_HOST=>HOST_name :apps.ora.com JDBC_PORT=>DB_PORT:1521

SID=>DB_name =>VIS then next test connection success ..similarly you can create new DB

connections to other instances .

 6)Set the default project properties :Project-default project settings ,click on OA path-

evvironment variables path ,DB connction –DEV-select Run options –select oa_diagnostics

then Run time connection dbc_file name browse jdev/home/jdev/dbc_files/secure/vis.dbc.

user name-operations pwd-welcome responsibility –one reference responsibility is given

which should contain OAF page APP short name PO responsibility PURCHAISNG_OPERATIONS

() this resp shud be ter for users)

Page 35: Callable Statement

 

 

 

Creation of dependent pick list or poplist

 

 Creation fo dependent pick list or poplist

D:\oracle\visappl\fnd\11.5.0\secure\myprojects

Page 36: Callable Statement
Page 37: Callable Statement
Page 38: Callable Statement

]Creation of BC4J

Page 39: Callable Statement
Page 40: Callable Statement
Page 41: Callable Statement

Creation of AM

Next next

Page 42: Callable Statement

Finish it

Page 43: Callable Statement

Save it and create page

Page 44: Callable Statement
Page 45: Callable Statement
Page 46: Callable Statement

Rebuild page

Run it

Creation of vo

Page 47: Callable Statement

Write  query

Page 48: Callable Statement
Page 49: Callable Statement

Create another vo for polines

Page 50: Callable Statement

select po_header_id,       po_line_id,       line_num       from po_lines_all

Page 51: Callable Statement
Page 52: Callable Statement

Creation of pick list by using items

Page 53: Callable Statement
Page 54: Callable Statement

dependenPick.oracle.apps.po.mgmt.picklist.server.poheadersVO

Page 55: Callable Statement

dependenPick.oracle.apps.po.mgmt.picklist.server.polinesVO

Page 56: Callable Statement
Page 57: Callable Statement
Page 58: Callable Statement

Creation of new controller

Page 59: Callable Statement

Attach vo to am only polinevo

Go to controller.java and write the following code

import

Page 60: Callable Statement

dependenPick.oracle.apps.po.mgmt.picklist.server.dependentpickAMImpl;

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) {   super.processFormRequest(pageContext, webBean);   dependentpickAMImpl obj=(dependentpickAMImpl) pageContext.getApplicationModule(webBean);      if("POLineidevent".equals(pageContext.getParameter(EVENT_PARAM)))   {     System.out.println("SAmple");      

     String pohid=pageContext.getParameter("poheader");

     System.out.println("poheaderid"+pohid);      obj.XXHndleLines(pohid);         } }

And writge the code in the AM class file

public void XXHndleLines(String pohid) {   polinesVOImpl vos=getpolinesVO();   vos.setWhereClause("po_header_id='"+pohid+"'");   vos.executeQuery(); }

Change the some properties for dependent lov where when 1st val changes then automatically changes the 2nd value

In poheaders item the following properties are final modifications

Page 61: Callable Statement
Page 62: Callable Statement
Page 63: Callable Statement
Page 64: Callable Statement
Page 65: Callable Statement

Similarly in the polines also

Page 66: Callable Statement
Page 67: Callable Statement

Save it and run the page

Page 68: Callable Statement
Page 69: Callable Statement

Here we can create some defaultdouble region and develop the items below 

Page 70: Callable Statement
Page 71: Callable Statement

Creation of items like poheader and poline under region of defaultdouble column

Page 72: Callable Statement

 

 

 

Creation of Search page & Dependent LOV

Creation of Search (query ) page with screenshots

 

querySearch.jwsD:\oracle\visappl\fnd\11.5.0\secure\myprojects

Page 73: Callable Statement

querySear.jpr

querySearch.oracle.apps.po.webui

Page 74: Callable Statement

Querysearch

Username: apps

Page 75: Callable Statement

Password: apps

Vis

Page 76: Callable Statement
Page 77: Callable Statement

USERNAME: operationsPASWORD:WELCOMERES:POSHORTKEY: PURCHASING_OPERATION

Page 78: Callable Statement

Creation of BC4J component:

Page 79: Callable Statement

querySearch.oracle.apps.po.server

Select the connection name

Page 80: Callable Statement

Click on log on

Page 81: Callable Statement

Creation of AM

Page 82: Callable Statement

querySearchAMquerySearch.oracle.apps.po.server

Page 83: Callable Statement
Page 84: Callable Statement
Page 85: Callable Statement

The overall node likeCreation of VO

Page 86: Callable Statement

querySearchVOquerySearch.oracle.apps.po.server

Page 87: Callable Statement

select EMPLOYEE_ID,       FULL_NAME,       EMAIL_ADDRESS,       POSITION_CODE,       START_DATE,       END_DATEfrom     fwk_tbx_employees

Page 88: Callable Statement
Page 89: Callable Statement

Attaching vo to AM

Double click

Page 90: Callable Statement
Page 91: Callable Statement
Page 92: Callable Statement

Select and rename it

Page 93: Callable Statement

We4 see that if the vo is attach to it or not in the AMIMPL 

Page 94: Callable Statement

Cretion of page

Page 95: Callable Statement

Select pagequerySearchpagequerySearch.oracle.apps.po.webui

we see the page

Page 96: Callable Statement

Go to page

Page 97: Callable Statement

    Set AM definition

Page 98: Callable Statement
Page 99: Callable Statement

Click on ok

Set the other propertiesWindow: Search PageTitle: Search Page

Page 100: Callable Statement

Creation of another region

Page 101: Callable Statement

Id: query

Page 102: Callable Statement

Style: query

Page 103: Callable Statement

And 

Page 104: Callable Statement

Creation of search using wizard

Page 105: Callable Statement

Select refion using wizard

Page 106: Callable Statement

Select the AM and the vo file

Page 107: Callable Statement

Select the table

Page 108: Callable Statement

Here I leaveone as messagetext input only

Page 109: Callable Statement

By changing another way alos

Page 110: Callable Statement

We see the node like

Select the end one

Page 111: Callable Statement

Change the propertiesAs message styletext

Specify the property as seach allowe is true any of hte  column

Page 112: Callable Statement

Save it and run the page as like below

Page 113: Callable Statement

Rebuild it and run it…

If u get the error then change the databse name in the connection

Page 114: Callable Statement

For the above we do the switcher regions

Page 115: Callable Statement
Page 116: Callable Statement
Page 117: Callable Statement
Page 118: Callable Statement
Page 119: Callable Statement
Page 120: Callable Statement
Page 121: Callable Statement
Page 122: Callable Statement
Page 123: Callable Statement
Page 124: Callable Statement
Page 125: Callable Statement
Page 126: Callable Statement

************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* 

Dependent LOV

 

Page 127: Callable Statement
Page 128: Callable Statement

CREATION OFBC4J COMPONENT

Page 129: Callable Statement
Page 130: Callable Statement
Page 131: Callable Statement

Creation of AM

Page 132: Callable Statement
Page 133: Callable Statement

Save it and 

Creation of Page

Page 134: Callable Statement
Page 135: Callable Statement

Set the AM defination

Page 136: Callable Statement

Run the page

Creation of VO

Page 137: Callable Statement
Page 138: Callable Statement
Page 139: Callable Statement

Create another VO for Supplier site

Page 140: Callable Statement
Page 141: Callable Statement

Set the vo to am

Creation of external regions for loves

Page 142: Callable Statement

For both supplier name and supplier site also

Page 143: Callable Statement
Page 144: Callable Statement
Page 145: Callable Statement
Page 146: Callable Statement
Page 147: Callable Statement
Page 148: Callable Statement
Page 149: Callable Statement
Page 150: Callable Statement
Page 151: Callable Statement

Save it and create another region for supplier site

Page 152: Callable Statement
Page 153: Callable Statement
Page 154: Callable Statement
Page 155: Callable Statement
Page 156: Callable Statement
Page 157: Callable Statement
Page 158: Callable Statement
Page 159: Callable Statement

GO TO PAGE CREATE ITEM FOR LOVS

Page 160: Callable Statement
Page 161: Callable Statement
Page 162: Callable Statement
Page 163: Callable Statement
Page 164: Callable Statement
Page 165: Callable Statement

Set supplier item properties

Page 166: Callable Statement

as 

Page 167: Callable Statement

Create new region for defaultdoubled region style

Page 168: Callable Statement
Page 169: Callable Statement

Create new itrem, for suppliersite

Page 170: Callable Statement
Page 171: Callable Statement
Page 172: Callable Statement

Set the properties of lovmapping

Page 173: Callable Statement

Creation of item for form value

Page 174: Callable Statement
Page 175: Callable Statement

Creation of new lovmapping for formvalue

Page 176: Callable Statement

Creation of lovmapping for to handle the return item

Page 177: Callable Statement
Page 178: Callable Statement

Save it and run it

Page 179: Callable Statement
Page 180: Callable Statement
Page 181: Callable Statement

 

 

 

 

 

 

 

 

Oracle Application Frame Work

Update Page & Delete Page in OA Framework:

 

Update Page in OA Framework:

 

Update Page Steps:

 

 

1)     Create the page as the normal way like create jws, jpr, bc4js, AM, page etc…. .

2)     EO should be mandatory to develop the update page.

3)      Create the EO which table you want to update the records through page.

4)      Create the BC4J for EO and develop the EO.

      Ex: xxaam.oracle.apps.po.autosearch.schema.server and xxxEO.

5)     Then create VO based on EO. Create a new VO under particular(VO) BC4J, there you

can  Shuffle the EO (which you created in 2nd step) into selected side

6)     Add above VO into AM.

7)     Select the search page, there select table region and create one item and style as

image.

8)     In the image properties a) image uri as updateicon_enabled.gif b)Action Type as fire

action. In the parameter window -> id = pdeptid  value -> ${oa.SearchVO1.DeptId}.

Page 182: Callable Statement

9)     Create the update page with appropriate records. And Buttons.

10)  Create Controller under pageLayouot region to handle the go button events and call the

logic from AM. Follow logic below.

 

 

     

Process  request:

 

  if(pageContext.getParameter("pdeptid")!=null)

    {

      String deptid=pageContext.getParameter("pdeptid").toString();

      String whereclause="DEPT_ID='"+deptid+"'";

      am.getCreateVO1().setWhereClauseParams(null);

      am.getCreateVO1().setWhereClause(whereclause);

      am.getCreateVO1().executeQuery();

    }

 

Process Form request:

 

 

If (pageContext.getParameter("Save")!=null)

    {

      am.getOADBTransaction().commit();

    }

 

Create the table and synonym example: 

Create table modpos.DEPARTMENT(DEPT_ID number PRIMARY KEY,

                                                            DEPTNO  VARCHAR2(50),

                                                         DEPTNAME VARCHAR2(100),

                                                         LOCATION  VARCHAR2(100),

                                                         CREATED_BY NUMBER,

                                                            CREATION_DATE Date,

                                                         LAST_UPDATED_BY NUMBER,

                                                            LAST_UPDATE_DATE Date,

                                                            LAST_UPDATE_LOGIN NUMBER)

                                                                         

CREATE SYNONYM DEPARTMENT FOR modpos.DEPARTMENT

 

 

Create the Sequene with example: 

Page 183: Callable Statement

create sequence DEPT_DEPT_ID_SEQ

Start with 1 increment by 1

Grant all on DEPT_DEPT_ID_SEQ to apps

create sequence DEPT_DEPT_ID_SEQ

Start with 4 increment by 1  cus

 

Grant all on DEPT_DEPT_ID_SEQ to apps  cus

 

 

 

Create synonym  DEPT_DEPT_ID_SEQ for cus.DEPT_DEPT_ID_SEQ  apps

 

 

Call one OAF page from another  OAF page Syntax: 

if (pageContext.getParameter("Create")!=null)

    {

    pageContext.setForwardURL("OA.jsp?page=rajesh/oracle/apps/po/dept/webui/

DepartmentCreationPage",

                               null,

                               OAWebBeanConstants.KEEP_MENU_CONTEXT,

                               null,

                               null,

                               false, // Retain AM

                               OAWebBeanConstants.ADD_BREAD_CRUMB_NO, // Do not display

breadcrums

                               OAWebBeanConstants.IGNORE_MESSAGES);

    }

 

 

Follow Bc4j for each object: 

Ø   AM AND VO -> BC4J

XXAAM.oracle.apps.po.xxname.server

Ø   Entity Object(EO) -> BC4J

XXAAM.oracle.apps.po.xxname.schema.server

Ø   LOV ->BC4J

XXAAM.oracle.apps.po.xxname.LOV.server

Ø   Poplist ->BC4J

XXAAM.oracle.apps.po.xxname.poplist.server

Ø   Controller,Page & Region

Page 184: Callable Statement

XXAAM.oracle.apps.po.xxname.webui

Delete page steps 1)     For delete no need to create any pages.

2)     Select search page , in table region you create one item and style as image.

Below set of properties needs to set for this image.

 

Image Uri    - deleteicon_enabled.gif

Action Type – fireAction

Event           - Any Name (delete)

 

Parameter window:SPEL

 

Name – DeptId

Value - ${oa.SearchVO1.DeptId}

 

3)     write the delete login AM, start with creating  method ->

 

public void deletedepartment(String departmentid)

 {

   // First, we need to find the selected Program in our VO.

    // When we find it, we call remove( ) on the row which in turn

    // calls remove on the associated ModposVendorProgsImpl object.

 

    int deptidtodelete=Integer.parseInt(departmentid);

   

    SearchVOImpl vo=getSearchVO1();

   

    SearchVORowImpl row=null; 

      // This tells us the number of rows that have been fetched in the

    // row set, and will not pull additional rows in like some of the

    // other "get count" methods.

 

     int fetchedrowcount =vo.getFetchedRowCount();

      System.out.println("Fetched Row Count is"+fetchedrowcount);

        // We use a separate iterator -- even though we could step through the

    // rows without it -- because we don't want to affect row currency.

      RowSetIterator deleteiter=vo.createRowSetIterator("deleteiter");

     

     if (fetchedrowcount >0)

     {

Page 185: Callable Statement

       deleteiter.setRangeStart(0);

       deleteiter.setRangeSize(fetchedrowcount);

 

       for (int i=0;i<fetchedrowcount;i++)

       {

         row=(SearchVORowImpl)deleteiter.getRowAtRangeIndex(i);

             // For performance reasons, we generate ViewRowImpls for all

        // View Objects. When we need to obtain an attribute value,

        // we use the named accessors instead of a generic String lookup.

         Number deptid=row.getDeptId();

         if(deptid.compareTo(deptidtodelete)==0)

         {

             // This performs the actual delete.

            row.remove();

            getOADBTransaction().commit();

            break;          

         }      

           

       }

             

     }

   deleteiter.closeRowSetIterator();

 }

 

4)     Call that delete even tin Controller like below. Below logic having how to

create OADialog box in OA Framework.

 

 if ("delete".equals(pageContext.getParameter(EVENT_PARAM)))

    {

      // The user has clicked a "Delete" icon so we want to display a "Warning"

      // dialog asking if she really wants to delete the employee. Note that we

      // configure the dialog so that pressing the "Yes" button submits to

      // this page so we can handle the action in this processFormRequest( )

method.

       String DeptId =  pageContext.getParameter("DeptId");

      

      OAException mainMessage = new OAException("POS","xxx");

          // Note that even though we're going to make our Yes/No buttons submit a

      // form, we still need some non-null value in the constructor's Yes/No

      // URL parameters for the buttons to render, so we just pass empty

      // Strings for this.

 

        OADialogPage dialogPage = new OADialogPage(OAException.WARNING,

Page 186: Callable Statement

      mainMessage, null, "", "");

        // Always use Message Dictionary for any Strings you want to display.

      String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);

      String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);

       // We set this value so the code that handles this button press is

      // descriptive.

       dialogPage.setOkButtonItemName("DeleteYesButton");

         // The following configures the Yes/No buttons to be submit buttons,

      // and makes sure that we handle the form submit in the originating

      // page (the "Employee" summary) so we can handle the "Yes"

      // button selection in this controller.

 

       dialogPage.setOkButtonToPost(true);

      dialogPage.setNoButtonToPost(true);

      dialogPage.setPostToCallingPage(true);

       // Now set our Yes/No labels instead of the default OK/Cancel.

      dialogPage.setOkButtonLabel(yes);

      dialogPage.setNoButtonLabel(no);

         // The OADialogPage gives us a convenient means

      // of doing this. Note that the use of the Hashtable is 

      // most appropriate for passing multiple parameters. See the OADialogPage

      // javadoc for an alternative when dealing with a single parameter.

      Hashtable formParams = new Hashtable();

 

      formParams.put("DeptId", DeptId);

     

      dialogPage.setFormParameters(formParams);

  

      pageContext.redirectToDialogPage(dialogPage);

           

    }

   else if (pageContext.getParameter("DeleteYesButton") != null)

    {

      // User has confirmed that she wants to delete this employee.

      // Invoke a method on the AM to set the current row in the VO and

      // call remove() on this row.

      String DeptId = pageContext.getParameter("DeptId");

    

      Serializable[] parameters = { DeptId };

    //  OAApplicationModule am = pageContext.getApplicationModule(webBean);

      am.invokeMethod("deletedepartment", parameters);

 

      // Now, redisplay the page with a confirmation message at the top. Note

Page 187: Callable Statement

      // that the deleteComponent() method in the AM commits, and our code

      // won't get this far if any exceptions are thrown.

 

 

 

      OAException message = new OAException("POS","xxxxxxxx",

                                            null,OAException.CONFIRMATION,null);

 

      pageContext.putDialogMessage(message);

    

    }

  }

 

Emp advance table row 

public void createemp()

{

  EmployeeCreationVOImpl vo= getEmployeeCreationVO1();

  DepartmentCreationVOImpl vo1= getDepartmentCreationVO1();

 

  OADBTransaction tr=getOADBTransaction();

 

  vo.setMaxFetchSize(0);

 

  Row row1=vo.createRow();

  vo.insertRow(row1);

row1.setNewRowState(Row.STATUS_INITIALIZED);

Number empid=tr.getSequenceValue("EMPLOEE_EMP_ID_SEQ");

vo.getCurrentRow().setAttribute("EmployeeId",empid);

 String departmentid=vo1.getCurrentRow().getAttribute("DeptId").toString();

 vo.getCurrentRow().setAttribute("DeptId",departmentid);

 

}

 

  if (ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))

    {

      am.invokeMethod("createemp");

    }

 

 

 

Page 188: Callable Statement

Validations

 

SEACH PAGE VALIDATION   (Display the Value after Entering value in Search

Criteria)

Public  int /**This is Search page Validation*/ ConsumerSearch (OAPageContext

pc,OAWebBean wb)

  {

    int flag = 0; //For search page Validation

    String pna=null;

    String div=null;

    String ctno=null;

    XXconsumer_DiscountVOImpl vo=getXXconsumer_DiscountVO1();

    if(pc.getParameter("PartyName")!=null && ! pc.getParameter("PartyName").equals(""))

    {

      pna=pc.getParameter("PartyName").toString();

      vo.setWhereClauseParam(0,pna);

      flag =1; //For search page Validation

    }

    else

    {

      vo.setWhereClauseParam(0,null);

    }

    if(pc.getParameter("Division")!=null && ! pc.getParameter("Division").equals(""))

    {

      div=pc.getParameter("Division").toString();

      vo.setWhereClauseParam(1,div);

      flag=2;//For search page Validation

    }

    else

    {

      vo.setWhereClauseParam(1,null);

    }

     if(pc.getParameter("ContractNumber")!=null && ! pc.getParameter

                                                                                    ("ContractNumber").equals(""))

    {

      ctno=pc.getParameter("ContractNumber").toString();

      vo.setWhereClauseParam(2,ctno);

      flag=3;//For search page Validation

    }

    else

Page 189: Callable Statement

    {

      vo.setWhereClauseParam(2,null);

    }

      return flag;//For search page Validation

  }

 

IN Search CO (ProcessFormRequest)   Write the code after  B/T Go & Commit  if(pageContext.getParameter("Go")!=null)

    {

      int flag=am.ConsumerSearch(pageContext,webBean);

      if(flag==0)

      {

       am.getXXconsumer_DiscountVO1().setWhereClauseParam(0,"asdf");

       am.getXXconsumer_DiscountVO1().setWhereClauseParam(1,"lkjh");

       am.getXXconsumer_DiscountVO1().setWhereClauseParam(1,"qwer");

       throw new OAException("plz entry any value in search criteria",OAException.ERROR);

      }

     else

        {

          am.getXXconsumer_DiscountVO1().executeQuery();

        }      }

 

 

COMPARE TWO DAYS (Validation on Start Date & End Date)In Create CO (ProcessFormRequest)    Write the code b/t the save and commit 

 

     import.java.util.Date;

     String startdate=pageContext.getParameter("ContractStartDate");

     String enddate=pageContext.getParameter("ContractEndDate");

     if((null!=startdate)&&(null!=enddate))

     {

       Date sdate=new Date(startdate);

       Date edate=new Date(enddate);

       if(edate.getTime()<sdate.getTime())

       {

         throw new OAException("end date should be greaterthan stard

date",OAException.ERROR);

       }

     }

Page 190: Callable Statement

 

 

COMPARE TWO NUMBER(Validation on Levels to Greater than one as another)In Create CO  (ProcessFormRequest)      Write the code b/t save and commit 

 

import.oracle.jbo.domain.Number;

     String slevel1=pageContext.getParameter("Level1From");

     String slevel2=pageContext.getParameter("Level1To");

     Number nlevel1=null;

     Number nlevel2=null;

     try

     {

       nlevel1 = new Number (slevel1);

       nlevel2 = new Number (slevel2);

     }

     catch (Exception e)

     {

       e.printStackTrace();

     }

     if((null!=slevel1)&&(null!=slevel2))

     {

       if(nlevel1.intValue() > nlevel2.intValue())

     {

     throw new OAException("level2 is greater than level1",OAException.ERROR);

     }

     }

 

 

DISPLAY CAPTER LETERS ON FIELD (validation on BillToLocation)In Create CO  (ProcessRequest) 

 

import oracle.cabo.style.CSSStyle;

import oracle.apps.fnd.framework.webui.beans.message.OAMessageLovInputBean;

   CSSStyle css=new CSSStyle();

   css.setProperty("text-transform","uppercase");

Page 191: Callable Statement

   OAMessageLovInputBean

mti=(OAMessageLovInputBean)webBean.                                                                  

findChildRecursive("BillToLocation");

   if(mti!=null)

  {

    mti.setInlineStyle(css);

  }

CHANGE THE COLORS OF THE LETTERS(Validation on BillToLocation)In Create CO (ProcessRequest)import oracle.cabo.style.CSSStyle;

 CSSStyle css=new CSSStyle();

 css.setProperty("color","#ff0000");// THIS FOR COLORS OF THE FIED

 OAMessageLovInputBean mti=(OAMessageLovInputBean)webBean.

                                                                        findChildRecursive("BillToLocation");

 if(mti!=null)

  {

    mti.setInlineStyle(css);

  }

SPECIAL CHARACTERS ARE NOT ALLOWED ON A FIELD (validation On PartyName)In Create CO (ProcessFormRequest)   Write the code b/t save and commit 

 

     String cname=pageContext.getParameter("PartyName");

     Pattern p=Pattern.compile("[^a-zA-Z0-9\\s]");

     Matcher m=p.matcher(cname);

     if(m.find())

     {

     throw new OAException("Special Characters are not allowed",OAException.ERROR);

     }

 

 

FRIEGHT DEDUCTION FIELD SHOULD NOT ALLOW MORE THAN 100

(Validation on Freight Deduction)

In Create PG    Select Freight Deduction item

 In Properties      Action Type: FirepartialAction

                                     event: firepartial (here we can give any name)

In Create CO (ProcessFormRequest)

 if("firepartial".equals(pageContext.getParameter(EVENT_PARAM)))

Page 192: Callable Statement

    {

      String fright=pageContext.getParameter("FreightDeduct");

      Number frighting=null;

      try

      {

        frighting=new Number(fright);

      }

      catch (Exception e)

      {

        e.printStackTrace();

      }

      if((null!=fright))//&&(null!=fright))

      {

        if((frighting.intValue()<=0)||(frighting.intValue()>=100))

       // if((frighting.intValue()<0)||(frighting.intValue()>100))

        {

          throw new OAException("frieght deduction should not allow more then 100",

                                                                                                OAException.ERROR);

        }

      }

DEPENDENT LOV  (Validation on PartyName & BillToLocation) CREATE 2 VO'S & VO's

to AM

1.CUSTOMERVO (QUERY)

  SELECT

            hp.party_name,

 hp.party_id,

 hp.party_number

FROM

  hz_parties hp

WHERE

  EXISTS (SELECT   HCAS.CUST_ACCOUNT_ID,HCAS.PARTY_SITE_ID, HPS.PARTY_ID

             FROM hz_cust_acct_sites_all HCAS, HZ_PARTY_SITES HPS 

            WHERE HPS.PARTY_SITE_ID = HCAS.PARTY_SITE_ID AND

            HP.PARTY_ID = HPS.PARTY_ID AND

            HP.STATUS <> 'M')

ORDER BY HP.PARTY_NAME

 

2. LOCATIONVO (QUERY)

SELECT

hzsu.site_use_id,

hzl.address1||DECODE(hzl.address2,NULL,NULL,','||hzl.address2)||

                                 ','||hzl.city||','||hzl.country||','||hzl.postal_code LOCATION,

hp.party_id

Page 193: Callable Statement

FROM  

            hz_parties hp,

hz_cust_accounts hza,

             hz_cust_acct_sites_all hzas,

             hz_cust_site_uses_all hzsu,

             hz_party_sites hzps,

             hz_locations hzl

 

WHERE

            hza.party_id = hp.party_id

   AND hzas.cust_account_id = hza.cust_account_id

   AND hzps.party_site_id = hzas.party_site_id

   AND hzl.location_id = hzps.location_id

   AND hzsu.site_use_code = 'BILL_TO'

   AND hzsu.cust_acct_site_id = hzas.cust_acct_site_id

   AND hzsu.org_id = hzas.org_id

  Create one item under DefaultDebouleRegion

              Item  Style: Form Value      ID& Prompt: Linkid

  Create one more Mapping under PartyName

             In Properties: LOV Region Item: PartyId

                                             Return Item: Linkid

    Create one more Mapping under BillToLocation

In Properties: LOV Region Item: PartyId

                                          Criteria item: Linkid

 

DEPENDENT POPLISTCreate 2 VO's Under POP List..Server & Attach VO's To AM

1. DNameVO: SELECT DNAME FROM SCOTT.DEPT

2. ENameVO: SELECT ENAME, DNAME FROM SCOTT.EMP E, SCOTT.DEPT D WHERE      

                                                                                                            E.DEPTNO=D.DEPTNO

In Search PG Create Item under MessageComponetLayout

  Item Style: Message Choice      Id & Prompt: DName

     In Properties:  PickListviewinstance: DNameVo

                             PickdisplayAttribute: DName

                           PicklistvalueAttribute: DName

                                  Add Block Value : False ( if use this values will enable in field)

                                       Action Type: FirePartialAction

                                                Event: DName

Create one more  Item Style: MessageChoice      Id & Prompt: EName

   In Properties:  PickListviewinstance: ENameVo

                                         PickdisplayAttribute: EName

                                       PicklistvalueAttribute: EName

Page 194: Callable Statement

                                                  Add Block Value : False ( if use this values will enable in

field)

Go to AMIpmL.java

public void initquary (String dname)

 {

   EnameVOImpl vo=getEnameVO1();

   vo.setWhereClause("DNAME=:1");

   vo.setWhereClauseParams(null);

   vo.setWhereClauseParam(0,dname);

   vo.executeQuery();

 }

In Search CO (ProcessFormRequest)

import java.io.Serializable;

 if("Dname".equals(pageContext.getParameter(EVENT_PARAM)))

    {

      String dname=pageContext.getParameter("Dname");

      if(!(("".equals(dname))&&(dname==null)))

      {

        Serializable[] param={dname};

        am.invokeMethod("initquary",param);      }    }

 

DISPLAY CURRENCY VALUE/FORMAT (Validation on Advertising Rebate)

In Search VO we have to ADD 1 Column -Advertising Rebate

In Search PG Create Item under Table Region

Item   Id &Prompt:      Advertising Rebate       Style: message Styled Text input

            In Properties: View Instance: SearchVo

                                   View Attribute: AdvertisingRebate

In Search CO (ProcessRequest)

 

import oracle.apps.fnd.framework.webui.beans.table.OATableBean;

import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;

 

 OATableBean tb=(OATableBean)webBean.findChildRecursive("region4");

 OAMessageStyledTextBean mst=(OAMessageStyledTextBean)webBean.

                                                            findChildRecursive("ADVERTISING_REBATE");

 if(mst!=null)

    {

      mst.setCurrencyCode("USD");

    }

                                   

EXPORTING DATE TO EXCELL SHEET

In Search PG

Create Item under RowLoyoutRegion

Page 195: Callable Statement

Item   Id & Prompt: Export        Style: export Button

             In properties: View Instance: SearchVO

 

 

 

MESSAGE FILE UPLOADBEAN (Validation on Attachment Column)IN Create PG           Attachment Data Type: Make sure=BLOBif want display the file Name on the field write below codeInprocessRequest 

import oracle.apps.fnd.framework.webui.beans.message.OAMessageFileUploadBean;

import oracle.apps.fnd.framework.webui.OADataBoundValueViewObject;

 

 OAMessageFileUploadBean upload=(OAMessageFileUploadBean)webBean.

                                                                        findChildRecursive("ContractAttachment");

 OADataBoundValueViewObject displaybound=new OADataBoundValueViewObject

                                                                                                            (upload,"FileName");

 upload.setAttributeValue(DOWNLOAD_FILE_NAME,displaybound);

 

SPEL IN OA Framework Persolizations

SPEL IN OA Framework Persolizations

 

In personalizations, We have two ways to change properties like Rendered or Read Only or

Required.

1.  First is  we hardcode a value of True/False during personalization.

2.  Second is we can use  a SPEL syntax to these properties via personalization. SPEL is

nothing but an expression that returns TRUE or FALSE.

In this post , I going to use SPEL feature. I have a requirement there is a responsibility

named "OA Framework Tollbax Tutorial Labs".In the responsibility there is Page "Create

Employee".In Employee page there is feild "Hire Date".So I want to enable this feild only for

a Specific user.So how i can do this. I am going to do this by "SPEL" function.

The User is "OAF_USER" As Given Below.

Page 196: Callable Statement

Step 1:  Create Function

Go to responsibility "Functional Administrator".

Click under "Core Services" Tab.Under this select Function.

Create function "XX_HIRE_DATE_REAF_ONLY"

             This function will be of Type JSP

              Name = XX Hire Date Read Only

              Code= XX_HIRE_DATE_REAF_ONLY

Page 197: Callable Statement

              Type=SSWA jsp Function

              HTML Call= OA.jsp?page=/dummy

 

   

Function has created as be,ow.

Step 2: In Menu screen, Create Permission Set named “XX Employee Date Read Only”

Menu = XX_EMPOYEE_HIRE_DATE_READ

User Menu Name = XX Employee Date Read Only

Menu Type = Permission Set

Add Function “XX Hire Date Read Only” to this, and ensure that Global Grant is removed by

unchecking checkbox “Grant”.

Page 198: Callable Statement

 Step3Grant this permission set “XX_EMPOYEE_HIRE_DATE_READ” to "OAF_USER" User

Name

Navigate to Functional Administrator

Click on Security Tab, and click on Grants, and then Create Grant

Name=XX_EMPLOYEE_HIRE_DATE_READ_GRANT

Grantee Type = Specific User

Grantee = OAF_USER

Click on Next, and in Set field, attach the permission set “XX Employee Date Read Only”.

Page 200: Callable Statement

 

 

Click on Next, and in Set field, attach the permission set “XX Employee Date Read Only”

 Click Next and Finish.

Step 4Now personalize and set the Read Only Property to SPEL with value of SPEL being 

${oa.FunctionSecurity.XX_HIRE_DATE_REAF_ONLY}

Navigate to responsibility "OA Framework Toollbox Tutorial Labs"

Click on Create Employee Page

Page 201: Callable Statement

Click on personalize page on top right corner

And personalize Hire Date

In the read only property, at site level, select SPEL and enter $

{oa.FunctionSecurity.XX_HIRE_DATE_REAF_ONLY}

Click Apply.And then again open the Page to see the changes below.

Page 202: Callable Statement

      

Now Login again with user name "OAF_USER".

And then again go to the page "Create Employee Page". and see we have given the

permission to this user so Hire Date  will be enable for this User.

**************************************************************************************************************************** 

oaf interview questions

oaf interview questions 

                  OAF interview questions and answers

 

 

Q) What is BC4J ?

Page 203: Callable Statement

A )Business Components for Java is JDeveloper's programming framework for building

multitier database applications from reusable business components

Q) What are the methods in controller?

   A)   3 types methods they are

1. ProcessRequest,

2.processFormRequest

3. processFormData

Q) When is the processRequest method called?

A) processRequest method is called when the page is getting rendered onto the screen and

a region is displayed.

Q) When is processFormRequest method called?

A) ProcessFormReques(PFR)t method is called when we perform some action on the screen

like click of submit button or click on Go or any action perform on the page the result is

displayed is called PFR

Q) What are all the methods in CO?}

 A)processForRequest

processRequest

Q )When a page renders which method in CO fires?

A)        processRequest

Q) Where will you write your business logic?

A)        Entity object (EO)

Q) How do you catch the button event on ProcessFormRequest Method?

A) if (pageContext.getParameter(.EVENT_PARAM). equals("update")) Here update is the

event.

1.     What is an EO?

a. Map to a database table or other data source

b. Each entity object instance represents a single row

c. Contains attributes representing database columns

d. Fundamental BC4J object through which all inserts/updates/deletes interact with the

database

e. Central point for business logic and validation related to a table

f. Encapsulates attribute-level and entity-level validation logic

g. Can contain custom business methods

2. What is a VO?

a. Represent a query result

b. Are used for joining, filtering, projecting, and sorting your business data

c. Can be based on any number of entity objects

d. Can also be constructed from a SQL statement

3. What are the methods in controller?

ProcessRequest and processformrequest

Page 204: Callable Statement

4. What is a Controller?

Controller is the java file and can be associated to a complete OAF page or to a specific

region.

There are several tasks you will do routinely in your code.

� Handle button press and other events

� Automatic queries

� Dynamic WHERE clauses

� Commits

� JSP Forwards

The logic for accomplishing all these tasks is written in controller

5. When is the processRequest method called?

PR method is called when the page is getting rendered onto the screen

6. When is processFormRequest method called?

PFR method is called when we perform some action on the screen like click of submit button

or click on lov

7. What is extension?

Extension is when you take an already existing component ex an OAF page or a region and

then add some more functionality to it without disturbing the original functionality.

8. What is personalization?

Oracle Apps Framework has an OA Personalization Framework associated with it so that you

can personalize any OAF page in an Oracle E-business Suite application without changing

the basic or underlying code of that OA Framework page, Oracle Application Framework

makes it very easy to personalize the appearance of the page or even the personalization of

data displayed on to an OA Framework page.

9. What are levels of personalization?

1. Function Level

2. Localization Level

3. Site Level

4. Organization Level

5. Responsibility Level

6. Admin-Seeded User Level

7. Portlet Level

8. User Level

Page 205: Callable Statement

2.     1) What is BC4J?

Business Components for Java is JDeveloper's programming framework for building multitier

database applications from reusable business components. These applications typically

consist of:

• A client-side user interface written in Java and/or HTML.

• One or more business logic tier components that provide business logic and views of

business objects.

• Tables on the database server that store the underlying data.

2.What are all the components of BC4J?

3.     Following are the components of BC4J:

4.     

• Entity Object - EO encapsulates the business logic and rules. EO’s are used for Inserting,

Updating and Deleting data from the database table. E0 is also used for validating the

records across the applications.

5.     

• View Object - View object encapsulates the database query. It is used for selecting data. It

provides iteration over a query result set. VO’s are primarily based on EO’s. It can be used

on multiple EO’s if the UI is for update.

6.     

• Application Module - Application Modules serve as containers for related BC4J components.

The pages are related by participating in the same task. It also defines the logical data

model and business methods needed.

2) What is an EO?

EO encapsulates the business logic and rules.EO’s are used for Inserting, Updating and

Deleting data. This is used for validating across the applications. We can also link to other

EO’s and create a Association object.

3) What is an VO?

View object encapsulates the database query. It is used for selecting data. It provides

iteration over a query result set.VO’s are primarily based on Eo’s. It can be used on multiple

EO’s if the UI is for update. It provides a single point of contact for getting and setting entity

object values. It can be linked together to form View Links.

4) What is an AO?

An association object is created where we link EO’s. For example take the search page

where we link the same EO to form a association between the manager and employee.

Every employee should have a manager associated. But if it President then no there is no

manager associated. This is a perfect example to understand the AO.

Page 206: Callable Statement

5) What is an VL?

A view link is an active link between view links. A view link can be created by providing the

source and destination views and source and destination attributes. There are two modes of

View link operation that can be performed. A document and Master/Detail operation.

6). What is UIX?

UIX is an extensible, J2EE-based framework for building web applications. It is based on the

Model-View-Controller (MVC) design pattern, which provides the foundation for building

scalable enterprise web applications.

7). Where the VO is located in the MVC architecture?

VO is located in the View Layer in MVC which is responsible for presenting the data to the

user.

9) Which package should include EO and AO.

The EO and AO will be present in the schema.server package.

10) What is the difference between inline lov and external lov.

Inline lov is a lov which is used only for that particular page for which it was created and

cannot be used by any other page.

7.     

External lov is a common lov which can be used by any page. It is a common component for

any page to use it. It can be used by giving the full path of the lov in the properties section

“External LOV” of the item.

 

1) what is a Javabean?

JavaBeans is an object-oriented programming interface that lets you build re-useable

applications or program building blocks called components that can be deployed in a

network on any major operating system platform.

2) What is query Bean?

QueryBean is used to execute and return the results of a query on behalf of the QueryPortlet

application.

3) what is the difference between autocustomization criteria and result based search?

Results based search generates search items automatically based on the columns on the

results table.

In Autocustomization search we need to set what all fields are required to display as a

search criteria.

4) what is MDS?

MDS is MetaData Service. When a web page is broken into small units like buttons,fields etc

they are stored in a database. These are not stored as binary files but as data in tables. The

Page 207: Callable Statement

data are present in JDR tables. MDS provides service to store & return page definitions. MDS

collects those definitions in components/fields in a meaningful manner to build a page.

5) What is XML?

XML is a markup language for documents containing structured information.

Structured information contains both content (words, pictures, etc.) and some indication of

what role that content plays (for example, content in a section heading has a different

meaning from content in a footnote, which means something different than content in a

figure caption or content in a database table, etc.).

6) What is the difference between customization and extension?

Customization is under direct user control. The user explicitly selects between certain

options. Using customization a user can:

    Altering the functionality of an application

    Altering existing UI

    Altering existing business logic

Extension is about extending the functionality of an application beyond what can be done

through personalization. Using extension we can:

    Add new functional flows

    Extend or override existing business logic

    Create New application/module

    Create New page

    Create New attribute

    Extend/Override defaults & validations

7) What is Personalization?

Personalization enables you to declaratively tailor the UI look-and-feel, layout or visibility of

page content to suit a business need or a user preference. Using Personalization we can:

    • Tailor the order in which table columns are displayed.

    • Tailor a query result.

    • Tailor the color scheme of the UI.

    • Folder Forms

    • Do Forms Personalization

   

8)Can you extend every possible Application Module?

Answer: No..Root AM cannot be extended.

9) What is rootAM?

The application module which is associated with the top-level page region (the pageLayout

region) is root application module.

Page 208: Callable Statement