|On object||TMLContext "this"|
Returns a WGAPI object "WGDatabase", representing some content database
Use the dbkey parameter to specify which content database you want to be returned. Omit it to return the database of the content document currently in context.
When accessing a database that has not yet been accessed in this request OpenWGA will try to login the user to this database, using whatever login information is available. If that fails - bc. the user has no access - the database is still returned but has no open session. You can test the availability of an open session by WGDatabase method "isSessionOpen()".
The method may return OpenWGA content stores as well as data sources.
The method returns null if no database of the given dbkey is connected.
dbkey (String, optional):
Key of a database to retrieve. Omit to retrieve the current context database
|Return value||The database that is mapped in OpenWGA for the given key (WGAPI objekt WGDatabase)|
|Allowed in script types||
The following script uses the method db() as entry point for WGAPI operations based on the database. It retrieves the available areas and returns their names:
var thedb = db("ig");