Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community
Interface TagManager

All Superinterfaces:
JiveManager

public interface TagManager
extends JiveManager

Provides a manager to create, retrieve and delete tags.


Nested Class Summary
static class TagManager.Taggable
          Enumeration of the primary three types of content elements in the system.
 
Method Summary
 void addTag(ContentTag tag, JiveObject jiveObject)
          Associates a tag with this object
 ContentTag createTag(String tagname)
          Creates a tag in the database.
 ContentTag getTag(long tagID)
          Returns a tag given a tag ID.
 ContentTag getTag(String tagname)
          Returns a tag by tag name.
 List<com.jivesoftware.community.ContentTagCloudBean> getTagCloud(Map<String,Integer> popularTags)
          Returns a list of ContentTagCloudBean objects corresponding to the provided parameters
 List<com.jivesoftware.community.ContentTagCloudBean> getTagCloud(Map<String,Integer> popularTags, int numOfBuckets, int sort)
          Returns a list of ContentTagCloudBean objects corresponding to the provided parameters
 int getTagCount(JiveObject jiveObject)
          Return a count of all the tags associated with this jive object.
 JiveIterator<JiveObject> getTaggableContent(JiveContainer container)
          Returns an iterator of taggable jive objects for the specific container.
 JiveIterator<JiveObject> getTaggableContent(JiveContainer container, ResultFilter resultFilter, TagManager.Taggable... taggableTypes)
          Returns an iterator of taggable jive objects for the specific container.
 int getTaggableContentCount(JiveContainer container)
          Returns a count of taggable jive objects for the specific container.
 int getTaggableContentCount(JiveContainer container, ResultFilter resultFilter, TagManager.Taggable... taggableTypes)
          Returns a cout of taggable jive objects for the specific container.
 Map<String,Integer> getTagMap(JiveContainer container)
          Returns all tags for a given container in a Map where the key is the name of tag and the value is the number of times the tag has been used in this container.
 Map<String,Integer> getTagMap(JiveContainer container, TagResultFilter resultFilter, TagManager.Taggable... types)
          Returns all tags for a given container in a Map where the key is the name of tag and the value is the number of times the tag has been used in this container filtered by the TagResultFilter.
 JiveIterator<ContentTag> getTags(JiveObject jiveObject)
          Return an Iterable for all the tags associated with this jive object.
 String getTagsAsString(JiveObject jiveObject)
          Return a String for all the tags associated with this jive object.
 void removeAllTags(JiveObject jiveObject)
          Disassociates this object with all tags.
 void removeTag(ContentTag tag, JiveObject jiveObject)
          Disassociates this object with the given tag.
 void setTags(String tags, JiveObject jiveObject)
          Sets tags for the specified jive object.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

Method Detail

createTag

ContentTag createTag(String tagname)
Creates a tag in the database.

Parameters:
tagname - the name of the tag to create.
Returns:
the newly created tag.

getTag

ContentTag getTag(String tagname)
                  throws com.jivesoftware.community.TagObjectNotFoundException
Returns a tag by tag name.

Parameters:
tagname - the name of the tag to lookup.
Returns:
the tag corresponding to the supplied name
Throws:
TagObjectNotFoundException - if no tag exists with that name.

getTag

ContentTag getTag(long tagID)
                  throws com.jivesoftware.community.TagObjectNotFoundException
Returns a tag given a tag ID.

Parameters:
tagID - the id of the tag to retrieve
Returns:
the tag corresponding to the supplied id
Throws:
TagObjectNotFoundException - if no tag exists with that ID.

addTag

void addTag(ContentTag tag,
            JiveObject jiveObject)
            throws UnauthorizedException
Associates a tag with this object

Parameters:
tag - the tag to associate with the object
jiveObject - the object to associate the tag with
Throws:
UnauthorizedException - if does not have permission to the tag

setTags

void setTags(String tags,
             JiveObject jiveObject)
Sets tags for the specified jive object. If tags do not already exist, they will be created, and if tags exist that are not specified in the string, they will be removed.

Parameters:
tags - the tag to associate with the object
jiveObject - the object to associate the tag with
Throws:
UnauthorizedException - if does not have permission to the tag

getTags

JiveIterator<ContentTag> getTags(JiveObject jiveObject)
Return an Iterable for all the tags associated with this jive object.

