OpenWGA 7.2 - TMLScript reference
Object:
profile
Description |
This object represents the personalisation profile of the current browser user. This is a document which is automatically created for each browser user and stores any settings that just apply to him. Its main purpose is to to store items which influence the indiviual application behavior for this user. These profile items have the same characteristics as items on content documents. They can be created and read by the OpenWGA design as needed can hold arbitrary data. Additionally personalisation profiles can automatically collect statistical data about the user, like his number of sessions, his recently used browser etc. These are available as metadata fields of the user profile but it is up to the administrative application configuration in if and which statistics are collected. There is a shortform syntax for reading items and metadata fields. You can just use the name of the item (in lowercase) or the name of a metadata field (in uppercase) as property of the TMLUserProfile object. The personalisation profile does also host the registration of WebTML portlets for the current user. These however are not maintained by this object but by object TMLPortlet. There are different strategies how a personalisation profile is assigned to a browser user, which are also chosen on the administrative configuration. Based on that there are some cases where the current user may not have a profile:
All methods of this object are case insensitive and can be used in arbitrary cases though we recommend to use the case specified in this documentation. Changed profile 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. |
||||||||||||||||||||||
Retrieval |
this.profile |
||||||||||||||||||||||
Allowed in script types |
|
||||||||||||||||||||||
Properties and methods |
|
||||||||||||||||||||||
Examples |
Reading a profile item, once in full, once in shortform syntax:profile.item("username") The same with a metadata field, in this case "sessions" holding the number of browser sessions of the user: profile.meta("sessions") |