Package org.nuxeo.ecm.platform.tag
Interface TagService
-
- All Known Implementing Classes:
AbstractTagService
,BridgeTagService
,FacetedTagService
,RelationTagService
public interface TagService
The Tag Service interface. It gathers the entire service API. The available capabilities are:- list the tags, either related or not to a document
- create tags and taggings
- obtain tag cloud
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TagService.Feature
Features of the implementation of the service.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
canUntag(CoreSession session, String docId, String label)
Returns whether or not the current session can untag tag on provided document.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)
Deprecated.since 9.3, username is not needed anymoreList<Tag>
getDocumentTags(CoreSession session, String docId, String username, boolean useCore)
Deprecated.since 9.3, username and useCore are not needed anymoreSet<String>
getSuggestions(CoreSession session, String label)
Gets suggestions for a given tag label prefix.List<Tag>
getSuggestions(CoreSession session, String label, String username)
Deprecated.since 9.3, username is not needed anymoreList<Tag>
getTagCloud(CoreSession session, String docId, String username, Boolean normalize)
Deprecated.since 9.3, seems unusedList<String>
getTagDocumentIds(CoreSession session, String label)
Gets the documents to which a tag is applied.List<String>
getTagDocumentIds(CoreSession session, String label, String username)
Deprecated.since 9.3, username is not needed anymoreSet<String>
getTags(CoreSession session, String docId)
Gets the tags applied to a document.boolean
hasFeature(TagService.Feature feature)
Checks if a feature is available.boolean
isEnabled()
Defines if tag service is enable.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.boolean
supportsTag(CoreSession session, String docId)
Checks if document support tag.void
tag(CoreSession session, String docId, String label)
Tags a document with a given tag.void
tag(CoreSession session, String docId, String label, String username)
Deprecated.since 9.3, username is not needed anymorevoid
untag(CoreSession session, String docId, String label)
Untags a document of the given tagvoid
untag(CoreSession session, String docId, String label, String username)
Deprecated.since 9.3, username is not needed anymore
-
-
-
Field Detail
-
ID
static final String ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
isEnabled
boolean isEnabled()
Defines if tag service is enable.- Returns:
- true if the underlying repository supports the tag feature
-
tag
void tag(CoreSession session, String docId, String label)
Tags a document with a given tag.- Parameters:
session
- the sessiondocId
- the document idlabel
- the tag- Since:
- 9.3
-
tag
@Deprecated void tag(CoreSession session, String docId, String label, String username)
Deprecated.since 9.3, username is not needed anymoreTags a document with a given tag.- Parameters:
session
- the sessiondocId
- the document idlabel
- the tagusername
- the user associated to the tagging
-
untag
void untag(CoreSession session, String docId, String label)
Untags a document of the given tag- Parameters:
session
- the sessiondocId
- the document idlabel
- the tag, ornull
for all tags
-
untag
@Deprecated void untag(CoreSession session, String docId, String label, String username)
Deprecated.since 9.3, username is not needed anymoreUntags a document of the given tag- Parameters:
session
- the sessiondocId
- the document idlabel
- the tag, ornull
for all tagsusername
- the user associated to the tagging
-
canUntag
boolean canUntag(CoreSession session, String docId, String label)
Returns whether or not the current session can untag tag on provided document.- Parameters:
session
- the sessiondocId
- the document idlabel
- the tag, ornull
for all tags- Returns:
- whether or not the current session can untag provided document
- Since:
- 8.4
-
getTags
Set<String> getTags(CoreSession session, String docId)
Gets the tags applied to a document.- Parameters:
session
- the sessiondocId
- the document id- Returns:
- the list of tags
- Since:
- 9.3
-
getDocumentTags
@Deprecated List<Tag> getDocumentTags(CoreSession session, String docId, String username)
Deprecated.since 9.3, username is not needed anymoreGets the tags applied to a document by a given user, or by all users.- Parameters:
session
- the sessiondocId
- the document idusername
- the user name, ornull
for all users- Returns:
- the list of tags
-
getDocumentTags
@Deprecated List<Tag> getDocumentTags(CoreSession session, String docId, String username, boolean useCore)
Deprecated.since 9.3, username and useCore are not needed anymoreGets the tags applied to a document by a given user, or by all users.Alternative method allowing to specify whether the core should be used for this query.
- Parameters:
session
- the sessiondocId
- the document idusername
- the user name, ornull
for all usersuseCore
- if true, the core should be used to retrieve tags.- Returns:
- the list of tags
- Since:
- 6.0
-
removeTags
void removeTags(CoreSession session, String docId)
Removes all the tags applied to a document.- Since:
- 5.7.3
-
copyTags
void copyTags(CoreSession session, String srcDocId, String dstDocId)
Copy all the tags applied to the source document to the destination document.The tags are merged.
- Parameters:
srcDocId
- the source document iddstDocId
- the destination document id- Since:
- 5.7.3
-
replaceTags
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.- Parameters:
srcDocId
- the source document iddstDocId
- the destination document id- Since:
- 5.7.3
-
getTagDocumentIds
List<String> getTagDocumentIds(CoreSession session, String label)
Gets the documents to which a tag is applied.- Parameters:
session
- the sessionlabel
- the tag- Returns:
- the set of document ids
- Since:
- 9.3
-
getTagDocumentIds
@Deprecated List<String> getTagDocumentIds(CoreSession session, String label, String username)
Deprecated.since 9.3, username is not needed anymoreGets the documents to which a tag is applied.- Parameters:
session
- the sessionlabel
- the tagusername
- the user name, ornull
for all users- Returns:
- the set of document ids
-
getTagCloud
@Deprecated List<Tag> getTagCloud(CoreSession session, String docId, String username, Boolean normalize)
Deprecated.since 9.3, seems unusedGets 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 sessiondocId
- the document id under which to look, ornull
for all documentsusername
- the user name, ornull
for all usersnormalize
- 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)
-
getSuggestions
Set<String> getSuggestions(CoreSession session, String label)
Gets suggestions for a given tag label prefix.- Parameters:
session
- the sessionlabel
- the tag label prefix- Returns:
- a list of tags
- Since:
- 9.3
-
getSuggestions
@Deprecated List<Tag> getSuggestions(CoreSession session, String label, String username)
Deprecated.since 9.3, username is not needed anymoreGets suggestions for a given tag label prefix.- Parameters:
session
- the sessionlabel
- the tag label prefixusername
- the user name, ornull
for all users- Returns:
- a list of tags
-
hasFeature
boolean hasFeature(TagService.Feature feature)
Checks if a feature is available.- Since:
- 9.3
-
supportsTag
boolean supportsTag(CoreSession session, String docId)
Checks if document support tag.- Since:
- 9.3
-
-