public abstract class AbstractTagService extends Object implements TagService
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractTagService.PAGE_PROVIDERS |
TagService.Feature
ID
Constructor and Description |
---|
AbstractTagService() |
Modifier and Type | Method and Description |
---|---|
boolean |
canUntag(CoreSession session,
String docId,
String label)
Returns whether or not the current session can untag tag on provided document.
|
protected static 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) |
abstract List<String> |
doGetTagDocumentIds(CoreSession session,
String label) |
abstract Set<String> |
doGetTags(CoreSession session,
String docId) |
abstract Set<String> |
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) |
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> |
getDocumentTags(CoreSession session,
String docId,
String username,
boolean useCore)
Gets the tags applied to a document by a given user, or by all users.
|
protected static List<Map<String,Serializable>> |
getItems(String pageProviderName,
CoreSession session,
Object... params)
Returns results from calls to
CoreSession.queryAndFetch(String, String, Object...) using page providers. |
Set<String> |
getSuggestions(CoreSession session,
String label)
Gets suggestions for a given tag label prefix.
|
List<Tag> |
getSuggestions(CoreSession session,
String label,
String username)
Gets suggestions for a given tag label prefix.
|
List<String> |
getTagDocumentIds(CoreSession session,
String label)
Gets the documents to which a tag is applied.
|
List<String> |
getTagDocumentIds(CoreSession session,
String label,
String username)
Gets the documents to which a tag is applied.
|
Set<String> |
getTags(CoreSession session,
String docId)
Gets the tags applied to a document.
|
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.
|
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)
Tags a document with a given tag.
|
void |
untag(CoreSession session,
String docId,
String label)
Untags a document of the given tag
|
void |
untag(CoreSession session,
String docId,
String label,
String username)
Untags a document of the given tag
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTagCloud, hasFeature, supportsTag
public AbstractTagService()
public boolean isEnabled()
TagService
isEnabled
in interface TagService
public void tag(CoreSession session, String docId, String label) throws DocumentSecurityException
TagService
tag
in interface TagService
session
- the sessiondocId
- the document idlabel
- the tagDocumentSecurityException
public void tag(CoreSession session, String docId, String label, String username)
TagService
tag
in interface TagService
session
- the sessiondocId
- the document idlabel
- the tagusername
- the user associated to the taggingpublic void untag(CoreSession session, String docId, String label) throws DocumentSecurityException
TagService
untag
in interface TagService
session
- the sessiondocId
- the document idlabel
- the tag, or null
for all tagsDocumentSecurityException
public void untag(CoreSession session, String docId, String label, String username) throws DocumentSecurityException
TagService
untag
in interface TagService
session
- the sessiondocId
- the document idlabel
- the tag, or null
for all tagsusername
- the user associated to the taggingDocumentSecurityException
public boolean canUntag(CoreSession session, String docId, String label)
TagService
canUntag
in interface TagService
session
- the sessiondocId
- the document idlabel
- the tag, or null
for all tagspublic Set<String> getTags(CoreSession session, String docId)
TagService
getTags
in interface TagService
session
- the sessiondocId
- the document idpublic List<Tag> getDocumentTags(CoreSession session, String docId, String username)
TagService
getDocumentTags
in interface TagService
session
- the sessiondocId
- the document idusername
- the user name, or null
for all userspublic List<Tag> getDocumentTags(CoreSession session, String docId, String username, boolean useCore)
TagService
Alternative method allowing to specify whether the core should be used for this query.
getDocumentTags
in interface TagService
session
- the sessiondocId
- the document idusername
- the user name, or null
for all usersuseCore
- if true, the core should be used to retrieve tags.public void removeTags(CoreSession session, String docId)
TagService
removeTags
in interface TagService
public void copyTags(CoreSession session, String srcDocId, String dstDocId)
TagService
The tags are merged.
copyTags
in interface TagService
srcDocId
- the source document iddstDocId
- the destination document idprotected void copyTags(CoreSession session, String srcDocId, String dstDocId, boolean removeExistingTags)
public void replaceTags(CoreSession session, String srcDocId, String dstDocId)
TagService
replaceTags
in interface TagService
srcDocId
- the source document iddstDocId
- the destination document idpublic List<String> getTagDocumentIds(CoreSession session, String label)
TagService
getTagDocumentIds
in interface TagService
session
- the sessionlabel
- the tagpublic List<String> getTagDocumentIds(CoreSession session, String label, String username)
TagService
getTagDocumentIds
in interface TagService
session
- the sessionlabel
- the tagusername
- the user name, or null
for all userspublic Set<String> getSuggestions(CoreSession session, String label)
TagService
getSuggestions
in interface TagService
session
- the sessionlabel
- the tag label prefixpublic List<Tag> getSuggestions(CoreSession session, String label, String username)
TagService
getSuggestions
in interface TagService
session
- the sessionlabel
- the tag label prefixusername
- the user name, or null
for all userspublic abstract void doTag(CoreSession session, String docId, String label, String username)
public abstract void doUntag(CoreSession session, String docId, String label)
public abstract Set<String> doGetTags(CoreSession session, String docId)
public abstract void doCopyTags(CoreSession session, String srcDocId, String dstDocId, boolean removeExistingTags)
public abstract List<String> doGetTagDocumentIds(CoreSession session, String label)
public abstract Set<String> doGetTagSuggestions(CoreSession session, String label)
protected static String cleanLabel(String label, boolean allowEmpty, boolean allowPercent)
protected static String cleanUsername(String username)
protected static List<Map<String,Serializable>> getItems(String pageProviderName, CoreSession session, Object... params)
CoreSession.queryAndFetch(String, String, Object...)
using page providers.protected void fireUpdateEvent(CoreSession session, String docId)
Copyright © 2018 Nuxeo. All rights reserved.