Skip navigation links

Oracle BI Publisher Java API Reference
Release 10.1.3.4


oracle.apps.xdo.batch
Class DocumentProcessor

java.lang.Object
  extended by oracle.apps.xdo.batch.DocumentProcessor


public class DocumentProcessor
extends java.lang.Object

The class DocumentProcessor provides a complete beginning-to-end report flow. There are two main functions listed below.

The DocumentProcessor (a.k.a XML API) takes one XML instruction file. The XML file contains more than one set of pairs of template and data. Please refer to XML Publisher Develier's Guide for more detail. Here is how to use it.

  DocumentProcessor docProcessor = null;
  try
  {
    docProcessor = new DocumentProcessor(xmlFilePath, temporaryDirectory);
    Vector outputList = docProcessor.process();
  }
  catch(IOException ioe)
  {
    // If this exception is thrown, the temporaryDirectory information is incorrect.
    ioe.printStackTrace();
  }
  catch(Exception exc)
  {
    //If this exception is thrown, process() failed
    exc.printStackTrace();
  }
 

The command line usage is following.

 java oracle.apps.xdo.batch.DocumentProcessor -tempdir <tempdir> <xml file>
 

Please refer to main() method for more.

Version:
5.0
Author:
Incheol Kang.
See Also:

Field Summary
static java.lang.String ENC_LEVEL
           
static java.lang.String ENC_OWNER_PW
           
static java.lang.String ENC_USER_PW
           
static java.lang.String RCS_ID
           
static boolean RCS_ID_RECORDED
           

 

Constructor Summary
DocumentProcessor(java.io.InputStream xmlInputStream, java.io.InputStream dataInputStream, java.lang.String tmpDir)
          Constructors a new DocumentProcessor for bursting process.
DocumentProcessor(java.io.InputStream xmlInputStream, java.lang.String tmpDir)
          Constructors a new DocumentProcessor.
DocumentProcessor(java.io.Reader xmlInputReader, java.io.Reader dataInputReader, java.lang.String tmpDir)
          Constructors a new DocumentProcessor for bursting process.
DocumentProcessor(java.io.Reader xmlInputReader, java.lang.String tmpDir)
          Constructors a new DocumentProcessor.
DocumentProcessor(java.lang.String xmlInput, java.lang.String tmpDir)
          Constructors a new DocumentProcessor.
DocumentProcessor(java.lang.String xmlInput, java.lang.String dataInput, java.lang.String tmpDir)
          Constructors a new DocumentProcessor for bursting process.

 

Method Summary
 void cleanup()
          Clean ups any temporary files explicitly.
static void main(java.lang.String[] args)
          This DocumentProcessor can run on command mode.
 java.util.Vector process()
          Returns the generated output path list so that the client of DocumentProcessor can print them.
 void registerListener(BurstingListener listener)
          Registers the listener for bursting process.
 void removeListener(BurstingListener listener)
          Removes the listener.
 void setConfig(java.util.Properties configProp)
          Let users specify XDO properties programatically.
 void setConfig(java.lang.String propName, java.lang.String propValue)
          Please refer to setConfig(Properties prop) for more info.

 

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

ENC_USER_PW

public static final java.lang.String ENC_USER_PW

ENC_OWNER_PW

public static final java.lang.String ENC_OWNER_PW

ENC_LEVEL

public static final java.lang.String ENC_LEVEL

Constructor Detail

DocumentProcessor

public DocumentProcessor(java.io.InputStream xmlInputStream,
                         java.lang.String tmpDir)
Constructors a new DocumentProcessor. The "tmpDir" can be null if the default configuration file has valid system-temp-dir. If the "tmpDir" is incorrect and a default configuration file doesn't include valid system-temp-dir info. Closing the InputStream is required after calling the process().
Parameters:
xmlInputStream - the instruction XML InputStream.
tmpDir - the temporary directory information which has enough free space.

DocumentProcessor

public DocumentProcessor(java.lang.String xmlInput,
                         java.lang.String tmpDir)
Constructors a new DocumentProcessor. The "tmpDir" can be null if the default configuration file has valid system-temp-dir.
Parameters:
xmlInput - the instruction XML file path.
tmpDir - the temporary directory information which has enough free space.

DocumentProcessor

public DocumentProcessor(java.io.Reader xmlInputReader,
                         java.lang.String tmpDir)
                  throws java.io.IOException
Constructors a new DocumentProcessor. The "tmpDir" can be null if the default configuration file has valid system-temp-dir. If the "tmpDir" is incorrect and a default configuration file doesn't include valid system-temp-dir info. Closing the xmlInputReader is required after calling the process().
Parameters:
xmlInputReader - the instruction XML Reader.
tmpDir - the temporary directory information which has enough free space.
Throws:
java.io.IOException

DocumentProcessor

public DocumentProcessor(java.io.InputStream xmlInputStream,
                         java.io.InputStream dataInputStream,
                         java.lang.String tmpDir)
