Wiki source code of System
Hide last authors
3.1 | 1 | This object provide a few utility functions to access the inners of the Requea platform. | |
1.1 | 2 | ||
3.1 | 3 | == Properties == | |
4 | === User === | ||
1.1 | 5 | ||
3.1 | 6 | ReadOnly | |
1.1 | 7 | ||
3.1 | 8 | return: The current logged user object | |
9 | example: | ||
10 | {{code language="javascript"}} | ||
11 | var login = System.User.Login; | ||
12 | {{/code}} | ||
1.1 | 13 | ||
3.1 | 14 | === UserName === | |
1.1 | 15 | ||
3.1 | 16 | ReadOnly | |
1.1 | 17 | ||
3.1 | 18 | return: The currently logged user name | |
19 | === UserLogin === | ||
1.1 | 20 | ||
3.1 | 21 | ReadOnly | |
1.1 | 22 | ||
3.1 | 23 | return: The currently logged user login | |
24 | === SessionId === | ||
1.1 | 25 | ||
3.1 | 26 | ReadOnly | |
1.1 | 27 | ||
3.1 | 28 | eturn: The current HttpSession ID | |
29 | === IPAddress === | ||
1.1 | 30 | ||
3.1 | 31 | ReadOnly | |
1.1 | 32 | ||
3.1 | 33 | return: The IP address of the current user | |
34 | === UserId === | ||
1.1 | 35 | ||
3.1 | 36 | ReadOnly | |
1.1 | 37 | ||
3.1 | 38 | return: the logged user id (sysId of the sysPerson) | |
39 | example: | ||
40 | {{code language="javascript"}} | ||
41 | data.rqBeneficiary = System.UserId; | ||
42 | {{/code}} | ||
1.1 | 43 | ||
3.1 | 44 | === Client === | |
1.1 | 45 | ||
3.1 | 46 | ReadOnly | |
1.1 | 47 | ||
3.1 | 48 | return: the client type (browser) | |
49 | === ClientVersion === | ||
1.1 | 50 | ||
3.1 | 51 | ReadOnly | |
1.1 | 52 | ||
3.1 | 53 | return: The client version (browser version) | |
54 | === DefaultTimeZoneID === | ||
1.1 | 55 | ||
3.1 | 56 | ReadOnly | |
1.1 | 57 | ||
3.1 | 58 | return: the default timezone for the platform. | |
59 | This parameter may be changed in TimeZone system setting | ||
60 | === DefaultLanguage === | ||
1.1 | 61 | ||
3.1 | 62 | ReadOnly | |
1.1 | 63 | ||
3.1 | 64 | return: The default language for the platform. | |
65 | This parameter may be changed in Language system setting | ||
66 | === Registry === | ||
1.1 | 67 | ||
3.1 | 68 | ReadOnly | |
1.1 | 69 | ||
3.1 | 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}} | ||
1.1 | 77 | ||
3.1 | 78 | example: | |
79 | {{code language="javascript"}} | ||
80 | var values=System.Registry.getOptionValues("2c9e849412dd022b0112f5ed01c8656e"); | ||
81 | var first=values[0].sysValue; | ||
82 | {{/code}} | ||
1.1 | 83 | ||
3.1 | 84 | === NewGuid === | |
85 | Generates a new Guid | ||
86 | ReadOnly | ||
1.1 | 87 | ||
3.1 | 88 | return: The generated guid as a string | |
1.1 | 89 | ||
90 | |||
3.1 | 91 | == Functions == | |
92 | === parseDate(str) === | ||
93 | Parse a date from a string | ||
1.1 | 94 | ||
3.1 | 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" | ||
1.1 | 100 | ||
3.1 | 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 | ||
1.1 | 104 | ||
3.1 | 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" | ||
1.1 | 110 | ||
3.1 | 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" | ||
1.1 | 116 | ||
3.1 | 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 | ||
1.1 | 122 | ||
3.1 | 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) | ||
1.1 | 127 | ||
3.1 | 128 | return: the date | |
129 | === getTimeOfDate(obj) === | ||
130 | Extract the time portion of a date time | ||
131 | * the time stamp | ||
1.1 | 132 | ||
3.1 | 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 | ||
1.1 | 138 | ||
3.1 | 139 | return: true if the user belongs to this group | |
1.1 | 140 | === hasBundleAccess(bid) === | |
3.1 | 141 | Checks if the current user may edit a bundle given its id. | |
142 | * bundle Id | ||
1.1 | 143 | ||
3.1 | 144 | return: true if the user has edit access | |
1.1 | 145 | === EvalScript(jsScript, jsContext) === | |
3.1 | 146 | Eval a script | |
1.1 | 147 | ||
3.1 | 148 | return: the return value of the script evaluation | |
1.1 | 149 | === executeSQL(strCommand) === | |
3.1 | 150 | Execute a row SQL command. | |
151 | Note that some updates made by hibernate may not yet have been flushed to the database | ||
1.1 | 152 | ||
153 | === Encrypt(cipher, value, type) === | ||
3.1 | 154 | Encrypt a string | |
155 | * cipher. only 3DES is supported for now | ||
1.1 | 156 | ||
3.1 | 157 | return: the encrypted value as a string | |
1.1 | 158 | === Decrypt(cipher, value, type) === | |
3.1 | 159 | Decrypt a string | |
1.1 | 160 | ||
3.1 | 161 | return: the decrypted value as a string | |
162 | === getLineCount(code) === | ||
163 | Count the number of lines in a script | ||
1.1 | 164 | ||
3.1 | 165 | return: the number of lines as an integer. |