|
Oracle BI Publisher Java API Reference Release 10.1.3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.apps.xdo.template.RTFProcessor
public final class RTFProcessor
The class RTFProcessor class is the front-end class to use RTF Processing engine. To use RTFProcessor class, users have to instanciate this class and set parameters such as input, output and control parameters.
After setting the parameters, you can start processing by calling process() method.
Typical usage is following:
RTFProcessor processor = new RTFProcessor("/home/system.rtf");
processor.setOutput("/home/sample.xsl");
processor.process();
Stream data are also allowed to be set.
RTFProcessor processor = new RTFProcessor(rtfInputStream);
processor.setOutput(xslOutputStream);
processor.process();
Field Summary | |
---|---|
static int |
EXTRACT_AUTO This value is to let the processor to automatically choose whether it needs to extract attribute sets or not. |
static int |
EXTRACT_DISABLE This value is to let the processor not to extract attribute sets, this is suitable for sub template. |
static int |
EXTRACT_ENABLE This value is to force the processor to extract attribute sets, this is suitable for stand-alone template |
static java.lang.String |
RCS_ID |
static boolean |
RCS_ID_RECORDED |
Constructor Summary | |
---|---|
RTFProcessor(java.io.InputStream is) Constructor |
|
RTFProcessor(java.lang.String path) Constructor |
Method Summary | |
---|---|
java.lang.String[] |
getFieldNames() Return an String array of placeholder's element names found in the RTF file, only the names in <xsl:value-of> elements are return. |
java.util.Hashtable |
getTransUnits() Return a java.util.Hashtable of xliff's translate units key is the translate unit's ID, value is oracle.apps.xdo.common.xliff.TransUnit |
java.util.Hashtable |
getUserParameters() Return a java.util.hashtable of user defined parameters in the RTF template. |
static void |
main(java.lang.String[] args) Command line utility. |
org.w3c.dom.Document |
process() Run the RTF compiler to convert RTF to XSL. |
void |
setConfig(java.io.InputStream docLevelInputStream) Sets the configuration for the document to be processed. |
void |
setConfig(java.util.Properties prop) Sets the configuration for the document to be processed. |
void |
setConfig(java.lang.String docLevelConfigPath) Sets the configuration for the document to be processed. |
void |
setExtractAttributeSet(int flag) Deprecated. |
void |
setExtractXLIFF(boolean toExtract) Sets the flag to extract xliff file or not |
void |
setLocale(java.util.Locale locale) Sets the locale. |
void |
setLocale(java.lang.String locale) Sets the locale setting. |
void |
setMasterTemplate(java.io.InputStream is) |
void |
setMasterTemplate(java.lang.String path) set Master Template File's path |
void |
setOutput(java.io.OutputStream os) Set the output stream for XSL file |
void |
setOutput(java.lang.String path) Set the output XSL file's path |
void |
setSequenceID(java.lang.String seqID) Sets the sequence ID of current RTF template for sub-template generation |
void |
setXLIFFOutput(java.io.OutputStream os) Set the output stream for XLIFF file Calling this method will automatically turn on the xliff extraction flag. |
void |
setXLIFFOutput(java.lang.String path) Set the output XLIFF file's path. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String RCS_ID
public static final boolean RCS_ID_RECORDED
public static final int EXTRACT_ENABLE
public static final int EXTRACT_AUTO
public static final int EXTRACT_DISABLE
Constructor Detail |
---|
public RTFProcessor(java.lang.String path) throws java.io.IOException
path
- RTF source file's pathjava.io.IOException
- if file cannot be createdjava.io.IOException
public RTFProcessor(java.io.InputStream is)
in
- RTF input streamMethod Detail |
---|
public void setOutput(java.lang.String path) throws java.io.IOException
path
- the output XSL file's pathjava.io.IOException
- if file cannot be createdjava.io.IOException
public void setMasterTemplate(java.lang.String path) throws java.io.IOException
java.io.IOException
public void setMasterTemplate(java.io.InputStream is)
public void setXLIFFOutput(java.lang.String path) throws java.io.IOException
setExtractXLIFF(boolean toExtract)
path
- the output XLIFF file's pathjava.io.IOException
- if file cannot be createdjava.io.IOException
public void setExtractAttributeSet(int flag)
EXTRACT_AUTOMATIC
After 5.6.3, new XSLT run-time optimization made this obsolete.flag
- Set the value of how the processor will handle the attribute setsEXTRACT_AUTOMATIC
, EXTRACT_DISABLE
, EXTRACT_ENABLE
public void setOutput(java.io.OutputStream os)
out
- the outputStream for the XSLpublic void setXLIFFOutput(java.io.OutputStream os)
setExtractXLIFF(boolean toExtract)
out
- the outputStream for the XLIFFpublic org.w3c.dom.Document process() throws XDOException
org.w3c.dom.Document
object representing the XSL, returns null if processed unsuccessfully. If the OutputStream is set, then it also writes the xsl to the OutputStreamoracle.apps.xdo.XDOException
XDOException
public void setLocale(java.lang.String locale)
locale
- local Stringpublic void setLocale(java.util.Locale locale)
locale
- java localepublic void setConfig(java.util.Properties prop)
prop
- Properties for the document level configurationpublic void setConfig(java.io.InputStream docLevelInputStream)
configStream
- InputStream for the document level configurationpublic void setExtractXLIFF(boolean toExtract)
toExtract
- true if want to extract xliff from the generated rtf templatepublic java.util.Hashtable getTransUnits()
java.util.Hashtable
of xliff's translate units key is the translate unit's ID, value is oracle.apps.xdo.common.xliff.TransUnit
java.util.Hashtable
of xliff's translate unitspublic void setSequenceID(java.lang.String seqID)
seqID
- the sequence id to be setpublic void setConfig(java.lang.String docLevelConfigPath)
configFilePath
- file path for the document level configurationpublic java.lang.String[] getFieldNames() throws XDOException
oracle.apps.xdo.XDOException
XDOException
public java.util.Hashtable getUserParameters() throws XDOException
java.util.hashtable
of user defined parameters in the RTF template.
the hashtable uses the parameter's name as the key, and the default value as the hashed value. If default value is empty, it uses an empty string, i.e. "" without the double quotes.
Notice that, xsl:param can either accept default value from attribute "select" or from text node. RTF template checks if the attribute "select"'s value is empty or not, if not empty, use the attribute's value, if it's empty, uses the text node's value. This behavior is as same as the xslt engine's behavior.
If default value is set in attribute "select", it's usually an xpath statement. If default value is set as text node, it's usually a string. It's up to the user to choose which way they want to construct the xsl:param element, and hence how to parse the default values returned by the method. As a common convernion, we suggest user all to use attribute "select", not use text node.
RTF template also supports an extended attribute xdofo:label to specify a more readable label or description of the parameter, e.g.:
The first one uses XSLT's native notation
The second one uses XML Publisher's alias
When a parameter element has an xdofo:label attribute, the key is returned as following format
parameter_name(label), e.g., the key of the hash of above example is revenue(Mimimum Revenue to Be Shown) and the value is 0
This method only returns user-defined global parameters, and it doesn't return parameters in the sub-template or xml publisher's internal parameters.
oracle.apps.xdo.XDOException
XDOException
public static final void main(java.lang.String[] args) throws XDOException
args
- parameters for this processororacle.apps.xdo.XDOException
- raise XDOException if exception happensXDOException
|
Oracle BI Publisher Java API Reference Release 10.1.3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |