Interface TagService

All Known Implementing Classes:
AbstractTagService, FacetedTagService

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
  • Field Details

  • Method Details

    • 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 session
      docId - the document id
      label - the tag
      Since:
      9.3
    • untag

      void untag(CoreSession session, String docId, String label)
      Untags a document of the given tag
      Parameters:
      session - the session
      docId - the document id
      label - the tag, or null for all tags
    • 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 session
      docId - the document id
      label - the tag, or null 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 session
      docId - the document id
      Returns:
      the list of tags
      Since:
      9.3
    • 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 id
      dstDocId - 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 id
      dstDocId - 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 session
      label - the tag
      Returns:
      the set of document ids
      Since:
      9.3
    • getSuggestions

      Set<String> getSuggestions(CoreSession session, String label)
      Gets suggestions for a given tag label prefix.
      Parameters:
      session - the session
      label - the tag label prefix
      Returns:
      a list of tags
      Since:
      9.3
    • supportsTag

      boolean supportsTag(CoreSession session, String docId)
      Checks if document support tag.
      Since:
      9.3