From version 2.1
edited by Pierre Dubois
on 2011/10/17 15:26
To version 3.1
edited by Pierre Dubois
on 2012/05/31 15:18
Change comment: Imported from XAR

Summary

Details

Icon Page properties
Content
... ... @@ -1,143 +1,165 @@
1 -A scripted entity
1 +This object provide a few utility functions to access the inners of the Requea platform.
2 2  
3 -== Functions ==
4 -=== getUser() ===
3 +== Properties ==
4 +=== User ===
5 5  
6 +ReadOnly
6 6  
7 -=== getUserLogin() ===
8 +return: The current logged user object
9 +example:
10 +{{code language="javascript"}}
11 +var login = System.User.Login;
12 +{{/code}}
8 8  
14 +=== UserName ===
9 9  
10 -=== parseDate(str) ===
16 +ReadOnly
11 11  
18 +return: The currently logged user name
19 +=== UserLogin ===
12 12  
13 -=== formatDate(dt, style) ===
21 +ReadOnly
14 14  
23 +return: The currently logged user login
24 +=== SessionId ===
15 15  
16 -=== formatNumber(obj, pattern) ===
26 +ReadOnly
17 17  
28 +eturn: The current HttpSession ID
29 +=== IPAddress ===
18 18  
19 -=== formatDateTime(dt, style) ===
31 +ReadOnly
20 20  
33 +return: The IP address of the current user
34 +=== UserId ===
21 21  
22 -=== AdjustTime(objDt, unit, value) ===
36 +ReadOnly
23 23  
38 +return: the logged user id (sysId of the sysPerson)
39 +example:
40 +{{code language="javascript"}}
41 +data.rqBeneficiary = System.UserId;
42 +{{/code}}
24 24  
25 -=== formatTime(dt, style) ===
44 +=== Client ===
26 26  
46 +ReadOnly
27 27  
28 -=== parseDateTime(str, format) ===
48 +return: the client type (browser)
49 +=== ClientVersion ===
29 29  
51 +ReadOnly
30 30  
31 -=== getDayOfDate(obj) ===
53 +return: The client version (browser version)
54 +=== DefaultTimeZoneID ===
32 32  
56 +ReadOnly
33 33  
34 -=== getTimeOfDate(obj) ===
58 +return: the default timezone for the platform.
59 + This parameter may be changed in TimeZone system setting
60 +=== DefaultLanguage ===
35 35  
62 +ReadOnly
36 36  
37 -=== getUserGroup(name) ===
64 +return: The default language for the platform.
65 + This parameter may be changed in Language system setting
66 +=== Registry ===
38 38  
68 +ReadOnly
39 39  
40 -=== isMemberOfGroup(objusr, grpname) ===
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}}
41 41  
78 +example:
79 +{{code language="javascript"}}
80 +var values=System.Registry.getOptionValues("2c9e849412dd022b0112f5ed01c8656e");
81 + var first=values[0].sysValue;
82 +{{/code}}
42 42  
43 -=== formatPrefix(prefix) ===
84 +=== NewGuid ===
85 +Generates a new Guid
86 +ReadOnly
44 44  
88 +return: The generated guid as a string
45 45  
46 -=== formatName(name, fup, rmspace) ===
47 47  
91 +== Functions ==
92 +=== parseDate(str) ===
93 +Parse a date from a string
48 48  
49 -=== SearchNewFeatures() ===
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"
50 50  
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
51 51  
52 -=== InstallFeatures(p) ===
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"
53 53  
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"
54 54  
55 -=== GetBuildInfo(p) ===
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
56 56  
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)
57 57  
58 -=== SearchFeaturesToUpdateFromSite(p) ===
128 +return: the date
129 +=== getTimeOfDate(obj) ===
130 +Extract the time portion of a date time
131 +* the time stamp
59 59  
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
60 60  
61 -=== AddDependentFeatures(p) ===
62 -
63 -
64 -=== CheckDatabase() ===
65 -
66 -
67 -=== StrTrim(str) ===
68 -
69 -
70 -=== StrStartsWith(str, str2) ===
71 -
72 -
73 -=== StrEndsWith(str, str2) ===
74 -
75 -
139 +return: true if the user belongs to this group
76 76  === hasBundleAccess(bid) ===
141 +Checks if the current user may edit a bundle given its id.
142 +* bundle Id
77 77  
78 -
79 -=== getDefaultBundleSysId() ===
80 -
81 -
82 -=== setDefaultBundleSysId(bsid) ===
83 -
84 -
85 -=== getAuthorizedBundleList() ===
86 -
87 -
88 -=== getBundleVersion(bid) ===
89 -
90 -
91 -=== getContentType(data) ===
92 -
93 -
94 -=== getContentName(data) ===
95 -
96 -
97 -=== getContentLength(data) ===
98 -
99 -
100 -=== setImageSize(objImage) ===
101 -
102 -
103 -=== CreateHistoryApplication(strPrefix, strName) ===
104 -
105 -
144 +return: true if the user has edit access
106 106  === EvalScript(jsScript, jsContext) ===
146 +Eval a script
107 107  
108 -
109 -=== executeDDLCommand(strCommand) ===
110 -
111 -
148 +return: the return value of the script evaluation
112 112  === 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
113 113  
114 -
115 -=== InitLayout(objLayout) ===
116 -
117 -
118 -=== Login(objUser) ===
119 -
120 -
121 -=== Logout() ===
122 -
123 -
124 -=== ExtractText(jsObj) ===
125 -
126 -
127 -=== InvalidateOption(name) ===
128 -
129 -
130 130  === Encrypt(cipher, value, type) ===
154 +Encrypt a string
155 +* cipher. only 3DES is supported for now
131 131  
132 -
157 +return: the encrypted value as a string
133 133  === Decrypt(cipher, value, type) ===
159 +Decrypt a string
134 134  
161 +return: the decrypted value as a string
162 +=== getLineCount(code) ===
163 +Count the number of lines in a script
135 135  
136 -=== SaveAsFile(jsObj, path) ===
137 -
138 -
139 -=== ReadFile(path) ===
140 -
141 -
142 -=== TimeDurationFormat(val) ===
143 -
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