public class TagServiceImpl extends DefaultComponent implements TagService
| Modifier and Type | Field and Description |
|---|---|
static String |
NXTAG |
ID| Constructor and Description |
|---|
TagServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
copyTags(CoreSession session,
String srcDocId,
String dstDocId)
Copy all the tags applied to the source document to the destination
document.
|
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.
|
static void |
normalizeCloud(List<Tag> cloud,
int min,
int max,
boolean linear) |
void |
removeTags(CoreSession session,
String docId)
Removes all the tags applied to a document.
|
void |
replaceTags(CoreSession session,
String srcDocId,
String dstDocId)
Replace all the existing tags applied on the destination document by the
ones applied on the source document.
|
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
|
activate, applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerContribution, registerExtension, setLastModified, unregisterContribution, unregisterExtensionpublic static final String NXTAG
public boolean isEnabled()
TagServiceisEnabled in interface TagServicepublic void tag(CoreSession session, String docId, String label, String username) throws ClientException
TagServicetag in interface TagServicesession - the sessiondocId - the document idlabel - the tagusername - the user associated to the taggingClientExceptionpublic void untag(CoreSession session, String docId, String label, String username) throws ClientException
TagServiceuntag in interface TagServicesession - the sessiondocId - the document idlabel - the tag, or null for all tagsusername - the user associated to the taggingClientExceptionpublic List<Tag> getDocumentTags(CoreSession session, String docId, String username) throws ClientException
TagServicegetDocumentTags in interface TagServicesession - the sessiondocId - the document idusername - the user name, or null for all usersClientExceptionpublic void removeTags(CoreSession session, String docId) throws ClientException
TagServiceremoveTags in interface TagServiceClientExceptionpublic void copyTags(CoreSession session, String srcDocId, String dstDocId) throws ClientException
TagServiceThe tags are merged.
copyTags in interface TagServicesrcDocId - the source document iddstDocId - the destination document idClientExceptionpublic void replaceTags(CoreSession session, String srcDocId, String dstDocId) throws ClientException
TagServicereplaceTags in interface TagServicesrcDocId - the source document iddstDocId - the destination document idClientExceptionpublic List<String> getTagDocumentIds(CoreSession session, String label, String username) throws ClientException
TagServicegetTagDocumentIds in interface TagServicesession - the sessionlabel - the tagusername - the user name, or null for all usersClientExceptionpublic List<Tag> getTagCloud(CoreSession session, String docId, String username, Boolean normalize) throws ClientException
TagServiceIf a docId is passed, only documents under it are considered, otherwise all documents in the database are used.
The cloud is returned unsorted.
getTagCloud in interface TagServicesession - the sessiondocId - the document id under which to look, or null for all
documentsusername - the user name, or null for all usersnormalize - null for no weight normalization (a count is returned),
FALSE for 0-100 normalization, TRUE for
logarithmic 0-100 normalizationClientExceptionpublic List<Tag> getSuggestions(CoreSession session, String label, String username) throws ClientException
TagServicegetSuggestions in interface TagServicesession - the sessionlabel - the tag label prefixusername - the user name, or null for all usersClientExceptionCopyright © 2014 Nuxeo SA. All Rights Reserved.