@AlfrescoPublicApi
public interface NodeService
Amongst other things, this service must enforce the unique name check as mandated by the duplicate entity in the model.
When duplicates are not allowed, and the cm:name property of a node changes, then the... ... false
DuplicateChildNodeNameException
exception must be thrown. Client code can catch this exception and deal with it
appropriately.Modifier and Type | Interface and Description |
---|---|
static class |
NodeService.FindNodeParameters
General node-find parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addAspect(NodeRef nodeRef,
QName aspectTypeQName,
java.util.Map aspectProperties)
Applies an aspect to the given node.
|
java.util.List |
addChild(java.util.Collection parentRefs,
NodeRef childRef,
QName assocTypeQName,
QName qname)
Associates a given child node with a given collection of parents.
|
ChildAssociationRef |
addChild(NodeRef parentRef,
NodeRef childRef,
QName assocTypeQName,
QName qname)
Makes a parent-child association between the given nodes.
|
void |
addProperties(NodeRef nodeRef,
java.util.Map properties)
Add all given properties to the node.
|
int |
countChildAssocs(NodeRef nodeRef,
boolean isPrimary)
Counts the number of child associations of nodeRef.
|
AssociationRef |
createAssociation(NodeRef sourceRef,
NodeRef targetRef,
QName assocTypeQName)
Create a peer association between two nodes.
|
ChildAssociationRef |
createNode(NodeRef parentRef,
QName assocTypeQName,
QName assocQName,
QName nodeTypeQName) |
ChildAssociationRef |
createNode(NodeRef parentRef,
QName assocTypeQName,
QName assocQName,
QName nodeTypeQName,
java.util.Map properties)
Creates a new, non-abstract, real node as a primary child of the given parent node.
|
StoreRef |
createStore(java.lang.String protocol,
java.lang.String identifier)
Create a new store for the given protocol and identifier.
|
void |
deleteNode(NodeRef nodeRef)
Deletes the given node.
|
void |
deleteStore(StoreRef storeRef)
Delete a store and all its contents.
|
boolean |
exists(NodeRef nodeRef) |
boolean |
exists(StoreRef storeRef) |
java.util.List |
findNodes(NodeService.FindNodeParameters params) |
java.util.Set |
getAllRootNodes(StoreRef storeRef) |
java.util.Set |
getAspects(NodeRef nodeRef) |
AssociationRef |
getAssoc(java.lang.Long id)
Gets an association by ID.
|
java.util.List |
getChildAssocs(NodeRef nodeRef)
Get all child associations of the given node.
|
java.util.List |
getChildAssocs(NodeRef nodeRef,
QNamePattern typeQNamePattern,
QNamePattern qnamePattern)
Gets all child associations where the pattern of the association qualified
name is a match.
|
java.util.List |
getChildAssocs(NodeRef nodeRef,
QNamePattern typeQNamePattern,
QNamePattern qnamePattern,
boolean preload)
Gets all child associations where the pattern of the association qualified
names match the patterns provided.
|
java.util.List |
getChildAssocs(NodeRef nodeRef,
QNamePattern typeQNamePattern,
QNamePattern qnamePattern,
int maxResults,
boolean preload)
Gets all child associations where the pattern of the association qualified
name is an exact match.
|
java.util.List |
getChildAssocs(NodeRef nodeRef,
java.util.Set childNodeTypeQNames)
Retrieve immediate children of a given node where the child nodes are in the given inclusive list.
|
java.util.List |
getChildAssocsByPropertyValue(NodeRef nodeRef,
QName propertyQName,
java.io.Serializable value)
Retrieve the immediate children of a given node based on the value of a property of those
children.
|
java.util.Collection |
getChildAssocsWithoutParentAssocsOfType(NodeRef parent,
QName assocTypeQName)
Gets the set of child associations of a certain parent node without parent associations of a certain type to
other nodes with the same parent! In effect the 'orphans' with respect to a certain association type.
|
NodeRef |
getChildByName(NodeRef nodeRef,
QName assocTypeQName,
java.lang.String childName)
Get the node with the given name within the context of the parent node.
|
java.util.List |
getChildrenByName(NodeRef nodeRef,
QName assocTypeQName,
java.util.Collection childNames)
Get the nodes with the given names within the context of the parent node.
|
java.lang.Long |
getNodeAclId(NodeRef nodeRef) |
NodeRef |
getNodeRef(java.lang.Long nodeId)
Get the node reference for a given node DB ID
|
NodeRef.Status |
getNodeStatus(NodeRef nodeRef)
Gets the ID of the last transaction that caused the node to change.
|
java.util.List |
getParentAssocs(NodeRef nodeRef) |
java.util.List |
getParentAssocs(NodeRef nodeRef,
QNamePattern typeQNamePattern,
QNamePattern qnamePattern)
Gets all parent associations where the pattern of the association qualified
name is a match
|
Path |
getPath(NodeRef nodeRef)
The root node has an entry in the path(s) returned.
|
java.util.List |
getPaths(NodeRef nodeRef,
boolean primaryOnly)
The root node has an entry in the path(s) returned.
|
ChildAssociationRef |
getPrimaryParent(NodeRef nodeRef)
Fetches the primary parent-child relationship.
|
java.util.Map |
getProperties(NodeRef nodeRef) |
java.io.Serializable |
getProperty(NodeRef nodeRef,
QName qname) |
NodeRef |
getRootNode(StoreRef storeRef) |
java.util.List |
getSourceAssocs(NodeRef targetRef,
QNamePattern qnamePattern)
Fetches all associations to the given target where the associations'
qualified names match the pattern provided.
|
NodeRef |
getStoreArchiveNode(StoreRef storeRef)
Get the node where archived items will have gone when deleted from the given store.
|
java.util.List |
getStores()
Gets a list of all available node store references
|
java.util.List |
getTargetAssocs(NodeRef sourceRef,
QNamePattern qnamePattern)
Fetches all associations from the given source where the associations'
qualified names match the pattern provided.
|
QName |
getType(NodeRef nodeRef) |
boolean |
hasAspect(NodeRef nodeRef,
QName aspectTypeQName)
Determines if a given aspect is present on a node.
|
ChildAssociationRef |
moveNode(NodeRef nodeToMoveRef,
NodeRef newParentRef,
QName assocTypeQName,
QName assocQName)
Moves the primary location of the given node.
|
void |
removeAspect(NodeRef nodeRef,
QName aspectTypeQName)
Remove an aspect and all related properties from a node
|
void |
removeAssociation(NodeRef sourceRef,
NodeRef targetRef,
QName assocTypeQName) |
void |
removeChild(NodeRef parentRef,
NodeRef childRef)
Severs all parent-child relationships between two nodes.
|
boolean |
removeChildAssociation(ChildAssociationRef childAssocRef)
Remove a specific child association.
|
void |
removeProperty(NodeRef nodeRef,
QName qname)
Removes a property value completely.
|
boolean |
removeSeconaryChildAssociation(ChildAssociationRef childAssocRef)
Deprecated.
|
boolean |
removeSecondaryChildAssociation(ChildAssociationRef childAssocRef)
Remove a specific secondary child association.
|
NodeRef |
restoreNode(NodeRef archivedNodeRef,
NodeRef destinationParentNodeRef,
QName assocTypeQName,
QName assocQName)
Restore an individual node (along with its sub-tree nodes) to the target location.
|
void |
setAssociations(NodeRef sourceRef,
QName assocTypeQName,
java.util.List targetRefs)
Re-assign all typed target associations for a given node.
|
void |
setChildAssociationIndex(ChildAssociationRef childAssocRef,
int index)
Set the ordering index of the child association.
|
void |
setProperties(NodeRef nodeRef,
java.util.Map properties)
Set the values of all properties to be an
Serializable instances. |
void |
setProperty(NodeRef nodeRef,
QName qname,
java.io.Serializable value)
Sets the value of a property to be any
Serializable instance. |
void |
setType(NodeRef nodeRef,
QName typeQName)
Re-sets the type of the node.
|
@Auditable java.util.List getStores()
@Auditable(parameters={"protocol", "identifier"}) StoreRef createStore(java.lang.String protocol, java.lang.String identifier) throws StoreExistsException
protocolthe
- implementation protocolidentifier
- the protocol-specific identifierStoreExistsException
@Auditable(parameters="storeRef") void deleteStore(StoreRef storeRef)
storeRef
- the store to deleteInvalidStoreRefException
- if the store reference is invalid@Auditable(parameters="storeRef") boolean exists(StoreRef storeRef)
storeRef
- a reference to the store to look for@Auditable(parameters="nodeRef") boolean exists(NodeRef nodeRef)
nodeRef
- a reference to the node to look for@Auditable(parameters="nodeRef") NodeRef.Status getNodeStatus(NodeRef nodeRef)
nodeRef
- a reference to a current or previously existing node@Auditable(parameters="nodeId") NodeRef getNodeRef(java.lang.Long nodeId)
nodeId
- the node's DB ID@Auditable(parameters="storeRef") NodeRef getRootNode(StoreRef storeRef) throws InvalidStoreRefException
storeRef
- a reference to an existing storeInvalidStoreRefException
- if the store could not be found@Auditable(parameters="storeRef") java.util.Set getAllRootNodes(StoreRef storeRef)
storeRef
- a reference to an existing storeInvalidStoreRefException
- if the store could not be found@Auditable(parameters={"parentRef", "assocTypeQName", "assocQName", "nodeTypeQName"}) ChildAssociationRef createNode(NodeRef parentRef, QName assocTypeQName, QName assocQName, QName nodeTypeQName) throws InvalidNodeRefException, InvalidTypeException
@Auditable(parameters={"parentRef", "assocTypeQName", "assocQName", "nodeTypeQName", "properties"}) ChildAssociationRef createNode(NodeRef parentRef, QName assocTypeQName, QName assocQName, QName nodeTypeQName, java.util.Map properties) throws InvalidNodeRefException, InvalidTypeException
parentRef
- the parent nodeassocTypeQName
- the type of the association to create. This is used
for verification against the data dictionary.assocQName
- the qualified name of the associationnodeTypeQName
- a reference to the node typeproperties
- optional map of properties to keyed by their qualified namesInvalidNodeRefException
- if the parent reference is invalidInvalidTypeException
- if the node type reference is not recognisedDictionaryService
@Auditable(parameters={"nodeToMoveRef", "newParentRef", "assocTypeQName", "assocQName"}) ChildAssociationRef moveNode(NodeRef nodeToMoveRef, NodeRef newParentRef, QName assocTypeQName, QName assocQName) throws InvalidNodeRefException
This involves changing the node's primary parent and possibly the name of the association referencing it.
If the new parent is in a different store from the original, then the entire node hierarchy is moved to the new store. Inter-store associations are not affected.
nodeToMoveRef
- the node to movenewParentRef
- the new parent of the moved nodeassocTypeQName
- the type of the association to create. This is used
for verification against the data dictionary.assocQName
- the qualified name of the new child associationInvalidNodeRefException
- if either the parent node or move node reference is invalidCyclicChildRelationshipException
- if the child partakes in a cyclic relationship after the addNodeService.getPrimaryParent(NodeRef)
@Auditable(parameters={"childAssocRef", "index"}) void setChildAssociationIndex(ChildAssociationRef childAssocRef, int index) throws InvalidChildAssociationRefException
childAssocRef
- the child association that must be moved in the orderindex
- an arbitrary index that will affect the return orderInvalidChildAssociationRefException
NodeService.getChildAssocs(NodeRef)
,
NodeService.getChildAssocs(NodeRef, QNamePattern, QNamePattern)
,
ChildAssociationRef.getNthSibling()
@Auditable(parameters="nodeRef") QName getType(NodeRef nodeRef) throws InvalidNodeRefException
nodeRef
- InvalidNodeRefException
- if the node could not be foundDictionaryService
@Auditable(parameters={"nodeRef", "typeQName"}) void setType(NodeRef nodeRef, QName typeQName) throws InvalidNodeRefException
nodeRef
- the node referencetypeQName
- the type QNameInvalidNodeRefException
@Auditable(parameters={"nodeRef", "aspectTypeQName", "aspectProperties"}) void addAspect(NodeRef nodeRef, QName aspectTypeQName, java.util.Map aspectProperties) throws InvalidNodeRefException, InvalidAspectException
nodeRef
- aspectTypeQName
- the aspect to apply to the nodeaspectProperties
- a minimum of the mandatory properties required for
the aspectInvalidNodeRefException
InvalidAspectException
- if the class reference is not to a valid aspectDictionaryService.getAspect(QName)
,
ClassDefinition.getProperties()
@Auditable(parameters={"nodeRef", "aspectTypeQName"}) void removeAspect(NodeRef nodeRef, QName aspectTypeQName) throws InvalidNodeRefException, InvalidAspectException
nodeRef
- aspectTypeQName
- the type of aspect to removeInvalidNodeRefException
- if the node could not be foundInvalidAspectException
- if the the aspect is unknown or if the
aspect is mandatory for the class of the node@Auditable(parameters={"nodeRef", "aspectTypeQName"}) boolean hasAspect(NodeRef nodeRef, QName aspectTypeQName) throws InvalidNodeRefException, InvalidAspectException
nodeRef
- aspectTypeQName
- InvalidNodeRefException
- if the node could not be foundInvalidAspectException
- if the aspect reference is invalid@Auditable(parameters="nodeRef") java.util.Set getAspects(NodeRef nodeRef) throws InvalidNodeRefException
nodeRef
- InvalidNodeRefException
- if the node could not be found@Auditable(parameters="nodeRef") void deleteNode(NodeRef nodeRef) throws InvalidNodeRefException
All associations (both children and regular node associations) will be deleted, and where the given node is the primary parent, the children will also be cascade deleted.
nodeRef
- reference to a node within a storeInvalidNodeRefException
- if the reference given is invalid@Auditable(parameters={"parentRef", "childRef", "assocTypeQName", "qname"}) ChildAssociationRef addChild(NodeRef parentRef, NodeRef childRef, QName assocTypeQName, QName qname) throws InvalidNodeRefException
parentRef
- the parent nodechildRef
- the child nodeassocTypeQName
- the qualified name of the association type as defined in the datadictionaryqname
- the qualified name of the associationInvalidNodeRefException
- if the parent or child nodes could not be foundCyclicChildRelationshipException
- if the child partakes in a cyclic relationship after the add@Auditable(parameters={"parentRefs", "childRef", "assocTypeQName", "qname"}) java.util.List addChild(java.util.Collection parentRefs, NodeRef childRef, QName assocTypeQName, QName qname) throws InvalidNodeRefException
parentRefs
- the parent nodes (there will be this many associations created).childRef
- the child nodeassocTypeQName
- the qualified name of the association type as defined in the datadictionaryqname
- the qualified name of the associationInvalidNodeRefException
- if the parent or child nodes could not be foundCyclicChildRelationshipException
- if the child partakes in a cyclic relationship after the add@Auditable(parameters={"parentRef", "childRef"}) void removeChild(NodeRef parentRef, NodeRef childRef) throws InvalidNodeRefException
The child node will be cascade deleted if one of the associations was the primary association, i.e. the one with which the child node was created.
parentRef
- the parent end of the associationchildRef
- the child end of the associationInvalidNodeRefException
- if the parent or child nodes could not be found@Auditable(parameters="childAssocRef") boolean removeChildAssociation(ChildAssociationRef childAssocRef)
The child node will be cascade deleted if the association was the primary association, i.e. the one with which the child node was created.
childAssocRef
- the association to remove@Auditable(parameters="childAssocRef") boolean removeSeconaryChildAssociation(ChildAssociationRef childAssocRef)
NodeService.removeSecondaryChildAssociation(ChildAssociationRef)
@Auditable(parameters="childAssocRef") boolean removeSecondaryChildAssociation(ChildAssociationRef childAssocRef)
childAssocRef
- the association to removejava.lang.IllegalArgumentException
- if the association is primary@Auditable(parameters="nodeRef") java.util.Map getProperties(NodeRef nodeRef) throws InvalidNodeRefException
nodeRef
- InvalidNodeRefException
- if the node could not be found@Auditable(parameters="nodeRef") java.lang.Long getNodeAclId(NodeRef nodeRef) throws InvalidNodeRefException
nodeRef
- InvalidNodeRefException
- if the node could not be found@Auditable(parameters={"nodeRef", "qname"}) java.io.Serializable getProperty(NodeRef nodeRef, QName qname) throws InvalidNodeRefException
nodeRef
- qname
- the qualified name of the propertyInvalidNodeRefException
- if the node could not be found@Auditable(parameters={"nodeRef", "properties"}) void setProperties(NodeRef nodeRef, java.util.Map properties) throws InvalidNodeRefException
Serializable
instances.
The properties given must still fulfill the requirements of the class and
aspects relevant to the node.
NOTE: Null values are allowed.
nodeRef
- the node to chanceproperties
- all the properties of the node keyed by their qualified namesInvalidNodeRefException
- if the node could not be found@Auditable(parameters={"nodeRef", "properties"}) void addProperties(NodeRef nodeRef, java.util.Map properties) throws InvalidNodeRefException
NOTE: Null values are allowed and will replace the existing value.
nodeRef
- the node to changeproperties
- the properties to change, keyed by their qualified namesInvalidNodeRefException
- if the node could not be found@Auditable(parameters={"nodeRef", "qname", "value"}) void setProperty(NodeRef nodeRef, QName qname, java.io.Serializable value) throws InvalidNodeRefException
Serializable
instance.
NOTE: Null values are allowed.
nodeRef
- a reference to an existing nodeqname
- the fully qualified name of the propertypropertyValue
- the value of the property - never nullInvalidNodeRefException
- if the node could not be found@Auditable(parameters={"nodeRef", "qname"}) void removeProperty(NodeRef nodeRef, QName qname) throws InvalidNodeRefException
nodeRef
- a reference to an existing nodeqname
- the fully qualified name of the propertyInvalidNodeRefException
- if the node could not be found@Auditable(parameters="nodeRef") java.util.List getParentAssocs(NodeRef nodeRef) throws InvalidNodeRefException
nodeRef
- the child nodeInvalidNodeRefException
- if the node could not be foundNodeService.getParentAssocs(NodeRef, QNamePattern, QNamePattern)
@Auditable(parameters={"nodeRef", "typeQNamePattern", "qnamePattern"}) java.util.List getParentAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) throws InvalidNodeRefException
The resultant list is ordered by (a) explicit index and (b) association creation time.
nodeRef
- the child nodetypeQNamePattern
- the pattern that the type qualified name of the association must matchqnamePattern
- the pattern that the qnames of the assocs must matchInvalidNodeRefException
- if the node could not be foundChildAssociationRef.getNthSibling()
,
NodeService.setChildAssociationIndex(ChildAssociationRef, int)
,
QName
,
RegexQNamePattern.MATCH_ALL
@Auditable(parameters="nodeRef") java.util.List getChildAssocs(NodeRef nodeRef) throws InvalidNodeRefException
The resultant list is ordered by (a) explicit index and (b) association creation time.
nodeRef
- the parent node - usually a containerChildAssocRef
instances. If the
node is not a container then the result will be empty.InvalidNodeRefException
- if the node could not be foundNodeService.getChildAssocs(NodeRef, QNamePattern, QNamePattern)
,
NodeService.setChildAssociationIndex(ChildAssociationRef, int)
,
ChildAssociationRef.getNthSibling()
@Auditable(parameters={"nodeRef", "typeQNamePattern", "qnamePattern"}) java.util.List getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) throws InvalidNodeRefException
wildcard
for the type and a specific qualified name
for the association is
akin to using the XPath browse expression ./{url}localname in the context of the
parent node.
Note that all child associations are fetched and preloading is done for all results.nodeRef
- the parent node - usually a containertypeQNamePattern
- the pattern that the type qualified name of the association must matchqnamePattern
- the pattern that the qnames of the assocs must matchChildAssociationRef
instances. If the
node is not a container then the result will be empty.InvalidNodeRefException
- if the node could not be foundQName
,
RegexQNamePattern.MATCH_ALL
,
NodeService.getChildAssocs(NodeRef, QNamePattern, QNamePattern, int, boolean)
@Auditable(parameters={"nodeRef", "typeQNamePattern", "qnamePattern", "maxResults", "preload"}) java.util.List getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern, int maxResults, boolean preload) throws InvalidNodeRefException
nodeRef
- the parent node - usually a containertypeQNamePattern
- the qualified name of the association (null to ignore)qnamePattern
- the path qualified name (null to ignore)maxResults
- the number of results to getpreload
- true if the nodes must be preloaded into the cacheChildAssociationRef
instancesInvalidNodeRefException
- if the node could not be foundQName
@Auditable(parameters={"nodeRef", "typeQNamePattern", "qnamePattern"}) java.util.List getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern, boolean preload) throws InvalidNodeRefException
nodeRef
- the parent node - usually a containertypeQNamePattern
- the qualified name pattern of the associationqnamePattern
- the path qualified name patternpreload
- true if the nodes must be preloaded into the cacheChildAssociationRef
instancesInvalidNodeRefException
- if the node could not be foundRegexQNamePattern.MATCH_ALL
,
QName
,
NodeService.getChildAssocs(NodeRef, QNamePattern, QNamePattern, int, boolean)
@Auditable(parameters={"nodeRef", "childNodeTypes"}) java.util.List getChildAssocs(NodeRef nodeRef, java.util.Set childNodeTypeQNames)
nodeRef
- the parent node - usually a containerchildNodeTypes
- the types that the children may be. Subtypes are not automatically calculated
and the list must therefore be exhaustive.ChildAssociationRef
instances.InvalidNodeRefException
- if the node could not be found@Auditable(parameters={"nodeRef", "propertyQName", "value"}) java.util.List getChildAssocsByPropertyValue(NodeRef nodeRef, QName propertyQName, java.io.Serializable value)
If the property to be searched is multi-valued then will match on any one values.
Please note, the following system maintained properties that cannot be used with this method.
nodeRef
- the parent node - usually a containerpropertyQName
- the fully qualified name of the propertyvalue
- the value to search for. Must be a simple type such as
String, Number, Date or Boolean, it cannot be a collection,
a content property, MLText or a float.ChildAssociationRef
instances.@Auditable(parameters={"nodeRef", "assocTypeQName", "childName"}) NodeRef getChildByName(NodeRef nodeRef, QName assocTypeQName, java.lang.String childName)
That API method getChildByName only works for associations that don't allow duplicate child names. See cm:folder and the duplicate tag. Child associations without this allow duplicate child names and therefore it is possible to have multiple children with the same name stored against the given association type.
nodeRef
- the parent node - usuall a containerassocTypeQName
- the type of the associationchildName
- the name of the node as per the property cm:name@Auditable(parameters={"nodeRef", "assocTypeQName", "childName"}) java.util.List getChildrenByName(NodeRef nodeRef, QName assocTypeQName, java.util.Collection childNames)
childNames
- a collection of up to 1000 child names to match on#getChildByName(NodeRef, QName, String)}
@Auditable(parameters="nodeRef") ChildAssociationRef getPrimaryParent(NodeRef nodeRef) throws InvalidNodeRefException
For a root node, the parent node reference will be null.
nodeRef
- InvalidNodeRefException
- if the node could not be found@Auditable(parameters={"parent", "assocTypeQName"}) java.util.Collection getChildAssocsWithoutParentAssocsOfType(NodeRef parent, QName assocTypeQName)
parent
- the parent node referenceassocTypeQName
- the association type QName@Auditable(parameters={"sourceRef", "targetRef", "assocTypeQName"}) AssociationRef createAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName) throws InvalidNodeRefException, AssociationExistsException
setAssociations
.sourceRef
- a reference to a real nodetargetRef
- a reference to a nodeassocTypeQName
- the qualified name of the association typeInvalidNodeRefException
- if either of the nodes could not be foundAssociationExistsException
- if an association of the same type exists between the nodesNodeService.setAssociations(NodeRef, QName, List)
@Auditable(parameters={"sourceRef", "targetRef", "assocTypeQName"}) void removeAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName) throws InvalidNodeRefException
sourceRef
- the associaton source nodetargetRef
- the association target nodeassocTypeQName
- the qualified name of the association typeInvalidNodeRefException
- if either of the nodes could not be found@Auditable(parameters={"sourceRef", "assocTypeQName", "targetRefs"}) void setAssociations(NodeRef sourceRef, QName assocTypeQName, java.util.List targetRefs)
sourceRef
- the source nodeassocTypeQName
- the specific type of the associationtargetRefs
- the target nodes (not null but empty list is accepted).AssociationRef getAssoc(java.lang.Long id)
assocId
- the association idnull
if it does not exist@Auditable(parameters={"sourceRef", "qnamePattern"}) java.util.List getTargetAssocs(NodeRef sourceRef, QNamePattern qnamePattern) throws InvalidNodeRefException
sourceRef
- the association sourceqnamePattern
- the association qname pattern to match againstNodeAssocRef
instances for which the
given node is a sourceInvalidNodeRefException
- if the source node could not be foundQName
,
RegexQNamePattern.MATCH_ALL
@Auditable(parameters={"targetRef", "qnamePattern"}) java.util.List getSourceAssocs(NodeRef targetRef, QNamePattern qnamePattern) throws InvalidNodeRefException
targetRef
- the association targetqnamePattern
- the association qname pattern to match againstNodeAssocRef
instances for which the
given node is a targetInvalidNodeRefException
QName
,
RegexQNamePattern.MATCH_ALL
@Auditable(parameters="nodeRef") Path getPath(NodeRef nodeRef) throws InvalidNodeRefException
nodeRef
- InvalidNodeRefException
- if the node could not be foundNodeService.getPaths(NodeRef, boolean)
@Auditable(parameters={"nodeRef", "primaryOnly"}) java.util.List getPaths(NodeRef nodeRef, boolean primaryOnly) throws InvalidNodeRefException
nodeRef
- primaryOnly
- true if only the primary path must be retrieved. If true, the
result will have exactly one entry.InvalidNodeRefException
- if the node could not be found@Auditable(parameters="storeRef") NodeRef getStoreArchiveNode(StoreRef storeRef)
storeRef
- the store that items were deleted from@Auditable(parameters={"archivedNodeRef", "destinationParentNodeRef", "assocTypeQName", "assocQName"}) NodeRef restoreNode(NodeRef archivedNodeRef, NodeRef destinationParentNodeRef, QName assocTypeQName, QName assocQName)
archived aspect
set against it.archivedNodeRef
- the archived nodedestinationParentNodeRef
- the parent to move the node into
or null to use the originalassocTypeQName
- the primary association type name to use in the new location
or null to use the originalassocQName
- the primary association name to use in the new location
or null to use the originaljava.util.List findNodes(NodeService.FindNodeParameters params)
@Auditable(parameters={"nodeRef", "isPrimary"}) int countChildAssocs(NodeRef nodeRef, boolean isPrimary) throws InvalidNodeRefException
nodeRef
- the parent node idisPrimary
- count just primary associations?InvalidNodeRefException
Copyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.