Form variable provider
IPluginFormReplacer
Use cases
This type of plugin allows you to define new form variables or modify how existing variables are being evaluated. These plugins will be run before variables are processed by Xima® Formcycle.
You could also replace variables referring to form fields with a variable for a different field, which will then get evaluated by Xima® Formcycle as that form field's value.
Form variables have got the following syntax:
Method signature
Parameters
An object of type IPluginFormReplacerParams is passed to the execute method, providing access to the following properties:
- The entire variable string, including its syntax, eg. [%tf1%}. (getPlaceholder())
- The variable name, without its syntax, eg. tf1. (getPlaceholderContent())
- The current form version. (getFormversion())
- The form data adapter, providing access to form data. (getFormDataAdapter())
- Boolean flag controlling whether the return value must be valid HTML. (isEncodeForHTML())
- Current user context for accessing the databases. (getEntityContext())
Return value
The execute method must return an object implementing IPluginFormReplacerRetVal.
The class PluginGenericReplacerRetVal provides a reference implementation. Its constructor takes the string containing the evaluated value of the variable.