Skip navigation links

Oracle BI Publisher Java API Reference
Release 10.1.3.4


oracle.apps.xdo.dataengine
Class DataProcessor

java.lang.Object
  extended by oracle.apps.xdo.dataengine.DataProcessor


public class DataProcessor
extends java.lang.Object

Overview

The class DataProcessor is the front-end class to use XML Publisher Data Engine. To use this, users have to instanciate this class and set parameters such as template. connection and output.

After setting the parameters, you can start processing by calling processData() method.

 
Sample Data Template : EmpDataTemplate.xml &lt?xml version="1.0" encoding="WINDOWS-1252" ?&gt &ltdataTemplate name="dataTemplateName" description="Employee Details" defaultPackage="" Version="1.0"&gt &ltparameters&gt &ltparameter name="p_DeptNo" dataType="character" /&gt &lt/parameters&gt &ltdataQuery&gt &ltsqlStatement name="Q1"&gt &lt![CDATA[ SELECT d.DEPTNO,d.DNAME,d.LOC, EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,nvl(COMM,0) from dept d, emp e where d.deptno=e.deptno and d.deptno = nvl(:p_DeptNo,d.deptno) ]]&gt &lt/sqlStatement&gt &lt/dataQuery&gt &ltdataStructure&gt &ltgroup name="G_DEPT" source="Q1"&gt &ltelement name="DEPT_NUMBER" value="DEPTNO" /&gt &ltelement name="DEPT_NAME" value="DNAME" /&gt &ltelement name="DEPTSAL" value="G_EMP.SALARY" function="SUM()" /&gt &ltelement name="LOCATION" value="LOC" /&gt &ltgroup name="G_EMP" source="Q1"&gt &ltelement name="EMPLOYEE_NUMBER" value="EMPNO" /&gt &ltelement name="NAME" value="ENAME" /&gt &ltelement name="JOB" value="JOB" /&gt &ltelement name="MANAGER" value="MGR" /&gt &ltelement name="HIREDATE" value="HIREDATE" /&gt &ltelement name="SALARY" value="SAL" /&gt &lt/group&gt &lt/group&gt &lt/dataStructure&gt &lt/dataTemplate&gt

Typical usage of DataProcessor :


 {

 try {

  //Initilization//
  DataProcessor dataProcessor = new DataProcessor();

   //Set Data Template
  dataProcessor.setDataTemplate("/home/EmpDataTemplate.xml");

  //Get Parameters
  ArrayList parameters = dataProcessor.getParameters();

  //set Parameter Values as ArrayList of oracle.apps.xdo.dataengine.Parameter

   Iterator it = parameters.iterator();

   while (it.hasNext())
  {
     Parameter p = (Parameter) it.next();
     if (p.getName().equals("p_DeptNo"))
       p.setValue(new "10");
   }

   dataProcessor.setParameters(parameters);

   //OR you can set Parameter Values as Hashtable.

   Hashtable parameters = new Hashtable();
   parameters.put("p_DeptNo","10");
   dataProcessor.setParameters(parameters);

   dataProcessor.setConnection(jdbcConnection);
   dataProcessor.setOutput("/home/EmpDetails.xml")
   dataProcessor.processData();
 } catch (Exception e)
  {
  }
 }
 

Field Summary
static java.lang.String RCS_ID
           
static boolean RCS_ID_RECORDED
           

 

Constructor Summary
DataProcessor()
          Initilize the DataProcessor.

 

