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