File extension
Summary
This extension generates files in one of the following formats: Excel, CSV, JSON, XML, JSONL, XMLL
Plugin ID
The plugin ID for File delivery is fr.cantor.c4i.FileDelivery.
Properties
Environment independent parameters (set in extension configuration or properties file)
| Property key | Description | Mandatory | Default value |
|---|---|---|---|
| configAssetId | The ID of the asset containing the YAML mappings | Yes | |
| connection | The name of the connection in the c4i.properties file | Yes | |
| prefixFileNamesWithContextId | true or false to indicate whether or not to prefix the file names with the context IDs | Yes | |
| outputFormat | CSV, EXCEL, JSON, JSONL, XML or XMLL | Yes | |
| fileNameStrategy | Indicates how to name the output file. Authorized values are FILENAME_TIMESTAMP, STEPXML_TIMESTAMP, COPY_FILENAME | No | STEPXML_TIMESTAMP |
| includeEmptyTabs | true or false to indicate whether or not to include empty tabs when using Excel templates | No | false |
| csvSeparator | The CSV separator used to separate values, can be ,, \t,|,;, or (Space) | Only if outputFormat = CSV | |
| templateExtensions | A semicolon (;) separated list of extensions to resolve template files | No | .xlsx |
| cacheConfig | The ID of the asset containing the JCS configuration | No | |
| displayPerfStat | true to display performance statistics (see Performance statistics dedicated page) | No | false |
Environment dependent parameters (set in centralized c4i.properties file)
| Property key | Description | Mandatory | Default value |
|---|---|---|---|
| outputDirectory | The path of the directory where the output files will be written | Yes | |
| templateFolderPath | The path of the directory where the Excel template are in standalone mode only | No |
Configuration example
JSON specificities
When producing JSON files, there are two formats for target node mapping :
- Simple (Array) :
${fileName}[{key}] - Complex (Object):
${fileName}#{target node path}[{key}]
Simple (Array) Mapping
Using this format will produce a JSON file containing an array whose elements will be the mapped nodes.
For example, given the following configuration:
- Product:
product[id]:
- ./@ID: idThe resulting file will contain a single JSON array. For each <Product> in the source file, a new object will be inserted.
[
{ "id": "Product1" },
{ "id": "Product2" }
]Complex (Object) Mapping
Using this format will produce a JSON file containing a JSON Object whose values (or sub-values) will be JSON arrays containing the mapped nodes.
For example, given the following configuration:
- Product:
product#data.products[id]:
- ./@ID: idThe resulting file will contain a single JSON Object. For each <Product> in the source file, a new object will be inserted in the "data.products" array.
{
"data": {
"products": [
{ "id": "Product1" },
{ "id": "Product2" }
]
}
}Arrays indices are not supported in the supplied path.
XML specificities
Target node mapping
When producing XML files, the format for target node mapping is the following : {fileName}#{target node xPath}[{key}]
For example, given the following configuration :
- Product:
product#MyCustomProducts/Product[./@ID]:
- ...For each <Product> in the source file, a new <Product> element will be created underneath the root node <MyCustomProducts> in the output XML file [{contextId}]_product.xml.
The root node (in this case MyCustomProducts) must be the same across all the mapping rules for a given output file. Otherwise, a DOMException will be thrown when generating the file.
Converting JSON values to XML
JSON values such as returned by c4i custom functions are converted to XML, as shown by the following example :