@AlfrescoPublicApi
public interface NodeService
Amongst other things, this service must enforce the unique name check as mandated by the duplicate entity in the model.
<type name="cm:folder"> ... <associations> <child-association name="cm:contains"> ... <duplicate>false</duplicate> </child-association> </associations> </type>When duplicates are not allowed, and the cm:name property of a node changes, then the
org.alfresco.service.cmr.repository.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,
Map<QName,Serializable> aspectProperties)
Applies an aspect to the given node.
|
List<ChildAssociationRef> |
addChild(Collection<NodeRef> 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,
Map<QName,Serializable> 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,
Map<QName,Serializable> properties)
Creates a new, non-abstract, real node as a primary child of the given parent node.
|
StoreRef |
createStore(String protocol,
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) |
List<NodeRef> |
findNodes(NodeService.FindNodeParameters params) |
Set<NodeRef> |
getAllRootNodes(StoreRef storeRef) |
Set<QName> |
getAspects(NodeRef nodeRef) |
AssociationRef |
getAssoc(Long id)
Gets an association by ID.
|
List<ChildAssociationRef> |
getChildAssocs(NodeRef nodeRef)
Get all child associations of the given node.
|
List<ChildAssociationRef> |
getChildAssocs(NodeRef nodeRef,
QNamePattern typeQNamePattern,
QNamePattern qnamePattern)
Gets all child associations where the pattern of the association qualified
name is a match.
|
List<ChildAssociationRef> |
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.
|
List<ChildAssociationRef> |
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.
|
List<ChildAssociationRef> |
getChildAssocs(NodeRef nodeRef,
Set<QName> childNodeTypeQNames)
Retrieve immediate children of a given node where the child nodes are in the given inclusive list.
|
List<ChildAssociationRef> |
getChildAssocsByPropertyValue(NodeRef nodeRef,
QName propertyQName,
Serializable value)
Retrieve the immediate children of a given node based on the value of a property of those
children.
|
Collection<ChildAssociationRef> |
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,
String childName)
Get the node with the given name within the context of the parent node.
|
List<ChildAssociationRef> |
getChildrenByName(NodeRef nodeRef,
QName assocTypeQName,
Collection<String> childNames)
Get the nodes with the given names within the context of the parent node.
|
Long |
getNodeAclId(NodeRef nodeRef) |
NodeRef |
getNodeRef(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.
|
List<ChildAssociationRef> |
getParentAssocs(NodeRef nodeRef) |
List<ChildAssociationRef> |
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.
|
List<Path> |
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.
|
Map<QName,Serializable> |
getProperties(NodeRef nodeRef) |
Serializable |
getProperty(NodeRef nodeRef,
QName qname) |
NodeRef |
getRootNode(StoreRef storeRef) |
List<AssociationRef> |
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.
|
List<StoreRef> |
getStores()
Gets a list of all available node store references
|
List<AssociationRef> |
getTargetAssocs(NodeRef sourceRef,
QNamePattern qnamePattern)
Fetches all associations from the given source where the associations'
qualified names match the pattern provided.
|
List<AssociationRef> |
getTargetAssocsByPropertyValue(NodeRef sourceRef,
QNamePattern qnamePattern,
QName propertyQName,
Serializable propertyValue)
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,
List<NodeRef> 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,
Map<QName,Serializable> properties)
Replace all current properties on the node with the given properties.
|
void |
setProperty(NodeRef nodeRef,
QName qname,
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 List<StoreRef> getStores()
@Auditable(parameters={"protocol","identifier"}) StoreRef createStore(String protocol, String identifier) throws StoreExistsException
protocol
- 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(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") Set<NodeRef> 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, Map<QName,Serializable> 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 invalidorg.alfresco.service.cmr.repository.CyclicChildRelationshipException
- if the child partakes in a cyclic relationship after the addgetPrimaryParent(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
getChildAssocs(NodeRef)
,
getChildAssocs(NodeRef, QNamePattern, QNamePattern)
,
ChildAssociationRef.getNthSibling()
@Auditable(parameters="nodeRef") QName getType(NodeRef nodeRef) throws InvalidNodeRefException
nodeRef
- NodeRefInvalidNodeRefException
- 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, Map<QName,Serializable> aspectProperties) throws InvalidNodeRefException, InvalidAspectException
nodeRef
- NodeRefaspectTypeQName
- 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
- NodeRefaspectTypeQName
- 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
- NodeRefaspectTypeQName
- QNameInvalidNodeRefException
- if the node could not be foundInvalidAspectException
- if the aspect reference is invalid@Auditable(parameters="nodeRef") Set<QName> getAspects(NodeRef nodeRef) throws InvalidNodeRefException
nodeRef
- NodeRefInvalidNodeRefException
- 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.
Node stores may be mapped to an associated archive node store. For example, Alfresco ships with the mapping
workspace://SpacesStore
.. maps to .. archive://SpacesStore
.
When a node is deleted:
restore
feature to return a node back to its original store.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 foundorg.alfresco.service.cmr.repository.CyclicChildRelationshipException
- if the child partakes in a cyclic relationship after the add@Auditable(parameters={"parentRefs","childRef","assocTypeQName","qname"}) List<ChildAssociationRef> addChild(Collection<NodeRef> 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 foundorg.alfresco.service.cmr.repository.CyclicChildRelationshipException
- 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)
removeSecondaryChildAssociation(ChildAssociationRef)
@Auditable(parameters="childAssocRef") boolean removeSecondaryChildAssociation(ChildAssociationRef childAssocRef)
childAssocRef
- the association to removeIllegalArgumentException
- if the association is primary@Auditable(parameters="nodeRef") Map<QName,Serializable> getProperties(NodeRef nodeRef) throws InvalidNodeRefException
nodeRef
- NodeRefInvalidNodeRefException
- if the node could not be found@Auditable(parameters="nodeRef") Long getNodeAclId(NodeRef nodeRef) throws InvalidNodeRefException
nodeRef
- NodeRefInvalidNodeRefException
- if the node could not be found@Auditable(parameters={"nodeRef","qname"}) Serializable getProperty(NodeRef nodeRef, QName qname) throws InvalidNodeRefException
nodeRef
- NodeRefqname
- the qualified name of the propertyInvalidNodeRefException
- if the node could not be found@Auditable(parameters={"nodeRef","properties"}) void setProperties(NodeRef nodeRef, Map<QName,Serializable> properties) throws InvalidNodeRefException
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, Map<QName,Serializable> 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, Serializable value) throws InvalidNodeRefException
Serializable
instance.
NOTE: Null values are allowed.
nodeRef
- a reference to an existing nodeqname
- the fully qualified name of the propertyvalue
- 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") List<ChildAssociationRef> getParentAssocs(NodeRef nodeRef) throws InvalidNodeRefException
nodeRef
- the child nodeInvalidNodeRefException
- if the node could not be foundgetParentAssocs(NodeRef, QNamePattern, QNamePattern)
@Auditable(parameters={"nodeRef","typeQNamePattern","qnamePattern"}) List<ChildAssociationRef> 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()
,
setChildAssociationIndex(ChildAssociationRef, int)
,
QName
,
RegexQNamePattern.MATCH_ALL
@Auditable(parameters="nodeRef") List<ChildAssociationRef> 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 foundgetChildAssocs(NodeRef, QNamePattern, QNamePattern)
,
setChildAssociationIndex(ChildAssociationRef, int)
,
ChildAssociationRef.getNthSibling()
@Auditable(parameters={"nodeRef","typeQNamePattern","qnamePattern"}) List<ChildAssociationRef> 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
,
getChildAssocs(NodeRef, QNamePattern, QNamePattern, int, boolean)
@Auditable(parameters={"nodeRef","typeQNamePattern","qnamePattern","maxResults","preload"}) List<ChildAssociationRef> 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"}) List<ChildAssociationRef> 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
,
getChildAssocs(NodeRef, QNamePattern, QNamePattern, int, boolean)
@Auditable(parameters={"nodeRef","childNodeTypes"}) List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, Set<QName> childNodeTypeQNames)
nodeRef
- the parent node - usually a containerchildNodeTypeQNames
- 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"}) List<ChildAssociationRef> getChildAssocsByPropertyValue(NodeRef nodeRef, QName propertyQName, 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, 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"}) List<ChildAssociationRef> getChildrenByName(NodeRef nodeRef, QName assocTypeQName, Collection<String> childNames)
childNames
- a collection of up to 1000 child names to match ongetChildByName(NodeRef, QName, String)
@Auditable(parameters="nodeRef") ChildAssociationRef getPrimaryParent(NodeRef nodeRef) throws InvalidNodeRefException
For a root node, the parent node reference will be null.
nodeRef
- NodeRefInvalidNodeRefException
- if the node could not be found@Auditable(parameters={"parent","assocTypeQName"}) Collection<ChildAssociationRef> 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 nodessetAssociations(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, List<NodeRef> targetRefs)
sourceRef
- the source nodeassocTypeQName
- the specific type of the associationtargetRefs
- the target nodes (not null but empty list is accepted).AssociationRef getAssoc(Long id)
id
- the association idnull
if it does not exist@Auditable(parameters={"sourceRef","qnamePattern"}) List<AssociationRef> 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={"sourceRef","qnamePattern","propertyQName","propertyValue"}) List<AssociationRef> getTargetAssocsByPropertyValue(NodeRef sourceRef, QNamePattern qnamePattern, QName propertyQName, Serializable propertyValue)
sourceRef
- the association sourceqnamePattern
- the association qname pattern to match againstpropertyQName
- the fully qualified name of the property of the association target. Optional parameter - can be null.propertyValue
- association target property 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. If propertyQName is null the value is ignored.AssociationRef
instances for which the
given node is a sourceInvalidNodeRefException
- if the source node could not beIllegalArgumentException
- if propertyQName is a system maintained propertyQName
,
RegexQNamePattern.MATCH_ALL
@Auditable(parameters={"targetRef","qnamePattern"}) List<AssociationRef> 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
- NodeRefInvalidNodeRefException
- if the node could not be foundgetPaths(NodeRef, boolean)
@Auditable(parameters={"nodeRef","primaryOnly"}) List<Path> getPaths(NodeRef nodeRef, boolean primaryOnly) throws InvalidNodeRefException
nodeRef
- NodeRefprimaryOnly
- 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. This would have been applied when a node was originally deleted
.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 originalList<NodeRef> 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–2018 Alfresco Software. All rights reserved.