Class DefaultNodeService

    • Constructor Detail

      • DefaultNodeService

        public DefaultNodeService()
    • Method Detail

      • delete

        public void delete​(String componentInstanceId)
        Description copied from interface: ComponentInstanceDeletion
        Deletes the resources belonging to the specified component instance. This method is invoked by Silverpeas when a component instance is being deleted.
        Specified by:
        delete in interface ComponentInstanceDeletion
        Parameters:
        componentInstanceId - the unique identifier of a component instance.
      • getDetailByNameAndFatherId

        public NodeDetail getDetailByNameAndFatherId​(NodePK pk,
                                                     String name,
                                                     int nodeFatherId)
        Description copied from interface: NodeService
        Gets complete details about the specified node with the given name and with as father the specified one.
        Specified by:
        getDetailByNameAndFatherId in interface NodeService
        Parameters:
        pk - the node primary key.
        name - the name of the node.
        nodeFatherId - the local unique identifier of the father of the asked node.
        Returns:
        a NodeDetail instance.
      • getDetail

        public NodeDetail getDetail​(NodePK pk)
        Get the attributes of a node and of its children
        Specified by:
        getDetail in interface NodeService
        Parameters:
        pk - the node primary key.
        Returns:
        a NodeDetail
        Since:
        1.0
        See Also:
        NodeDetail
      • getTree

        public List<NodeDetail> getTree​(NodePK pk)
        Description copied from interface: NodeService
        Gets all the nodes that are part of the tree rooted from the specified node.
        Specified by:
        getTree in interface NodeService
        Parameters:
        pk - the unique identifier of the root node of the tree.
        Returns:
        a list of nodes.
      • getSubTree

        public List<NodeDetail> getSubTree​(NodePK pk)
        Description copied from interface: NodeService
        Gets all the nodes that are part of the subtree from the specified node.
        Specified by:
        getSubTree in interface NodeService
        Parameters:
        pk - the unique identifier of the node from which the subtree should be returned.
        Returns:
        a list of nodes.
      • getSubTree

        public List<NodeDetail> getSubTree​(NodePK pk,
                                           String sorting)
        Description copied from interface: NodeService
        Gets all the nodes that are part of the subtree from the specified node and sorted according to the sorting argument.
        Specified by:
        getSubTree in interface NodeService
        Parameters:
        pk - the unique identifier of the node from which the subtree should be returned.
        sorting - a coma-separated list of node's attributes from which the returned list should be sorted.
        Returns:
        a list of nodes.
      • getSubTreeByStatus

        public List<NodeDetail> getSubTreeByStatus​(NodePK pk,
                                                   String status)
        Description copied from interface: NodeService
        Gets all the nodes that are part of the subtree from the specified node and having the given status.
        Specified by:
        getSubTreeByStatus in interface NodeService
        Parameters:
        pk - the unique identifier of the node from which the subtree should be returned.
        status - the status of the nodes to return.
        Returns:
        a list of nodes.
      • getSubTreeByStatus

        public List<NodeDetail> getSubTreeByStatus​(NodePK pk,
                                                   String status,
                                                   String sorting)
        Description copied from interface: NodeService
        Gets all the nodes that are part of the subtree from the specified node and having the given status.
        Specified by:
        getSubTreeByStatus in interface NodeService
        Parameters:
        pk - the unique identifier of the node from which the subtree should be returned.
        status - the status of the nodes to return.
        sorting - a coma-separated list of node's attributes from which the returned list should be sorted.
        Returns:
        a list of nodes.
      • getSubTreeByLevel

        public List<NodeDetail> getSubTreeByLevel​(NodePK pk,
                                                  int level)
        Description copied from interface: NodeService
        Gets all the nodes that are part of the subtree from the specified node down to the given deep level of the subtree.
        Specified by:
        getSubTreeByLevel in interface NodeService
        Parameters:
        pk - the unique identifier of the node from which the subtree should be returned.
        level - the level of the subtree to get.
        Returns:
        a list of nodes from the specified node down to the given level of the subtree.
      • getSubTreeByLevel

        public List<NodeDetail> getSubTreeByLevel​(NodePK pk,
                                                  int level,
                                                  String sorting)
        Description copied from interface: NodeService
        Gets all the nodes that are part of the subtree from the specified node down to the given deep level of the subtree.
        Specified by:
        getSubTreeByLevel in interface NodeService
        Parameters:
        pk - the unique identifier of the node from which the subtree should be returned.
        level - the level of the subtree to get.
        sorting - a coma-separated list of node's attributes from which the returned list should be sorted.
        Returns:
        a list of nodes from the specified node down to the given level of the subtree.
      • getSubTree

        public List<NodeDetail> getSubTree​(NodePK pk,
                                           String status,
                                           int level,
                                           String sorting)
        Description copied from interface: NodeService
        Gets all the nodes that are part of the subtree from the specified node down to the given deep level of the subtree and having the given status.
        Specified by:
        getSubTree in interface NodeService
        Parameters:
        pk - the unique identifier of the node from which the subtree should be returned.
        status - the status of the nodes to return.
        level - the level of the subtree to get.
        sorting - a coma-separated list of node's attributes from which the returned list should be sorted.
        Returns:
        a list of nodes.
      • moveNode

        public void moveNode​(NodePK nodePK,
                             NodePK toNode)
        Description copied from interface: NodeService
        Moves the specified node to the given another one that then will become its new father.
        Specified by:
        moveNode in interface NodeService
        Parameters:
        nodePK - the unique identifier of the node to move.
        toNode - the unique identifier of the new father of the node.
      • moveNode

        public void moveNode​(NodePK nodePK,
                             NodePK toNode,
                             boolean preserveRights)
        Description copied from interface: NodeService
        Moves the specified node to the given another one that then will become its new father.
        Specified by:
        moveNode in interface NodeService
        Parameters:
        nodePK - the unique identifier of the node to move.
        toNode - the unique identifier of the new father of the node.
        preserveRights - indicates if specific rights must be maintained or not
      • getHeader

        public NodeDetail getHeader​(NodePK pk,
                                    boolean getTranslations)
        Description copied from interface: NodeService
        Gets synthetic details about the specified node.
        Specified by:
        getHeader in interface NodeService
        Parameters:
        pk - the node primary key.
        getTranslations - a flag indicating if the translation has to be retrieved.
        Returns:
        a NodeDetail instance.
      • getHeader

        public NodeDetail getHeader​(NodePK pk)
        Get the attributes of THIS node
        Specified by:
        getHeader in interface NodeService
        Parameters:
        pk - the node primary key.
        Returns:
        a NodeDetail
        Since:
        1.0
        See Also:
        NodeDetail
      • setDetail

        public void setDetail​(NodeDetail nd)
        Update the attributes of the node
        Specified by:
        setDetail in interface NodeService
        Parameters:
        nd - the NodeDetail which contains updated data
        Since:
        1.0
        See Also:
        NodeDetail
      • removeNode

        public void removeNode​(NodePK pk)
        Remove a node and its descendants
        Specified by:
        removeNode in interface NodeService
        Parameters:
        pk - the node PK to delete
        Since:
        1.0
        See Also:
        NodePK
      • getPath

        public NodePath getPath​(NodePK pk)
        Get the path of this node from this node to root
        Specified by:
        getPath in interface NodeService
        Parameters:
        pk - The PK of the node
        Returns:
        a NodeDetail Collection (only header)
        Since:
        1.0
        See Also:
        NodeDetail, Collection
      • getMinimalDataByInstances

        public List<NodeDetail> getMinimalDataByInstances​(Collection<String> instanceIds)
        Description copied from interface: NodeService
        Selects massively simple data about nodes.

        For now, only the following data are retrieved:

        • nodeId
        • instanceId
        • rightsDependsOn
        This method is designed for process performance needs.

        Specified by:
        getMinimalDataByInstances in interface NodeService
        Parameters:
        instanceIds - the instance ids aimed.
        Returns:
        a list of NodeDetail instances.
      • createNode

        public NodePK createNode​(NodeDetail node)
        Description copied from interface: NodeService
        Creates a new node in Silverpeas.
        Specified by:
        createNode in interface NodeService
        Parameters:
        node - the details of the node to save.
        Returns:
        the unique identifier of the new node.
      • createNode

        public NodePK createNode​(NodeDetail nd,
                                 NodeDetail fatherDetail)
        Create a new Node object
        Specified by:
        createNode in interface NodeService
        Parameters:
        nd - the NodeDetail which contains data
        fatherDetail - the PK of the user who have create this node
        Returns:
        the NodePK of the new Node
        Since:
        1.0
        See Also:
        NodeDetail
      • isSameNameSameLevelOnCreation

        public boolean isSameNameSameLevelOnCreation​(NodeDetail nd)
        On node creation, check if another node have got the same name with same father
        Specified by:
        isSameNameSameLevelOnCreation in interface NodeService
        Parameters:
        nd - A NodeDetail contains new node data to compare
        Returns:
        true if there is already a node with same name with same father false else
        Since:
        1.0
        See Also:
        NodeDetail
      • isSameNameSameLevelOnUpdate

        public boolean isSameNameSameLevelOnUpdate​(NodeDetail nd)
        On node update, check if another node have got the same name with same father
        Specified by:
        isSameNameSameLevelOnUpdate in interface NodeService
        Parameters:
        nd - A NodeDetail contains new node data to compare
        Returns:
        true if there is already a node with same name with same father false else
        Since:
        1.0
        See Also:
        NodeDetail
      • processWysiwyg

        public void processWysiwyg​(NodePK nodePK)
        Description copied from interface: NodeService
        A wysiwyg's content has been added or modified to a node. Its content must be added to the indexed content of the node
        Specified by:
        processWysiwyg in interface NodeService
        Parameters:
        nodePK - the identifier of the node associated to the wysiwyg
      • updateRightsDependency

        public void updateRightsDependency​(NodeDetail nodeDetail)
        Description copied from interface: NodeService
        Updates the dependency on the access rights of the specified node.
        Specified by:
        updateRightsDependency in interface NodeService
        Parameters:
        nodeDetail - a node.
      • sortNodes

        public void sortNodes​(List<NodePK> nodePKs)
        Description copied from interface: NodeService
        Sorts the specified nodes in Silverpeas.
        Specified by:
        sortNodes in interface NodeService
        Parameters:
        nodePKs - a list of the unique identifiers of the nodes to sort.
      • createIndex

        public void createIndex​(NodeDetail nodeDetail)
        Description copied from interface: NodeService
        Indexes the specified node.
        Specified by:
        createIndex in interface NodeService
        Parameters:
        nodeDetail - a node.
      • deleteIndex

        public void deleteIndex​(NodePK pk)
        Called on : - removeNode()
        Specified by:
        deleteIndex in interface NodeService
        Parameters:
        pk - the unique identifier of the node.