OpenWGA 7.9 - TMLScript reference

WGA
Method :

dataSource()
dataSource(dbkey)
dataSource(context)
dataSource(WGAPI-WGDatabase)

On object WGA
Usage Retrieves an DataSource for an OpenWGA data source
Description

There are four variants of this method:

  • WGA.dataSource() retrieves the data source of the current scripts context
  • WGA.dataSource(dbkey) retrieves the data source of the given database key
  • WGA.dataSource(context) retrieves the data source for the given WebTML context
  • WGA.dataSource(WGAPI-Database) retrieves the data source that is represented by the given WGAPI database object

Using this method to open an app throws an error.

If the currently logged in user has no access to this database then a DataSource object is returned without an open session (testable via method isOpen()).

Parameters

dbkey (String):

Database key

context (TMLContext):

WebTML context

WGAPI-Database (WGAPI-Object WGDatabaset):

WGAPI database object

Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events