Plumtree Tags API  
 

ITagState Methods

The methods of the ITagState interface are listed below. For a complete list of ITagState interface members, see the ITagState Members topic.

Public Instance Methods

GetAnyVariable Gets a variable from memory from all scopes. The scope determines who can see this variable and how long it stays in memory. For instance, a variable can only be retrieved from Tag Scope if a tag that includes the current tag added the variable to Tag Scope. A variable can only be retrieved from Portlet Request Scope if another tag in the portlet stored the variable in memory. Standard variables (as opposed to shared variables) can only be accessed by tags from the same tag library as the tag that originally stored the variable. This method will first look for standard variables, and if not found will then look for shared variables. Note: Retrieving an HTMLElement from memory that has already been displayed in another tag and then adding more HTML to the original tag is not supported. HTMLElement trees can be retrieved from memory and re-used, as long as they are not modified. The safest way to do this is to make a clone of the cached HTMLElement tree before trying to display it again to make sure there are no threading problems.
GetApplication Return the Application for use in storing data on the HTTP Application. Most developers should use the Get/SetVariable methods instead.
GetPersistentSubSession Returns the persistent subsession that can be used to store data on the HTTP Session for use across multiple login/logout cycles. This SubSession is not cleared of its data on user logout, so be sure not to cache anything on this session that could be considered a security risk if it was leaked to another user. Most developers should use the normal subsession (GetSubSession()) for HTTP Session data storage, and the Get/SetVariable methods instead.
GetSharedVariable Gets a shared variable from memory in the appropriate scope. The scope determines who can see this variable and how long it stays in memory. For instance, a variable can only be retrieved from Tag Scope if a tag that includes the current tag added the variable to Tag Scope. A variable can only be retrieved from Portlet Request Scope if another tag in the portlet stored the variable in memory. Shared variables can be accessed by tags from any tag library (as opposed to standard variables, which can only be accessed by tags from the same tag library). Note: Retrieving an HTMLElement from memory that has already been displayed in another tag and then adding more HTML to the original tag is not supported. HTMLElement trees can be retrieved from memory and re-used, as long as they are not modified. The safest way to do this is to make a clone of the cached HTMLElement tree before trying to display it again to make sure there are no threading problems.
GetSubSession Returns the subsession that can be used to store data on the HTTP Session. This SubSession is cleared of all data on logout. Most developers should use the Get/SetVariable methods instead.
GetVariable Gets a variable from memory in the appropriate scope. The scope determines who can see this variable and how long it stays in memory. For instance, a variable can only be retrieved from Tag Scope if a tag that includes the current tag added the variable to Tag Scope. A variable can only be retrieved from Portlet Request Scope if another tag in the portlet stored the variable in memory. Standard variables (as opposed to shared variables) can only be accessed by tags from the same tag library as the tag that originally stored the variable. Note: Retrieving an HTMLElement from memory that has already been displayed in another tag and then adding more HTML to the original tag is not supported. HTMLElement trees can be retrieved from memory and re-used, as long as they are not modified. The safest way to do this is to make a clone of the cached HTMLElement tree before trying to display it again to make sure there are no threading problems.
SetSharedVariable Sets a variable in memory in the appropriate scope. The scope determines who can see this variable and how long it stays in memory. For instance, a variable stored in Tag Scope can only be seen by children of the current tag and will be removed from memory when the tag is finished. A variable stored in Portlet Request Scope will be visible to all tags in the same portlet as the current tag, and will be removed from memory when the portlet is finished displaying. Tags in other portlets on the same page will not be able to see the variable. Shared variables (as opposed to standard variables) can be accessed by tags from any library. If bOwnerEditOnly is set to true when a shared variable is first stored, then any tag can read the variable, but only tags from the same library as the tag that originally stored the variable can edit it (and replace the value in memory). Note: Displaying an HTMLElement in a tag and then caching it so that another tag can add more HTML to the original tag later is not supported. HTMLElement trees can be generated and stored for later use, as long as they are self-contained trees and used in a read only way. It is safest to make clones of a cached HTMLElement tree before trying to display it again to make sure there are no threading problems.
SetVariable Sets a variable in memory in the appropriate scope. The scope determines who can see this variable and how long it stays in memory. For instance, a variable stored in Tag Scope can only be seen by children of the current tag and will be removed from memory when the tag is finished. A variable stored in Portlet Request Scope will be visible to all tags in the same portlet as the current tag, and will be removed from memory when the portlet is finished displaying. Tags in other portlets on the same page will not be able to see the variable. Standard variables (as opposed to shared variables) can only be accessed by tags from the same tag library as the tag that originally stored the variable. Note: Displaying an HTMLElement in a tag and then caching it so that another tag can add more HTML to the original tag later is not supported. HTMLElement trees can be generated and stored for later use, as long as they are self-contained trees and used in a read only way. It is safest to make clones of a cached HTMLElement tree before trying to display it again to make sure there are no threading problems.

See Also

ITagState Interface | com.plumtree.portaluiinfrastructure.tags Namespace