Template is file which use models defined into XML component. Template can be :
This template is used to generate file or update XML file.
For code generation, template use :
Template declaration (used into output element into XML component path_of_myTemplate is done with template element :
... <template uri="path_of_myTemplate" /> ...
path_of_myTemplate is the path of the template to use. More exactly path_of_myTemplate is the uri of the template. All templates must be stored into Templates folder of the catalog. Template uri must start with this folder.
... <template uri="/ftl/HelloWord/helloWord.ftl" /> ...
means there is a file /ftl/HelloWord/helloWord.ftl stored into the Templates folder of the catalog.
Attribute name | Description | Required ? |
uri | Template URI. | Yes |
It's possible to put default value into template engine with param elements :
... <template uri="/ftl/HelloWord/helloWord.ftl" > <param name="myParam" value="Value of myParam" /> </template> ...
With freemarker we can use param name into template :
${myParam}
Template engine are getted with Spring descriptor. By default, Akrogen implements template engine :
Template extension give the template engine to use :
You can use engine attribute of the template element, to set the template engine to use.
In this case, only Freemarker template engine is supported. Square bracket syntax ([#list, [#if) is used to describe XML component with XML well formtated.
Dynamique XUL section show how write XUL which use models defined into XML component.