Class AbstractTagService

java.lang.Object
org.nuxeo.ecm.platform.tag.AbstractTagService
All Implemented Interfaces:
TagService
Direct Known Subclasses:
FacetedTagService

public abstract class AbstractTagService extends Object implements TagService
Since:
9.3
  • Field Details

  • 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 interface TagService
      Returns:
      true if the underlying repository supports the tag feature
    • tag

      public void tag(CoreSession session, String docId, String label)
      Description copied from interface: TagService
      Tags a document with a given tag.
      Specified by:
      tag in interface TagService
      Parameters:
      session - the session
      docId - the document id
      label - the tag
    • untag

      public void untag(CoreSession session, String docId, String label)
      Description copied from interface: TagService
      Untags a document of the given tag
      Specified by:
      untag in interface TagService
      Parameters:
      session - the session
      docId - the document id
      label - the tag, or null for all tags
    • 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 interface TagService
      Parameters:
      session - the session
      docId - the document id
      label - the tag, or null for all tags
      Returns:
      whether or not the current session can untag provided document
    • getTags

      public Set<String> getTags(CoreSession session, String docId)
      Description copied from interface: TagService
      Gets the tags applied to a document.
      Specified by:
      getTags in interface TagService
      Parameters:
      session - the session
      docId - the document id
      Returns:
      the list of tags
    • removeTags

      public void removeTags(CoreSession session, String docId)
      Description copied from interface: TagService
      Removes all the tags applied to a document.
      Specified by:
      removeTags in interface TagService
    • copyTags

      public void copyTags(CoreSession session, String srcDocId, String dstDocId)
      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 interface TagService
      srcDocId - the source document id
      dstDocId - the destination document id
    • copyTags

      protected void copyTags(CoreSession session, String srcDocId, String dstDocId, boolean removeExistingTags)
    • replaceTags

      public void replaceTags(CoreSession session, String srcDocId, String dstDocId)
      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 interface TagService
      srcDocId - the source document id
      dstDocId - the destination document id
    • getTagDocumentIds

      public List<String> getTagDocumentIds(CoreSession session, String label)
      Description copied from interface: TagService
      Gets the documents to which a tag is applied.
      Specified by:
      getTagDocumentIds in interface TagService
      Parameters:
      session - the session
      label - the tag
      Returns:
      the set of document ids
    • getSuggestions

      public Set<String> getSuggestions(CoreSession session, String label)
      Description copied from interface: TagService
      Gets suggestions for a given tag label prefix.
      Specified by:
      getSuggestions in interface TagService
      Parameters:
      session - the session
      label - the tag label prefix
      Returns:
      a list of tags
    • isTagSanitizationEnabled

      protected boolean isTagSanitizationEnabled()
    • doTag

      public abstract void doTag(CoreSession session, String docId, String label, String username)
    • doUntag

      public abstract void doUntag(CoreSession session, String docId, String label)
    • doGetTags

      public abstract Set<String> doGetTags(CoreSession session, String docId)
    • doCopyTags

      public abstract void doCopyTags(CoreSession session, String srcDocId, String dstDocId, boolean removeExistingTags)
    • doGetTagDocumentIds

      public abstract List<String> doGetTagDocumentIds(CoreSession session, String label)
    • doGetTagSuggestions

      public abstract Set<String> doGetTagSuggestions(CoreSession session, String label)
    • cleanLabel

      protected String cleanLabel(String label, boolean allowEmpty, boolean allowPercent)
    • cleanUsername

      protected static String cleanUsername(String username)
    • getItems

      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.
      Since:
      6.0
    • fireUpdateEvent

      protected void fireUpdateEvent(CoreSession session, String docId)