XML Publisher Using API’s(转)
原文地址: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(转)的更多相关文章
- How to Delete XML Publisher Data Definition Template
DECLARE -- Change the following two parameters VAR_TEMPLATECODE VARCHAR2(100) := 'CUX_CHANGE_RPT1 ...
- OAF与XML Publisher集成(转)
原文地址:OAF与XML Publisher集成 有两种方式,一种是用VO与XML Publisher集成,另一种是用PL/SQL与XML Publisher集成 用VO与XML Publisher集 ...
- BIP_开发案例07_将原有Report Builer报表全部转为XML Publisher形式(案例)
2014-05-31 Created By BaoXinjian
- 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 ...
- xml publisher根据条件显示或隐藏列
xml publisher根据条件显示或隐藏列 <?if@column:condition? > -- <?end if?> 样例: 依据PROJECT_FLAG标签显示 ...
- XML Publisher Report Issues, Recommendations and Errors
In this Document Purpose Questions and Answers References APPLIES TO: Oracle Process Manufactu ...
- 使用XML Publisher导出PDF报表
生成XML数据源有两种方式. 一种是使用存储过程,返回一个clob作为xml数据源. 另一种是直接使用VO中的数据生成xml数据源. 方法一参考: Oracle XML Publisher技巧集锦 O ...
- OAF 中下载使用XML Publisher下载PDF附件
OAF doesn't readily expose the Controller Servlet's HttpRequest and HttpResponse objects so you need ...
- EBS xml publisher中文乱码
http://www.cnblogs.com/benio/archive/2011/11/22/2259313.html 由于本机环境问题,导致做的xml publisher报表跑不出来. 无法显 ...
随机推荐
- HTML 和 JavaScript 实现飘花的效果
HTML 和 JavaScript 实现飘花的效果,也不算花,就是有悬浮物飘下来,和下雪似的. 也是不需要图片和其他的 js 脚本做辅助,其实已经全写在 HTML 文件中了. <html> ...
- 使用PopupWindow弹窗提醒
一.新建view.xml 注意里面的控件要一个一个的定义离上一个控件的距离,即margin_top,不然最后的效果是紧缩的 二.在java中定义两个变量 1.View view=null: 2.pop ...
- MVC 视图的简单学习
视图学习第一阶段:http://www.cnblogs.com/meetyy/p/3464432.html 视图学习第二阶段:http://www.cnblogs.com/meetyy/p/34665 ...
- 主引导记录MBR的结构和作用
MBR磁盘分区都有一个引导扇区,称为主引导记录,英文简称为MBR.1. MBR的结构MBR扇区位于整个硬盘的第一个扇区:按照C/H/S地址描述,即0柱面〇磁头1扇 区:按照LBA地址描述即0扇区.它是 ...
- HDU 2841 Visible Trees(容斥)题解
题意:有一块(1,1)到(m,n)的地,从(0,0)看能看到几块(如果两块地到看的地方三点一线,后面的地都看不到). 思路:一开始是想不到容斥...后来发现被遮住的地都有一个特点,若(a,b)有gcd ...
- vuejs全局api概念
什么是全局API? 全局API并不在构造器里,而是先声明全局变量或者直接在Vue上定义一些新功能,Vue内置了一些全局API,比如我们今天要学习的指令Vue.directive.说的简单些就是,在构造 ...
- 04_Flume多节点load_balance实践
1.负载均衡场景 1)初始:上游Agent通过round_robin selector, 将event轮流发送给下游Collecotor1, Collector2 2)故障: 关闭Collector1 ...
- workerman如何写mysql连接池
首先要了解为什么用连接池,连接池能为你解决什么问题 连接池主要的作用1.减少与数据服务器建立TCP连接三次握手及连接关闭四次挥手的开销,从而降低客户端和mysql服务端的负载,缩短请求响应时间2.减少 ...
- Cocos2d-x学习笔记(十一)动作
动作类Action是一切动作的祖先类.它有三个直接继承子类: FiniteTimeAction受时间限制的动作: Follow精灵跟随精灵的动作: Speed运动速度控制: 而FiniteTimeAc ...
- AES SBox的构造(python)
几点需要注意的,求解逆元的时候使用的是拓展欧几里得,但是那些运算规则需要变一变,模2的加减乘除(或者可以理解为多项式的运算) 在进行字节的仿射变换不用进行矩阵的运算. 一个矩阵和一个列向量进行运算的时 ...