原文地址:XML Publisher Using API’s

Applications Layer APIs
The applications layer of XML Publisher allows you to store and manager data sources
and templates through the Template Manager user interface via the XML Publisher
Administrator responsibility. You can also access and manipulate these objects via an
application program interfaces.

Data sources and templates are stored in the database. This includes the metadata
describing the object and the physical object itself (for example, an RTF file). Use these
APIs to register, update, and retrieve information about datasources and templates. You
can also call use the APIs to call XML Publisher to apply a template to a data source to
generate output documents directly (without going through the concurrent manager).

Datasource APIs
The following APIs are provided to access and manipulate the data definitions
programmatically:
• DataSource Class
The data source acts as a placeholder object against which you register templates. The
DataSource class represents a single data source definition entry.
• DataSourceHelper Class
This is a utility class that can be used to manage data source definition entries in the
Template Manager repository.

Getting AppsContext
All methods require the AppsContext instance to communicate with the Applications
database like If you are using this class in a Java concurrent program, pass CpContext as an
AppsContext.

Creating Data Source Definition Entries
Add a new data source definition entry to the Template Manager repository as follows:
1. Create an instance of the DataSource class by calling the
DataSource.createInstance() method.
2. Set the attributes of the instance.
3. Pass it to the DataSourceHelper.createDataSource()method.

Adding, Updating, and Deleting Schema Files and Sample Files
You can add, update and delete the data source schema definition file and the sample
XML file by calling methods defined in the DataSourceHelper class. Please note that
unlike the deleteDataSource() method described above, these methods actually
delete the schema file and sample records from the repository.
Example
// Add a schema definition file
DataSourceHelper.addSchemaFile(ctx, “XDO”, “TestDataSource”,
“schema.xsd”, new FileInputStream(“/path/to/schema.xsd”));
// Add a sample xml data file
DataSourceHelper.addSampleFile(ctx, “XDO”, “TestDataSource”,
“sample.xml”, new FileInputStream(“/path/to/sample.xml”));
// Update a schema definition file
DataSourceHelper.addSchemaFile(ctx, “XDO”, “TestDataSource”,
new FileInputStream(“/path/to/new_schema.xsd”));
// Update a sample xml data file
DataSourceHelper.addSampleFile(ctx, “XDO”, “TestDataSource”,
new FileInputStream(“/path/to/new_sample.xml”));
// Delete a schema definition file
DataSourceHelper.deleteSchemaFile(ctx, “XDO”, “TestDataSource”);
// Delete a sample xml data file
DataSourceHelper.deleteSampleFile(ctx, “XDO”, “TestDataSource”);

Getting Schema Files and Sample Files from the Repository
You can download schema files or sample files from the repository by calling the
getSchemaFile() or the getSampleFile() method. These methods return an
InputStream connected to the file contents as a return value.
The sample code is as follows:
Example
// Download the schema definition file from the repository
InputStream schemaFile = DataSourceHelper.getSchemaFile(ctx, “XDO”, “TestDataSource”, );
// Download the XML sample data file from the repository
InputStream sampleFile = DataSourceHelper.getSampleFile(ctx, “XDO”, “TestDataSource”, );

Template APIs
Multiple template objects can be associated with a single data source. The Template
class represents a single template instance. The TemplateHelper class is a utility class
used to create and update template objects in the Template Manager.

The Template Class
The Template class represents a single template object in the template manager. It is
associated with a data source object. The class has several get and set methods to
manipulate the template object.
TemplateHelper Class
The TemplateHelper class is a utility class to manage the template entries in the
Template Manager repository. It consists of a set of static utility methods.

