Information Classification: External Restricted.
See https://www.chili-publish.com/security

External DataSources XML

Concept

When working with DataSources, the administrator can choose to have variable data pulled in from external sources.

Administrators can configure the DataSource by providing three URLs:

  • Main URL: this dynamic page should return XML containing the data visible to the user (and used to generate PDF files if no PDF URL is provided)
  • PDF URL: this url is optional. If provided, the data in the document is downloaded again from this location right before generating a PDF
  • Query URL: This returns a list of possible queries for the end user to select from. The Main or PDF URLs can contain %QUERY%, which is replaced by the query selected  by the user

Any of the URLs can contain additional replacement patterns: External XML URL replacement

XML Definitions

Query XML
<queries>
   <item name="All Products" value="all"/>
   <item name="Filtered Products" value="filtered"/>
</queries>

The Query XML contains a list of queries available to the user to select from. The "value" attribute is replaced in the Main or PDF URLs by replacing the string "%QUERY%".

Data XML
<dataSource>
	<row rowNum="1">
    <col1 varName="simple_var">simple_var from row 1</col1>
    <col2 varName="boolean_variable">True</col2>
	</row>
	<row rowNum="2">
		<col1 varName="simple_var">simple_var from second row</col1>
    <col2 varName="boolean_variable">False</col2>
  </row>
	<row rowNum="3">
		<col1 varName="simple_var">another value here...</col1>
    <col2 varName="boolean_variable">True</col2>
  </row>
</dataSource>

Variable data is provided in XML with:

  • a "row" node under the document element for each row
  • a node per column in the database, with the data in the innerText, and the field name in the varName attribute

The structure of this XML has been changed in comparison to early versions. By moving the field name to an attribute, we made it possible to have variable names containing spaces (and other XML-unfriendly characters).
External datasources using the old structure are still supported and converted automatically.  

 

 Example of previous structure
<data>
   <row>
      <MY_FIELD_1>MY_DATA_1</MY_FIELD_1>
      <MY_FIELD_2>MY_DATA_2</MY_FIELD_2>
   </row>
   <row>
      <MY_FIELD_1>MY_DATA_1</MY_FIELD_1>
      <MY_FIELD_2>MY_DATA_2</MY_FIELD_2>
   </row>
</data>

All information on this page must be treated as External Restricted, or more strict. https://www.chili-publish.com/security