Class TagSupport
- java.lang.Object
-
- org.glassfish.admingui.common.handlers.TagSupport
-
- All Implemented Interfaces:
Serializable
public class TagSupport extends Object implements Serializable
This class provides API support for managing
Tags.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringBASE_NODEThis is the base Preferences node for tags.static StringTAG_DATA_KEYThis is the key used to access the tag data under theBASE_NODEJava Preferences APInode.
-
Constructor Summary
Constructors Constructor Description TagSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddTag(String tagName, String tagViewId, String displayName, String user)This method adds a tag for the giventagViewIdanduser.static voidmain(String[] args)static StringnormalizeTagViewId(String tagViewId)tagViewId's are expected to be context relative paths.static List<Tag>queryTags(String tagName, String tagViewId, String user)This method searches the tags based on the given criteria.static voidremoveTag(String tagName, String tagViewId, String user)This method removes a Tag.
-
-
-
Field Detail
-
BASE_NODE
public static final String BASE_NODE
This is the base Preferences node for tags.
- See Also:
- Constant Field Values
-
TAG_DATA_KEY
public static final String TAG_DATA_KEY
This is the key used to access the tag data under the
BASE_NODEJava Preferences APInode.- See Also:
- Constant Field Values
-
-
Method Detail
-
addTag
public static void addTag(String tagName, String tagViewId, String displayName, String user)
This method adds a tag for the given
tagViewIdanduser. If the tagViewId is new, it will store the givendisplayName.
-
queryTags
public static List<Tag> queryTags(String tagName, String tagViewId, String user)
This method searches the tags based on the given criteria. Any of the criteria may be null, meaning not to filter by that criterion.
- Parameters:
tagName- Name of the tag to find, not required. May be null if tagViewId, or user is supplied -- or to return all tags.tagViewId- Unique id for the page to search for tags. May be null (for all pages).user- User id. From getUserPrincipal() in some cases? Allow seeing tags created by specific users. May be null (for all users).- Returns:
- Returns the search results, or
nullif nothing is found.
-
removeTag
public static void removeTag(String tagName, String tagViewId, String user)
This method removes a Tag.
-
normalizeTagViewId
public static String normalizeTagViewId(String tagViewId)
tagViewId's are expected to be context relative paths. These tagViewId's may include QUERY_STRING parameters if they are used to determine the content of the page. This means, we must take extra special care to normalize the order of important QUERY_STRING properties. We also need to ensure leading (or intermediate) '/' characters are normalized, and that the extension is normalized (this method will ensure all tagViewId's end in .jsf).
Case will be preserved.
-
main
public static void main(String[] args)
-
-