Building a Data Template
The BI Publisher data engine enables you to rapidly generate any kind of XML data structure against any database in a scalable, efficient manner. The data template is the method by which you communicate your request for data to the data engine. It is an XML document whose elements collectively define how the data engine will process the template to generate the XML.
The data engine supports the following functionality:
- Single and multiple data queries
- Query links
- Parameters
- Aggregate functions (SUM, AVG, MIN, MAX, COUNT)
- Event triggers
- Multiple data groups
The XML output generated by the data engine supports the following:
- Unicode for XML Output Unicode is a global character set that allows multilingual text to be displayed in a single application. This enables you to develop a single multilingual application and deploy it worldwide.
- Canonical format The data engine generates date elements using the canonical ISO date format: YYYY-MM-DDTHH24:MI:SS.FF3TZH:TZM for a mapped date element, and ######.## for number elements in the data template XML output.
The Data Template Definition
The data template is an XML document that consists of four basic sections: define parameters, define triggers, define data query, define data structure. This structure is shown in the following graphic:
As shown in the sample figure, the data template consists of a section in which parameters are declared in child elements; a section in which the SQL queries are defined in child elements; and a section in which the output XML structure is defined.
The table below lists the elements that make up the XML data template. Each element is described in detail in the following sections. Required elements are noted.
- name (Required)
- description
- version (Required)
- defaultPackage - the PL/SQL package name to resolve any lexical references, group filters, or data triggers defined in the template.
- dataSourceRef - (Required) the default data source reference for the entire data template.
- name (Required) - the property name.
- value - valid values for this property.
- name (Required) - the parameter name that will be referenced in the template.
- dataType - valid values are: "character", "date", "number"
- defaultValue - value to use for the parameter if none supplied from the data
- include_in_output - whether this parameter should appear in the XML output or not. The valid values are “true” and “false”.
- oracle.apps.fnd.flex.kff.segments_metadata
- oracle.apps.fnd.flex.kff.select
- oracle.apps.fnd.flex.kff.where
- oracle.apps.fnd.flex.kff.order_by
- name (Required) - the unique query identifier. Note that this name identifier will be the same across the data template. Enter the query inside the CDATA section.
- name (Required) - the unique query identifier.
- expressionPath – Xpath expression
- method – either GET or POST
- realm - authentication name
- username- valid username
- password - valid password
- parentQuery - specify the parent query name.
- parentColumn - specify the parent column name.
- childQuery - specify the child query name.
- childColumn - specify the child column name.
- condition - the SQL operator that defines the relationship between the parent column and the child column. The following values for condition are supported: =, , >=
- name (Required) - the event name to fire this trigger
- source (Required) - the PL/SQL .
- name (Required) - the XML tag name to be assigned to the group.
- source (Required) - the unique query identifier for the corresponding sqlstatement from which the group's elements will be derived.
- groupFilter - the filter to apply to the output data group set. Define the filter as: .. Note: Applying a filter has performance impact. Do not use this functionality unless necessary. When possible, filter data using a WHERE clause in your query.
- name - the tag name to assign to the element in the XML data output.
- value (Required) - the column name for the SQL statement. Note that for aggregations in which the column name is in another group, the value must be defined as ..
- function - supported functions are: SUM(), COUNT(), AVG(), MIN(), MAX()
Constructing the Data Template
You can use any text or XML editor to write a data template.
Data Template Declaration
The element is the root element. It has a set of related attributes expressed within the tag.