System

Last modified by Pierre Dubois on 2018/06/06 16:34

This object provide a few utility functions to access the inners of the Requea platform.

Properties

User

ReadOnly

return: The current logged user object
example:
var login = System.User.Login;

UserName

ReadOnly

return: The currently logged user name

UserLogin

ReadOnly

return: The currently logged user login

SessionId

ReadOnly

eturn: The current HttpSession ID

IPAddress

ReadOnly

return: The IP address of the current user

UserId

ReadOnly

return: the logged user id (sysId of the sysPerson)
example:
data.rqBeneficiary = System.UserId;

Client

ReadOnly

return: the client type (browser)

ClientVersion

ReadOnly

return: The client version (browser version)

DefaultTimeZoneID

ReadOnly

return: the default timezone for the platform.
 This parameter may be changed in TimeZone system setting

DefaultLanguage

ReadOnly

return: The default language for the platform.
 This parameter may be changed in Language system setting

Registry

ReadOnly

return: The Registry Object
 The Registry object. The Registry object is used to access to the entity metadata and provides a few utility functions.
example:
var reg = System.Registry;
var app = reg.getApplication("rqRequest");

example:
var values=System.Registry.getOptionValues("2c9e849412dd022b0112f5ed01c8656e");
var first=values[0].sysValue;

NewGuid

Generates a new Guid
ReadOnly

return: The generated guid as a string

Functions

parseDate(str)

Parse a date from a string

return: the parsed date

formatDate(dt, style)

Format a date. The string representation is based on the locale of the user

  • dt. The date to format
  • style. The style parameter can be: "long", "short", "medium", "full" or "ISO8601". By default, the style is "medium"

return: The formatted date as a string

formatNumber(obj, pattern)

Format a number as a string. The string representation is based on the locale of the user

return: The formatted number.

formatDateTime(dt, style, timezone)

Format a date time

  • dt. The date to format
  • style. The style parameter can be: "long", "short", "medium", "full" or "ISO8601". By default, the style is "medium"
  • timezone : The timezone for the rendering. By default the server timezone is used.

return: The formatted date as a string

formatTime(dt, style)

Format the time portion of a date time.

  • dt. The date to format
  • style. The style parameter can be: "long", "short", "medium", "full" or "ISO8601". By default, the style is "medium"

return: The formatted time as a string.

parseDateTime(str, format, timezone)

Parse a date time

  • str. The string to parse
  • format. The java SimpleDateFormat used for the parsing
  • timezone. The timezone corresponding to the time.  By default the server timezone is used.

return.: The parsed date

getDayOfDate(obj)

Extract the date portion of a time stamp. The date is rounded at 0:00:00, based on the timezone of the user.

  • the date and time (timestamp)

return: the date

getTimeOfDate(obj)

Extract the time portion of a date time

  • the time stamp

return: the time as a number of milliseconds since 0:00:00

isMemberOfGroup(objusr, grpname)

Check if a user is a member of a group

  • user: The user
  • grpname: the group name

return: true if the user belongs to this group

hasBundleAccess(bid)

Checks if the current user may edit a bundle given its id.

  • bundle Id

return: true if the user has edit access

EvalScript(jsScript, jsContext)

Eval a script

return: the return value of the script evaluation

executeSQL(strCommand)

Execute a row SQL command.
 Note that some updates made by hibernate may not yet have been flushed to the database

Encrypt(cipher, value, type)

Encrypt a string

  • cipher. only 3DES is supported for now

return: the encrypted value as a string

Decrypt(cipher, value, type)

Decrypt a string

return: the decrypted value as a string

getLineCount(code)

Count the number of lines in a script

return: the number of lines as an integer.

Tags:
Created by Pierre Dubois on 2018/06/06 16:34
     
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 9.11.5 - Documentation