DocFlex Technology - Features - Templates / Template Designer
Template Components
DocFlex templates can be considered as a sort of computer programs, containing instructions
interpreted by DocFlex Generator.
Such instructions are specified in the form of
template components.
Template components are the building blocks of templates and visualized in
DocFlex Template Designer.
Almost everything you can see on the following screenshot depicts some template components.
Component Properties
The interpretations of template components as well as their appearance in the
Template Designer can be adjusted with
component properties.
Most of the component properties are specified statically in templates using special Property Inspectors:
Some of the component properties, however, can be calculated dynamically depending on the data being processed.
Such dynamic properties are specified using
FlexQuery-expressions.
FlexQuery Expression Editors and Assistant Dialog
For programming convenience, all input fields for FlexQuery-expressions in
DocFlex Template Designer
are implemented with the special Expression Editors supplied with the expression quick-check button:
and the button invoking the FlexQuery Expression Assistant Dialog:
which provides a lot of information about everything that can be used in the expression:
all available
utility functions,
generator variables,
template parameters, XML-elements
and XML-attributes. This information is always up-to-date since it is obtained not from the static help
files but collected dynamically from all available resources. Here is also possible to select the necessary
identifier and insert it directly into the edited expression.
Location Path Chooser
Location Paths,
which are XPath-like expressions used in many settings within templates, can be selected
using the special Location Path Chooser dialog:
Template Parameters
DocFlex provides elaborated methods to handle template parameters.
The following parameter types are supported:
string
number
boolean
enum
text
object
In any template, it is possible to declare a list of template parameters:
Each parameter declaration consists of
- parameter name
- description
- data type
- for the
enum-parameter, the list of the possible values
- default value
- other settings
When starting the generator,
the template parameters can be either specified in the Template Parameter Inspector dialog:
or passed programmatically, using DocFlex API.
Within the template, the passed parameters can be accessed using
FlexQuery-expressions.
Stock-Sections
The small repeatable fragments of a template can be designed only once and, then,
be put into the special template part called Template Stock
in the form of
stock-sections.
Such stock-sections can be called many times from the different template's locations
and even from within themselves.
Each stock-section call produces the same fragment of the output document
as if the stock-section's content was in the place of its call. Stock-sections can be considered as an
equivalent of procedures in a typical programming language.
For more information, see documentation:
Template Components,
Stock-Sections,
Call Stock-Section.
Calling Subtemplates
DocFlex allows to call from one templates another templates
(subtemplates).
Each called subtemplate can produce either the separate document or a fragment of the common
document being generated by the calling one. This allows
-
having a set of specifically designed templates, to generate any number of logically
connected documents, whose creation, names and locations can be controlled by the processed data.
In particular, this allows to generate a
framed (HTML) documentation.
-
to create a library of subtemplates which can be reused many times by calling them
from the different application templates. This may help to reduce the project development
time as well as to simplify its further maintenance and modifications.
-
to generate single (RTF) documents containing section with their own sets of
page header/footer.
For more details, see documentation:
Template Components | Call Template.
|