Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.tag
Class TagServiceBean

java.lang.Object
  extended by org.nuxeo.ecm.platform.tag.TagServiceBean
All Implemented Interfaces:
TagService

public class TagServiceBean
extends java.lang.Object
implements TagService

Stateless bean for the tag service.


Field Summary
 
Fields inherited from interface org.nuxeo.ecm.platform.tag.TagService
ID
 
Constructor Summary
TagServiceBean()
           
 
Method Summary
 java.util.List<Tag> getDocumentTags(CoreSession session, java.lang.String docId, java.lang.String username)
          Gets the tags applied to a document by a given user, or by all users.
 java.util.List<Tag> getSuggestions(CoreSession session, java.lang.String label, java.lang.String username)
          Gets suggestions for a given tag label prefix.
 java.util.List<Tag> getTagCloud(CoreSession session, java.lang.String docId, java.lang.String username, java.lang.Boolean normalize)
          Gets the tag cloud for a set of documents (tags with weight corresponding to their popularity).
 java.util.List<java.lang.String> getTagDocumentIds(CoreSession session, java.lang.String label, java.lang.String username)
          Gets the documents to which a tag is applied.
 boolean isEnabled()
          Defines if tag service is enable.
 void tag(CoreSession session, java.lang.String docId, java.lang.String tagLabel, java.lang.String username)
          Tags a document with a given tag.
 void untag(CoreSession session, java.lang.String docId, java.lang.String tagLabel, java.lang.String username)
          Untags a document of the given tag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagServiceBean

public TagServiceBean()
Method Detail

isEnabled

public boolean isEnabled()
                  throws ClientException
Description copied from interface: TagService
Defines if tag service is enable.

Specified by:
isEnabled in interface TagService
Returns:
true if the underlying repository supports the tag feature
Throws:
ClientException

tag

public void tag(CoreSession session,
                java.lang.String docId,
                java.lang.String tagLabel,
                java.lang.String username)
         throws ClientException
Description copied from interface: TagService
Tags a document with a given tag.

Specified by:
tag in interface TagService
Parameters:
session - the session
docId - the document id
tagLabel - the tag
username - the user associated to the tagging
Throws:
ClientException

untag

public void untag(CoreSession session,
                  java.lang.String docId,
                  java.lang.String tagLabel,
                  java.lang.String username)
           throws ClientException
Description copied from interface: TagService
Untags a document of the given tag

Specified by:
untag in interface TagService
Parameters:
session - the session
docId - the document id
tagLabel - the tag, or null for all tags
username - the user associated to the tagging
Throws:
ClientException

getDocumentTags

public java.util.List<Tag> getDocumentTags(CoreSession session,
                                           java.lang.String docId,
                                           java.lang.String username)
                                    throws ClientException
Description copied from interface: TagService
Gets the tags applied to a document by a given user, or by all users.

Specified by:
getDocumentTags in interface TagService
Parameters:
session - the session
docId - the document id
username - the user name, or null for all users
Returns:
the list of tags
Throws:
ClientException

getTagDocumentIds

public java.util.List<java.lang.String> getTagDocumentIds(CoreSession session,
                                                          java.lang.String label,
                                                          java.lang.String username)
                                                   throws ClientException
Description copied from interface: TagService
Gets the documents to which a tag is applied.

Specified by:
getTagDocumentIds in interface TagService
Parameters:
session - the session
label - the tag
username - the user name, or null for all users
Returns:
the set of document ids
Throws:
ClientException

getTagCloud

public java.util.List<Tag> getTagCloud(CoreSession session,
                                       java.lang.String docId,
                                       java.lang.String username,
                                       java.lang.Boolean normalize)
                                throws ClientException
Description copied from interface: TagService
Gets the tag cloud for a set of documents (tags with weight corresponding to their popularity).

If a docId is passed, only documents under it are considered, otherwise all documents in the database are used.

The cloud is returned unsorted.

Specified by:
getTagCloud in interface TagService
Parameters:
session - the session
docId - the document id under which to look, or null for all documents
username - the user name, or null for all users
normalize - null for no weight normalization (a count is returned), FALSE for 0-100 normalization, TRUE for logarithmic 0-100 normalization
Returns:
the cloud (a list of weighted tags)
Throws:
ClientException

getSuggestions

public java.util.List<Tag> getSuggestions(CoreSession session,
                                          java.lang.String label,
                                          java.lang.String username)
                                   throws ClientException
Description copied from interface: TagService
Gets suggestions for a given tag label prefix.

Specified by:
getSuggestions in interface TagService
Parameters:
session - the session
label - the tag label prefix
username - the user name, or null for all users
Returns:
a list of tags
Throws:
ClientException

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.