Interface IPluginTemplateReplacer

Position of template variable evaluation plugins in Xima® Formcycle's program flow. They are run before template variables are processed by Xima® Formcycle.

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:

[%$$<variableName>%]

When multiple template variable evaluation plugins are installed, their order of execution is arbitrary. You should not rely on a certain fixed order.

Template variable evaluation plugins are run for all forms of the client they belong to, or for all existing forms when installed as a system plugin. We recommend you check whether the plugin should be executed for the current form, for example by defining a plugin property containing a list of allowed forms.

Method signature

IPluginTemplateReplacerRetVal replace(IPluginTemplateReplacerParams params) throws FCPluginException

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.

Tags:
Copyright 2000-2024