OpenWGA 7.9 - TMLScript reference
This object represents the configuration of a specific WebTML portlet for the current browser user. It mainly consists of a number of items that may influence behavior and appearance of the portlet. Those items can be set via portlet.setitem() and read via portlet.item() or in WebTML via <tml:item type="portlet"/>.
Changed portlet registration and configuration data is stored automatically at the end of each request. The method save(), which was needed to store profile/portlet data in OpenWGA
versions prior to 6, is still available for backward compatibility but does nothing now.
Additionally a portlet may hold "portlet variables" which are special versions of WebTML variables that are only visible in the scope of the portlet they were defined for. Set them via setvar() or portlet.setSessionVar(). Read them - as all WebTML variables - via the this.item method of the TMLContext.
The TMLPortlet object additionally grants control about some status settings of the portlet, like its mode, its position in the portlet hierarchy and the WebTML module that forms its layout. Additionally it can be used to modify the portlet registration, like to register or unregister portlets.
Portlet configurations are stored on the users personalisation profile. Therefor there is neither portlet registration nor portlet configuration available when the user has no profile.
The portlet object that is accessed in TMLScript is normally the object that represents the "current" WebTML portlet available as this.portlet. The current portlet is the portlet whose WebTML code is currently rendered. A portlet is rendered by specifying a <tml:portlet> tag on a WebTML page. If the current TMLScript code is not contained in any <tml:portlet> tag then this.portlet represents the implicit "root portlet" which is available without registration and serves as parent portlet for all manually registered first-level portlets.
All methods and properties of this objects are case insensitive and may be used in arbitrary cases though we recommend using the cases that are used in this documentation.
this.portlet for the "current" WebTML portlet
portlet.getPortletForName() to retrieve a portlet for a specific name
portlet.parentPortlet to retrieve the parent portlet of the "current" portlet
portlet.registerPortletForName() to register a new portlet under a given name
|Allowed in script types||
|Properties and methods||
Reading a portlet item, once in full once in shortform syntax:
Registering a portlet from TMLScript:
var newPortlet = portlet.registerPortletForName("childPortlet", "myportletmodule");