Changes for page Datenbankzähler-Plugin
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. gru1 +XWiki.awa - Default language
-
... ... @@ -1,1 +1,0 @@ 1 -de - Content
-
... ... @@ -1,336 +3,180 @@ 1 -[[**Plugin download**>>url:https://customer.formcycle.eu/index.php/apps/files/?dir=/FORMCYCLE%20-%20Plugins%20Customer/fc-plugin-bundle-dbcounter&fileid=5521||target="_blank"]] (requires login) 2 - 3 3 {{content/}} 4 4 5 -{{figure image=" plugin_dbcounter_workflow_select_en.png"width="600"}}6 -The database counter plugin may be installed as either a client plugin or a system plugin. It requ ires no additional configuration.Once installed, it offers to new workflow actions: //Variable// and //Counter.//. The //Counter// action requires you to choose a fixed counter that you would like to change. In contrast, the //Variable// action lets you choose the counter based on the submitted form data.3 +{{figure image="dbcounter_plugin_installation_en.png"}} 4 +The database counter plugin may be installed as either a client plugin or a system plugin. It requries no additional configuration. 7 7 {{/figure}} 8 8 9 -The database counter plugin lets you create one or more counter in a database. It alsoaddsanewmenu entry to thebackendwhereyou can view andeditall available counters.You can then usehe[[workflow processing>>doc:Formcycle.UserInterface.MyForms.WorkflowProcessing.WebHome]]toincrementor decrementthe counter. Thisplugin issubjecttoadditional charge.7 +The database counter plugin lets you create one or more global counter in a database. The counter value may be incremented, decremented or reset during [[workflow processing>>doc:Formcycle.UserInterface.MyForms.WorkflowProcessing.WebHome]]. Some possible uses cases are: 10 10 11 -Some of the possible use cases include: 9 +* A reservation form that counts the number of participants. When a certain limit is reached, further form submissions are blocked. 10 +* Generating a custom ID for a form record that is independent of the internal FORMCYCLE process ID. This is useful especially when the ID needs to conform to a certain pattern or has to be reset in regular intervals. 11 +* Repeating the actions of a certain state //n// times, where //n// is set depending of a submitted form value. 12 12 13 -* A registration form for a weekly event, when you need to keep track of the number of registered participants. You can then block new registrations for a certain date when the maximum number of participants has been reached. 14 -* Generating a unique {{smallcaps}}id{{/smallcaps}} for a form record that is independent of internal {{smallcaps}}id{{/smallcaps}}s used by {{formcycle/}}. Useful especially when the {{smallcaps}}id{{/smallcaps}} needs to conform to a certain pattern or needs to be reset in fixed intervals. 15 -* Running the [[actions>>doc:Formcycle.UserInterface.MyForms.WorkflowProcessing.Actions.WebHome]] of a certain [[state>>doc:Formcycle.UserInterface.MyForms.WorkflowProcessing.States.WebHome]] n-times, where //n// is determined by the value of a submitted form field. 13 +Furthermore, it is also possible to access the current value of the counter via a [[system variable>>doc:Formcycle.UserInterface.Variables]] during workflow processing; or via [[an AJAX request >>doc:Formcycle.FormDesigner.CodingPanel.ScriptTab.WebHome]] from within a form. 16 16 17 - Once thepluginisinstalled,youcanmanagethe availablecounterin aseparatebackendpage.You can checkwhich countersexist currentlyandadd or delete counter. Thecurrent valueofchcounter isdisplayedaswell, andif necessary, you canalso changethe counter'svalue.15 +Each counter has got both a name as well as a unqiue [[UUID>>https://en.wikipedia.org/wiki/Universally_Unique_Identifier]]. The UUID uniquely identifies a counter and is used when querying the counter value with an AJAX request. 18 18 19 - Inaddition, this plugin offers two new [[workflow>>doc:Formcycle.UserInterface.MyForms.WorkflowProcessing.WebHome]][[actions>>doc:Formcycle.UserInterface.MyForms.WorkflowProcessing.Actions.WebHome]]://Counter//and //Variable//. The action //Counter// requires you to select a predefined counter. The action //Variable//, on the other hand, lets you select a counter based on the value of a submitted fo m field. See the sections on each action below for further details.17 +== Workflow action "Counter" == 20 20 21 -Lastly, you can also access the current value of a counter either via a [[variable>>doc:Formcycle.UserInterface.Variables]] during workflow processing or [[via an {{smallcaps}}Ajax{{/smallcaps}} request from within an opened form>>doc:Formcycle.FormDesigner.CodingPanel.ScriptTab.WebHome]]. 19 +Once the plugin is installed, you can choose a new action in the [[workflow processing configuration>>doc:Formcycle.UserInterface.MyForms.WorkflowProcessing.WebHome]]. The action is a plugin action named //Counter//. You can use this action to modify the value of a counter or reset it in regular intervals. 20 +=== Allgemeine Einstellungen === 22 22 23 -Each counter has got both a name as well as a unique [[{{smallcaps}}Uuid{{/smallcaps}}>>https://de.wikipedia.org/wiki/Universally_Unique_Identifier]]. The {{smallcaps}}Uuid{{/smallcaps}} uniquely identifies a counter and is used, for example, when querying the counter's current value via an {{smallcaps}}Ajax{{/smallcaps}} request. 22 +{{figure image="dbcounter_plugin_action_base_settings_en.png"}} 23 +Base settings for the workflow action //Counter//. Here you can choose which counter should be changed and in what manner. 24 +{{/figure}} 24 24 25 -This is plugin bundle that includes two workflow action plugins, one placeholder replacer plugin, and one servlet action plugin. The following sections describe these plugins in more detail. 26 +; 1 - Zählername 27 +: Auswahl des Zählers, dessen Wert geändert werden soll. Für jeden Zähler wird sowohl sein Name als auch seine UUID angezeigt. Die UUID dient der eindeutigen Identifikation des Zählers und wird etwa bei der Abfrage per AJAX verwendet. Um einen Zähler zu löschen, wird dieser ausgewählt und das Papierkorb-Symbol rechts neben der Auswahl betätigt. Um einen neuen Zähler hinzuzufügen, wird zuerst auf das Plus-Symbol gedrückt, anschließend der gewünschte Name des Zählers eingegeben und schließlich der neue Zähler durch Drücken des Plus-Symbols angelegt. 28 +; 2 - Zählaktion 29 +: Gibt an, in welcher Art und Weise der Wert des Zählers geändert werden soll. Möglich Optionen sind: 30 +:; Hochzählen 31 +:: Erhöht den Wert des Zählers um die eingegebene Zahl. 32 +:; Herunterzählen 33 +:: Erniedrigt den Wert des Zählers um die eingegebene Zahl. 34 +:; Zähler auf Startwert zurücksetzen 35 +:: Setzt den Wert des Zählers auf den eingegebenen Startwert zurück. 36 +; 3 - Schrittweite 37 +: Anzahl, um die der Zähler hoch beziehungsweise herunter gesetzt werden soll. 38 +; 4 - Startwert 39 +: Initialer Wert des Zählers, den dieser annimmt, wenn er angelegt wird. Es ist auch möglich, den Zähler auf diesen Startwert zurückzusetzen. 40 +; 5 - Automatisch zurücksetzen 41 +: Ist diese Option aktiviert, erscheint eine weitere Konfigurationsmöglichkeit zum Einstellen, wann der Zähler automatisch auf den Startwert zurückgesetzt werden soll. Dies kann etwa beim Überschreiten eines bestimmten Werts oder in regelmäßigen Zeitabständen erfolgen. 26 26 27 -== Menuentry "Counterconfiguration"==43 +=== Automatisches Zurücksetzen === 28 28 29 -{{in fo}}30 - This plugin adds a new[[role permission>>doc:Formcycle.UserInterface.UserSettings.Roles]]that controls whethera useris grantedaccessto this menuentry. Contactyour administrator in caseyou do not seethemenuentryandbelieve youshould haveaccess.31 -{{/ info}}45 +{{figure image="dbcounter_plugin_action_reset_greater_or_equal_en.png"}} 46 +Die Konfiguration zum Zurücksetzen eines Zählers, wenn dessen Wert eine bestimmte Grenze übersteigt. 47 +{{/figure}} 32 32 33 -{{figure image="plugin_dbcounter_config_base_en.png" width="600"}} 34 - The menu with an overview of all existing counter. You can add or delete counter, or modify existing counters.{{/figure}} 49 +{{figure image="dbcounter_plugin_action_reset_daily_en.png"}} 50 +Die Konfiguration zum täglichen Zurücksetzen eines Zählers. 51 +{{/figure}} 35 35 36 -Once installed, a new menu entry appears in the main menu bar to the left. Please note that you may have to sign out and sign in again. The menu //Counter configuration// contains an overview of all existing counters, including their name and their current value. You can modify or delete existing counter, or add new counters. 53 +{{figure image="dbcounter_plugin_action_reset_weekly_en.png"}} 54 +Die Konfiguration zum wöchentlichen Zurücksetzen eines Zählers. 55 +{{/figure}} 37 37 38 -Press the plus icon to the top left to add a new counter. If you would like to delete an existing counter, click on that counter to select it, then press the trash icon to the top left. 57 +{{figure image="dbcounter_plugin_action_reset_monthly_en.png"}} 58 +Die Konfiguration zum monatlichen Zurücksetzen eines Zählers. 59 +{{/figure}} 39 39 40 -=== Properties === 61 +{{figure image="dbcounter_plugin_action_reset_yearly_en.png"}} 62 +Die Konfiguration zum jährlichen Zurücksetzen eines Zählers. 63 +{{/figure}} 41 41 42 -Select a counter by clicking on it in the list of counters to the left. The following details are shown for the counter: 43 - 44 -; {{smallcaps}}Uuid{{/smallcaps}} 45 -: A unique {{smallcaps}}id{{/smallcaps}} of the counter. You need to use this {{smallcaps}}Uuid{{/smallcaps}}, for example, when you want to retrieve the counter's current value via an {{smallcaps}}Ajax{{/smallcaps}} request, see also the servlet action plugin below. 46 -; Current value 47 -: The current value of the counter. 48 -; Creation date 49 -: The date when the counter was created. 50 -; Last change 51 -: The date of the most recent change to the counter's value. 52 - 53 -Additionally, you can also edit the following properties of a counter: 54 - 55 -; Counter name 56 -: The name of this counter. When you change the name of a counter, you may have to change existing //Variable// action, placeholders and {{smallcaps}}Ajax{{/smallcaps}} requests that reference a counter by its name. {{smallcaps}}Ajax{{/smallcaps}} requests that reference a counter by its {{smallcaps}}Uuid{{/smallcaps}} do not have to be updated. 57 -; Description 58 -: An optional description of this counter. This description is shown only within this backend menu. 59 -; Initial value 60 -: The initial value of this counter. This is also the value that is used when a workflow action resets a counter to its initial value. 61 -; Reset automatically 62 -: When this option es enabled, the value of this counter is reset in period intervals. 63 - 64 -=== Reset automatically === 65 - 66 -The following settings are available when the option to reset the counter automatically is enabled: 67 - 68 68 {{info}} 69 - When acounterisreset, thenafterthecounter actionwasprocessed,the counter'svalue will be equaltotheconfiguredinitialvalue.Forxample:Assumethe counteractionwasconfiguredto incrementthecounterby//3//eachimeitisexecuted, andshouldbeesetdaily. Letthethe currentcountervaluebe //37//andtheintial value //11//.Thefirstcounteractionthatisexecutedonanewdaywillnowresetthecountero//11//,andnot be incrementedat all.Startingwith thesecondcounteractionof that day, the counterwill becrementedby //3// each time the action is executed.66 +Geschieht ein Zurücksetzen des Zählers, so ist nach Ausführung der aktuellen Aktion der Wert des Zählers gleich dem Startwert, wie er in den allgemeinen Einstellung eingegeben wurde. Zum Beispiel: Die Counter-Aktion sei so eingestellt, dass der Zähler um 3 erhöht wird. Weiterhin soll der Zähler täglich zurückgesetzt werden. Der aktuelle Wert sei //39//, der Startwert //11//. Die erste Counter-Aktion, die an einem Tag ausgeführt wird, setzt nun dern Wert des Zählers auf den Wert //11// zurück. Das Hochzählen um //3// erfolgt erst ab der zweiten Counter-Aktion an einem Tag. 70 70 {{/info}} 71 71 72 -{{info}} 73 - Please note that the counter is not reset by background task, but only when the workflow action //Counter// or //Variable// is executed. Or, to be more precise, the counter value is reset (instead of being incremented or decremented), when the time points at which the counter should have been reset contains at least one point that lies between the last point in time the counter value was modified and the current point in time. 74 -{{/info}} 69 +Es ist möglich, den Zähler in regelmäßigen Abständen zurückzusetzen. Diese Option ist nur verfügbar, wenn als Zählaktion nicht //Zähler auf Startwert zurücksetzen// gewählt wurde. Zudem muss in den allgemeinen Einstellungen die Option //Automatische zurücksetzen// aktiviert sein. Es kann dann ausgewählt werden, wann der Zähler zurückgesetzt werden soll. 75 75 76 -; Condition 77 -: Lets you choose when and how the counter should be reset. The following options are available: 78 -:; Counter greater than or equal 79 -:: Available only when the counting action was set to //count up//. The counter is reset to its initial value when, after the counter was incremented, its value is now greater than or equal to the given limit. 80 -:; Counter less than or equal 81 -:: Available only when the counting action was set to //count down//. The counter is reset to its initial value when, after the counter was decremented, its value is now less than or equal to the given limit. 82 -:; daily 83 -:: The counter is reset each day at the given time of day. 84 -:; weekly 85 -:: The counter is reset at each of the given days of the week and at the given time of the day. 86 -:; monthly 87 -:: The counter is reset each month at the given date and time of the day. 88 -:; yearly 89 -:: The counter is reset each year the given day, month and time of the day. 71 +Hierbei ist zu beachten, dass der Zähler nicht in einem Hintergrundprozess zurückgesetzt wird, sondern erst wenn die Verarbeitungsaktion //Counter// ausgeführt wird. Genauer: Der Zählwert wird bei Ausführung der Aktion zurückgesetzt (anstelle erhöht oder erniedrigt zu werden), falls zwischen dem Zeitpunkt, an dem der Zählwert zuletzt geändert wurde, und dem aktuellen Zeitpunkt des Servers ein Zeitpunkt liegt, an dem der Zähler gemäß Konfiguration zurückgesetzt hätte werden müssen. 90 90 91 -== Workflow action "Counter" == 73 +; 1 - Bedingung 74 +: Hier kann festgelegt werden, wann und unter welchen Umständen der Zähler zurückgesetzt werden soll. 75 +:; Zähler größer gleich 76 +:: Nur verfügbar, wenn als Zählaktion //Hochzählen// gewählt wurde. Der Zähler wird auf den Startwert zurückgesetzt, wenn durch die aktuelle Aktion der Wert des Zählers so geändert wird, dass dieser größer oder gleich dem in (2) festgelegten Wert ist. 77 +:; Zähler kleiner gleich 78 +:: Nur verfügbar, wenn als Zählaktion //Herunterzählen// gewählt wurde. Der Zähler wird auf den Startwert zurückgesetzt, wenn durch die aktuelle Aktion der Wert des Zählers so geändert wird, dass dieser kleiner oder gleich dem in (2) festgelegten Wert ist. 79 +:; täglich 80 +:: Der Zähler wird jeden Tag zur bei (2) gewählten Uhrzeit auf den Startwert zurückgesetzt. 81 +:; wöchentlich 82 +:: Der Zähler wird an jedem unter (2) gewählten Wochentag zu der unter (3) gewählten Uhrzeit zurückgesetzt. 83 +:; monatlich 84 +:: Der Zähler wird jeden Monat zum unter (2) gewählten Tag zu der unter (3) gewählten Uhrzeit zurückgesetzt. 85 +:; jährlich 86 +:: Der Zähler wird jedes Jahr zum unter (2) und (3) gewählten Tag zu der unter (4) gewählten Uhrzeit zurückgesetzt 92 92 93 -{{figure image="plugin_dbcounter_action_counter_en.png"}} 94 - The settings for the workflow action //Counter//. You can select the counter to modify and how its value should be changed, e.g. incrementing or decrementing it by a certain amount. 95 -{{/figure}} 88 +=== Allgemeine Rückgabeparameter === 96 96 97 -Once the plugin is installed, you can select the new action //Counter// in the [[workflow processing configuration>>doc:Formcycle.UserInterface.MyForms.WorkflowProcessing.WebHome]]. This action lets you modify the value of a predefined counter. 98 - 99 -Compared with the action //Variable//, here you need to select a predefined counter. You should have created this counter in the counter configuration menu (see above). Use this action when you need a global, non-dynamic counter, such as when you want to generate an identifier for each form record. 100 - 101 -; Counter name 102 -: Name of the counter to be modified. For each counter you can see its name as well as its {{smallcaps}}Uuid{{/smallcaps}}. The {{smallcaps}}Uuid{{/smallcaps}} uniquely identifies a counter and is used when querying it via an {{smallcaps}}Ajax{{/smallcaps}} request. To delete a counter, first select the counter, then click on the thrash icon to the right. To add a counter, first click on the plus icon, then enter a name for the new counter, and finally save the counter by pressing the floppy disc icon. 103 -; Counting action 104 -: Lets you chose how the value of the counter should be changed. Possible options are: 105 -:; Increment count 106 -:: Adds the given amount to the current value of the counter. 107 -:; Decrement count 108 -:: Substracts the given amount from the current value of the counter. 109 -:; Reset counter to start value 110 -:: Sets the current value of the counter back to the selected initial value. 111 -; Step size 112 -: Amount by which the counter is incremented or decremented. 113 -; Use global settings (deprecated) 114 -: You should leave this option checked and configure the counter settings in the counter configuration menu (see above). It exists only to ensure backwards compatibility with older versions of the plugin and may be removed in future versions. 115 - 116 -== Workflow action "Variable" == 117 - 118 -{{figure image="plugin_dbcounter_action_variable_en.png"}} 119 - Settings for the workflow action //Variable//. It lets you select a counter dynamically by its name. You can also make use of placeholder variables to select a counter based on the value of some form field. 90 +{{figure image="dbcounter_plugin_action_return_parameters_en.png"}} 91 +Einstellungen für die Rückgabeparameter, die später über Platzhalter verfügbar sind. 120 120 {{/figure}} 121 121 122 - Once theplugin is installed,youcanselectthe newaction//Variiable//in the[[workflowprocessingconfiguration>>doc:Formcycle.UserInterface.MyForms.WorkflowProcessing.WebHome]].Thisaction letsyouselectacounterbyitsname andmodifyits value.94 +Manchmal ist es notwendig, auf den neuen Zählwert zugreifen zu können. Dies kann über Aktionsplatzhalter geschehen, welche auf die Rückgabewerte einer Aktion zugreifen. In den allgemeinen Rückgabeparametern kann eingestellt werden, über welchem Schlüssel die Rückgabeparameter Aktion zugegriffen werden kann. Beispielsweise trage die Zähleraktion den Namen //CountUp//. Dann kann über den Platzhalter //[%$CountUp.RESULT[0].count%]// auf den aktuellen Zählwert zugegriffen werden, falls unter (3) bei den allgemeinen Rückgabeparameter der Wert //count// eingetragen wurde. Folgende Rückgabeparameter sind verfügbar: 123 123 124 -Compared with the action //Counter//, here you do not have to choose a predefined counter. You can also use [[placeholder variables>>doc:Formcycle.UserInterface.Variables]] to select a counter based on the submitted form data. In case the counter does not exists yet, a new counter is created dynamically. 125 - 126 -Use this action when you need different counters for each submitted form record. For example, if you have got a participation form where users can sign up for a certain date, you can use a counter for each date to keep track of the number of registered people for that date. The counter name could be formatted like //participants-year-month-day//. 127 - 128 -=== Change variable === 129 - 130 -Select the name of the variable ("counter") to modify and how its value should be changed. 131 - 132 -; Counter name 133 -: Name of the counter to modify. Enter name of the counter, not its {{smallcaps}}Uuid{{/smallcaps}}). You can also use [[placeholder variables>>doc:Formcycle.UserInterface.Variables]] to select a counter based on a submitted form field. 134 -; Counting action 135 -: Lets you chose how the value of the counter should be changed. Possible options are: 136 -:; Increment count 137 -:: Adds the given amount to the current value of the counter. 138 -:; Decrement count 139 -:: Subtracts the given amount from the current value of the counter. 140 -:; Reset counter to start value 141 -:: Sets the current value of the counter back to the selected initial value. 142 -; Step size 143 -: Amount by which the counter is incremented or decremented. 144 - 145 -=== Default settings if variable does not exists yet === 146 - 147 -In case the variable ("counter") with the given name does not exist yet, a new counter is created. Here you can edit the default settings for a newly created counter. In case the counter exists already, these settings do not have any effect. 148 - 149 -; Initial value 150 -: The initial value of the newly created counter. 151 -; Reset automatically 152 -: Whether the newly created counter should be reset automatically. When this option is enabled, a few more settings appear. See the section on the counter configuration menu above for further details. 153 - 154 -== General return parameters == 155 - 156 -{{figure image="plugin_dbcounter_action_return_parameters_en.png"}} 157 -Settings for the return parameters of the counter action. You can access the returned values via placeholder variables. 158 -{{/figure}} 159 - 160 -Sometimes it may be necessary to access the new value of the counter. To do so, you can use [[action variables>>doc:Formcycle.UserInterface.Variables]] for accessing the returned values of an action. The section //general return parameters// lets you configure the key you need to use for accessing the return values. For example, assume a counter action were named //CountUp//. Then you can use the variable //[%$CountUp.RESULT[0].currentValue%]// to access the current counter value, provided you entered the key //currentValue// in the input field for the //Counter// return value. The following return values are available: 161 - 162 162 ; 1 - ResultCode 163 -: Anumericalvaluethat indicateswhether thecounteractionwas successful or not.The following result codes arepossible:97 +: Ein nummerischer Zahlenwert, der angibt, ob die Zählaktion erfolgreich war oder nicht. Folgende Ergebnisnummern sind möglich: 164 164 :; 1 (OK) 165 -:: Thecounteraction wasprocessed successfully.99 +:: Die Zählaktion wurde erfolgreich abgearbeitet. 166 166 :; 10 (UNKNOWN_ACTION_ERROR) 167 -:: Thecounteractioncouldnotbeprocessed, an unknowncountingactionwasselected.The currentlysupportedcountingactions are //count up//, //countdown//and //resetcountertostartvalue//.101 +:: Die Zählaktion kann nicht ausgeführt werden, da eine unbekannte Zählaktion ausgewählt wurde. Aktuell werden die Zählaktionen //Hochzählen//, //Herunterzählen// und //Auf den Startwert zurücksetzen// unterstützt. 168 168 :; 11 (PARSING_ERROR) 169 -:: A settingsdoesnot conformto the expecteddatatype or syntax; suchas when aletterwasenteredforthe initialvalue(insteadofa number).103 +:: Ein konfigurierter Wert hat nicht den erwarteten Datentyp, etwa wenn für die Schrittweite des Zählers keine syntaktisch korrekte Zahl eingegeben wurde. 170 170 :; 40 (INTERNAL_ERROR) 171 -:: Thecounteractionwasnot successful.The typeoferrorcannotbe specifiedmoreclosely.105 +:: Es ist ein anderer Fehler aufgetreten, der nicht näher klassifiziert werden kann. 172 172 ; 2 - ResultMessage 173 -: AnEnglishdescriptionof theresult (successor error).107 +: Eine englische Beschreibung des Resultats (Erfolg oder Fehler). 174 174 ; 3 - Counter 175 -: The newnumericalvalueofthecounter, after thecountingactionwasapplied.109 +: Der neue nummerische Wert des Zählers, nachdem die Zählaktion ausgeführt wurde. 176 176 ; 4 - IsReset 177 -: E ither //true//,whenthecounterwasresetduringthecurrent action; or //false//if itwasnot reset.111 +: Entweder //true//, falls der Zähler durch die aktuelle Aktion zurückgesetzt wurde; oder //false//, wenn er nicht zurückgesetzt wurde. 178 178 ; 5 - CounterAfterReset 179 -: In casethecounterwas reset:The numericalvalueofthecounterbeforethe reset.113 +: Falls der Zähler zurückgesetzt wurde: Der nummerische Wert des Zählers vor dem Zurücksetzen. 180 180 181 -== System variableplugin ==115 +== Systemplatzhalter-Plugin == 182 182 183 183 {{figure image="dbcounter-plugin-placeholder_en.png"}} 184 - An example forhow to retrievethecurrentvalueof a counter. Herewereada counterthat isused for keepingtrackofthenumberofparticipants of some event. Wethencheckwhetherthe valueexceeds the maximumnumberof participants. Based on theresultofthischeck,wecan displayanappropriate errormessageotheuserincasethelimit wasreached.By performingthischeckduringworkflow processing,we canvalidatethedataonthe serverand prevent manipulatios. Pleasenotethatitisbest practicetogivetheusersomefeedbackwhilethefill out theform andinformheuserincase nomore freeslots are available.118 +Ein Beispiel für den Platzhalter zum Auslesen des Zählwerts. Hier wird ein Zähler ausgelesen, der die Anzahl an Anmeldungen für eine Veranstaltung zählt. Dann wird geprüft, ob der Zählwert die maximale Anzahl an Anmeldungen übersteigt. Basierend auf dieser Prüfung kann dem Nutzer dann ein Fehler angezeigt werden, falls die Veranstaltung bereits ausgebucht ist. Hierbei handelt es sich um eine serverseitige Prüfung zur Validierung, bereits im Formular bei der Anmeldung sollte dem Nutzer natürlich schon die Information gegeben werden, ob überhaupt noch Plätze frei sind. 185 185 {{/figure}} 186 186 187 - Once thepluginisinstalled, you canaccessthe current value of the pluginwitha[[systemvariable>>doc:Formcycle.UserInterface.Variables]].This canbeused,forexample,toaccessthecountervalueintheconditionofaworkflowactionandcompareitwitha submittedvalue.Thesystem variablehas gotthe followingpattern:121 +Nach Installation des Plugins ist ein neuer [[Systemplatzhalter>>doc:Formcycle.UserInterface.Variables]] verfügbar, über den auf den aktuellen Wert eines Zählers zugegriffen werden kann. Dies ist etwa nützlich, um in einer Aktionsbedingung den Zählwert nutzen und prüfen zu können. Der Platzhalter baut sich nach dem folgenden Schema auf: 188 188 189 -{{code language="none"}}190 -[%$DBCOUNTER.< CounterName>%]123 +{{code}} 124 +[%$DBCOUNTER.<Zählername>%] 191 191 {{/code}} 192 192 193 - Forexample, inordertoaccessthevalueof a counternamed//test//,youcan usethe followingvariable:127 +Um also etwa auf den Zähler mit dem Name //test// zuzugreifen, muss der folgende Platzhalter genutzt werden: 194 194 195 -{{code language="none"}}129 +{{code}} 196 196 [%$DBCOUNTER.test%] 197 197 {{/code}} 198 198 199 - Incaseyou need to access a counterthat may not exist yet, you need to provide an initialvalueforthe counter. When the counter doesnot exist yet, a new counter with thegiveninitial value is created. Use the following pattern:133 +== Servlet-Aktions-Plugin == 200 200 201 -{{code language="none"}} 202 -[%$DBCOUNTER(<CounterName>, <InitialValue>)%] 203 -{{/code}} 204 - 205 -For example, if the counter is named //participants-2020-03-17// and should start at //0// in case it does not exist, you can use the following variable: 206 - 207 -{{code language="none"}} 208 -[%$DBCOUNTER(participants-2020-03-17, 0)%] 209 -{{/code}} 210 - 211 -== Servlet action plugin == 212 - 213 213 {{figure image="dbcounter_plugin_servlet_action.png"}} 214 - Anexamplefor how the countervaluecanbeaccessedviaan {{smallcaps}}Ajax{{/smallcaps}}request.The{{smallcaps}}Url{{/smallcaps}}isbuildwiththemetadataavailable in theformcontext.This avoidshaving toenterthe{{smallcaps}}Url{{/smallcaps}}directlyinthecode,which is pronetoerror: thehost or contextpathcouldchange,forexample, whentheform is moved betweena developmentndproduction.136 +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. 215 215 {{/figure}} 216 216 139 +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: 217 217 218 -Once the plugin is installed, a new servlet plugin action is available that lets you access the current value of a counter via an {{smallcaps}}Http{{/smallcaps}} request. This is useful, for example, when you would like to read the counter's current value from within a form and display it in the form. The {{smallcaps}}Url{{/smallcaps}} for the counter action plugin servlet takes the following pattern: 219 - 220 -{{code language="none"}} 221 -https://<Host>/<FormcycleContextPath>/plugin?name=Servlet%20Counter&client-id=<ClientId>&id=<CounterUuid> 141 +{{code}} 142 +https://<HOST>/<FORMCYCLE_CONTEXT_PATH>/plugin?name=Servlet%20Counter&client-id=<MANDANT_ID>&id=<ZAEHLER_UUID> 222 222 {{/code}} 223 223 224 - Assuming{{formcycle/}} wasinstalledlocallyand runs inthecontextpath//formcycle//,andthecounterpluginswasinstalledwithina clientwiththe{{smallcaps}}id{{/smallcaps}}//1//,andthe{{smallcaps}}Uuid{{/smallcaps}}of the counteris//bc49d3b0-f869-4e59-864e-ddcc2925ed63//,the{{smallcaps}}Url{{/smallcaps}}is:145 +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: 225 225 226 -{{code language="none"}}227 -https://localhost:8080/formcycle/plugin?name=Servlet%20Counter&client-id=1&id=bc49d3b0-f869-4e59-864e-ddcc2925ed63 147 +{{code}} 148 +https://localhost:8080/xima-formcycle/plugin?name=Servlet%20Counter&client-id=1&id=bc49d3b0-f869-4e59-864e-ddcc2925ed63 228 228 {{/code}} 229 229 230 -Alternativ ely,you can alsousethe{{smallcaps}}id{{/smallcaps}} of theform instead ofthe //client-id//.Both the clientandtheform{{smallcaps}}id{{/smallcaps}}areusedonlyto identifytheservletxecuted;andaretusedinanyway by thiscounterservlet.151 +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: 231 231 232 -{{code language="none"}}233 -https://<H ost>/<FormcycleContextPath>/plugin?name=Servlet%20Counter&project-id=<FormID>&id=<CounterUuid>153 +{{code}} 154 +https://<HOST>/<FORMCYCLE_CONTEXT_PATH>/plugin?name=Servlet%20Counter&project-id=<FORMULAR_ID>&id=<ZAEHLER_UUID> 234 234 {{/code}} 235 235 236 - ===HTTPparameter===157 +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: 237 237 238 -In addtional to the parameters mentioned above, you can also specify a few more paramters as {{smallcaps}}Url{{/smallcaps}} parameters. The following is an overview of all available parameters. 239 - 240 -; name 241 -: The name of the servlet plugin action to execute. Set this to //Servlet Counter// for this plugin. 242 -; client-id 243 -: {{smallcaps}}id{{/smallcaps}} of the client where the counter plugin was installed. Not required in case the plugin was installed as a system plugin. Only one of //client-id// or //project-id// may be specified. 244 -; project-id 245 -: {{smallcaps}}id{{/smallcaps}} of a form that belongs to a client that has access to the counter plugin., in dem das Zähler-Plugin zur Verfügung steht. Only one of //client-id// or //project-id// may be specified. 246 -; id 247 -: {{smallcaps}}Uuid{{/smallcaps}} of counter to read. In case a counter with the given {{smallcaps}}Uuid{{/smallcaps}} does not exist yet, a corresponding error code is returned, see below. Only one of //id// or //counter-name// may be specified. 248 -; counter-name 249 -: Name of the counter to read. In case a counter with the given name does not exist yet, a new counter is created with the given initial value.Only one of //id// or //counter-name// may be specified. 250 -; counter-initial 251 -: Optional. The initial value of the counter, in case it does not exist yet. Defaults to //0//. This parameter is allowed only when //counter-name// is specified. 252 -; counter-array 253 -: Optional. Either //true// or //false//, defaults to //false//. When this is set to //true//, the parameter //counter-name// or //id// may be specified multiple times. This will return an array with the current value of all specified counters. This can be used, for example, to reduce the amount of {{smallcaps}}Http{{/smallcaps}} requests when you need to query multiple counter simultaneously. 254 - 255 -=== HTTP response === 256 - 257 -If the servlet action plugin is executed successfully, it returns a {{smallcaps}}Json{{/smallcaps}} object as shown in the figure to the right. When the parameter //counter-array// was set to //true//, a {{smallcaps}}Json{{/smallcaps}} array is returned instead, with each item being a {{smallcaps}}Json{{/smallcaps}} object as described below. 258 - 259 -The {{smallcaps}}Json{{/smallcaps}}-Objekt has got the following properties: 260 - 261 261 ; Status 262 -: Indicateswhethertheservletequestwas successful.Thevalue isanother{{smallcaps}}Json{{/smallcaps}}objectwiththefollowingies:160 +: Gibt an, ob der Servlet-Aufruf erfolgreich war. Der Wert ist ein weiteres JSON-Objekt mit folgenden Einträgen: 263 263 :; Msg 264 -:: A numerical value that indicates whether the servlet request was successful. Possible values are: 265 -::; 0 (OK) 266 -::: The request was successful. 267 -::; 12 (NO_REQUEST_ID_ERROR) 268 -::: The request did not specify a counter UUID. 269 -::; 13 (NO_COUNTER_TO_UUID_ERROR) 270 -::: No counter with the specified UUID exists. 271 -::; 40 (INTERNAL_ERROR) 272 -::: The counter action was not successful. The type of error cannot be specified more closely. 162 +:: Ein nummerischer Wert, der angibt, ob der Servlet-Aufruf erfolgreich war. Mögliche Werte sind: 163 +::; (OK) 164 +::; (NO_REQUEST_ID_ERROR) 165 +::; (NO_COUNTER_TO_UUID_ERROR) 273 273 :; Code 274 -:: AnEnglishdescriptionof theresult (successor error).167 +:: Eine englische Beschreibung des Resultats (Erfolg oder Fehler). 275 275 ; Counter 276 -: Details about the requested counter. The value is another {{smallcaps}}Json{{/smallcaps}} object with the following entries: 169 +: Informationen zum angefragten Zähler. Der Wert ist ein weiteres JSON-Objekt mit folgenden Einträgen: 170 +: Der aktuelle nummerische Wert des Zählers. 277 277 :; LastChange 278 -:: The dateandtimeof themost recentmodificationofthecountervalue.Thedateandtimeis formattedaccording to thecurrentserverlocale.172 +:: Das Datum mit Uhrzeit, an dem der Zähler zuletzt geändert wurde. Das Datum wird mit dem Datums- und Zeitformat der aktuellen Server-Locale formattiert. 279 279 :; LastChangeTimestamp 280 -:: The dateandtimeof themost recentmodificationofthecountervalue.Thetimestamp is awholenumberindicatingthenumberof milliseconds January 1st, 1970, 00:00:00 GMT.174 +:: Das Datum mit Uhrzeit, an dem der Zähler zuletzt geändert wurde. Der Zeitstempel ist eine ganze Zahl, welche die Anzahl an Millisekunden seit dem 1. Januar, 1970, 00:00:00 GMT angibt. 281 281 :; Value 282 -:: Thecurrentnumericalvalueofthecounter.176 +:: Der aktuelle nummerische Wert des Zählers. 283 283 :; UUID 284 -:: The UUIDofthe requestedcounter.178 +:: Die UUID des angefragten Zählers, dessen Wert ausgelesen wurde. 285 285 :; Name 286 -:: The name of the requested counter. 287 - 288 -== Changelog == 289 - 290 -This section lists all known versions of this plugin and describes the changes that were made in each version. 291 - 292 -=== 2.3.3 === 293 - 294 -* Fixed some spelling mistakes 295 - 296 -=== 2.3.2 === 297 - 298 -* Fixed a UI bug: The checkbox //Use global settings// (action //Counter//) now toggles the options below correctly. 299 -* Fixed some spelling mistakes 300 - 301 -=== 2.3.1 === 302 - 303 -* Fixed a bug with {{smallcaps}}Mysql{{/smallcaps}} that prevented this plugin from working with that database management system. 304 - 305 -=== 2.3.0 === 306 - 307 -* New action: //Variable// 308 -* Lets you select a counter by its name and allows for placeholder variables. This requires an initial value. 309 -* New placeholder variable: //DBCOUNTER(name, initialValue)//. Creates a new counter in case a counter with the given name does not exist yet. 310 -* Added 3 new parameters to the servlet action plugin: //counter-name//, //counter-initial// and //counter-array//. 311 - 312 -=== 2.2.0 === 313 - 314 -* Make sure to reset the counter even when its value is only read 315 -* Portal page that adds a new menu entry to the backend: Counter configuration 316 -* Deprecate editing a counter's settings in the workflow action directly 317 - 318 -=== 2.1.0 === 319 - 320 -* Modifications for {{formcycle/}} version 6.1.6 321 -* The //CounterPlugin// and //ServletCounterPlugin// had the same name, this resulted in errors 322 -* Fixed an error that resulted in a counter not being resetted correctly 323 -* Add a new property to the {{smallcaps}}Json{{/smallcaps}} object returned by the servlet action plugin: //Counter.LastChangeTimestamp// 324 -* Added a new system variable replacer plugin that lets you access the value of a counter via a variable: //[%DBCOUNTER.name%]// 325 - 326 -=== 2.0.0 === 327 - 328 -* Modifications to make the plugin work with {{formcycle/}} version 6.0.2 329 - 330 -=== 1.0.1 === 331 - 332 -* Fix a bug where the counter value was not set when retrieved for the first time 333 - 334 -=== 1.0.0 === 335 - 336 -* Initial version 180 +:: Der Name des angefragten Zählers, dessen Wert ausgelesen wurde.