Changes for page UIN Script Service

Last modified by Admin on 2017/10/16 00:04

From version 6.1
edited by Denis Gervalle
on 2017/01/24 23:59
To version 7.1
edited by Denis Gervalle
on 2017/01/25 00:03
Change comment: There is no comment for this version

Summary

Details

ExtensionCode.ExtensionClass[0]
Description
... ... @@ -1,8 +1,26 @@
1 -This extension expose a simple script service that generate incremental unique identification number.
1 +This extension exposes a simple script service that generate incremental unique identification number.
2 2  
3 3  The service is thread-safe and store the last returned UIN into a configuration object in order to be resistant over server restarts.
4 4  You can define the value of the last generated number, and of the next increment from the UIN Script Service configuration in the administration of your wiki.
5 5  
6 -This is a per wiki extension. Since it install a script service through a wiki component, you should have programming rights on your wiki to install this extension.
6 +This is a per wiki extension. Since it installs a script service through a wiki component, you should have programming rights on your wiki to install this extension.
7 7  
8 -Don't confuse this extension with the [[Unique Identification Number Module>>Extension.Unique Identification Number Module]] which provides more advanced features, but with a high price in performance cost.
8 +Don't confuse this extension with the [[Unique Identification Number Module>>Extension.Unique Identification Number Module]] which provides more advanced features, but with a high price in performance costs.
9 +
10 +{{image reference="UINScriptServiceConfig.png"/}}
11 +
12 +== Usage from scripts ==
13 +
14 +To retrieve a new Unique Identification Number in velocity:
15 +
16 +{{code language="velocity"}}
17 + $services.uin.next
18 +{{/code}}
19 +
20 +To update safely the UIN configuration, use:
21 +
22 +{{code language="velocity"}}
23 + $services.uin.updateConfig(currentUIN, newUIN, increment)
24 +{{/code}}
25 +
26 +If the current UIN does not match the actual current when the update is applied, the update will be cancelled with a ConcurrentModificationException.

Get Connected