... |
... |
@@ -129,28
+129,28 @@ |
129 |
129 |
[%$DBCOUNTER.test%] |
130 |
130 |
{{/code}} |
131 |
131 |
|
132 |
|
-== Servlet action plugin == |
|
132 |
+== Counter servlet action plugin == |
133 |
133 |
|
134 |
134 |
{{figure image="dbcounter_plugin_servlet_action.png"}} |
135 |
|
-Beispiel zum Auslesen eines Zählers im Formular mittels AJAX. Die URL wird anhand der im Formular zur Verfügung stehenden Metadaten aufgebaut. Hiermit wird vermieden, die URL hart im Quelltext zu hinterlegen, was zu Fehlern führt, wenn sich etwa der Server oder der Kontextpfad ändern sollte. |
|
135 |
+An example for how the counter value can be accessed via an AJAX request. The URL is build with the metadata available in the form context. This avoids having to enter the URL directly in the code, which is error-prone: the host or context path could change, for example, when the form is moved between a development and production environment. |
136 |
136 |
{{/figure}} |
137 |
137 |
|
138 |
|
-Nach Installation des Plugins ist eine neue Servlet-Aktion verfügbar, mit der auf den aktuellen Wert eines Zähler zugegriffen werden kann. Dies ist etwa nützlich, wenn aus dem Formular heraus ein Zählwert per AJAX-Anfrage abgerufen werden soll. Die URL für das Servlet baut sich nach dem folgenden Schema auf: |
|
138 |
+Once the plugin is installed, a new servlet plugin action is available that lets you access the current value of a counter via an HTTP request. This is useful, for example, to read the counter value from within a form and display it in the form. The URL for the counter action plugin servlet follows the following pattern: |
139 |
139 |
|
140 |
140 |
{{code}} |
141 |
|
-https://<HOST>/<FORMCYCLE_CONTEXT_PATH>/plugin?name=Servlet%20Counter&client-id=<MANDANT_ID>&id=<ZAEHLER_UUID> |
|
141 |
+https://<Host>/<FormcycleContextPath>/plugin?name=Servlet%20Counter&client-id=<ClientId>&id=<CounterUuid> |
142 |
142 |
{{/code}} |
143 |
143 |
|
144 |
|
-Falls also etwa FORMCYCLE lokal unter dem Pfad //xima-formcycle// installiert wurde, der Zähler in einem Projekt des Mandanten mit der ID //1// verwendet wird und die UUID //bc49d3b0-f869-4e59-864e-ddcc2925ed63// besitzt, dann lautet die URL: |
|
144 |
+Assume FORMCYCLE was installed locally with the context path //xima-formcycle//. Let counter be used in a form of a client with the ID //1//; and let the UUID of a counter be //bc49d3b0-f869-4e59-864e-ddcc2925ed63//. Then you can access that counter with the following URL: |
145 |
145 |
|
146 |
146 |
{{code}} |
147 |
147 |
https://localhost:8080/xima-formcycle/plugin?name=Servlet%20Counter&client-id=1&id=bc49d3b0-f869-4e59-864e-ddcc2925ed63 |
148 |
148 |
{{/code}} |
149 |
149 |
|
150 |
|
-Alternativ ist es auch möglich, statt der //client-id// die ID des Formulars zu verwenden. Diese IDs lediglich verwendet, um das Servlet-Aktions-Plugin zu bestimmen, welches ausgeführt werden soll, und werden von diesem konkreten Plugin nicht ausgewertet: |
|
150 |
+Alternatively, you may also specify the parameter //project-id// (ID of a form) instead of //client-id//. This ID is used only to determine which servlet action plugin should be run and is not used by the counter servlet action plugin itself: |
151 |
151 |
|
152 |
152 |
{{code}} |
153 |
|
-https://<HOST>/<FORMCYCLE_CONTEXT_PATH>/plugin?name=Servlet%20Counter&project-id=<FORMULAR_ID>&id=<ZAEHLER_UUID> |
|
153 |
+https://<Host>/<FormcycleContextPath>/plugin?name=Servlet%20Counter&project-id=<FormId>&id=<CounterUuid> |
154 |
154 |
{{/code}} |
155 |
155 |
|
156 |
156 |
Nach Ausführung des Servlet-Aktions-Plugin wird das Ergebnis als JSON-Objekt zurückgeliefert, siehe hierzu auch die Abbildung. Dieses JSON-Objekt hat die folgenden Einträge: |