Changes for page Datenbankzähler-Plugin
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -4,134 +4,132 @@ 4 4 The database counter plugin may be installed as either a client plugin or a system plugin. It requries no additional configuration. 5 5 {{/figure}} 6 6 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. Some possible uses cases are: 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: 8 8 9 -* EinTeilnahmeformular,indemdieAnzahlderTeilnehmergezähltwird und weitereAnmeldungenabeiner bestimmtenGrenzeblockiert werden.10 -* DasGeneriereneinerID füreinenFormularvorgang,dieunabhängigvonder FORMCYCLE-internenProzess-IDist.Dies istspezielldannsinnvoll,wenndie IDeinem bestimmtenMusterfolgensolloder in regelmäßigenAbständen zurückgesetzt werden muss.11 -* Dasn-facheDurchlaufenderAktioneneinesStatus, wobei//n// inAbhängigkeit einer Formulareingabefestgelegtwird.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 - Zudem istes auch möglich,denaktuellenWert einesZählersübereinen[[Platzhalter>>doc:Formcycle.UserInterface.Variables]] inderVerarbeitung oder [[perAJAX>>doc:Formcycle.FormDesigner.CodingPanel.ScriptTab.WebHome]]im Formularabzufragen.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. 14 14 15 - Jeder ZählerbesitztsowohleinenNamenals aucheine eindeutige [[UUID>>https://de.wikipedia.org/wiki/Universally_Unique_Identifier]].Die UUIDdient zur eindeutigenIdentifikationZählersundwirdbeiderAbfrageper AJAXverwendet.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. 16 16 17 -== Aktionverarbeitung"Counter" ==17 +== Workflow action "Counter" == 18 18 19 -Nach Installation gibt es in der Status- und Aktionsverarbeitung eine neue Aktion namens //Counter//. Mit dieser Aktion kann der aktuelle Zählwert eines Zählers geändert werden. Hier ist es auch möglich, den Zähler in regelmäßigen Abständen zurückzusetzen. 20 - 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. 21 21 === Allgemeine Einstellungen === 22 22 23 23 {{figure image="dbcounter_plugin_action_base_settings_en.png"}} 24 - DieGrundeinstellungenfürdieVerarbeitungsaktion //Counter//. Hierkannfestgelegtwerden,welcherZählerin welcherWeise geändert werden soll.23 +Base settings for the workflow action //Counter//. Here you can choose which counter should be changed and in what manner. 25 25 {{/figure}} 26 26 27 -; 1 - Zählername28 -: Auswahl desZählers,dessenWertgeändertwerdensoll. Fürjeden Zählerwird sowohlseinName alsauchseineUUIDangezeigt.Die UUIDdient der eindeutigenIdentifikationdes ZählersundwirdetwabeiderAbfrageperAJAXverwendet.Umeinen Zählerzulöschen,wird dieserausgewählt und das Papierkorb-SymbolrechtsnebenderAuswahlbetätigt.UmeinenneuenZählerhinzuzufügen,wird zuerstaufdasPlus-Symbolgedrückt,anschließendder gewünschteNamedesZählerseingegebenundschließlichderneue ZählerdurchDrückendesPlus-Symbolsangelegt.29 -; 2 - Zählaktion30 -: Gibtan,in welcherArt und WeisederWertdes Zählersgeändertwerdensoll.MöglichOptionensind:31 -:; Hochzählen32 -:: ErhöhtdenWertdesZählersumdie eingegebene Zahl.33 -:; Herunterzählen34 -:: ErniedrigtdenWertdesZählersumdie eingegebene Zahl.35 -:; ZähleraufStartwertzurücksetzen36 -:: Set ztdenWertdesZählersaufdeneingegebenenStartwertzurück.37 -; 3 - S chrittweite38 -: An zahl,umdieder Zählerhoch beziehungsweiseheruntergesetzt werden soll.39 -; 4 - Startwert40 -: InitialerWertdesZählers,dendieserannimmt,wennerangelegt wird.Es ist auchmöglich,denZählerauf diesenStartwertzurückzusetzen.41 -; 5 - Automatisch zurücksetzen42 -: IstdieseOptionaktiviert, erscheinteineweitereKonfigurationsmöglichkeitzum Einstellen,wannderZähler automatischaufdenStartwertzurückgesetztwerdensoll.Dies kannetwabeimÜberschreiteneinesbestimmtenWertsoderinregelmäßigenZeitabständenerfolgen.26 +; 1 - Counter name 27 +: Name of the counter to be modified. For each counter you can see its name as well as its UUID. The UUID uniquely identifies a counter and is used when querying it via an AJAX 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. 28 +; 2 - Counting action 29 +: Lets you chose how the value of the counter should be changed. Possible options are: 30 +:; Increment count 31 +:: Adds the given amount to the current value of the counter. 32 +:; Decrement count 33 +:: Substracts the given amount from the current value of the counter. 34 +:; Reset counter to start value 35 +:: Sets the current value of the counter back to the selected initial value. 36 +; 3 - Step size 37 +: Amount by which the counter is incremented or decremented. 38 +; 4 - Initial value 39 +: The intial starting value of the counter. This is the value of the counter when it is first created. You may also reset the counter to this value. 40 +; 5 - Reset automatically 41 +: When this option is enabled, the counter is reset automatically by the system when certain conditions are met; such as each week, or when the counter value reaches a certain limit. See below for how to configure this feature. 43 43 44 -=== AutomatischesZurücksetzen===43 +=== Reset automatically === 45 45 46 46 {{figure image="dbcounter_plugin_action_reset_greater_or_equal_en.png"}} 47 - Die KonfigurationzumZurücksetzeneines Zählers,wenndessenWerteinebestimmteGrenzeübersteigt.46 +Configuration for resetting a counter when its value exceed a given limit. 48 48 {{/figure}} 49 49 50 50 {{figure image="dbcounter_plugin_action_reset_daily_en.png"}} 51 - Die KonfigurationzumtäglichenZurücksetzeneinesZählers.50 +Configuration for resetting a counter on a daily basis. 52 52 {{/figure}} 53 53 54 54 {{figure image="dbcounter_plugin_action_reset_weekly_en.png"}} 55 - Die KonfigurationzumwöchentlichenZurücksetzen eines Zählers.54 +Configuration for resetting a counter on a weekly basis. 56 56 {{/figure}} 57 57 58 58 {{figure image="dbcounter_plugin_action_reset_monthly_en.png"}} 59 - Die Konfigurationzum monatlichenZurücksetzeneinesZählers.58 +Configuration for resetting a counter on a monthly basis. 60 60 {{/figure}} 61 61 62 62 {{figure image="dbcounter_plugin_action_reset_yearly_en.png"}} 63 - Die Konfigurationzum jährlichenZurücksetzeneinesZählers.62 +Configuration for resetting a counter on a yearly basis. 64 64 {{/figure}} 65 65 66 66 {{info}} 67 -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. 68 -{{/info}} 66 +When a counter is reset, then after the counter action was processed, its value will be equal to the configured initial value. For example: Assume the counter action was configured to increment the counter by 3 each time it is executed, and should be reset daily. Let the the current counter value be //39// and the intial value //11//. The first counter action that is executed on a new day will now reset the counter to //11//, and not be incremented at all. Starting with the second counter action of that day, the counter will be incremented by //3// each time the action is executed.{{/info}} 69 69 70 - Esist möglich, denZählerin regelmäßigenAbständenzurückzusetzen.DieseOptionist nurverfügbar,wennalsZählaktionnicht//ZähleraufStartwertzurücksetzen//gewählt wurde.Zudem mussin denallgemeinenEinstellungendieOption//Automatische zurücksetzen// aktiviertsein.Es kanndann ausgewähltwerden,wannderZählerzurückgesetztwerdensoll.68 +A counter may be reset either in regular intervals or when its value exceeds a certain threshold. This feature is available only if the checkbox //reset automatically// was enabled and the counting action was not set to //Reset counter to start value//. 71 71 72 - Hierbeiistzu beachten,dassderZählernichtineinemHintergrundprozesszurückgesetztwird,sondernerst wenndieVerarbeitungsaktion //Counter//ausgeführtwird.Genauer:DerZählwertwirdbeiAusführung derAktionzurückgesetzt(anstelleerhöhtodererniedrigtzu werden),falls zwischendemZeitpunkt,andemderZählwertzuletztgeändertwurde,unddemaktuellenZeitpunktdesServerseinZeitpunktliegt, andemderZählergemäßKonfigurationzurückgesetzthättewerden müssen.70 +Regarding resetting the counter in daily intervals: Please note that the counter is not reset by background task, but only when the workflow action //counter// 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. 73 73 74 -; 1 - Bedingung75 -: Hierkannfestgelegtwerden,wann undunterwelchenUmständen derZählerzurückgesetzt werden soll.76 -:; Zähler größergleich77 -:: Nurverfügbar,wenn als Zählaktion //Hochzählen// gewähltwurde.Der Zählerwird auf denStartwertzurückgesetzt,wenndurch dieaktuelleAktionderWertdes Zählerssogeändertwird,dassdiesergrößer odergleichdem in(2)festgelegtenWertist.78 -:; Zählerkleinergleich79 -:: Nurverfügbar,wenn als Zählaktion //Herunterzählen//gewählt wurde.Der Zählerwird auf denStartwertzurückgesetzt,wenndurch dieaktuelleAktionderWertdes Zählerssogeändertwird, dassdieserkleiner odergleichdemin(2) festgelegtenWertist.80 -:; täglich81 -:: DerZählerwirdjedenTagzurbei (2) gewähltenUhrzeitauf denStartwert zurückgesetzt.82 -:; w öchentlich83 -:: DerZählerwirdan jedemunter(2) gewähltenWochentagzuderunter(3) gewähltenUhrzeitzurückgesetzt.84 -:; mon atlich85 -:: DerZählerwirdjedenMonatzumunter(2)gewähltenTagzuder unter (3)gewähltenUhrzeit zurückgesetzt.86 -:; jährlich87 -:: DerZählerwirdjedesJahrzumunter(2)und(3) gewähltenTagzuder unter (4)gewähltenUhrzeitzurückgesetzt72 +; 1 - Condition 73 +: Lets you choose when and how the counter should be reset. 74 +:; Counter greater than or equal 75 +:: 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 limit entered in (2). 76 +:; Counter less than or equal 77 +:: 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 limit entered in (2). 78 +:; daily 79 +:: The counter is reset each day at the time of day as entered in (2). 80 +:; weekly 81 +:: The counter is reset at each of the days of the week selected in (2); at the time of day as entered in (2). 82 +:; monthly 83 +:: The counter is reset each month at the date and time of day as entered in (2) and (3). 84 +:; yearly 85 +:: The counter is reset each year the the day, month and time of day as entered in (2), (3), and (4), respectively. 88 88 89 -=== AllgemeineRückgabeparameter ===87 +=== General return parameters === 90 90 91 91 {{figure image="dbcounter_plugin_action_return_parameters_en.png"}} 92 - EinstellungenfürdieRückgabeparameter,diespäterüberPlatzhalter verfügbarsind.90 +Settings for the return parameters of the counter action. You can access the returned values via variables. 93 93 {{/figure}} 94 94 95 - Manchmal istnotwendig,aufdenneuenZählwertzugreifenzukönnen.DieskannüberAktionsplatzhaltergeschehen, welcheaufdieRückgabewerte einerAktionzugreifen. In denallgemeinenRückgabeparameternkanneingestelltwerden,überwelchemSchlüsseldieRückgabeparameterAktionzugegriffenwerdenkann.BeispielsweisetragedieZähleraktiondenNamen//CountUp//.DannkannüberdenPlatzhalter//[%$CountUp.RESULT[0].count%]//aufdenaktuellenZählwertzugegriffen werden,fallsunter(3) beidenallgemeinen RückgabeparameterderWert//count//eingetragenwurde.Folgende Rückgabeparametersindverfügbar:93 +Sometimes it may be necessary to access the new value of the counter. To do so, you can use action 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 was named //CountUp//. Then you can use the variable //[%$CountUp.RESULT[0].count%]// to access the current counter value, provided you entered the key //count// in the input field (3). The following return values are available: 96 96 97 97 ; 1 - ResultCode 98 -: EinnummerischerZahlenwert, derangibt,ob dieZählaktion erfolgreichwaroder nicht.FolgendeErgebnisnummernsind möglich:96 +: A numerical value that indicates whether the counter action was successful or not. The following result codes are possible: 99 99 :; 1 (OK) 100 -:: DieZählaktion wurdeerfolgreich abgearbeitet.98 +:: The counter action was processed successfully. 101 101 :; 10 (UNKNOWN_ACTION_ERROR) 102 -:: DieZählaktionkannnichtausgeführtwerden,daeineunbekannteZählaktion ausgewähltwurde.Aktuellwerden dieZählaktionen//Hochzählen//, //Herunterzählen//und //Auf den Startwert zurücksetzen//unterstützt.100 +:: The counter action could not be processed, an unknown counting action was selected. The currently supported counting actions are //count up//, //count down// and //reset counter to start value//. 103 103 :; 11 (PARSING_ERROR) 104 -:: EinkonfigurierterWerthatnichtdenerwartetenDatentyp,etwa wennfürdieSchrittweitedesZählerskeinesyntaktischkorrekteZahleingegeben wurde.102 +:: A settings does not conform to the expected data type or syntax; such as when a letter was entered for the initial value (instead of a number). 105 105 :; 40 (INTERNAL_ERROR) 106 -:: EsistdererFehleraufgetreten,dernichtnäherklassifiziertwerdenkann.104 +:: The counter action was not successful. The type of error cannot be specified more closely. 107 107 ; 2 - ResultMessage 108 -: EineenglischeBeschreibungdesResultats(ErfolgoderFehler).106 +: An English description of the result (success or error). 109 109 ; 3 - Counter 110 -: DerneuenummerischeWertdesZählers,nachdemdieZählaktion ausgeführtwurde.108 +: The new numerical value of the counter, after the counting action was applied. 111 111 ; 4 - IsReset 112 -: E ntweder //true//,falls derZählerdurchdieaktuelleAktionzurückgesetztwurde; oder //false//,wennernichtzurückgesetzt wurde.110 +: Either //true//, when the counter was reset during the current action; or //false// if it was not reset. 113 113 ; 5 - CounterAfterReset 114 -: FallsderZählerzurückgesetztwurde:DernummerischeWertdesZählersvordemZurücksetzen.112 +: In case the counter was reset: The numerical value of the counter before the reset. 115 115 116 -== System platzhalter-Plugin ==114 +== System variable plugin == 117 117 118 118 {{figure image="dbcounter-plugin-placeholder_en.png"}} 119 - EinBeispiel fürdenPlatzhalterzum AuslesendesZählwerts. Hier wird einZählerausgelesen, derdie AnzahlanAnmeldungenfür eineVeranstaltungzählt.Dannwird geprüft,ob derZählwertdie maximaleAnzahlanAnmeldungenübersteigt.BasierendaufdieserPrüfungkanndemNutzerdanneinFehler angezeigtwerden,fallsdieVeranstaltungbereitsausgebuchtist.HierbeihandeltessichumineserverseitigePrüfung zur Validierung,bereitsimFormularbeider AnmeldungsolltedemNutzernatürlichschon dieInformation gegeben werden,obüberhaupt nochPlätze freisind.117 +An example for how a counter value can be accessed via variables. Here we read the value of a counter that keeps track of the number of reservations for an event. When the user submits the reservation form, we check the current value of the counter against the limit for that event. When the limit is exceeded, we can return an appropriate error message to the users. Please note that this is meant as a server-side validation - to make the form user-friendly, you should indicate the number of free slots in the form itself. 120 120 {{/figure}} 121 121 122 - NachInstallationdesPluginsist einneuerSystemplatzhalterverfügbar, überden auf denaktuellen WerteinesZählerszugegriffenwerdenkann.Diesistetwanützlich,umin einerAktionsbedingungdenZählwertnutzenund prüfenzukönnen.DerPlatzhalterbautsichnachdemfolgendenSchemaauf:120 +Once the plugin is installed, you can access the current value of the plugin with a [[system variable>>doc:Formcycle.UserInterface.Variables]]. This can be used, for example, to access the counter value in the condition of a workflow action and compare it with a submitted value. The system variable has got the following pattern: 123 123 124 124 {{code}} 125 -[%$DBCOUNTER.< Zählername>%]123 +[%$DBCOUNTER.<CounterName>%] 126 126 {{/code}} 127 127 128 - Umalso etwaaufdenZählermit dem Name //test//zuzugreifen,mussderfolgendePlatzhalter genutzt werden:126 +So to access the value of a counter named //test//, you can use the following variable: 129 129 130 130 {{code}} 131 131 [%$DBCOUNTER.test%] 132 132 {{/code}} 133 133 134 -== Servlet -Aktions-Plugin ==132 +== Servlet action plugin == 135 135 136 136 {{figure image="dbcounter_plugin_servlet_action.png"}} 137 137 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.