Conversion Templates
CUE Content Store, CUE Print and DC-X are all highly flexible system that allow documents and data structures to be customized in various ways. CUE Zipline makes frequent use of templates in order to be able to deal with this flexibility – most of the data transformations performed by CUE Zipline use templates to help generate correctly formatted output. A set of standard templates are supplied with CUE Zipline. These will work at many installations, but they may not produce exactly the desired results: they may not, for example include custom fields in converted content. In other cases, the supplied templates may not work at all.
In most cases, some template modifications will need to be carried out to produce the desired results.
CUE Zipline uses the
Jinja2
template processor. The Jinja2 templates are all intended to export
CUE
storylines to some external target format, or else to import from some
external format into
CUE.
All the external target/source formats are XML formats of one kind or
another, with a hierarchical internal structure. The storyline data that
CUE Zipline
retrieves from the
Content Store,
on the other hand is JSON data, and has a more or less flat internal
structure. All the story elements in the storyline are listed in a single
storyElements
array, and the relationships between them
are specified indirectly (see
The Storyline JSON Structure for an
example).
Converting between this kind of flat data structure and the hierarchical external structures is not easy to do using a templating language such as Jinja2. In order to simplify the process, therefore, CUE Zipline provides a built-in converter that converts between the internal storyline format and an intermediate format called the pseudo-storyline format. A pseudo-storyline is still a JSON data structure, but it has a hierarchical structure similar to the various external formats. The supplied templates are therefore designed to convert between the pseudo-storyline format and various external formats.
All the templates are located in the
/etc/conf/conversion-templates
folder by default. This
folder contains the following template subfolders:
cue-print/storyline-to-cue-print
-
This folder contains templates for converting CUE pseudo-storylines into CUE Print texts. These templates are used by the Content Store to CUE Print conversion and for generating print previews (see Print Previews in CUE). You may need to modify them to achieve the desired results with your content types.
cue-print/cue-print-to-storyline
-
This folder contains templates for converting CUE Print texts into CUE pseudo-storylines. These templates are used by the CUE Print to Content Store conversion. You may need to modify them to achieve the desired results with your content types.
newsmlg2/storyline-to-newsmlg2
-
This folder contains templates for converting CUE pseudo-storylines into NewsML files. You may need to modify them to achieve the desired results with your content types.
newsmlg2/newsmlg2-to-storyline
-
This folder contains templates for converting NewsML files into CUE pseudo-storylines. You may need to modify them to achieve the desired results with your content types.
classic
-
This folder contains templates for converting classic (rich text based) content items into CUE pseudo-storylines (
classic-to-storyline
) and vice-versa (storyline-to-classic
). These templates are used by the Classic/Storyline Conversions. You can both modify these standard templates and/or add additional sets of templates to be used for converting different types of content.