Constructors a new DocumentProcessor for bursting process. The dataInputStream is the XML Data Source for bursting process. It can be null if XML API contains inline data element for each template, other wise it's mandatory. The "tmpDir" can be null if the default configuration file has valid system-temp-dir.
Parameters:
xmlInputStream - the instruction XML InputStream.
dataInputStream - the XML Data InputStream.
tmpDir - the temporary directory information which has enough free space.

DocumentProcessor

public DocumentProcessor(java.lang.String xmlInput,
                         java.lang.String dataInput,
                         java.lang.String tmpDir)
Constructors a new DocumentProcessor for bursting process. The dataInput is the file path for XML Data Source for bursting process. It can be null if XML API contains inline data element for each template, other wise it's mandatory. The "tmpDir" can be null if the default configuration file has valid system-temp-dir.
Parameters:
xmlInput - the instruction XML file path.
dataInput - the XML Data file path.
tmpDir - the temporary directory information which has enough free space.

DocumentProcessor

public DocumentProcessor(java.io.Reader xmlInputReader,
                         java.io.Reader dataInputReader,
                         java.lang.String tmpDir)
Constructors a new DocumentProcessor for bursting process. The dataInputReader is the reader for XML Data Source for bursting process. It can be null if XML API contains inline data element for each template, other wise it's mandatory. The "tmpDir" can be null if the default configuration file has valid system-temp-dir.
Parameters:
xmlInputReader - the instruction XML Reader.
dataInputReader - the Data Reader.
tmpDir - the temporary directory information which has enough free space.

Method Detail

process

public java.util.Vector process()
                         throws java.io.IOException,
                                java.lang.Exception
Returns the generated output path list so that the client of DocumentProcessor can print them. Exception is thrown if the XML is not welformed or not conforming to XML API spec. If the "tmpDir" is incorrect and a default configuration file doesn't include valid system-temp-dir info, then IOException is thrown. Please refer to XML Publisher Developer's Guide for more.
Throws:
java.io.IOException
java.lang.Exception

cleanup

public void cleanup()
Clean ups any temporary files explicitly. If the process is nomally finished, the temporary files are expected to be deleted. However, the process is done abnormally, the temporary files are unexpectedly remained. In that case, calling this method will explicitly cleans up the files.

setConfig

public void setConfig(java.util.Properties configProp)
               throws java.lang.IllegalArgumentException
Let users specify XDO properties programatically.
The properties include ones for security and for user variable support.
The DocumentProcessor XML should contain security setting in the config element to encrypt outputs.
This method provides an option to encrypt the outputs even if the XML doesn't contain any security specific info.

Please see the following example.
 Properties prop = new Properties();
 prop.put(DocumentProcessor.ENC_USER_PW, "");
 prop.put(DocumentProcessor.ENC_OWNER_PW, "xxxx");
 prop.put(DocumentProcessor.ENC_LEVEL, "0");
 docProcessor.setConfig(prop);
 
At least, two properties(ENC_USER_PW and ENC_OWNER_PW) must be specified to encrypt the output.
If the "ENC_LEVEL" is not specified, then the default value is "0" which means 40 bit encryption.
The "ENC_LEVEL" can be "1" which means 128 bit encryption. Customers can specify user variable if the XML's data contains virtual path like "output=${OA_HTML}/a.pdf"
Please see the following example.

 docProcessor.setConfig("user-variable.OA_HTML", "/usr/home/OA_HTML");
 
Parameters:
configProp - the properties including security and user variables.
Throws:
java.lang.IllegalArgumentException
See Also:
setConfig(String propName, String propValue)

setConfig

public void setConfig(java.lang.String propName,
                      java.lang.String propValue)
               throws java.lang.IllegalArgumentException
Please refer to setConfig(Properties prop) for more info.
Parameters:
propName - the XDO property key
propValue - the proper value
Throws:
java.lang.IllegalArgumentException
See Also:
setConfig(Properties configProp)

main

public static void main(java.lang.String[] args)
This DocumentProcessor can run on command mode. The usage is following
  usage : java oracle.apps.xdo.batch.DocumentProcessor [-debug] -tempdir physicalPath xmlPath
 
  usage for Bursting process : java oracle.apps.xdo.batch.DocumentProcessor [-debug] -tempdir physicalPath -datafile dataFilePath xmlPath
 
The "debug" parameter can be used only for debugging purpose. If the "debug" is turned on, performance will be slow down. The "tempdir" parameter should have enough free space so that DocumentProcessor can create and delete internal files.

registerListener

public void registerListener(BurstingListener listener)
Registers the listener for bursting process.
Parameters:
listener -

removeListener

public void removeListener(BurstingListener listener)
Removes the listener.
Parameters:
listener -

Skip navigation links

Oracle BI Publisher Java API Reference
Release 10.1.3.4


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