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 as objects in the context.



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( $attribute in $entity.attributes )
  Do something with $attribute.name and $attribute.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).


Usually 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 examples are published here : Telosys bundles of templates .

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