OpenWGA 7.6 - TMLScript reference




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
Properties and methods
Name Purpose
WGA.Call Information about the current HTTP call that initialized the current environment.
WGA.Html Subobject "Html" collects functionalties to load and parse HTML documents.
WGA.Jobs This subobject provides services regarding OpenWGA Jobs
WGA.Master Subobject "Master" provides utilities to run scripts under master rights.
WGA.Scopes Constants for scopes of OpenWGA managed globals.
WGA.Server This subobject provides information and services regarding the OpenWGA server runtime and installation
WGA.TMLPage This subobject provides information and services regarding the currently rendered TML page.
WGA.TMLScript This object allows custom TMLScript expression and script execution.
WGA.Utils The subobject "Utils" provides direct access to the WGAPI utility object WGUtils.
WGA.Validate This subobject offers comfortable functions to validate data in common ways, prominently in WebTML form validations.
WGA.Xml Subobject "Xml" collects functionalities to load and parse Xml documents.
accessLogging() Retrieve the request information object for the current WebTML request to modify access logging data
Retrieves an App object for an OpenWGA application
alias(value, aliasString)
alias(value, aliasList)
Converts a value to an alias value
buildOptions(contents, [titleExpression, [emptyTitle]]) Builds options for WebTML form inputs from a list of contents
callAction([context], actionID, [param1, .... param5]) Calls a WebTML action
context([context-expression [, returnContextOnError]])
returns a TMLContext object
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) Creates a new FormInfo object
createHttpClient() Creates an object to do custom HTTP requests
Creates an ImageScaler object to perform scaling operations on an image file
createList(liststring, delimiter)
Creates a new List object

Creates a new 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

Creates a new Lookup table

Alias for WGA.createLookupTable()

createObject(modulename [, param1, ...paramN])
createObject(objectDef [, param1, ...paramN])
Creates a custom TMLScript object
Retrieves either an App or a DataSource object, depending on the type of database addressed
Retrieves an DataSource for an OpenWGA data source
dateOnly(date) Removes all daytime information from a date
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
Returns a design context object for the given parameter resource
domain(name) Retrieves a Domain by its name
encode(encoders, input [,context]) Encodes some text with a WebTML encoding
format(object, formatPattern [, language]) 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
log Provides a log object for writing to an appropriate log for the current environment
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
modifyDate(date, unit, amount) Modifies a date by adding/substracting a certain timespan
nav([context]) Creates a Nav object, providing WebTML navigator functionality, for a given reference context
parseDate(date, format [, language]) Converts a string containing date/time information to a date object
parseNumber(number, format [,language]) Converts a string containing numeric information into a Number object
Returns a Plugin object for any OpenWGA plugin
redirectTo(String url) Redirects the users browser to a different URL
reopenSessions() Reopens all currently open database sessions
request Returns the JavaEE object representing the current HTTP request
requestURL Returns the URL by which this request was called
response Returns the JavaEE object representing the current HTTP response
scoped(text [, scope]) Qualifies the given text with the current WebTML scope
selectDerivate([context,] fileName, derivateQuery) Selects a file derivate of a file attachment which is the best match for a derivate query
serializeObject(object) Serializes an object to an encrypted string
service(serviceInterface) Fetches a WGA Service API object
serviceClasses() Returns the interface classes of all available Service APIs
sortList(list, sortMeta, [order])
sortList(list, compareFunction, [order])
Sorts a List
synchronizedFunction(func [, syncObj]) Creates a synchronized version of a JavaScript function
toList(value1, value2, value3 ...) Converts any value into list form
urlBuilder([tmlContext], [url]) Creates a URLBuilder to contruct and modify URLs