Difference between revisions of "Context item (extension point)"
From BioUML platform
Tagir Valeev (Talk | contribs) (Created page with "{{Extension point|template|ru.biosoft.templates|since=0.8.7|registry=ru.biosoft.templates.TemplateRegistry}} === Description === This extension allows you to add objects which...") |
Revision as of 17:41, 13 May 2013
- 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.