Template Bindings Editor
To edit template bindings files you first view them in the Template Bindings Viewer and either edit them in XML using the Text Editor, or by opening the templatebindings file in the Template Bindings Editor using the buttons of the Template Bindings Viewer. The Template Bindings Editor is an easy way to define a templatebindings file without knowing the exact xml file format of a templatebindings file. All elements in the editor are mandatory and are described in more detail below.
The Template Bindings Editor consists of the following elements:
- Name
- This is the name of the templatebindings file. It's not the filename, but the name which will show up in the Template Bindings Viewer in the Name combo box. Make sure the name is unique among templatebindings files.
- Precedence
- This is the precedence level the templatebindings file has to be placed at when sorting the templatebindings files on the Template Bindings Tab of the Code Generation Task Configurator. Most templatebindings files shipped with LLBLGen Pro are either at precedence level 10 (the default) or lower. A higher precedence value will make the templatebindings file automatically overrule templatebindings files which have the bindings to the same TemplateID.
- Filename
- The filename isn't directly editable in the textbox, you can only edit it through the ellipsis button next to the Filename textbox. This is the filename of the templatebindings file and can only be specified when you create a new templatebindings file. Make sure a templatebindings file is in scope of the designer, so either in the default template folders of one of the frameworks or in the additional templates folder specified in the project properties.
- Description
- This is the area where you can explain what templates are bound by the templatebindings file. This description is also shown on the Template Bindings Tab of the Code Generation Task Configurator.
- Frameworks
- This is a multi-select combo box where you can select for which target frameworks the templatebindings file will be valid. DDL SQL is the framework used to group the create / update script templates under.
- Platforms
- This is a multi-select combo box where you can specify for which target platforms the templatebindings file will be valid. RDBMS is the target platform for create / update script templates.
- Databases
- This is a multi-select combo box where you can specify for which databases the templatebindings file will be valid. Only use this if your templates are specific for a particular database, e.g. for generating DDL SQL.
The second half of the Template Bindings Editor consists of the area to define Template ID - Filename bindings. It consists of the following elements:
- Target language
- This is the language of the output of the template, e.g. if the template generates VB.NET sourcecode, select VB.NET.
- Grid with bindings
-
To add a new binding click on the top, empty row to add a new binding and press
Ctrl-Enter
when done. The following elements can be specified:-
TemplateID
This is a string value which is used in tasks. It's also used for class names when the template is an .lpt template. -
Filename
This is the filename of the file to bind to the TemplateID. Make sure the filename is either specified with a filename/path local to the file location of the templatebindings file or with a full path (not recommended). When you use TDL based templates, use as file extension.template
. If you use C#/VB.NET based templates, use as file extension.lpt
. -
Logic language
LLBLGen Pro comes with two code generation engines: a TDL based one and a C#/VB.NET based one. In general it's recommended to use C#/VB.NET (lpt) templates and only use TDL templates if you want to extend the LLBLGen Pro RTL templates (which are written in TDL). TDL is an interpreted language with limited scope. Lpt templates are templates based on the generic two-language pattern where template logic code is embedded using<% %>
; style markers. See the SDK for more details about these template systems. -
Include Only
If your template is an.lpt
template, and it's included into another.lpt
template, the template shouldn't get its own wrapper class in the template code which is ran at generation time. To make sure an include template is seen as such, check the Include Only checkbox for these templates.
-
TemplateID
When you're done with the editing of the templatebindings file, click Save and Close to save the templatebindings file and close the editor.