Creating Template EntriesTo add a new template entry to the Template Manager repository:
1. Create an instance of the Template class by calling the
Template.createInstance() method
2. Set the attributes of the instance.
3. Pass it to the TemplateHelper.createTemplate() method
Example
// Create an instance
Template t = Template.createInstance(appsContext, “XDO”,”TestTemplate”,
TypeDefinitions.TEMPLATE_TYPE_PDF, “XDO”, “TestTemplate”);
// Set properties
t.setDescription(“This is the test template entry.”);
t.setStartDate(new java.sql.Date(System.currentTimeMillis()));
t.setName(“Test template !”);
t.setStatus(TypeDefinitions.TEMPLATE_STATUS_ENABLED);
// Call createTemplate() to create an entry into the repository
TemplateHelper.createTemplate(am, t);

Where am = oracle apps module.

Adding, Updating, and Deleting Template Files
You can add, update and delete template files by calling methods defined in the
TemplateHelper class.

Example
// Add English template file to the template entry
TemplateHelper.addTemplateFile(
appsContext, // AppsContext
“XDO”, // Application short name of the template
“TestTemplate”, // Template code of the template
“en”, // ISO language code of the template
“US”, // ISO territory code of the template
Template.TEMPLATE_TYPE_PDF, // Type of the template file
“us.pdf”, // Filename of the template file
new FileInputStream(“/path/to/us.pdf”)); // Template file

// Add Japanese template file to the template entry
TemplateHelper.addTemplateFile(
appsContext, // AppsContext
“XDO”, // Application short name of the template
“TestTemplate”, // Template code of the template
“ja”, // ISO language code of the template
“JP”, // ISO territory code of the template
Template.TEMPLATE_TYPE_PDF, // Type of the template file
“ja.pdf”, // Filename of the template file
new FileInputStream(“/path/to/ja.pdf”)); // Template file

// Update English template file to the template entry
TemplateHelper.updateTemplateFile(
appsContext, // AppsContext
“XDO”, // Application short name of the template
“TestTemplate”, // Template code of the template
“en”, // ISO language code of the template
“US”, // ISO territory code of the template
Template.TEMPLATE_TYPE_PDF, // Type of the template file
“us.pdf”, // Filename of the template file
new FileInputStream(“/path/to/new/us.pdf”)); // Template file

// Delete Japanese template file to the template entry
TemplateHelper.deleteTemplateFile(
appsContext, // AppsContext
“XDO”, // Application short name of the template
“TestTemplate”, // Template code of the template
“ja”, // ISO language code of the template
“JP”); // ISO territory code of the template

Getting Template FilesDownload template file contents from the repository by calling the getTemplateFile() methods. These methods return an InputStream connected to
the template file as a return value.
Example
// Download the English template file from the repository
InputStream in = TemplateHelper.getTemplateFile(
appsContext, // AppsContext
“XDO”, // Application short name of the template
“TestTemplate”, // Template code of the template
“en”, // ISO language code of the template
“US”); // ISO territory code of the template

Processing TemplatesYou can apply a template, stored in the Template Manager, to an XML data source by
calling one of the processTemplate() methods. You need to pass the OutputStream
object for the destination of the processed document.
Example
// Process template
TemplateHelper.processTemplateFile(
appsContext, // AppsContext
“XDO”, // Application short name of the template
“TestTemplate”, // Template code of the template
“en”, // ISO language code of the template
“US”, // ISO territory code of the template
dataInputStream, // XML data for the template
TemplateHelper.OUTPUT_TYPE_PDF, // Output type of the procesed
document
properties, // Properties for the template processing
docOutputStream) // OutputStream where the processed document goes.

