Wednesday, July 22, 2015

SOAP / REST   these are the technologies required for the Fusion Technical Consultants.

Iam a newbie in this area : i just found following are the simple samples provided by the developers.

Expose ADB BC (EO,V) as REST  WebService

Entity Based REST WebService

Wednesday, May 13, 2015

Way to Fusion 

The following posts lists down some set of links which are useful during Fusion Personalization.

Adding Attachments :

Tuesday, March 10, 2015

OAF VO Extension  Sample on iExpense page

You can find the source code @

I hope the images are self explanatory.

Monday, March 09, 2015

OAF - Parameterized Popup

In this article, i will show you how to implement a parameterized popUp in OAF Page.

Region Style : PopUp is available only from R12.1.3 Ebiz.

Iam considering the below requirement to work on the functionality of popUp region.

BC4J Object List :

DeptVO --> parameterized with DeptID

HelloPopUPPG.xml (Shows the employee details)

DeptRN.xml (Shows the Dept Details) -- Shared Region

Final Result

Sunday, March 01, 2015

OAF Integration with XML Report (Merge Multiple VO's)

In this sample, you will get to know how to merge multiple VO's into single XMLDocument and pass this input to RTF Template using : TemplateHelpder API to get the desired output.

RTF Template

Make sure you get the xdo files from $JAVA_TOP and move them in your myclasses of Jdeveloper

Below is the logic of the controller for the buttons in the page :

 |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
 |                         All rights reserved.                              |
 |  HISTORY                                                                  |


import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;

import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OADBTransactionImpl;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;

import oracle.apps.xdo.oa.schema.server.TemplateHelper;


import oracle.jbo.XMLInterface;

import oracle.xml.parser.v2.XMLDOMException;
import oracle.xml.parser.v2.XMLDocument;
import oracle.xml.parser.v2.XMLElement;
import oracle.xml.parser.v2.XMLNode;


 * Controller for ...
public class XMLReportWithMultipleVOCO extends OAControllerImpl
  public static final String RCS_ID="$Header$";
  public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);

   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
      else if (pageContext.getParameter("generateReport")!=null)
          XMLDocument  xmlDocObj =   getXMLDocument(pageContext,webBean);
      System.out.println("GEnerate Report Is Clicked");
                  // Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.
                  DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject("_SessionParameters");
                   HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,"HttpServletResponse");
                                       try {
                                        ServletOutputStream os = response.getOutputStream();
                                         // Set the Output Report File Name and Content Type
                                         String contentDisposition = "attachment;filename=PerPopleData.html";
                                         // Get the Data XML File as the XMLNode
                          ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                          System.out.println("Output Stream-->");
                          ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
                          ByteArrayOutputStream outputStreamFle = new ByteArrayOutputStream();
                          //Generate the PDF Report.
                          //Process Template
                          "FND",//APPLICATION SHORT NAME
                          "XXCUS_EMP_DEPT_REP", //TEMPLATE_SHORT_CODE
              // Write the PDF Report to the HttpServletResponse object and flush.
                          byte[] b = outputStreamFle.toByteArray();
                          os.write(b, 0, b.length);
              catch(Exception e)
                      throw new OAException(e.getMessage(), OAException.ERROR);

    public XMLDocument getXMLDocument(OAPageContext pageContext, OAWebBean webBean)
       XMLDocument exportDoc = new XMLDocument();
       XMLElement root = (XMLElement)exportDoc.createElement("RootNode");
       XXSriBizzServicesAMImpl am = (XXSriBizzServicesAMImpl)pageContext.getApplicationModule(webBean);
       XMLNode adbpaXMLNode = getEmpVOXMLData(pageContext,webBean);
       XMLNode sysDateXMLNode =getDeptVOXMLData(pageContext,webBean);
        ByteArrayOutputStream bo  = new ByteArrayOutputStream() ;
         catch(Exception ex)
      System.out.println("Final XML Docu-->"+ bo.toString());
       return exportDoc ;
  public XMLNode getEmpVOXMLData(OAPageContext pageContext, OAWebBean webBean)
       XXSriBizzServicesAMImpl am = (XXSriBizzServicesAMImpl)pageContext.getApplicationModule(webBean);
       EmpVOImpl vo = am.getEmpVO1();
       XMLNode xmlNode = (XMLNode) vo.writeXML(1, XMLInterface.XML_OPT_ALL_ROWS);
       ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
       System.out.println("getEmpVOXMLData"+ vo.getRowCount());
       return xmlNode;

    public XMLNode getDeptVOXMLData(OAPageContext pageContext, OAWebBean webBean)
         XXSriBizzServicesAMImpl am = (XXSriBizzServicesAMImpl)pageContext.getApplicationModule(webBean);
         DeptVOImpl vo = am.getDeptVO1();
         XMLNode xmlNode = (XMLNode) vo.writeXML(1, XMLInterface.XML_OPT_ALL_ROWS);
         ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
         System.out.println("getDeptVOXMLData"+ vo.getRowCount());
         return xmlNode;
    public void appendChild(XMLDocument doc, XMLNode parent, XMLNode child)
        catch(XMLDOMException e)
               catch(Exception ex) {}

Thursday, February 26, 2015

Auto-Repeating Layout (ARL) - in OAF

One of the very good feature to display a region multiple times.

As most of them aware of Table/ HGrid to display multiple records, but there is also a container to show the data repeatedly based on the VO applied.

Please find the below screenshot for same.

PG.xml Properties

Monday, February 23, 2015

Attribute Level Validations in OAF

You Can use the below method in EOImpl

    protected void doDML(int operation, TransactionEvent e) {
        super.doDML(operation, e);
        String value= getEmail();
        if (value==null)
           throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
           getEntityDef().getFullName(), // entity         name
           getPrimaryKey(), // entity primary key
           "Email", // attribute Name
           value, // bad attribute value
           "FND", // message application short name
           "XXCUS_EMAIL_REQ"); //


Invoking Workflow From OAF Page

Use the below method in the processFormRequest , on based on the button event.

              String PItemType = "XXHRWF";
            String PProcess = "XXPROC";
            oracle.jbo.domain.Number pitekKeyNo =

            String PItemKey = pitekKeyNo.toString(); // This can be a random item key generated

            OANavigation wf = new OANavigation();

            // Now create Workflow Process
            wf.createProcess(pageContext, PItemType, PProcess, PItemKey);

            // Set Sales Order Number
            wf.setItemAttrText(pageContext, PItemType, PItemKey,"XXATTRIB", "OPERATIONS");

            // Start Workflow Process
            wf.startProcess(pageContext, PItemType, PProcess, PItemKey);

Sunday, February 15, 2015

Playing with conversion of dates

Frequently required script

Following code is used for the purpose of converting :  Date Input in : String format into : java.sql.Date

    private java.sql.Date stringToDate(String dateS) {

        java.sql.Date sqlStartDate = null;
        if (dateS != null && !"".equals(dateS)) {
            String dateFormat = "yyyy-MM-dd";
            SimpleDateFormat df = new SimpleDateFormat(dateFormat);
            java.util.Date parsedDate1 = null;
                try {
                    parsedDate1 = df.parse(dateS);
                } catch (ParseException e) {
                    // TODO
                sqlStartDate = new java.sql.Date(parsedDate1.getTime());

        return sqlStartDate;

Following scrip tis used to convert String into  oracle.jbo.domain.Date

        private Date stringToDate(String dateS)
         Date date=null;
          if(dateS!=null &&  !"".equals(dateS)   )
           String dateFormat = "dd-MMM-yyyy";
           SimpleDateFormat df = new SimpleDateFormat(dateFormat);
               java.util.Date parsedDate1=null;
              parsedDate1 =  df.parse(dateS);
             catch(ParseException e)
             date = new Date(new Timestamp(parsedDate1.getTime()));  
          return date;

Tuesday, January 27, 2015

The following diagram represents the metadata XML files used for a Fusion web application:

Note : The above is an excerpt from : Jobinesh : Oracle ADF Real World Developer Guide

Wednesday, January 21, 2015

What happens when you execute an entity-based view object?

ViewObject vo = applicationModule.findViewObject("Departments");
vo.execute();//execute view object to fetch rows
Row row=vo.first();//Move to the first row in the row set
The following sequence diagram highlights how the business components interact
with one another to query the database:

Note : The above content is from : Jobinesh  : Oracle ADF Real World Developer Guide a fantastic book on ADF.

Just shared the above for reference to others.