OpenWGA 7.10 - 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.Base64 Creates an object to do encode/decode to/from Base64.
WGA.Call Information about the current HTTP call that initialized the current environment.
WGA.Date([otherDate])
WGA.Date(dateString, formatString[, language])
Creates a WGADate Object.
WGA.File([folder,] filename | File-Object) Utility object to read and write file contents.
WGA.Html Subobject "Html" collects functionalties to load and parse HTML documents.
WGA.HttpClient(url) Creates an object to do HTTP requests to the specified URL.
WGA.Jobs This subobject provides services regarding OpenWGA Jobs
WGA.List([otherList]) Creates a WGAList Object.
WGA.Logger(name) Returns a WGALogger utility object for the given name.
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.TempFile(filename) Creates a TempFile object
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
app()
app(dbkey)
app(context)
app(WGAPI-WGDatabase)
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]])
context(content)
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

DEPRECATED since 7.10.1. Use WGA.Date() instead.

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

DEPRECATED since version 7.7.2. Use WGA.HttpClient() instead.

createImageScaler(file)
createImageScaler(inputStream)
Creates an ImageScaler object to perform scaling operations on an image file
createList()
createList(array)
createList(liststring, delimiter)
Creates a new List object

DEPRECATED since 7.10.1. Use WGA.List() instead.

createLookupTable([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])
createMail(config)
Creates a Mail object for sending e-mails
createMap([object])

Creates a new Lookup table

Alias for WGA.createLookupTable()

createObject(modulename [, param1, ...paramN])
createObject(objectDef [, param1, ...paramN])
Creates a custom TMLScript object
database()
database(dbkey)
database(context)
database(WGAPI-WGDatabase)
Retrieves either an App or a DataSource object, depending on the type of database addressed
dataSource()
dataSource(dbkey)
dataSource(context)
dataSource(WGAPI-WGDatabase)
Retrieves an DataSource for an OpenWGA data source
dateOnly(date) Removes all daytime information from a date

DEPRECATED since 7.10.1. Use WGA.Date().dateOnly() instead.

db(dbkey) Returns the WGAPI database object for the given database key
decryptString(text) Decrypts the given secret text encrypted with encryptString().
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
domain(name) Retrieves a Domain by its name
encode(encoders, input [,context]) Encodes some text with a WebTML encoding
encryptString(text) Encrypts the given text
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.

DEPRECATED since 7.10.1. Use WGA.Date().modify() instead.

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.

DEPRECATED since 7.10.1. Use WGA.Date(date, format, language) instead.

parseNumber(number, format [,language]) 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
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)
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