XML Publisher Using API’s(转)的更多相关文章

  1. How to Delete XML Publisher Data Definition Template

    DECLARE  -- Change the following two parameters  VAR_TEMPLATECODE  VARCHAR2(100) := 'CUX_CHANGE_RPT1 ...

  2. OAF与XML Publisher集成(转)

    原文地址:OAF与XML Publisher集成 有两种方式,一种是用VO与XML Publisher集成,另一种是用PL/SQL与XML Publisher集成 用VO与XML Publisher集 ...

  3. BIP_开发案例07_将原有Report Builer报表全部转为XML Publisher形式(案例)

    2014-05-31 Created By BaoXinjian

  4. How to Determine the Version of Oracle XML Publisher for Oracle E-Business Suite 11i and Release 12 (Doc ID 362496.1)

    Modified: 29-Mar-2014 Type: HOWTO In this DocumentGoal   Solution   1. Based upon an output file gen ...

  5. xml publisher根据条件显示或隐藏列

     xml publisher根据条件显示或隐藏列 <?if@column:condition? > -- <?end if?> 样例: 依据PROJECT_FLAG标签显示 ...

  6. XML Publisher Report Issues, Recommendations and Errors

    In this Document   Purpose   Questions and Answers   References APPLIES TO: Oracle Process Manufactu ...

  7. 使用XML Publisher导出PDF报表

    生成XML数据源有两种方式. 一种是使用存储过程,返回一个clob作为xml数据源. 另一种是直接使用VO中的数据生成xml数据源. 方法一参考: Oracle XML Publisher技巧集锦 O ...

  8. OAF 中下载使用XML Publisher下载PDF附件

    OAF doesn't readily expose the Controller Servlet's HttpRequest and HttpResponse objects so you need ...

  9. EBS xml publisher中文乱码

    http://www.cnblogs.com/benio/archive/2011/11/22/2259313.html   由于本机环境问题,导致做的xml publisher报表跑不出来. 无法显 ...

随机推荐

  1. 干货:Java并发编程系列之synchronized(一)

    1. 使用方法 synchronized 是 java 中最常用的保证线程安全的方式,synchronized 的作用主要有三方面: 确保线程互斥的访问代码块,同一时刻只有一个方法可以进入到临界区 保 ...

  2. 解析分布式锁之Zookeeper实现(一)

    实现分布式锁目前有三种流行方案,分别为基于数据库.Redis.Zookeeper的方案,本文主要阐述基于Zookeeper的分布式锁,其他两种会在后文中一起探讨.现在我们来看下使用Zookeeper如 ...

  3. nginx/ajax跨子域请求的两种现代方法以及403解决

    因为面向互联网的性质,我们公司的大部分系统都采用多子域的方式进行开发和部署,以达到松耦合和分布式的目的,因此子系统间的交互不可避免.虽然通过后台的rpc框架解决了大部分的交互问题,但有些情况下,前端直 ...

  4. 01: RabbitMQ

    目录: 1.1 RabbitMq与Redis队列对比 1.2 在win7 64位机上安装RabbitMQ 1.3 RabbitMQ消息分发轮询 与 持久化 1.4 RabbitMQ 设定某个队列里最大 ...

  5. 20145212罗天晨 逆向及Bof基础实践

    20145212罗天晨<网络对抗>第1周学习总结--逆向及Bof基础实践 逆向及Bof基础实践 一.实践目标 1.运行原本不可访问的代码片段 2.强行修改程序执行流 3.以及注入运行任意代 ...

  6. VC++ PathFindFileName函数,由文件路径获得文件名

    1.PathFindFileName函数的作用是返回路径中的文件名. PTSTR PathFindFileName( __in PTSTR pPath ); pPath是指向文件路径字符串的指针,函数 ...

  7. python字符串、列表和文件对象总结

    1.字符串是字符序列.字符串文字可以用单引号或者双引号分隔. 2.可以用内置的序列操作来处理字符串和列表:连接(+).重复(*).索引([]),切片([:])和长度(len()).可以用for循环遍历 ...

  8. 详解C中的volatile关键字【转】

    本文转载自:http://www.cnblogs.com/yc_sunniwell/archive/2010/06/24/1764231.html volatile提醒编译器它后面所定义的变量随时都有 ...

  9. illumina support

    http://support.illumina.com/help/BaseSpace_App_WGS_BWA_help/Content/Vault/Informatics/Sequencing_Ana ...

  10. React Native基础概念和基础认识

    学习地址:https://github.com/vczero/react-native-lesson 当我们初始化一个RN项目的时候主要的是index.ios.js文件和index.android.j ...