Parameters:
jiveObject - the object to return associated tags for
Returns:
an Iterable for all tags associated with this jive object.

getTagsAsString

String getTagsAsString(JiveObject jiveObject)
Return a String for all the tags associated with this jive object.

Parameters:
jiveObject - the object to return associated tags for
Returns:
a String for all the tags associated with this jive object.

getTagCount

int getTagCount(JiveObject jiveObject)
Return a count of all the tags associated with this jive object.

Parameters:
jiveObject - the object to return associated tags for
Returns:
an count of all tags associated with this jive object.

getTagMap

Map<String,Integer> getTagMap(JiveContainer container)
Returns all tags for a given container in a Map where the key is the name of tag and the value is the number of times the tag has been used in this container.

Parameters:
container - the container to return associated tags for
Returns:
all tags in a given container in a Map where the key is the name of tag and the value is the number of times the tag has been used in this container

getTagMap

Map<String,Integer> getTagMap(JiveContainer container,
                              TagResultFilter resultFilter,
                              TagManager.Taggable... types)
Returns all tags for a given container in a Map where the key is the name of tag and the value is the number of times the tag has been used in this container filtered by the TagResultFilter.

Parameters:
container - the container to return associated tags for
resultFilter - the filter to use to restrict tag results
types - the content types to use to restrict tag results
Returns:
all tags for a given jive object in a Map where the key is the name of tag and the value is the number of times the tag has been used in this jive object filtered by the TagResultFilter.

getTaggableContentCount

int getTaggableContentCount(JiveContainer container)
Returns a count of taggable jive objects for the specific container.

Parameters:
container - the specified container to get taggable jive objects
Returns:
a count of taggable jive objects for the specified container

getTaggableContentCount

int getTaggableContentCount(JiveContainer container,
                            ResultFilter resultFilter,
                            TagManager.Taggable... taggableTypes)
Returns a cout of taggable jive objects for the specific container.

Parameters:
container - the specified container to get taggable jive objects
resultFilter - the result filter to set various options such as sorting, filtering
taggableTypes - the taggable types to return
Returns:
a count of taggable jive objects for the specified container

getTaggableContent

JiveIterator<JiveObject> getTaggableContent(JiveContainer container)
Returns an iterator of taggable jive objects for the specific container.

Parameters:
container - the specified container to get taggable jive objects
Returns:
an iterator of taggable jive objects for the specified container

getTaggableContent

JiveIterator<JiveObject> getTaggableContent(JiveContainer container,
                                            ResultFilter resultFilter,
                                            TagManager.Taggable... taggableTypes)
Returns an iterator of taggable jive objects for the specific container.

Parameters:
container - the specified container to get taggable jive objects
resultFilter - the result filter to set various options such as sorting, filtering
taggableTypes - the taggable types to return
Returns:
an iterator of taggable jive objects for the specified container

removeTag

void removeTag(ContentTag tag,
               JiveObject jiveObject)
               throws UnauthorizedException
Disassociates this object with the given tag.

Parameters:
tag - the tag to remove from this object
jiveObject - the object to remove the tag association for
Throws:
UnauthorizedException - if does not have permission to remove tag.

removeAllTags

void removeAllTags(JiveObject jiveObject)
                   throws UnauthorizedException
Disassociates this object with all tags.

Parameters:
jiveObject - the object to disassociate all tags from
Throws:
UnauthorizedException - if user does not have administrator permissions.

getTagCloud

List<com.jivesoftware.community.ContentTagCloudBean> getTagCloud(Map<String,Integer> popularTags)
Returns a list of ContentTagCloudBean objects corresponding to the provided parameters

Parameters:
popularTags - a map of popular tags
Returns:
a list of ContentTagCloudBean objects corresponding to the provided parameters

getTagCloud

List<com.jivesoftware.community.ContentTagCloudBean> getTagCloud(Map<String,Integer> popularTags,
                                                                 int numOfBuckets,
                                                                 int sort)
Returns a list of ContentTagCloudBean objects corresponding to the provided parameters

Parameters:
popularTags - a map of popular tags
numOfBuckets - the number of buckets to sort the tags into
sort - one of ContentTag.SORT_TAGNAME or ContentTag.SORT_TAGCOUNT
Returns:
a list of ContentTagCloudBean objects corresponding to the provided parameters

Clearspace Project Page

Copyright © 1999-2007 Jive Software.