Wiki source code of Platzhalterersetzung (Formularwerte)
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{content/}} | ||
2 | |||
3 | == IPluginFormReplacer == | ||
4 | |||
5 | === Uses === | ||
6 | |||
7 | {{figure image="plugin_platzhalterersetzung_formparam_en.png" width="400" clear="h3"}} | ||
8 | Placement of the placeholder replacement plugin for form values in the process chain of {{formcycle case="dat"/}} | ||
9 | {{/figure}} | ||
10 | |||
11 | An implementation of the interface //IPluginFormReplacer// allows to integrate own replacement logic for the placeholder replacement process of form elements. | ||
12 | The custom implementations are performed **before** the internal placeholder replacement process of {{formcycle case="dat"/}}. | ||
13 | This also makes it possible, for example, to replace system-internal form placeholders with a custom implementation. | ||
14 | |||
15 | When the placeholder replacement is executed, the following pattern is searched for and the placeholder is replaced by the corresponding form value: | ||
16 | |||
17 | {{code language="none"}} | ||
18 | [%<own placeholder identifier or name of a form field>%] | ||
19 | {{/code}} | ||
20 | |||
21 | {{warning}} | ||
22 | When using multiple //IPuginFormReplacer// implementations, their execution order is not fixed. This may lead to different results when executed multiple times. | ||
23 | {{/warning}} | ||
24 | |||
25 | {{warning}} | ||
26 | 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. | ||
27 | {{/warning}} | ||
28 | |||
29 | === Method signatures === | ||
30 | |||
31 | The plugin interface //IPuginFormReplacer// references all methods provided by the [[base interface IFCPlugin>>doc:IFCPlugin]]. | ||
32 | and additionally the following plugin-specific method signatures: | ||
33 | |||
34 | {{panel title="{{code language='java'~}~}IPluginFormReplacerRetVal replace(IPluginFormReplacerParams params) throws FCPluginException{{/code~}~}" triggerable="true" fullwidth="true"}} | ||
35 | |||
36 | **Transfer value. | ||
37 | The //IPluginFormReplacerParams// type provides access to the following properties: | ||
38 | * **getPlaceholder()** complete string of the placeholder (this includes the markup of the placeholder). | ||
39 | * **getPlaceholderContent()** content of the placeholder (without type-specific markup) | ||
40 | * **getFormversion()** the current form version | ||
41 | * **getFormDataAdapter()** the form data adapter, as interface to the concrete form data as well as their description | ||
42 | * **isEncodeForHTML()** flag which determines whether the return is to be coded in HTML conformity | ||
43 | * **getEntityContext()** current user context, for example to be able to perform database operations | ||
44 | |||
45 | **Return values | ||
46 | 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. | ||
47 | {{/panel}} |