Template
template is an intermediate step that creates a data resource from a template.
The template:
- and creates a data resource as output.
Arguments
The template operations accept the following arguments.
- template-selectors - a list of data selectors that selects templates data resources.
- template-inline - a inline template with the following properties:
- logical-name: the logicalName (used to match the template to a source data resource)
- type: the mediaType type of the template
- content: the template text
- template-email: define if an html template is an email template. It defaults to false, if true, the css rules will be in-lined for html template. If you use bootstrap, the bootstrap email css stylesheet is used instead.
- engine - the templating engine (default to native)
- step-granularity: defines the granularity of the execution
- table-variables: template variables that defines tabular data. A map of:
- name: a variable name
- selectors: a data selector
- parameters: a map of SQL parameters applied to the selected data query resources
- name: the parameter name
- value: the parameter value (you can reference value of the input data using the $ sign)
- output-logical-name: a pattern that defines the logical name of:
- the resources (for a template output)
- or of the columns (for a extended-records)
- output:
- templates: the templates output
- extended-records: the source records with extra columns that stores the templates output
Engine
The engine is the process that is responsible to transform a template in a document.
Tabulify supports the following value as engine:
- native (default) - the built-in tabulify engine
- thymeleaf - the the thymeleaf engine (natural template)
- pebble - the pebble engine (ninja syntax)
Type
type is the media type of the template. The type default to the type of the template.
Template Match
If the operation has:
- only one template defined, the template will be applied to all source data resource.
- several templates defined, the template will be the template that has the same logicalName than the source data resource
Syntax
This operation is a intermediate pipeline operation
- Template Selectors
- name: "Json"
op: "template"
args:
template-selectors:
- pattern@connection
- pattern2@connection2
- Inline Json Template
- name: "Json"
op: "template"
args:
template-inline:
type: json
content: |
{
"${group}": {
"${item_code}": {
"price": "${price}",
"description": "${description}"
}
}