OpenWGA 7.11 - TMLScript reference

Method :

urlBuilder([tmlContext], [url])

On object WGA
Usage Creates a URLBuilder to contruct and modify URLs

The URLBuilder object is  a utility object which allows you to edit URLs in a structured way. It allows you to add/edit/delete query parameters or modify separated parts of the URL, like the host name.

On construction it takes an URL as parameter which it analyzes and stores internally. The parts of the URL may then be modified via the methods of the object. To retrieve the complete modified URL again as String use the method build() or simply convert the object to a String.


tmlContext (TMLContext, optional):

A WebTML context which is used as application context for the URL to generate (for example to retrieve configurations about protocol ports to use). Defaults to the context of the running script if not specified.

If this argument is specified but argument "url" is omitted then the url builder will be initialized with the content URL pointing to this context document.

url (String, optional):

Some URL that you want the URLBuilder to modify. It may be an absolute URL or a relative one that will be complemented with the URL of the current request. Omit this parameter to use the URL of the current request entirely.

Return value A  new URLBuilder
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events