Wiki source code of Pre-persist
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{content/}} | ||
2 | |||
3 | == Interface: IPluginFormPrePersist == | ||
4 | |||
5 | {{figure image="plugin_prepersist.png" width="500"}} | ||
6 | Placement of the PrePersist plugin in the {{formcycle/}} process chain. | ||
7 | {{/figure}} | ||
8 | |||
9 | === Uses === | ||
10 | |||
11 | Provides a way to build in a custom check if data should be saved. | ||
12 | |||
13 | If not, then an abort of further data processing can be caused at this point. | ||
14 | |||
15 | {{warning}} | ||
16 | When using multiple Form PrePersists implementations, the order in which they are executed is not fixed. The order may therefore be different each time. | ||
17 | {{/warning}} | ||
18 | |||
19 | {{warning}} | ||
20 | The //Form-PrePersistors// are basically executed before each form call in the respective application area (system or client plug-in) in which they were installed. It is recommended to first check in the implementation logic whether the //PrePersistierer// should be executed for the respective form processing. This can be made configurable, for example, by using //Bundle-Properties//. | ||
21 | {{/warning}} | ||
22 | |||
23 | === Method signatures === | ||
24 | |||
25 | {{panel title="{{code language='java'~}~}IPluginFormPrePersistRetVal execute(IPluginFormPrePersistParams params) throws FCPluginException{{/code~}~}" triggerable="true" fullwidth="true"}} | ||
26 | |||
27 | **Transfer value. | ||
28 | The //IPluginFormPrePersistParams// type provides access to the //IFormRequestContext// interface with the **getFormRequestContext()** method and thus to the following properties: | ||
29 | * **getCurrentUser():** the current user. | ||
30 | * **getUserContext():** the current user context, for example to be able to perform database operations | ||
31 | * **getProject():** the current project | ||
32 | * **getMandant():** the current client | ||
33 | * **getTask():** the current task | ||
34 | * **getFormVersion():** the current version of the form with access to all contained form elements | ||
35 | * **getLocale():** information about the currently selected language and region | ||
36 | * **getSessionAttributeMap():** a map with the current session parameters | ||
37 | * **getFrontendServer():** access to the frontend server object if called via frontend server | ||
38 | |||
39 | **Return values:** | ||
40 | |||
41 | The return value must be of type //IPluginFormPrePersistRetVal//. | ||
42 | A reference implementation is provided by the class //PluginGenericFormProcessingRetVal//. On initialisation, this expects a boolean value. | ||
43 | : //true// | ||
44 | :: Further processing in {{formcycle case="dat"/}} is continued. | ||
45 | : //false// | ||
46 | :: Further processing in {{formcycle case="dat"/}} is aborted. | ||
47 | |||
48 | {{/panel}} |