Method Summary
 java.util.Vector getDataSourceRefs()
          Returns the List of DataSourceRef used in data template.
 org.w3c.dom.Document getDataTemplate()
           
 com.sun.java.util.collections.ArrayList getParameters()
          Returns the ArrayList holding oraccle.apps.xdo.dataengine.Parameter.
 org.w3c.dom.Document getXMLSchema()
           
 void includeParameters(boolean includeParameter)
           
 void processData()
          Start Processing and write XML to specified destination.
 void processDataStructre()
           
 void setConfig(java.util.Properties props)
          To specify Data Engine properties programmatically.
 void setConnection(java.sql.Connection connection)
          Set the JDBC Connection.
 void setDataModel(java.io.InputStream inputStream)
           
 void setDataModel(java.lang.String templateFile)
           
 void setDataTemplate(java.io.InputStream inputStream)
          Set Data Template as InputStream.
 void setDataTemplate(java.lang.String templateFile)
          Set Data Template from file System.
 void setDebugLogOn()
          Strat Debug Logging.
 void setDistributedConnections(com.sun.java.util.collections.Hashtable connections)
          Set the JDBC Connections as Hashtable for distributed queries.
 void setMaxRows(int maxRows)
          Set the maximum no of rows.
 void setOutput(java.io.OutputStream outStream)
          Set the output stream to write the XML output.
 void setOutput(java.lang.String outFile)
          Set the output file to write the XML output.
 void setParameters(com.sun.java.util.collections.ArrayList parameters)
          Pass the parameter as ArrayList holding oracle.apps.xdo.dataengine.Parameter Object.
 void setParameters(com.sun.java.util.collections.Hashtable paramters)
          Pass the parameter as Name:Value pair using Hashtable.
 void setRowsetTag(java.lang.String rowSetTag)
           
 void setRowTag(java.lang.String rowTag)
           
 void setScalableModeOn()
           
 void setSql(java.lang.String sqlQuery)
           
 void setTraceOn()
          Set SQL trace on.
 void writeDefaultLayout(java.io.OutputStream outStream)
           
 void writeDefaultLayout(java.lang.String fileName)
           
 void WriteXDOReport(java.lang.String dataSorceRef, java.lang.String layoutTemplate, java.io.OutputStream outStream, java.lang.String description, java.lang.String reportTitle)
           
 void WriteXDOReport(java.lang.String dataSorceRef, java.lang.String layoutTemplate, java.lang.String fileName, java.lang.String description, java.lang.String reportTitle)
           
 void writeXMLSchema(java.io.OutputStream outStream)
           
 void writeXMLSchema(java.lang.String fileName)
           

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values

RCS_ID_RECORDED

public static final boolean RCS_ID_RECORDED

Constructor Detail

DataProcessor

public DataProcessor()
Initilize the DataProcessor.

Method Detail

setDataTemplate

public void setDataTemplate(java.io.InputStream inputStream)
                     throws XDOException
Set Data Template as InputStream.
Parameters:
inputStream - InputStream
Throws:
XDOException

setDataTemplate

public void setDataTemplate(java.lang.String templateFile)
                     throws XDOException
Set Data Template from file System.
Parameters:
templateFile - [File Absolute Path] String
Throws:
XDOException

setDataModel

public void setDataModel(java.lang.String templateFile)
                  throws XDOException
Throws:
XDOException

setDataModel

public void setDataModel(java.io.InputStream inputStream)
                  throws XDOException
Throws:
XDOException

getParameters

public com.sun.java.util.collections.ArrayList getParameters()
                                                      throws XDOException
Returns the ArrayList holding oraccle.apps.xdo.dataengine.Parameter.
Throws:
XDOException

setParameters

public void setParameters(com.sun.java.util.collections.Hashtable paramters)
Pass the parameter as Name:Value pair using Hashtable. Value could be a Object.
Parameters:
paramters - Hashtable

setParameters

public void setParameters(com.sun.java.util.collections.ArrayList parameters)
Pass the parameter as ArrayList holding oracle.apps.xdo.dataengine.Parameter Object.
Parameters:
parameters - ArrayList

setConnection

public void setConnection(java.sql.Connection connection)
Set the JDBC Connection.
Parameters:
connection - Connection

setDistributedConnections

public void setDistributedConnections(com.sun.java.util.collections.Hashtable connections)
Set the JDBC Connections as Hashtable for distributed queries. Pass dataSourceRef as Key and corresponding Connection as value.
Parameters:
connections - Hashtable

setOutput

