Template variable provider
Interface IPluginTemplateReplacer
Use cases
This type of plugin allows you to define new template variables or modify how existing variables are being evaluated. These plugins will be run before variables are processed by Xima® Formcycle.
You can create custom template in Xima® Formcycle by opening the menu File & templates from the menu bar to the left hand side. Currently, templates are available for HTML, text, mails and links.
Template variables have got the following syntax:
Method signature
Parameters
An object of type IPluginTemplateReplacerParams is passed to the execute method, providing access to the following properties:
- The entire variable string, including its syntax, eg. [%templateSuccess%}. (getPlaceholder())
- The variable name, without its syntax, eg. templateSuccess. (getPlaceholderContent())
- Current user context for accessing the databases. (getEntityContext())
- The current client (getMandant())
Return value
The execute method must return an object implementing IPluginTemplateReplacerRetVal.
The class PluginGenericReplacerRetVal provides a reference implementation. Its constructor takes the string containing the evaluated value of the variable.