Context item (extension point)
From BioUML platform
- Identifier
- ru.biosoft.templates.template
- Plugin
- ru.biosoft.templates
- Since
- 0.8.7
- Registry
TemplateRegistry
Description
This extension allows you to add objects which will be accessible during velocity template execution.
Configuration Markup
<!ELEMENT helper> <!ATTLIST helper name CDATA #REQUIRED class CDATA #REQUIRED >
- name
- name of the variable accessible during template execution. For example, if
"test"
is specified, then you can refer to it inside the template as$test
. - class
- fully-qualified name of the class to instantiate. This class must have default constructor. The only one global instance of this class is created for all templates execution, thus it's highly recommended that this class has no internal state.
Example
<extension id="utils" point="ru.biosoft.templates.contextItem"> <helper name="utils" class="ru.biosoft.templates.Formatter" /> </extension>
Now an instance of Formatter
class will be accessible from any velocity template via $utils
variable.