public void setOutput(java.io.OutputStream outStream)
Set the output stream to write the XML output.
Parameters:
outStream - OutputStream

setOutput

public void setOutput(java.lang.String outFile)
Set the output file to write the XML output.
Parameters:
outFile - [Absolute path] String

processData

public void processData()
                 throws XDOException,
                        java.sql.SQLException
Start Processing and write XML to specified destination. All required parameter should be set before start the process.
Throws:
XDOException
java.sql.SQLException

processDataStructre

public void processDataStructre()
                         throws XDOException,
                                java.sql.SQLException
Throws:
XDOException
java.sql.SQLException

setTraceOn

public void setTraceOn()
Set SQL trace on.

setDebugLogOn

public void setDebugLogOn()
Strat Debug Logging.

writeXMLSchema

public void writeXMLSchema(java.lang.String fileName)
                    throws java.io.IOException,
                           XDOException,
                           oracle.xml.parser.v2.XSLException,
                           java.lang.Exception
Throws:
java.io.IOException
XDOException
oracle.xml.parser.v2.XSLException
java.lang.Exception

writeXMLSchema

public void writeXMLSchema(java.io.OutputStream outStream)
                    throws java.io.IOException,
                           XDOException,
                           oracle.xml.parser.v2.XSLException,
                           java.lang.Exception
Throws:
java.io.IOException
XDOException
oracle.xml.parser.v2.XSLException
java.lang.Exception

getXMLSchema

public org.w3c.dom.Document getXMLSchema()
                                  throws XDOException,
                                         oracle.xml.parser.v2.XSLException,
                                         java.lang.Exception
Throws:
XDOException
oracle.xml.parser.v2.XSLException
java.lang.Exception

setMaxRows

public void setMaxRows(int maxRows)
                throws XDOException,
                       java.sql.SQLException
Set the maximum no of rows. Use this to generate sample data. By default it sets to -1 to fetch all the rows.
Parameters:
maxRows - int
Throws:
XDOException
java.sql.SQLException

writeDefaultLayout

public void writeDefaultLayout(java.io.OutputStream outStream)
                        throws java.lang.Exception,
                               XDOException
Throws:
java.lang.Exception
XDOException

writeDefaultLayout

public void writeDefaultLayout(java.lang.String fileName)
                        throws java.lang.Exception,
                               XDOException
Throws:
java.lang.Exception
XDOException

setScalableModeOn

public void setScalableModeOn()

setSql

public void setSql(java.lang.String sqlQuery)
            throws XDOException
Throws:
XDOException

getDataTemplate

public org.w3c.dom.Document getDataTemplate()
                                     throws java.lang.Exception,
                                            XDOException
Throws:
java.lang.Exception
XDOException

WriteXDOReport

public void WriteXDOReport(java.lang.String dataSorceRef,
                           java.lang.String layoutTemplate,
                           java.io.OutputStream outStream,
                           java.lang.String description,
                           java.lang.String reportTitle)
                    throws java.lang.Exception,
                           XDOException
Throws:
java.lang.Exception
XDOException

WriteXDOReport

public void WriteXDOReport(java.lang.String dataSorceRef,
                           java.lang.String layoutTemplate,
                           java.lang.String fileName,
                           java.lang.String description,
                           java.lang.String reportTitle)
                    throws java.lang.Exception,
                           XDOException
Throws:
java.lang.Exception
XDOException

setRowTag

public void setRowTag(java.lang.String rowTag)

setRowsetTag

public void setRowsetTag(java.lang.String rowSetTag)

includeParameters

public void includeParameters(boolean includeParameter)

getDataSourceRefs

public java.util.Vector getDataSourceRefs()
                                   throws XDOException
Returns the List of DataSourceRef used in data template.
Throws:
XDOException

setConfig

public void setConfig(java.util.Properties props)
To specify Data Engine properties programmatically.
Parameters:
props -

Skip navigation links

Oracle BI Publisher Java API Reference
Release 10.1.3.4


© 2004, 2005, 2006, 2007, 2008, Oracle. All rights reserved.