Wiki source code of Platzhalterersetzung (Session)
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{content/}} | ||
2 | |||
3 | == Interface IPluginSessionReplacer == | ||
4 | |||
5 | === Uses === | ||
6 | |||
7 | {{figure image="plugin_platzhalterersetzung_session_en.png" width="400" clear="h3"}} | ||
8 | Placement of the placeholder replacement plugin of //session// parameters in the process chain of {{formcycle case="dat"/}} | ||
9 | {{/figure}} | ||
10 | |||
11 | The session placeholder replacer is a special form of the system placeholder replacer, which is applied when a template is delivered to the browser. It is executed after all other placeholder replacements and is used to insert values that should only be valid within a form session, e.g. time-limited links. | ||
12 | |||
13 | The placeholder substitution searches for the following pattern and replaces it with the corresponding value: | ||
14 | |||
15 | {{code language="none"}} | ||
16 | [%$<placeholder name>%] | ||
17 | {{/code}} | ||
18 | |||
19 | {{warning}} | ||
20 | When using multiple SessionReplacer implementations, the order in which they are executed is not fixed. Therefore, the order may be different each time. | ||
21 | {{/warning}} | ||
22 | |||
23 | {{warning}} | ||
24 | The SessionReplacer implementations are basically executed with each template delivery in the respective application area (system or client plug-in) in which they were installed. It is therefore recommended to first check within the implementation logic whether the //SessionReplacer// should be executed for the current process processing. This can be made configurable, for example, by using //Plugin-Properties//. | ||
25 | {{/warning}} | ||
26 | |||
27 | === Method signatures === | ||
28 | |||
29 | The plugin interface //IPluginSessionReplacer// references all methods provided by the [[base interface IFCPlugin>>doc:IFCPlugin]]. | ||
30 | and additionally the following plugin-specific method signatures: | ||
31 | |||
32 | {{panel title="{{code language='java'~}~}IPluginSessionReplacerRetVal replace(IPluginSessionReplacerParams params) throws FCPluginException{{/code~}~}" triggerable="true" fullwidth="true"}} | ||
33 | |||
34 | **Transfer value. | ||
35 | The //IPluginSessionReplacerParams// type provides access to the following properties: | ||
36 | * **getPlaceholder()** complete string of the placeholder (this includes the markup of the placeholder). | ||
37 | * **getPlaceholderContent()** content of the placeholder (without type-specific markup) | ||
38 | * **getEntityContext()** current user context, for example to be able to perform database operations | ||
39 | * **getTask()** the current session | ||
40 | * **getSessionId()** the session ID | ||
41 | * **getContextName()** the context name of the application | ||
42 | |||
43 | **return values:** | ||
44 | The return value must be of type //IPluginSessionReplacerRetVal//. A reference implementation is provided by the //PluginGenericReplacerRetVal// class, which shall be initialised with the generated replacement value. | ||
45 | {{/panel}} |