Using the Delivery Manager Java APIs 8-33
■
S : 2 digit sec 00 - 59
■
l : 3 digit millisec 000 - 999 For example, if you specify my_file_ymd.txt for the filename, the actual
filename will would be my_file_20051108.txt for November 8, 2005. All undefined expressions will be translated into 0 length string, for example, if you
specify my_file_abc.txt, it would generate my_file_.txt. You can escape the character by passing .
8.18 Internationalization Support
The Delivery Server API supports following internationalization features for the listed delivery channels:
8.18.1 SMTP
■
Specify character encoding for the main document with SMTP_CONTENT_TYPE.
■
Specify character encoding for the attachments by passing content type when you call addAttachment method.
■
Specify the character encoding for email ToFromCCSubject with SMTP_ CHARACTER_ENCODING property. The default value is UTF-8.
8.18.2 IPP
■
Specify character encoding for the IPP attributes by using IPP_ATTRIBUTE_ CHARSET property. The default value is UTF-8.
■
Specify IPP_URL_CHARACTER_ENCODING property for encoding non-ASCII letters in a URL.
8.18.3 WebDAV
■
Specify WEBDAV_URL_CHARACTER_ENCODING property for encoding non-ASCII letters in a URL.
8.18.4 FTP
■
The FTP delivery channel automatically detects the internationalization support in the target FTP server. You can specify a non-ASCII directory name and file name
only if the FTP server supports internationalization see RFC 2640 for more detail. In that case, the UTF-8 encoding will be used automatically. If the server does not
support internationalization and you specify a non-ASCII value, an exception will be thrown during the delivery process.
8.18.5 HTTP
■
You can specify HTTP_CHARACTER_ENCODING property for encoding non-ASCII letters in a URL.
8.19 Setting Global Properties
You can define the global properties to the DeliveryManager so that all the delivery requests inherit the global properties automatically.
The following global properties are supported:
8-34 Developers Guide for Oracle Business Intelligence Publisher
Example 8–34 Sample Code for Setting Global Properties
create delivery manager instance DeliveryManager dm = new DeliveryManager;
set global properties dm.addPropertyDeliveryPropertyDefinitions.TEMP_DIR, tmp;
dm.addPropertyDeliveryPropertyDefinitions.BUFFERING_MODE, true; create delivery requests
DeliveryRequest req1 = dm.createRequestDeliveryManager.TYPE_IPP_PRINTER; DeliveryRequest req2 = dm.createRequestDeliveryManager.TYPE_IPP_FAX;
DeliveryRequest req3 = dm.createRequestDeliveryManager.TYPE_SMTP_EMAIL; :
:
8.20 Adding a Custom Delivery Channel
You can add custom delivery channels to the system by following the steps below:
1.
Define the delivery properties
2.
Implement the DeliveryRequest interface
3.
Implement the DeliveryRequestHandler interface
4. Implement the DeliveryRequestFactory interface
5. Register your custom DeliveryRequestFactory to the DeliveryManager
The following sections detail how to create a custom delivery channel by creating a sample called File delivery channel that delivers documents to the local file system.
8.20.1 Define Delivery Properties
The first step to adding a custom delivery channel is to define the properties. These will vary depending on what you want your channel to do. You can define constants
for your properties. Our example, a file delivery channel requires only one property, which is the destination.
Sample code is:
Example 8–35 Sample Code for Defining Delivery Channel Properties
package oracle.apps.xdo.delivery.file; public interface FilePropertyDefinitions
{
Table 8–13 Global Properties Supported by the DeliveryManager API
Property Description
BUFFERING_MODE Valid values are true default and false. See
Section 8.14, Direct and Buffering Modes.
TEMP_DIR Define the location of the temporary directory.
CA_CERT_FILE Define the location of the CA Certificate file generated by
Oracle Wallet Manager. This is used for SSL connection with the Oracle SSL library. If not specified, the default CA
Certificates are used.