Templates operating principle

The "Velocity context" contains all the objects usable in a template.
All the entities defined in the model and all the project variables are loaded in the context.



In the context the entities are exposed in the same way regardless of their original model (DSL model or DB model).
Hence the templates are not model-dependent.

In the template file the context objects are accessible using their symbolic name preceded by the character "$".

Very basic example :

Current entity is ${entity.name}

#foreach( $attrib in $entity.attributes )
  Do something with $attrib.name and $attrib.type
#end

       

Templates bundles

Telosys templates are organized in "bundles".
Each bundle contains a set of templates files (".vm" files), a "templates.cfg" file and a "readme.md" file.



A bundle contains a set of templates designed to generate a part of the application (web interface, domain classes, services, persistence, etc).


In general several bundles are needed to generate a complete application.

Bundles publishing and installation

The templates bundles are published on GitHub (a bundle is a "Git repository").
The official Telosys bundles are published here : https://github.com/telosys-templates-v3 .

Downloading and installing bundles is done by Telosys.
After being installed a bundle is a directory located in "TelosysTools/templates" (the name of the directory is the name of the bundle).



So everyone can create their own bundles and publish them on a GitHub organization.
Telosys can install bundles from any GitHub organization.

Velocity official documentation

The Telosys templating language is "VTL" (Velocity Template Language).
For detailed documentation visit the links bellow

Apache Velocity