Interface TaggingService

    • Method Detail

      • isTag

        @NotAuditable
        boolean isTag​(StoreRef storeRef,
                      String tag)
        Indicates whether the tag already exists
        Parameters:
        storeRef - store reference
        tag - tag name
        Returns:
        boolean true if the tag exists, false otherwise
      • getTags

        @NotAuditable
        List<String> getTags​(StoreRef storeRef,
                             String filter)
        Get all the tags currently available that match the provided filter.
        Parameters:
        storeRef - store reference
        filter - tag filter
        Returns:
        list of tags
      • deleteTag

        @Auditable(parameters="tag")
        void deleteTag​(StoreRef storeRef,
                       String tag)
        Delete an existing tag and any references to it(cascade delete).
        Parameters:
        storeRef - store reference
        tag - tag name
      • hasTag

        @Auditable(parameters="tag")
        boolean hasTag​(NodeRef nodeRef,
                       String tag)
        Indicates whether a node has the specified tag or not.
        Parameters:
        nodeRef - node reference
        tag - tag name
        Returns:
        boolean true if the node has the tag, false otherwise
      • addTag

        @Auditable(parameters="tag")
        NodeRef addTag​(NodeRef nodeRef,
                       String tag)
        Add a tag to a node. Creating the tag if it does not already exist.
        Parameters:
        nodeRef - node reference
        tag - tag name
      • getTagNodeRef

        @NotAuditable
        NodeRef getTagNodeRef​(StoreRef storeRef,
                              String tag)
        Gets the node reference for a given tag.

        Returns null if tag is not present.

        Parameters:
        storeRef - store reference
        tag - tag
        Returns:
        NodeRef tag node reference or null not exist
      • removeTag

        @Auditable(parameters="tag")
        void removeTag​(NodeRef nodeRef,
                       String tag)
        Remove a tag from a node.
        Parameters:
        nodeRef - node reference
        tag - tag name
      • removeTags

        @Auditable(parameters="tags")
        void removeTags​(NodeRef nodeRef,
                        List<String> tags)
        Removes a list of tags from a node.
        Parameters:
        nodeRef - node reference
        tags - list of tags
      • getTags

        @NotAuditable
        List<String> getTags​(NodeRef nodeRef)
        Get all the tags on a node
        Parameters:
        nodeRef - node reference
        Returns:
        list of tags on the node
      • setTags

        @Auditable(parameters="tags")
        void setTags​(NodeRef nodeRef,
                     List<String> tags)
        Sets the list of tags that are applied to a node, replaces any existing tags with those provided.
        Parameters:
        nodeRef - node reference
        tags - list of tags
      • clearTags

        @Auditable
        void clearTags​(NodeRef nodeRef)
        Clears all tags from an already tagged node.
        Parameters:
        nodeRef - node reference
      • isTagScope

        @NotAuditable
        boolean isTagScope​(NodeRef nodeRef)
        Indicates whether the node reference is a tag scope
        Parameters:
        nodeRef - node reference
        Returns:
        boolean true if node is a tag scope, false otherwise
      • addTagScope

        @Auditable
        void addTagScope​(NodeRef nodeRef)
        Adds a tag scope to the specified node
        Parameters:
        nodeRef - node reference
      • refreshTagScope

        @Auditable
        void refreshTagScope​(NodeRef nodeRef,
                             boolean async)
        Refreshes the tag count of the passed tag scope by recounting all the tags of the children of the scope.
        Parameters:
        nodeRef - tag scope node reference
        async - indicates whether the tag scope refresh should happen asynchronously or not
      • removeTagScope

        @Auditable
        void removeTagScope​(NodeRef nodeRef)
        Removes a tag scope from a specified node. Note that any tag count information will be lost when the scope if removed.
        Parameters:
        nodeRef - node reference
      • findTagScope

        @NotAuditable
        TagScope findTagScope​(NodeRef nodeRef)
        Finds the 'nearest' tag scope for the specified node.

        The 'nearest' tag scope is discovered by walking up the primary parent path until a tag scope is found or the root node is reached.

        If no tag scope if found then a null value is returned.

        Parameters:
        nodeRef - node reference
        Returns:
        the 'nearest' tag scope or null if none found
      • findAllTagScopes

        @NotAuditable
        List<TagScope> findAllTagScopes​(NodeRef nodeRef)
        Finds all the tag scopes for the specified node.

        The resulting list of tag scopes is ordered with the 'nearest' at the bedining of the list.

        If no tag scopes are found an empty list is returned.

        Parameters:
        nodeRef - node reference
        Returns:
        list of tag scopes
      • findTaggedNodes

        @NotAuditable
        List<NodeRef> findTaggedNodes​(StoreRef storeRef,
                                      String tag)
        Find all nodes that have been tagged with the specified tag.
        Parameters:
        tag - tag name
        Returns:
        list of nodes tagged with specified tag, empty of none found
      • findTaggedNodes

        @NotAuditable
        List<NodeRef> findTaggedNodes​(StoreRef storeRef,
                                      String tag,
                                      NodeRef nodeRef)
        Find all nodes that have been tagged with the specified tag and reside within the context of the node reference provided.
        Parameters:
        tag - tag name
        nodeRef - node providing context for the search
        Returns:
        list of nodes tagged in the context specified, empty if none found
      • getPagedTags

        @NotAuditable
        Pair<List<String>,​Integer> getPagedTags​(StoreRef storeRef,
                                                      int fromTag,
                                                      int pageSize)
        Get page of the tags currently available
        Parameters:
        storeRef - node reference
        fromTag - offset
        pageSize - page size
        Returns:
        pair of tag names and total count
      • getPagedTags

        @NotAuditable
        Pair<List<String>,​Integer> getPagedTags​(StoreRef storeRef,
                                                      String filter,
                                                      int fromTag,
                                                      int pageSize)
        Parameters:
        storeRef - node reference
        filter - tag filter
        fromTag - page offset
        pageSize - page size
        Returns:
        pair of tag names and total count
      • findTaggedNodesAndCountByTagName

        @NotAuditable
        List<Pair<String,​Integer>> findTaggedNodesAndCountByTagName​(StoreRef storeRef)
        Get tagged nodes and count of nodes group by tag name
        Parameters:
        storeRef -
        Returns: