OpenWGA 5.4 - TMLScript reference


Object:

WGA

Description

The object "WGA" collects global functions that are part of the basic TMLScript platform. 

The Object "WGA" is available throughout all TMLScript scripts just like a TMLScript global. You can regard it a predefined TMLScript global of the platform.

The object was introduced in OpenWGA 5.3. In earlier versions most functionalities of this object were available as global function or as method on TMLContext. They were moved to this new object to allow better organisation of the TMLScript platform functions and prevent item name concealing when introducing new functions. However to maintain backward compatibility all global functions and TMLScript methods that worked in 5.2 continue to work in 5.3 and later versions. But note that their use is discouraged for new OpenWGA designs that are created for these versions.

Retrieval Global object named "WGA" available in all scripts
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
    portletevent
Properties and methods
Name Purpose
WGA.Auth The subobject "Auth" collects authentication related functions of TMLScript.
WGA.Html Subobject "Html" collects functionalties to load and parse HTML documents.
WGA.Master Subobject "Master" provides utilities to run scripts under master rights.
WGA.Utils The subobject "Utils" provides direct access to the WGAPI utility object WGUtils.
WGA.Xml Subobject "Xml" collects functionalties to load and parse Xml documents.
buildOptions(contents, [titleExpression, [emptyTitle]]) Builds options for WebTML form inputs from a list of contents
callAction([context], actionID, [param1, .... param5]) Calls a WebTML action
createCalendar(date) Creates a Java Calendar object offering diverse functionality to modify date values
createCookie(name, value) Creates a browser cookie object that can be added to the users browser session
createDate([includeMillis]) Creates a new date object holding its creation time
createForm(formInfo) Creates a new TMLForm object as configured by a FormInfo object
createFormInfo(formid [, htmlinput, persistent]) Creates a new FormInfo object
createImageScaler([file]) Creates an ImageScaler object to perform scaling operations on an image file
createList()
createList(array)
createList(liststring, delimiter)
Creates a new List object
createLookupTable()

Creates a new empty Lookup table

For backward compatibility there still is a method "createLookupTable()" available on TMLContext whose use is discouraged since OpenWGA 5.3.

createMail([host, username, password]) Creates a Mail object for sending e-mails
createObject(modulename [, param1, ...paramN])
createObject(objectDef [, param1, ...paramN])
Creates a custom TMLScript object
db(dbkey) Returns the WGAPI database object for the given database key
deleteDoublets(list) Removes multiple equal entries from a list
deserializeObject(string) Converts a string created by serializeObject() back to the original object
design()
design(scriptObject)
design(db)
design(dbkey)
Returns a design context object for the given parameter resource
encode(encoding, input) Encodes some text with a WebTML encoding
format(object, formatPattern) Creates a formatted date string from a Date object or a formatted number string from a Number object
getLookupKeys(lookupTable) Returns the keys of a Lookup table as List
hdb(dbkey) Returns a WGAPI HDB object for an application
javaObject(jsObject) Converts a JavaScript object to the corresponding Java object, making its Java methods accessable
logException([msg, ] error) Logs a JavaScript exception as WebTML warning and in application log
lucene([tmlContext]) Returns a Lucene object providing functionalities related to fulltext search
parseDate(date, format) Converts a string containing date/time information to a date object
parseNumber(number, format) Converts a string containing numeric information into a Number object
plugin(uniqueName)
plugin(pluginDb)
Returns a Plugin object for any OpenWGA plugin
redirectTo(String url) Redirects the users browser to a different URL
scoped(text [, scope]) Qualifies the given text with the current WebTML scope
serializeObject(object) Serializes an object to an encrypted string
sortList(list)
sortList(list, sortMeta)
sortList(list, compareFunction)
Sorts a List
synchronizedFunction(func [, syncObj]) Creates a synchronized version of a JavaScript function
urlBuilder([url]) Creates a WGAPI URLBuilder object to contruct and modify URLs