7-30 Developers Guide for Oracle Business Intelligence Publisher
SignatureFields signFields = pdfSignature.getSignatureFields; Vector signedFieldNames = signFields.getSignatureFieldNames;
int size = signedFieldNames.size; forint i = 0 ; i size ; i++
{ String signFieldName = StringsignedFieldNames.elementAti;
SignatureField signField = signFields.getSignatureFieldsignFieldName; boolean isValid = signField.verifyDocument;
System.out.printlnValid? : + isValid; boolean isCertValid = signField.verifyCertificatestrustedCerts, null;
System.out.printlnTrusted? : + isCertValid; }
} catchThrowable t
{ t.printStackTrace;
}
7.10 eText Processor
The eText Processor enables you to convert RTF eText templates to XSL, and merge the XSL with XML to produce text output for EDI and EFT transmissions.
7.10.1 Converting RTF eText Templates to XSL
The following is an example of an API method call that converts an RTF eText template to XSL:
Example 7–32 Sample Code for Converting RTF eText Templates to XSL
String rtf = test.rtf; etext template filename String xsl = out.xsl; xsl-fo filename
Properties prop = new Properties;
try {
EFTProcessor p = new EFTProcessor; p.setTemplatertf;
p.setConfigprop; p.setOutputxsl;
p.process; }
catch Exception e {
e.printStackTrace; }
7.10.2 Producing Text Output for EDI and EFT Transmissions
The following is an example of an API method call that merges XSL with XML to produce eText output:
Example 7–33 Sample Code for Producing Text Output for EDI and EFT Transmissions
String rtf = test.rtf; etext template filename String xml = “data.xml”; xml data filename
String etext = “etext.txt”; etext output filename Properties prop = new Properties;
Using the BI Publisher Java APIs 7-31
try {
EFTProcessor p = new EFTProcessor; p.setConfigprop;
p.setTemplatertf; p.setDataxml;
p.setOutputetext; p.process;
} catch Exception e
{ e.printStackTrace;
}
7.11 Document Processor Engine
The Document Processor Engine provides batch processing functionality to access a single API or multiple APIs by passing a single XML instance document to specify
template names, data sources, languages, output type, output names, and destinations.
This solution enables batch printing with BI Publisher, in which a single XML document can be used to define a set of invoices for customers, including the preferred
output format and delivery channel for those customers. The XML format is very flexible allowing multiple documents to be created or a single master document.
This section:
■
Describes the hierarchy and elements of the Document Processor XML file
■
Provides sample XML files to demonstrate specific processing options
■
Provides example code to invoke the processors
7.11.1 Hierarchy and Elements of the Document Processor XML File
The Document Processor XML file has the following element hierarchy: Requestset
request delivery
filesystem print
fax number
email message
document background
text pagenumber
template data
This hierarchy is displayed in the following illustration:
7-32 Developers Guide for Oracle Business Intelligence Publisher
Figure 7–6 Hierarchy and Elements of the Document Processor XML File
The following table describes each of the elements:
Table 7–1 Elements in Document Processor XML File Hierarchy
Element Attributes
Description
requestset xmlns
version Root element must contain
[xmlns:xapi=http:xmlns.o racle.comoxpxapi] block
The version is not required, but defaults to 1.0.
request NA
Element that contains the data and template processing definitions.
delivery NA
Defines where the generated output is sent.
document output-type
Specify one output that can have several template elements. The
output-type attribute is optional. Valid values are:
pdf Default rtf
html excel
text filesystem
output Specify this element to save the
output to the file system. Define the directory path in the output
attribute.
print
■
printer
■
server-alias The print element can occur
multiple times under delivery to print one document to several
printers. Specify the printer attribute as a URI, such
as:ipp:myprintserver:631 printersprintername