Wiki source code of Servlet-Aktion
Hide last authors
author | version | line-number | content |
---|---|---|---|
1.1 | 1 | {{content/}} | |
2 | |||
3 | == IPluginServletAction == | ||
4 | |||
5 | === Uses === | ||
6 | |||
7 | {{figure image="plugin_actionservlet.png" width="400" clear="h3"}} | ||
8 | Placement of the //servlet plugin// in the process chain of {{formcycle case="dat"/}} | ||
9 | {{/figure}} | ||
10 | |||
11 | The plugin is used for servlet-related delivery of own content. | ||
12 | |||
13 | {{panel type="info"}} | ||
14 | The plugin servlet implementation is called using the following URL pattern. | ||
15 | ((( | ||
16 | **{{{http://<Webdomain>/<FORMCYCLE-Webapplikation>/plugin/?name=<Name der IPluginServletAction-Implementierung>&client-id=<MandantId>}}}** | ||
17 | ))) | ||
18 | Instead of the parameter //client-id//, the parameter //project-id// can also be specified. If the //project-id// is specified, the client object necessary for processing is obtained from the determined project object. | ||
19 | {{/panel}} | ||
20 | |||
21 | === Method signatures === | ||
22 | |||
23 | The plug-in interface //IPluginServletAction// references all methods provided by the [[Base interface IFCPlugin>>doc:IFCPlugin]] | ||
24 | and additionally the following plugin-specific method signatures: | ||
25 | |||
26 | {{panel title="{{code language='java'~}~}IPluginServletActionRetVal execute(IPluginServletActionParams params) throws FCPluginException{{/code~}~}" triggerable="true" fullwidth="true"}} | ||
27 | |||
28 | **Transfer values. | ||
29 | The //IPluginServletActionParams// type provides the following properties: | ||
30 | * **getRequestParameters():** a map with the currently passed request parameters (without uploads). | ||
31 | * **getUploadFiles():** a map with all uploaded files from the request | ||
32 | * **getHeaderMap():** a map with the header information from the request | ||
33 | * **getUser():** the user currently referenced in the session | ||
34 | * **getSessionAttributeMap():** the parameters currently present in the session | ||
35 | * **getLocale():** information about the currently set language and region | ||
36 | * **getFrontend-Server():** reference to the frontend server, if servlet plugin was called via frontend server | ||
37 | * **getAction():** type of servlet call | ||
38 | |||
39 | |||
40 | **Return values:** | ||
41 | The return value must be of type //IPluginServletActionRetVal//, a reference implementation is provided by the //PluginServletActionRetVal// class. | ||
42 | |||
43 | The object enables the return of an object of the type //IServletResponse//, which offers the possibility to deliver a simple string, but also binary data to the browser. | ||
44 | By determining the **Response type** of the //IServletResponse// object, it is determined how the transferred response data is interpreted or delivered: | ||
45 | |||
46 | {{table}} | ||
47 | |=Response type|=Description | ||
48 | |**HTML**|The passed //Response// string is interpreted as finished HTML and delivered to the browser. | ||
49 | |**SHOW_FILE**|The passed data (binary data and //Response// string) is delivered as a file download to the browser, where the content of the //Response// string is interpreted as a file name. | ||
50 | |**TEMPLATE**|A new HTML document is created and the passed //Response// string is taken as the content of the //body// element. | ||
51 | |**TEMPLATE_SYSTEM**|Currently identical to //TEMPLATE//. | ||
52 | |**REFIT**|The passed //Response// string is interpreted as a URL and a redirect is performed. | ||
53 | {{/table}} | ||
54 | |||
55 | If the plugin is processed incorrectly, an //FCPluginException// is thrown. | ||
56 | |||
57 | {{/panel}} |