Package org.silverpeas.core.node.service
Interface NodeService
-
- All Known Implementing Classes:
DefaultNodeService
public interface NodeService
Service working on a nodes in a graph.- Author:
- Nicolas Eysseric
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
createIndex(NodeDetail nodeDetail)
Indexes the specified node.NodePK
createNode(NodeDetail nodeDetail)
Creates a new node in Silverpeas.NodePK
createNode(NodeDetail nodeDetail, NodeDetail fatherDetail)
Creates a new node in Silverpeas.void
deleteIndex(NodePK pk)
Unindexes the specified node.static NodeService
get()
Collection<NodeDetail>
getAllNodes(NodePK nodePK)
Gets all the nodes that are part of the tree of nodes managed by the same component instance that the specified node.Collection<NodeDetail>
getChildrenDetails(NodePK pk)
Gets the details of all of the children of the specified node.Collection<NodePK>
getChildrenPKs(NodePK nodePK)
Gets all the identifier of the children of the specified node.List<NodeDetail>
getDescendantDetails(NodeDetail node)
Gets all the descendants of the specified node.List<NodeDetail>
getDescendantDetails(NodePK nodePK)
Gets all the descendants of the specified node.Collection<NodePK>
getDescendantPKs(NodePK nodePK)
Gets the identifiers of all of the descendants of the specified node.NodeDetail
getDetail(NodePK pk)
Gets complete details about the specified node.NodeDetail
getDetailByNameAndFatherId(NodePK pk, String name, int nodeFatherId)
Gets complete details about the specified node with the given name and with as father the specified one.NodeDetail
getHeader(NodePK pk)
Gets synthetic details about the specified node without any translations.NodeDetail
getHeader(NodePK pk, boolean getTranslations)
Gets synthetic details about the specified node.List<NodeDetail>
getHeadersByLevel(NodePK pk, int level)
Gets the synthetic details of all the nodes that are managed by the same component instance that the specified node down to the deep level of the tree of nodes to return.List<NodeDetail>
getMinimalDataByInstances(Collection<String> instanceIds)
Selects massively simple data about nodes.NodePath
getPath(NodePK pk)
Gets the path of the specified node from the root one.List<NodeDetail>
getSubTree(NodePK pk)
Gets all the nodes that are part of the subtree from the specified node.List<NodeDetail>
getSubTree(NodePK pk, String sorting)
Gets all the nodes that are part of the subtree from the specified node and sorted according to the sorting argument.List<NodeDetail>
getSubTree(NodePK pk, String status, int level, String sorting)
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.List<NodeDetail>
getSubTreeByLevel(NodePK pk, int level)
Gets all the nodes that are part of the subtree from the specified node down to the given deep level of the subtree.List<NodeDetail>
getSubTreeByLevel(NodePK pk, int level, String sorting)
Gets all the nodes that are part of the subtree from the specified node down to the given deep level of the subtree.List<NodeDetail>
getSubTreeByStatus(NodePK pk, String status)
Gets all the nodes that are part of the subtree from the specified node and having the given status.List<NodeDetail>
getSubTreeByStatus(NodePK pk, String status, String sorting)
Gets all the nodes that are part of the subtree from the specified node and having the given status.List<NodeDetail>
getTree(NodePK pk)
Gets all the nodes that are part of the tree rooted from the specified node.boolean
isSameNameSameLevelOnCreation(NodeDetail nd)
On node creation, check if another node have got the same name with same fatherboolean
isSameNameSameLevelOnUpdate(NodeDetail nd)
On node update, check if another node have got the same name with same fathervoid
moveNode(NodePK nodePK, NodePK toNode)
Moves the specified node to the given another one that then will become its new father.void
moveNode(NodePK nodePK, NodePK toNode, boolean preserveRights)
Moves the specified node to the given another one that then will become its new father.void
processWysiwyg(NodePK nodePK)
A wysiwyg's content has been added or modified to a node.void
removeNode(NodePK pk)
Removes a node and its descendantsvoid
setDetail(NodeDetail nodeDetail)
Updates the specified node.void
sortNodes(List<NodePK> nodePKs)
Sorts the specified nodes in Silverpeas.void
updateRightsDependency(NodeDetail nodeDetail)
Updates the dependency on the access rights of the specified node.
-
-
-
Method Detail
-
get
static NodeService get()
-
getHeader
NodeDetail getHeader(NodePK pk)
Gets synthetic details about the specified node without any translations.- Parameters:
pk
- the node primary key.- Returns:
- a
NodeDetail
instance.
-
getHeader
NodeDetail getHeader(NodePK pk, boolean getTranslations)
Gets synthetic details about the specified node.- Parameters:
pk
- the node primary key.getTranslations
- a flag indicating if the translation has to be retrieved.- Returns:
- a
NodeDetail
instance.
-
getDetail
NodeDetail getDetail(NodePK pk)
Gets complete details about the specified node.- Parameters:
pk
- the node primary key.- Returns:
- a
NodeDetail
instance.
-
getDetailByNameAndFatherId
NodeDetail getDetailByNameAndFatherId(NodePK pk, String name, int nodeFatherId)
Gets complete details about the specified node with the given name and with as father the specified one.- 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.
-
getTree
List<NodeDetail> getTree(NodePK pk)
Gets all the nodes that are part of the tree rooted from the specified node.- Parameters:
pk
- the unique identifier of the root node of the tree.- Returns:
- a list of nodes.
-
getSubTree
List<NodeDetail> getSubTree(NodePK pk)
Gets all the nodes that are part of the subtree from the specified node.- Parameters:
pk
- the unique identifier of the node from which the subtree should be returned.- Returns:
- a list of nodes.
-
getSubTree
List<NodeDetail> getSubTree(NodePK pk, String sorting)
Gets all the nodes that are part of the subtree from the specified node and sorted according to the sorting argument.- 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
List<NodeDetail> getSubTreeByStatus(NodePK pk, String status)
Gets all the nodes that are part of the subtree from the specified node and having the given status.- 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
List<NodeDetail> getSubTreeByStatus(NodePK pk, String status, String sorting)
Gets all the nodes that are part of the subtree from the specified node and having the given status.- 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
List<NodeDetail> getSubTreeByLevel(NodePK pk, int level)
Gets all the nodes that are part of the subtree from the specified node down to the given deep level of the subtree.- 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
List<NodeDetail> getSubTreeByLevel(NodePK pk, int level, String sorting)
Gets all the nodes that are part of the subtree from the specified node down to the given deep level of the subtree.- 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
List<NodeDetail> getSubTree(NodePK pk, String status, int level, String sorting)
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.- 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.
-
getHeadersByLevel
List<NodeDetail> getHeadersByLevel(NodePK pk, int level)
Gets the synthetic details of all the nodes that are managed by the same component instance that the specified node down to the deep level of the tree of nodes to return.- Parameters:
pk
- the unique identifier of a node.level
- the level of the subtree to get.- Returns:
- a list of all nodes of a given component instance.
-
getAllNodes
Collection<NodeDetail> getAllNodes(NodePK nodePK)
Gets all the nodes that are part of the tree of nodes managed by the same component instance that the specified node.- Parameters:
nodePK
- the unique identifier of a node.- Returns:
- all the nodes of the component instance referred by the specified node.
-
getMinimalDataByInstances
List<NodeDetail> getMinimalDataByInstances(Collection<String> instanceIds)
Selects massively simple data about nodes.For now, only the following data are retrieved:
- nodeId
- instanceId
- rightsDependsOn
- Parameters:
instanceIds
- the instance ids aimed.- Returns:
- a list of
NodeDetail
instances.
-
getPath
NodePath getPath(NodePK pk)
Gets the path of the specified node from the root one.- Parameters:
pk
- the unique identifier of the node in the data source.- Returns:
- the path of the node as a
NodePath
instance.
-
getChildrenDetails
Collection<NodeDetail> getChildrenDetails(NodePK pk)
Gets the details of all of the children of the specified node.- Parameters:
pk
- the node primary key.- Returns:
- a collection of nodes.
-
setDetail
void setDetail(NodeDetail nodeDetail)
Updates the specified node.- Parameters:
nodeDetail
- the details of the node with which it will be updated.
-
createNode
NodePK createNode(NodeDetail nodeDetail, NodeDetail fatherDetail)
Creates a new node in Silverpeas.- Parameters:
nodeDetail
- the details of the node to save.fatherDetail
- the parent of the node to save.- Returns:
- the unique identifier of the new node.
-
createNode
NodePK createNode(NodeDetail nodeDetail)
Creates a new node in Silverpeas.- Parameters:
nodeDetail
- the details of the node to save.- Returns:
- the unique identifier of the new node.
-
removeNode
void removeNode(NodePK pk)
Removes a node and its descendants- Parameters:
pk
- the unique identifier of the node to remove.- See Also:
NodePK
-
moveNode
void moveNode(NodePK nodePK, NodePK toNode)
Moves the specified node to the given another one that then will become its new father.- Parameters:
nodePK
- the unique identifier of the node to move.toNode
- the unique identifier of the new father of the node.
-
moveNode
void moveNode(NodePK nodePK, NodePK toNode, boolean preserveRights)
Moves the specified node to the given another one that then will become its new father.- 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
-
isSameNameSameLevelOnCreation
boolean isSameNameSameLevelOnCreation(NodeDetail nd)
On node creation, check if another node have got the same name with same father- 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
-
isSameNameSameLevelOnUpdate
boolean isSameNameSameLevelOnUpdate(NodeDetail nd)
On node update, check if another node have got the same name with same father- 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
-
getChildrenPKs
Collection<NodePK> getChildrenPKs(NodePK nodePK)
Gets all the identifier of the children of the specified node.
-
getDescendantPKs
Collection<NodePK> getDescendantPKs(NodePK nodePK)
Gets the identifiers of all of the descendants of the specified node.
-
getDescendantDetails
List<NodeDetail> getDescendantDetails(NodePK nodePK)
Gets all the descendants of the specified node.- Parameters:
nodePK
- the unique identifier of a node.- Returns:
- A collection of
NodePK
instances. - See Also:
NodeDetail
-
getDescendantDetails
List<NodeDetail> getDescendantDetails(NodeDetail node)
Gets all the descendants of the specified node.- Parameters:
node
- a node.- Returns:
- A collection of
NodePK
instances. - See Also:
NodeDetail
-
processWysiwyg
void processWysiwyg(NodePK nodePK)
A wysiwyg's content has been added or modified to a node. Its content must be added to the indexed content of the node- Parameters:
nodePK
- the identifier of the node associated to the wysiwyg
-
updateRightsDependency
void updateRightsDependency(NodeDetail nodeDetail)
Updates the dependency on the access rights of the specified node.- Parameters:
nodeDetail
- a node.
-
createIndex
void createIndex(NodeDetail nodeDetail)
Indexes the specified node.- Parameters:
nodeDetail
- a node.
-
deleteIndex
void deleteIndex(NodePK pk)
Unindexes the specified node.- Parameters:
pk
- the unique identifier of the node.
-
-