Wiki source code of Platzhalterersetzung (System)
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{content/}} | ||
2 | |||
3 | == Schnittstelle IPluginSystemReplacer == | ||
4 | |||
5 | {{figure image="plugin_platzhalterersetzung_system_en.png"}} | ||
6 | Position of system variable evaluation plugins in {{formcycle/}}'s program flow. They are run before system variables are processed by {{formcycle/}}. | ||
7 | {{/figure}} | ||
8 | |||
9 | === Use cases === | ||
10 | |||
11 | This type of plugin allows you to define new [[system variables>>doc:Formcycle.UserInterface.Variables]] or modify how existing variables are being evaluated. These plugins will be run before variables are processed by {{formcycle/}}. | ||
12 | |||
13 | For example, this allows you to change the URLs of certain system variables and to redirect them to other URLs. | ||
14 | |||
15 | System variables use the following syntax: | ||
16 | |||
17 | {{code language="none"}} | ||
18 | [%$variableName>%] | ||
19 | {{/code}} | ||
20 | |||
21 | {{warning}} | ||
22 | When multiple system variable evaluation plugins are installed, their order of execution is arbitrary. You should not rely on a certain fixed order. | ||
23 | {{/warning}} | ||
24 | |||
25 | {{warning}} | ||
26 | System 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>>doc:Formcycle.PluginDevelopment.BundleProperties]] containing a list of allowed forms. | ||
27 | {{/warning}} | ||
28 | |||
29 | === Method signature === | ||
30 | |||
31 | {{code language="java"}} | ||
32 | IPluginSystemReplacerRetVal replace(IPluginSystemReplacerParams params) throws FCPluginException | ||
33 | {{/code}} | ||
34 | |||
35 | == Parameters == | ||
36 | |||
37 | An object of type {{jpath path="de.xima.fc.interfaces.plugin.param.replacer.IPluginSystemReplacerParams"/}} is passed to the execute method, providing access to the following properties: | ||
38 | |||
39 | * The entire variable string, including its syntax, eg. {{code language="none"}}[%$ATTACHMENT_LIST%]{{/code}}. (//getPlaceholder()//) | ||
40 | * The variable name, without its syntax, eg. {{code language="none"}}ATTACHMENT_LIST{{/code}}. (//getPlaceholderContent()//) | ||
41 | * The workflow processing context (//getWorkflowProcessingContext()//), granting access to: | ||
42 | ** The current form record (//getVorgang()//) | ||
43 | ** The form data (//getFormDataAdapter()//) | ||
44 | ** Session attributes (//getSessionAttributes()//) | ||
45 | ** A temporary directory for storing data (//getTempDirPath()//) | ||
46 | |||
47 | == Return value == | ||
48 | |||
49 | The execute method must return an object implementing {{jpath path="de.xima.fc.interfaces.plugin.retval.replacer.IPluginSystemReplacerRetVal"/}}. | ||
50 | |||
51 | The class {{jpath path="de.xima.fc.plugin.models.retval.replacer.PluginGenericReplacerRetVal"/}} provides a reference implementation. Its constructor takes the string containing the evaluated value of the variable. |