The code generators supplied with NaturalONE use Velocity templates, which are embedded in the .jar file created during the build process. To customize the templates, you can copy the embedded templates from the .jar file to your custom-templates folder and modify the template there. Velocity will check this folder first for the template. If it exists, it will be used by the code generator.
This section describes how to customize the code generators. The following topics are covered:
To export the supplied templates
Select
on the menu.The Export window is displayed.
Expand the Software AG root node.
Select Code Generation Templates.
For example:
Select
.The Select Templates for Export panel is displayed. For example:
This panel displays the default target folder for the templates, as well as the templates available for export.
Note:
You can change the default target folder in the
Preferences window for Code Generation. For information,
see Set Code
Generation Preferences.
Select the templates you want to export.
To select all templates in a template node, select the node (for example, if you select the Common Templates root node, all templates within that node will be selected).
To select individual templates, expand a template root node and select the template.
For example:
Select
.The templates are exported to the selected target folder.
Note:
You cannot change the functionality of the internal Java
code, you can only modify the templates.
To customize a template
Select the template in the custom-templates > cst folder.
For example:
Note:
Custom templates are stored in the folder specified in
the Preferences window for Code Generation. For
information, see Set
Code Generation Preferences.
Open the template you want to modify.
For example:
Modify the template.
Save the changes.