Package org.nuxeo.ecm.platform.tag
Class FacetedTagService
- java.lang.Object
-
- org.nuxeo.ecm.platform.tag.AbstractTagService
-
- org.nuxeo.ecm.platform.tag.FacetedTagService
-
- All Implemented Interfaces:
TagService
public class FacetedTagService extends AbstractTagService
Implementation of the tag service based on facet- Since:
- 9.3
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nuxeo.ecm.platform.tag.AbstractTagService
AbstractTagService.PAGE_PROVIDERS
-
Nested classes/interfaces inherited from interface org.nuxeo.ecm.platform.tag.TagService
TagService.Feature
-
-
Field Summary
Fields Modifier and Type Field Description static String
DISABLE_VERSIONING
Context data to disable versioning, used by NoVersioningFacetedTagFilter.static String
LABEL_PROPERTY
static String
USERNAME_PROPERTY
-
Fields inherited from class org.nuxeo.ecm.platform.tag.AbstractTagService
TAG_SANITIZATION_PROP
-
Fields inherited from interface org.nuxeo.ecm.platform.tag.TagService
ID
-
-
Constructor Summary
Constructors Constructor Description FacetedTagService()
-
Method Summary
All Methods Instance Methods Concrete 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
doCopyTags(CoreSession session, String srcDocId, String dstDocId, boolean removeExistingTags)
List<String>
doGetTagDocumentIds(CoreSession session, String label)
Set<String>
doGetTags(CoreSession session, String docId)
Set<String>
doGetTagSuggestions(CoreSession session, String label)
void
doTag(CoreSession session, String docId, String label, String username)
void
doUntag(CoreSession session, String docId, String label)
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).protected List<Map<String,Serializable>>
getTags(DocumentModel docModel)
boolean
hasFeature(TagService.Feature feature)
Checks if a feature is available.protected void
saveDocument(CoreSession session, DocumentModel doc)
protected void
setTags(DocumentModel docModel, List<Map<String,Serializable>> tags)
boolean
supportsTag(CoreSession session, String docId)
Checks if document support tag.-
Methods inherited from class org.nuxeo.ecm.platform.tag.AbstractTagService
cleanLabel, cleanUsername, copyTags, copyTags, fireUpdateEvent, getDocumentTags, getDocumentTags, getItems, getSuggestions, getSuggestions, getTagDocumentIds, getTagDocumentIds, getTags, isEnabled, isTagSanitizationEnabled, removeTags, replaceTags, tag, tag, untag, untag
-
-
-
-
Field Detail
-
LABEL_PROPERTY
public static final String LABEL_PROPERTY
- See Also:
- Constant Field Values
-
USERNAME_PROPERTY
public static final String USERNAME_PROPERTY
- See Also:
- Constant Field Values
-
DISABLE_VERSIONING
public static final String DISABLE_VERSIONING
Context data to disable versioning, used by NoVersioningFacetedTagFilter.- Since:
- 9.10
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FacetedTagService
public FacetedTagService()
-
-
Method Detail
-
hasFeature
public boolean hasFeature(TagService.Feature feature)
Description copied from interface:TagService
Checks if a feature is available.
-
supportsTag
public boolean supportsTag(CoreSession session, String docId)
Description copied from interface:TagService
Checks if document support tag.
-
saveDocument
protected void saveDocument(CoreSession session, DocumentModel doc)
-
doTag
public void doTag(CoreSession session, String docId, String label, String username)
- Specified by:
doTag
in classAbstractTagService
-
doUntag
public void doUntag(CoreSession session, String docId, String label)
- Specified by:
doUntag
in classAbstractTagService
-
canUntag
public boolean canUntag(CoreSession session, String docId, String label)
Description copied from interface:TagService
Returns whether or not the current session can untag tag on provided document.- Specified by:
canUntag
in interfaceTagService
- Overrides:
canUntag
in classAbstractTagService
- Parameters:
session
- the sessiondocId
- the document idlabel
- the tag, ornull
for all tags- Returns:
- whether or not the current session can untag provided document
-
doGetTags
public Set<String> doGetTags(CoreSession session, String docId)
- Specified by:
doGetTags
in classAbstractTagService
-
doCopyTags
public void doCopyTags(CoreSession session, String srcDocId, String dstDocId, boolean removeExistingTags)
- Specified by:
doCopyTags
in classAbstractTagService
-
doGetTagDocumentIds
public List<String> doGetTagDocumentIds(CoreSession session, String label)
- Specified by:
doGetTagDocumentIds
in classAbstractTagService
-
doGetTagSuggestions
public Set<String> doGetTagSuggestions(CoreSession session, String label)
- Specified by:
doGetTagSuggestions
in classAbstractTagService
-
getTagCloud
public List<Tag> getTagCloud(CoreSession session, String docId, String username, Boolean normalize)
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.
- 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)
-
getTags
protected List<Map<String,Serializable>> getTags(DocumentModel docModel)
-
setTags
protected void setTags(DocumentModel docModel, List<Map<String,Serializable>> tags)
-
-