Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.tag
Interface TagService

All Known Subinterfaces:
TagServiceLocal, TagServiceRemote
All Known Implementing Classes:
TagServiceImpl

public interface TagService

The Tag Service interface. It gathers the entire service API. The available capabilities are:


Field Summary
static String ID
           
 
Method Summary
 List<Tag> getDocumentTags(CoreSession session, String docId, String username)
          Gets the tags applied to a document by a given user, or by all users.
 List<Tag> getSuggestions(CoreSession session, String label, String username)
          Gets suggestions for a given tag label prefix.
 List<Tag> getTagCloud(CoreSession session, String docId, String username, Boolean normalize)
          Gets the tag cloud for a set of documents (tags with weight corresponding to their popularity).
 List<String> getTagDocumentIds(CoreSession session, String label, String username)
          Gets the documents to which a tag is applied.
 boolean isEnabled()
          Defines if tag service is enable.
 void tag(CoreSession session, String docId, String label, String username)
          Tags a document with a given tag.
 void untag(CoreSession session, String docId, String label, String username)
          Untags a document of the given tag
 

Field Detail

ID

static final String ID
See Also:
Constant Field Values
Method Detail

isEnabled

boolean isEnabled()
                  throws ClientException
Defines if tag service is enable.

Returns:
true if the underlying repository supports the tag feature
Throws:
ClientException

tag

void tag(CoreSession session,
         String docId,
         String label,
         String username)
         throws ClientException
Tags a document with a given tag.

Parameters:
session - the session
docId - the document id
label - the tag
username - the user associated to the tagging
Throws:
ClientException

untag

void untag(CoreSession session,
           String docId,
           String label,
           String username)
           throws ClientException
Untags a document of the given tag

Parameters:
session - the session
docId - the document id
label - the tag, or null for all tags
username - the user associated to the tagging
Throws:
ClientException

getDocumentTags

List<Tag> getDocumentTags(CoreSession session,
                          String docId,
                          String username)
                          throws ClientException
Gets the tags applied to a document by a given user, or by all users.

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

List<String> getTagDocumentIds(CoreSession session,
                               String label,
                               String username)
                               throws ClientException
Gets the documents to which a tag is applied.

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

List<Tag> getTagCloud(CoreSession session,
                      String docId,
                      String username,
                      Boolean normalize)
                      throws ClientException
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.

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

List<Tag> getSuggestions(CoreSession session,
                         String label,
                         String username)
                         throws ClientException
Gets suggestions for a given tag label prefix.

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 ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.