Package org.nuxeo.ecm.platform.tag
Class AbstractTagService
java.lang.Object
org.nuxeo.ecm.platform.tag.AbstractTagService
- All Implemented Interfaces:
TagService
- Direct Known Subclasses:
FacetedTagService
- Since:
- 9.3
-
Nested Class Summary
-
Field Summary
Fields inherited from interface org.nuxeo.ecm.platform.tag.TagService
ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canUntag
(CoreSession session, String docId, String label) Returns whether or not the current session can untag tag on provided document.protected String
cleanLabel
(String label, boolean allowEmpty, boolean allowPercent) protected static String
cleanUsername
(String username) void
copyTags
(CoreSession session, String srcDocId, String dstDocId) Copy all the tags applied to the source document to the destination document.protected void
copyTags
(CoreSession session, String srcDocId, String dstDocId, boolean removeExistingTags) abstract void
doCopyTags
(CoreSession session, String srcDocId, String dstDocId, boolean removeExistingTags) doGetTagDocumentIds
(CoreSession session, String label) doGetTags
(CoreSession session, String docId) doGetTagSuggestions
(CoreSession session, String label) abstract void
doTag
(CoreSession session, String docId, String label, String username) abstract void
doUntag
(CoreSession session, String docId, String label) protected void
fireUpdateEvent
(CoreSession session, String docId) protected static List<Map<String,
Serializable>> getItems
(String pageProviderName, CoreSession session, Object... params) Returns results from calls toCoreSession.queryAndFetch(String, String, Object...)
using page providers.getSuggestions
(CoreSession session, String label) Gets suggestions for a given tag label prefix.getTagDocumentIds
(CoreSession session, String label) Gets the documents to which a tag is applied.getTags
(CoreSession session, String docId) Gets the tags applied to a document.boolean
Defines if tag service is enable.protected boolean
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) Tags a document with a given tag.void
untag
(CoreSession session, String docId, String label) Untags a document of the given tagMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.ecm.platform.tag.TagService
supportsTag
-
Field Details
-
TAG_SANITIZATION_PROP
- See Also:
-
-
Constructor Details
-
AbstractTagService
public AbstractTagService()
-
-
Method Details
-
isEnabled
public boolean isEnabled()Description copied from interface:TagService
Defines if tag service is enable.- Specified by:
isEnabled
in interfaceTagService
- Returns:
- true if the underlying repository supports the tag feature
-
tag
Description copied from interface:TagService
Tags a document with a given tag.- Specified by:
tag
in interfaceTagService
- Parameters:
session
- the sessiondocId
- the document idlabel
- the tag
-
untag
Description copied from interface:TagService
Untags a document of the given tag- Specified by:
untag
in interfaceTagService
- Parameters:
session
- the sessiondocId
- the document idlabel
- the tag, ornull
for all tags
-
canUntag
Description copied from interface:TagService
Returns whether or not the current session can untag tag on provided document.- Specified by:
canUntag
in interfaceTagService
- Parameters:
session
- the sessiondocId
- the document idlabel
- the tag, ornull
for all tags- Returns:
- whether or not the current session can untag provided document
-
getTags
Description copied from interface:TagService
Gets the tags applied to a document.- Specified by:
getTags
in interfaceTagService
- Parameters:
session
- the sessiondocId
- the document id- Returns:
- the list of tags
-
removeTags
Description copied from interface:TagService
Removes all the tags applied to a document.- Specified by:
removeTags
in interfaceTagService
-
copyTags
Description copied from interface:TagService
Copy all the tags applied to the source document to the destination document.The tags are merged.
- Specified by:
copyTags
in interfaceTagService
srcDocId
- the source document iddstDocId
- the destination document id
-
copyTags
protected void copyTags(CoreSession session, String srcDocId, String dstDocId, boolean removeExistingTags) -
replaceTags
Description copied from interface:TagService
Replace all the existing tags applied on the destination document by the ones applied on the source document.- Specified by:
replaceTags
in interfaceTagService
srcDocId
- the source document iddstDocId
- the destination document id
-
getTagDocumentIds
Description copied from interface:TagService
Gets the documents to which a tag is applied.- Specified by:
getTagDocumentIds
in interfaceTagService
- Parameters:
session
- the sessionlabel
- the tag- Returns:
- the set of document ids
-
getSuggestions
Description copied from interface:TagService
Gets suggestions for a given tag label prefix.- Specified by:
getSuggestions
in interfaceTagService
- Parameters:
session
- the sessionlabel
- the tag label prefix- Returns:
- a list of tags
-
isTagSanitizationEnabled
protected boolean isTagSanitizationEnabled() -
doTag
-
doUntag
-
doGetTags
-
doCopyTags
public abstract void doCopyTags(CoreSession session, String srcDocId, String dstDocId, boolean removeExistingTags) -
doGetTagDocumentIds
-
doGetTagSuggestions
-
cleanLabel
-
cleanUsername
-
getItems
protected static List<Map<String,Serializable>> getItems(String pageProviderName, CoreSession session, Object... params) Returns results from calls toCoreSession.queryAndFetch(String, String, Object...)
using page providers.- Since:
- 6.0
-
fireUpdateEvent
-