Placeholder substitution (template)


Interface IPluginTemplateReplacer

Uses

Placement of the placeholder replacement plugin for templates in the process chain of Xima® Formcycle

An implementation of the IPluginTemplateReplacer interface allows to integrate own replacement logic for the replacement process of template placeholders. Templates can be defined under the menu item Files & Templates for the types HTML, Text, E-Mail and Link .

The own implementations are thereby carried out before the internal placeholder setting process of Xima® Formcycle.

The placeholder replacement will look for the following pattern and replace it with the corresponding Template:

[%$$<own placeholder identifier or name of a template>%]

When using multiple IPluginTemplateReplacer implementations, their execution order is not fixed. This may lead to different results when executed multiple times.

The IPluginTemplateReplacer implementations are basically executed for each form processing in the respective application area (system or client plug-in) in which they were installed. It is therefore recommended to first check in the implementation logic whether the IPluginTemplateReplacer should be executed for the respective form processing. This can be configured, for example, using Plugin-Properties.

Method signatures

The plugin interface IPluginTemplateReplacer references all methods provided by the base interface IFCPlugin
and additionally the following plugin-specific method signatures:

IPluginTemplateReplacerRetVal replace(IPluginTemplateReplacerParams params) throws FCPluginException

Transfer value. The IPluginTemplateReplacerParams type provides access to the following properties:
  • getPlaceholder() complete string of the placeholder (this includes the markup of the placeholder).
  • getPlaceholderContent() content of the placeholder (without type-specific markup)
  • getEntityContext() current user context, for example to be able to perform database operations
  • getMandant() current client in whose scope the TemplateReplacer is executed
Return values: The return value must be of type IPluginTemplateReplacerRetVal. A reference implementation is provided by the PluginGenericReplacerRetVal class, which is initialised with the replacement value from the IPluginTemplateReplacer.