A root level utils object is provided as a library of helper
methods that are missing from generic JavaScript.
- padpad(string, length) pads a string with leading zeros to the specified length.
- getNodeFromStringgetNodeFromString(noderef) returns a ScriptNode object representing the supplied NodeRef string. The node is not confirmed to exist in the repository.
- shortQNameshortQName(string) returns the short, or prefix, version of a long QName.
- longQNamelongQName(string) returns the long version of a short prefixed QName.
- moduleInstalledmoduleInstalled(moduleName) checks if a module is installed.
- toISO8601(long)toISO8601(long) formats a time in milliseconds to an ISO8601 formatted string.
- toISO8601(Date)toISO8601(Date) formats a date to an ISO8601 formatted string.
- fromISO8601fromISO8601(string) parses a Date from an ISO8601 formatted string.
- toBooleantoBoolean(string) returns a Boolean object from a string value.
- createPagingcreatePaging methods are used to build a ScriptPagingDetails object from the parameters supplied.
- getLocalegetLocale returns the locale string for the current thread.
- setLocalesetLocale sets the locale for the current thread.
- disableRulesdisableRules disables rule execution for the current thread.
- enableRulesenableRules enables rule execution for the current thread.
Parent topic: Scripting API