Using the Delivery Manager Java APIs 8-31
System.out.printlnRequest status msg : + pResponse.getStatusMessage; }
}
Once you implement the callback, you can pass your callback when you call the submit method of your DeliveryRequest. If you call the submit with the callback,
the delivery process will start in the background and the submit method will immediately return the control. Sample code follows:
Example 8–29 Sample Code for Submitting Callback Logic
create delivery manager instance DeliveryManager dm = new DeliveryManager;
create a delivery request DeliveryRequest req = dm.createRequestDeliveryManager.TYPE_IPP_PRINTER;
: :
submit request with the callback logic req.submitnew MyListener;
: :
8.16 Document Filter Support
The Delivery API supports the document filter functionality for all the supported protocols. This functionality enables you to call the native operating system OS
command to transform the document before each delivery request. To specify the filter, pass the native OS command string with the two placeholders for the input and
output filename: {infile} and {outfile}. You can set your filter in your delivery request as a delivery property. Following are two samples:
Example 8–30 Sample Code for Setting Document Filter as Delivery Property
The easiest filter, just copy the file : req.addPropertyDeliveryPropertyDefinitions.FILTER, cp {infile} {outfile};
Call pdftops utility to transform the PDF document into Postscript format req.addPropertyDeliveryPropertyDefinitions.FILTER, pdftops {infile}
{outfile};
Alternatively, you can also specify the filter for each server in the configuration file see
Section 8.21, Configuration File Support . In this case, the server will always use
this filter for the requests to this server:
Example 8–31 Sample Code for Setting Document Filter in Configuration File
: :
server name=printer1 type=ipp_printer default=true uriipp:myserver:80printersMyPrinter1.printeruri
filterpdftops {infile} {outfile}filter server
: :
8-32 Developers Guide for Oracle Business Intelligence Publisher
This is useful especially if you are trying to call IPP printers directly or IPP printers on Microsoft Internet Information Service IIS because those printers usually do not
accept PDF documents, but only limited document formats. With this functionality, you can call any of the native operating system OS commands to transform the
document to the format that the target printer can understand. For example, if you need to call the HP LaserJet printer setup on the Microsoft IIS from Linux, you can set
Ghostscript as a filter to transform the PDF document into the format that the HP LaserJet can understand.
Example 8–32 Sample Code for Setting Document Filter through OS Commands
specify filter req.addPropertyDeliveryPropertyDefinitions.FILTER,
gs -q -dNOPAUSE -dBATCH -sDEVICE=laserjet -sOutputFile={outfile} {infile};
Note that to use this functionality you must set the buffering mode must be enabled and a temporary directory must be specified. See
Section 8.21, Configuration File Support.
8.16.1 PDF-to-PostScript Conversion Filter
In addition, BI Publisher provides a PDF-to-Postscript Level 2 conversion filter. You do not need to set {infile} and {outfile} place holders to use this internal filter, instead,
directly specify the filter class as shown below:
Example 8–33 Sample for Setting the PDF-to-Postscript Level 2 Conversion Filter
req.addPropertyDeliveryPropertyDefinitions.FILTER, oracle.xdo.delivery.filter.PDF2PSFilterImpl;
server name=printer1 type=ipp_printer default=true ipp:myserver:80printersMyPrinter1.printer
filteroracle.xdo.delivery.filter.PDF2PSFilterImplfilter server
8.17 Date Expression Support
BI Publisher provides properties that support date expressions. Use date expressions if you want to name a file by the date, and have the date automatically set at run time.
The following properties support date expressions:
■
SMTP_CONTENT_FILENAME
■
FTP_REMOTE_FILENAME
■
WEBDAV_REMOTE_FILENAME The supported date expressions are:
■
y : 4 digit year ex, 1972, 2005
■
m : 2 digit month 00 - 12
■
d : 2 digit date 00 - 31
■
H : 24h based 2 digit hour 00 - 24
■
M : 2 digit minute 00 - 59