From version 3.1
edited by Pierre Dubois
on 2012/05/31 15:18
To version 4.1
edited by Maurice Gasco
on 2015/09/16 11:11
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.pdubois
1 +XWiki.mgasco
Content
... ... @@ -1,6 +1,7 @@
1 1  This object provide a few utility functions to access the inners of the Requea platform.
2 2  
3 3  == Properties ==
4 +
4 4  === User ===
5 5  
6 6  ReadOnly
... ... @@ -7,9 +7,7 @@
7 7  
8 8  return: The current logged user object
9 9  example:
10 -{{code language="javascript"}}
11 -var login = System.User.Login;
12 -{{/code}}
11 +{{code language="javascript"}}var login = System.User.Login;{{/code}}
13 13  
14 14  === UserName ===
15 15  
... ... @@ -16,21 +16,25 @@
16 16  ReadOnly
17 17  
18 18  return: The currently logged user name
18 +
19 19  === UserLogin ===
20 20  
21 21  ReadOnly
22 22  
23 23  return: The currently logged user login
24 +
24 24  === SessionId ===
25 25  
26 26  ReadOnly
27 27  
28 28  eturn: The current HttpSession ID
30 +
29 29  === IPAddress ===
30 30  
31 31  ReadOnly
32 32  
33 33  return: The IP address of the current user
36 +
34 34  === UserId ===
35 35  
36 36  ReadOnly
... ... @@ -37,9 +37,7 @@
37 37  
38 38  return: the logged user id (sysId of the sysPerson)
39 39  example:
40 -{{code language="javascript"}}
41 -data.rqBeneficiary = System.UserId;
42 -{{/code}}
43 +{{code language="javascript"}}data.rqBeneficiary = System.UserId;{{/code}}
43 43  
44 44  === Client ===
45 45  
... ... @@ -46,11 +46,13 @@
46 46  ReadOnly
47 47  
48 48  return: the client type (browser)
50 +
49 49  === ClientVersion ===
50 50  
51 51  ReadOnly
52 52  
53 53  return: The client version (browser version)
56 +
54 54  === DefaultTimeZoneID ===
55 55  
56 56  ReadOnly
... ... @@ -57,6 +57,7 @@
57 57  
58 58  return: the default timezone for the platform.
59 59   This parameter may be changed in TimeZone system setting
63 +
60 60  === DefaultLanguage ===
61 61  
62 62  ReadOnly
... ... @@ -63,6 +63,7 @@
63 63  
64 64  return: The default language for the platform.
65 65   This parameter may be changed in Language system setting
70 +
66 66  === Registry ===
67 67  
68 68  ReadOnly
... ... @@ -70,18 +70,15 @@
70 70  return: The Registry Object
71 71   The Registry object. The Registry object is used to access to the entity metadata and provides a few utility functions.
72 72  example:
73 -{{code language="javascript"}}
74 -var reg = System.Registry;
75 - var app = reg.getApplication("rqRequest");
76 -{{/code}}
78 +{{code language="javascript"}}var reg = System.Registry;
79 + var app = reg.getApplication("rqRequest");{{/code}}
77 77  
78 78  example:
79 -{{code language="javascript"}}
80 -var values=System.Registry.getOptionValues("2c9e849412dd022b0112f5ed01c8656e");
81 - var first=values[0].sysValue;
82 -{{/code}}
82 +{{code language="javascript"}}var values=System.Registry.getOptionValues("2c9e849412dd022b0112f5ed01c8656e");
83 + var first=values[0].sysValue;{{/code}}
83 83  
84 84  === NewGuid ===
86 +
85 85  Generates a new Guid
86 86  ReadOnly
87 87  
... ... @@ -89,77 +89,117 @@
89 89  
90 90  
91 91  == Functions ==
94 +
92 92  === parseDate(str) ===
96 +
93 93  Parse a date from a string
94 94  
95 95  return: the parsed date
100 +
96 96  === formatDate(dt, style) ===
102 +
97 97  Format a date. The string representation is based on the locale of the user
104 +
98 98  * dt. The date to format
99 99  * style. The style parameter can be: "long", "short", "medium", "full" or "ISO8601". By default, the style is "medium"
100 100  
101 -return: The formated date as a string
108 +return: The formatted date as a string
109 +
102 102  === formatNumber(obj, pattern) ===
111 +
103 103  Format a number as a string. The string representation is based on the locale of the user
104 104  
105 -return: The formated number.
106 -=== formatDateTime(dt, style) ===
114 +return: The formatted number.
115 +
116 +=== formatDateTime(dt, style, timezone) ===
117 +
107 107  Format a date time
119 +
108 108  * dt. The date to format
109 109  * style. The style parameter can be: "long", "short", "medium", "full" or "ISO8601". By default, the style is "medium"
122 +* timezone : The timezone for the rendering. By default the server timezone is used.
110 110  
111 -return: The formated date as a string
124 +return: The formatted date as a string
125 +
112 112  === formatTime(dt, style) ===
127 +
113 113  Format the time portion of a date time.
129 +
114 114  * dt. The date to format
115 115  * style. The style parameter can be: "long", "short", "medium", "full" or "ISO8601". By default, the style is "medium"
116 116  
117 -return: The formated time as a string.
118 -=== parseDateTime(str, format) ===
133 +return: The formatted time as a string.
134 +
135 +=== parseDateTime(str, format(% style="font-size: 20.4400005340576px; background-color: rgb(245, 245, 245);" %), timezone)(%%) ===
136 +
119 119  Parse a date time
138 +
120 120  * str. The string to parse
121 121  * format. The java SimpleDateFormat used for the parsing
141 +* timezone. The timezone corresponding to the time. (% style="font-family: sans-serif; font-size: 14px; font-style: normal; line-height: 19.6000003814697px; text-align: start;" %) By default the server timezone is used.
122 122  
123 123  return.: The parsed date
144 +
124 124  === getDayOfDate(obj) ===
146 +
125 125  Extract the date portion of a time stamp. The date is rounded at 0:00:00, based on the timezone of the user.
148 +
126 126  * the date and time (timestamp)
127 127  
128 128  return: the date
152 +
129 129  === getTimeOfDate(obj) ===
154 +
130 130  Extract the time portion of a date time
156 +
131 131  * the time stamp
132 132  
133 133  return: the time as a number of milliseconds since 0:00:00
160 +
134 134  === isMemberOfGroup(objusr, grpname) ===
162 +
135 135  Check if a user is a member of a group
164 +
136 136  * user: The user
137 137  * grpname: the group name
138 138  
139 139  return: true if the user belongs to this group
169 +
140 140  === hasBundleAccess(bid) ===
171 +
141 141  Checks if the current user may edit a bundle given its id.
173 +
142 142  * bundle Id
143 143  
144 144  return: true if the user has edit access
177 +
145 145  === EvalScript(jsScript, jsContext) ===
179 +
146 146  Eval a script
147 147  
148 148  return: the return value of the script evaluation
183 +
149 149  === executeSQL(strCommand) ===
185 +
150 150  Execute a row SQL command.
151 151   Note that some updates made by hibernate may not yet have been flushed to the database
152 152  
153 153  === Encrypt(cipher, value, type) ===
190 +
154 154  Encrypt a string
192 +
155 155  * cipher. only 3DES is supported for now
156 156  
157 157  return: the encrypted value as a string
196 +
158 158  === Decrypt(cipher, value, type) ===
198 +
159 159  Decrypt a string
160 160  
161 161  return: the decrypted value as a string
202 +
162 162  === getLineCount(code) ===
204 +
163 163  Count the number of lines in a script
164 164  
165 165  return: the number of lines as an integer.
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 9.11.5 - Documentation