Platzhalterersetzung (Formularwerte)


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>%]
{{code}}

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

{{warning}}
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.
{{/warning}}

=== Methodensignaturen ===

Die Plugin-Schnittstelle //IPuginFormReplacer// referenziert alle durch die [[Basis-Schnittstelle IFCPlugin>>doc:IFCPlugin]] bereitgestellten Methoden
und zusätzlich noch folgende Plugin-spezifische Methodensignaturen:

{{panel title="{{code language='java'~}~}IPluginFormReplacerRetVal replace(IPluginFormReplacerParams params) throws FCPluginException{{/code~}~}" triggerable="true" fullwidth="true"}}

**Übergabewert:**
Der Typ //IPluginFormReplacerParams// stellt den Zugriff auf folgende Eigenschaften bereit:
* **getPlaceholder()** kompletten String des Platzhalters (dies schließt den Markup des Platzhalters mit ein)
* **getPlaceholderContent()** Inhalt des Platzhalters (ohne typ-spezifischen Markup)
* **getFormversion()** die aktuelle Formular-Version
* **getFormDataAdapter()** den Formular-Daten-Adapter, als Schnittstelle zu den konkreten Formulardaten sowie deren Beschreibung
* **isEncodeForHTML()** Flag welches bestimmt, ob die Rückgabe HTML-konform codiert werden soll
* **getEntityContext()** aktueller Nutzerkontext, um beispielsweise Datenbankoperationen ausführen zu können

**Rückgabewerte:**
Der Rückgabewert muss vom Typ //IPluginFormReplacerRetVal// sein. Eine Referenzimplementierung wird durch die Klasse //PluginGenericReplacerRetVal// zur Verfügung gestellt, welche mit dem erzeugten Ersetzungswert zu initialisieren ist.
{{/panel}}