Interface TagService

    • Method Detail

      • 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
      • tag

        @Deprecated
        void tag​(CoreSession session,
                 String docId,
                 String label,
                 String username)
        Deprecated.
        since 9.3, username is not needed anymore
        Tags a document with a given tag.
        Parameters:
        session - the session
        docId - the document id
        label - the tag
        username - the user associated to the tagging
      • 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
      • untag

        @Deprecated
        void untag​(CoreSession session,
                   String docId,
                   String label,
                   String username)
        Deprecated.
        since 9.3, username is not needed anymore
        Untags a document of the given tag
        Parameters:
        session - the session
        docId - the document id
        label - the tag, or null for all tags
        username - the user associated to the tagging
      • 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<StringgetTags​(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
      • getDocumentTags

        @Deprecated
        List<TaggetDocumentTags​(CoreSession session,
                                  String docId,
                                  String username)
        Deprecated.
        since 9.3, username is not needed anymore
        Gets the tags applied to a document by a given user, or by all users.
        Parameters:
        session - the session
        docId - the document id
        username - the user name, or null for all users
        Returns:
        the list of tags
      • getDocumentTags

        @Deprecated
        List<TaggetDocumentTags​(CoreSession session,
                                  String docId,
                                  String username,
                                  boolean useCore)
        Deprecated.
        since 9.3, username and useCore are not needed anymore
        Gets the tags applied to a document by a given user, or by all users.

        Alternative method allowing to specify whether the core should be used for this query.

        Parameters:
        session - the session
        docId - the document id
        username - the user name, or null for all users
        useCore - if true, the core should be used to retrieve tags.
        Returns:
        the list of tags
        Since:
        6.0
      • 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<StringgetTagDocumentIds​(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
      • getTagDocumentIds

        @Deprecated
        List<StringgetTagDocumentIds​(CoreSession session,
                                       String label,
                                       String username)
        Deprecated.
        since 9.3, username is not needed anymore
        Gets the documents to which a tag is applied.
        Parameters:
        session - the session
        label - the tag
        username - the user name, or null for all users
        Returns:
        the set of document ids
      • getTagCloud

        @Deprecated
        List<TaggetTagCloud​(CoreSession session,
                              String docId,
                              String username,
                              Boolean normalize)
        Deprecated.
        since 9.3, seems unused
        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 session
        docId - the document id under which to look, or null for all documents
        username - the user name, or null for all users
        normalize - 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)
      • getSuggestions

        Set<StringgetSuggestions​(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
      • getSuggestions

        @Deprecated
        List<TaggetSuggestions​(CoreSession session,
                                 String label,
                                 String username)
        Deprecated.
        since 9.3, username is not needed anymore
        Gets suggestions for a given tag label prefix.
        Parameters:
        session - the session
        label - the tag label prefix
        username - the user name, or null for all users
        Returns:
        a list of tags