Placeholder substitution (form)


IPluginFormReplacer

Uses

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

An implementation of the interface IPluginFormReplacer allows to integrate own replacement logic for the placeholder replacement process of form elements.
The custom implementations are performed before the internal placeholder replacement process of Xima® Formcycle.
This also makes it possible, for example, to replace system-internal form placeholders with a custom implementation.

When the placeholder replacement is executed, the following pattern is searched for and the placeholder is replaced by the corresponding form value:

[%<own placeholder identifier or name of a form field>%]

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

The IPluginFormReplacer implementations are basically executed with every form call 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 IPluginFormReplacer should be executed for the respective form processing. This can be made configurable, for example, by using plugin properties.

Method signatures

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

IPluginFormReplacerRetVal replace(IPluginFormReplacerParams params) throws FCPluginException

Transfer value. The IPluginFormReplacerParams 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)
  • getFormversion() the current form version
  • getFormDataAdapter() the form data adapter, as interface to the concrete form data as well as their description
  • isEncodeForHTML() flag which determines whether the return is to be coded in HTML conformity
  • getEntityContext() current user context, for example to be able to perform database operations
Return values The return value must be of type IPluginFormReplacerRetVal. A reference implementation is provided by the PluginGenericReplacerRetVal class, which is to be initialised with the generated replacement value.