org.alfresco.repo.node.db
Class DbNodeServiceImpl

java.lang.Object
  extended by org.alfresco.repo.node.AbstractNodeServiceImpl
      extended by org.alfresco.repo.node.db.DbNodeServiceImpl
All Implemented Interfaces:
NodeService

public class DbNodeServiceImpl
extends AbstractNodeServiceImpl

Node service using database persistence layer to fulfill functionality


Field Summary
 
Fields inherited from class org.alfresco.repo.node.AbstractNodeServiceImpl
dictionaryService, storesToIgnorePolicies, tenantService, transactionService
 
Constructor Summary
DbNodeServiceImpl()
           
 
Method Summary
 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 assocQName)
          Associates a given child node with a given collection of parents.
 ChildAssociationRef addChild(NodeRef parentRef, NodeRef childRef, QName assocTypeQName, QName assocQName)
          Makes a parent-child association between the given nodes.
 void addProperties(NodeRef nodeRef, java.util.Map properties)
          Add all given properties to the node.
 AssociationRef createAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName)
           
 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)
          Defers to the typed service
 void deleteNode(NodeRef nodeRef)
          Delete Node
 void deleteStore(StoreRef storeRef)
          Delete a store and all its contents.
 boolean exists(NodeRef nodeRef)
           
 boolean exists(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, QNamePattern typeQNamePattern, QNamePattern qnamePattern)
          Filters out any associations if their qname is not a match to the given pattern.
 java.util.List getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern, boolean preload)
          Filters out any associations if their qname is not a match to the given pattern.
 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 and not in the given exclusive list.
 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.
 NodeRef.Status getNodeStatus(NodeRef nodeRef)
          Gets the ID of the last transaction that caused the node to change.
 java.util.List getParentAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern)
          Filters out any associations if their qname is not a match to the given pattern.
 java.util.Collection getParents(NodeRef nodeRef)
           
 Path getPath(NodeRef nodeRef)
          The root node has an entry in the path(s) returned.
 java.util.List getPaths(NodeRef nodeRef, boolean primaryOnly)
          When searching for primaryOnly == true, checks that there is exactly one path.
 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 aspectQName)
          Performs a check on the set of node aspects
 void indexChildren(org.alfresco.util.Pair nodePair, boolean cascade)
           
 ChildAssociationRef moveNode(NodeRef nodeToMoveRef, NodeRef newParentRef, QName assocTypeQName, QName assocQName)
          Move Node Drops the old primary association and creates a new one
 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)
          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 setAvmNodeService(NodeService avmNodeService)
           
 void setCascadeInTransaction(boolean cascadeInTransaction)
          Deprecated. the functionality did not see wide enough usage to warrant the maintenance
 void setChildAssociationIndex(ChildAssociationRef childAssocRef, int index)
          Set the ordering index of the child association.
 void setNodeDaoService(NodeDaoService nodeDaoService)
           
 void setNodeIndexer(NodeIndexer nodeIndexer)
           
 void setProperties(NodeRef nodeRef, java.util.Map properties)
          Ensures that all required properties are present on the node and copies the property values to the Node.
 void setProperty(NodeRef nodeRef, QName qname, java.io.Serializable value)
          Gets the properties map, sets the value (null is allowed) and checks that the new set of properties is valid.
 void setStoreArchiveMap(StoreArchiveMap storeArchiveMap)
           
 void setType(NodeRef nodeRef, QName typeQName)
          Re-sets the type of the node.
 
Methods inherited from class org.alfresco.repo.node.AbstractNodeServiceImpl
equals, generateGuid, getChildAssocs, getDefaultProperties, getDefaultProperties, getParentAssocs, getTypeAndAspectQNames, hashCode, init, invokeBeforeAddAspect, invokeBeforeCreateChildAssociation, invokeBeforeCreateNode, invokeBeforeCreateNodeAssociation, invokeBeforeCreateStore, invokeBeforeDeleteChildAssociation, invokeBeforeDeleteNode, invokeBeforeRemoveAspect, invokeBeforeUpdateNode, invokeOnAddAspect, invokeOnCreateAssociation, invokeOnCreateChildAssociation, invokeOnCreateNode, invokeOnCreateNodeAssociation, invokeOnCreateStore, invokeOnDeleteAssociation, invokeOnDeleteChildAssociation, invokeOnDeleteNode, invokeOnMoveNode, invokeOnRemoveAspect, invokeOnUpdateNode, invokeOnUpdateProperties, setDictionaryService, setPolicyComponent, setStoresToIgnorePolicies, setTenantService, setTransactionService
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbNodeServiceImpl

public DbNodeServiceImpl()
Method Detail

setNodeDaoService

public void setNodeDaoService(NodeDaoService nodeDaoService)

setStoreArchiveMap

public void setStoreArchiveMap(StoreArchiveMap storeArchiveMap)

setAvmNodeService

public void setAvmNodeService(NodeService avmNodeService)

setNodeIndexer

public void setNodeIndexer(NodeIndexer nodeIndexer)
Parameters:
nodeIndexer - the indexer that will be notified of node additions, modifications and deletions

setCascadeInTransaction

public void setCascadeInTransaction(boolean cascadeInTransaction)
Deprecated. the functionality did not see wide enough usage to warrant the maintenance


exists

public boolean exists(StoreRef storeRef)
Parameters:
storeRef - a reference to the store to look for
Returns:
Returns true if the store exists, otherwise false

exists

public boolean exists(NodeRef nodeRef)
Parameters:
nodeRef - a reference to the node to look for
Returns:
Returns true if the node exists, otherwise false

getNodeStatus

public NodeRef.Status getNodeStatus(NodeRef nodeRef)
Description copied from interface: NodeService
Gets the ID of the last transaction that caused the node to change. This includes deletions, so it is possible that the node being referenced no longer exists. If the node never existed, then null is returned.

Parameters:
nodeRef - a reference to a current or previously existing node
Returns:
Returns the status of the node, or null if the node never existed

getStores

public java.util.List getStores()
Description copied from interface: NodeService
Gets a list of all available node store references

Returns:
Returns a list of store references
See Also:
NodeDaoService.getStores()

createStore

public StoreRef createStore(java.lang.String protocol,
                            java.lang.String identifier)
Defers to the typed service

identifier - the protocol-specific identifier
Returns:
Returns a reference to the store
See Also:
StoreDaoService#createWorkspace(String)

deleteStore

public void deleteStore(StoreRef storeRef)
                 throws InvalidStoreRefException
Description copied from interface: NodeService
Delete a store and all its contents.

Parameters:
storeRef - the store to delete
Throws:
java.lang.UnsupportedOperationException - Always
InvalidStoreRefException - if the store reference is invalid

getRootNode

public NodeRef getRootNode(StoreRef storeRef)
                    throws InvalidStoreRefException
Parameters:
storeRef - a reference to an existing store
Returns:
Returns a reference to the root node of the store
Throws:
InvalidStoreRefException - if the store could not be found

createNode

public ChildAssociationRef createNode(NodeRef parentRef,
                                      QName assocTypeQName,
                                      QName assocQName,
                                      QName nodeTypeQName)
See Also:
DbNodeServiceImpl.createNode(NodeRef, QName, QName, QName, Map)

createNode

public ChildAssociationRef createNode(NodeRef parentRef,
                                      QName assocTypeQName,
                                      QName assocQName,
                                      QName nodeTypeQName,
                                      java.util.Map properties)
Description copied from interface: NodeService
Creates a new, non-abstract, real node as a primary child of the given parent node.

Parameters:
parentRef - the parent node
assocTypeQName - the type of the association to create. This is used for verification against the data dictionary.
assocQName - the qualified name of the association
nodeTypeQName - a reference to the node type
properties - optional map of properties to keyed by their qualified names
Returns:
Returns a reference to the newly created child association
See Also:
NodeService.createNode(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName, org.alfresco.service.namespace.QName, org.alfresco.service.namespace.QName, java.util.Map)

setChildAssociationIndex

public void setChildAssociationIndex(ChildAssociationRef childAssocRef,
                                     int index)
Description copied from interface: NodeService
Set the ordering index of the child association. This affects the ordering of of the return values of methods that return a set of children or child associations.

Parameters:
childAssocRef - the child association that must be moved in the order
index - an arbitrary index that will affect the return order
See Also:
NodeService.getChildAssocs(NodeRef), NodeService.getChildAssocs(NodeRef, QNamePattern, QNamePattern), ChildAssociationRef.getNthSibling()

getType

public QName getType(NodeRef nodeRef)
              throws InvalidNodeRefException
Returns:
Returns the type name
Throws:
InvalidNodeRefException - if the node could not be found
See Also:
DictionaryService

setType

public void setType(NodeRef nodeRef,
                    QName typeQName)
             throws InvalidNodeRefException
Description copied from interface: NodeService
Re-sets the type of the node. Can be called in order specialise a node to a sub-type. This should be used with caution since calling it changes the type of the node and thus implies a different set of aspects, properties and associations. It is the calling codes responsibility to ensure that the node is in a approriate state after changing the type.

Parameters:
nodeRef - the node reference
typeQName - the type QName
Throws:
InvalidNodeRefException
See Also:
NodeService.setType(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName)

addAspect

public void addAspect(NodeRef nodeRef,
                      QName aspectTypeQName,
                      java.util.Map aspectProperties)
               throws InvalidNodeRefException,
                      InvalidAspectException
Description copied from interface: NodeService
Applies an aspect to the given node. After this method has been called, the node with have all the aspect-related properties present

aspectTypeQName - the aspect to apply to the node
aspectProperties - a minimum of the mandatory properties required for the aspect
Throws:
InvalidNodeRefException
InvalidAspectException - if the class reference is not to a valid aspect
See Also:
Node.getAspects()

removeAspect

public void removeAspect(NodeRef nodeRef,
                         QName aspectTypeQName)
                  throws InvalidNodeRefException,
                         InvalidAspectException
Description copied from interface: NodeService
Remove an aspect and all related properties from a node

aspectTypeQName - the type of aspect to remove
Throws:
InvalidNodeRefException - if the node could not be found
InvalidAspectException - if the the aspect is unknown or if the aspect is mandatory for the class of the node

hasAspect

public boolean hasAspect(NodeRef nodeRef,
                         QName aspectQName)
                  throws InvalidNodeRefException,
                         InvalidAspectException
Performs a check on the set of node aspects

Returns:
Returns true if the aspect has been applied to the given node, otherwise false
Throws:
InvalidNodeRefException - if the node could not be found
InvalidAspectException - if the aspect reference is invalid

getAspects

public java.util.Set getAspects(NodeRef nodeRef)
                         throws InvalidNodeRefException
Returns:
Returns a set of all aspects applied to the node, including mandatory aspects
Throws:
InvalidNodeRefException - if the node could not be found

deleteNode

public void deleteNode(NodeRef nodeRef)
Delete Node

Parameters:
nodeRef - reference to a node within a store

addChild

public ChildAssociationRef addChild(NodeRef parentRef,
                                    NodeRef childRef,
                                    QName assocTypeQName,
                                    QName assocQName)
Description copied from interface: NodeService
Makes a parent-child association between the given nodes. Both nodes must belong to the same store.

assocTypeQName - the qualified name of the association type as defined in the datadictionary
assocQName - the qualified name of the association
Returns:
Returns a reference to the newly created child association

addChild

public java.util.List addChild(java.util.Collection parentRefs,
                               NodeRef childRef,
                               QName assocTypeQName,
                               QName assocQName)
Description copied from interface: NodeService
Associates a given child node with a given collection of parents. All nodes must belong to the same store.

assocTypeQName - the qualified name of the association type as defined in the datadictionary
assocQName - the qualified name of the association
Returns:
Returns a reference to the newly created child association

removeChild

public void removeChild(NodeRef parentRef,
                        NodeRef childRef)
                 throws InvalidNodeRefException
Description copied from interface: NodeService
Severs all parent-child relationships between two nodes.

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.

Parameters:
parentRef - the parent end of the association
childRef - the child end of the association
Throws:
InvalidNodeRefException - if the parent or child nodes could not be found

removeChildAssociation

public boolean removeChildAssociation(ChildAssociationRef childAssocRef)
Description copied from interface: NodeService
Remove a specific child association.

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.

Parameters:
childAssocRef - the association to remove
Returns:
Returns true if the association existed, otherwise false.

removeSeconaryChildAssociation

public boolean removeSeconaryChildAssociation(ChildAssociationRef childAssocRef)
Description copied from interface: NodeService
Remove a specific secondary child association.

Parameters:
childAssocRef - the association to remove
Returns:
Returns true if the association existed, otherwise false.

getProperty

public java.io.Serializable getProperty(NodeRef nodeRef,
                                        QName qname)
                                 throws InvalidNodeRefException
qname - the qualified name of the property
Returns:
Returns the value of the property, or null if not yet set
Throws:
InvalidNodeRefException - if the node could not be found

getProperties

public java.util.Map getProperties(NodeRef nodeRef)
                            throws InvalidNodeRefException
Returns:
Returns all properties keyed by their qualified name
Throws:
InvalidNodeRefException - if the node could not be found

setProperty

public void setProperty(NodeRef nodeRef,
                        QName qname,
                        java.io.Serializable value)
                 throws InvalidNodeRefException
Gets the properties map, sets the value (null is allowed) and checks that the new set of properties is valid.

Parameters:
nodeRef - a reference to an existing node
qname - the fully qualified name of the property
Throws:
InvalidNodeRefException - if the node could not be found
See Also:
DbNodeServiceImpl.NullPropertyValue

setProperties

public void setProperties(NodeRef nodeRef,
                          java.util.Map properties)
                   throws InvalidNodeRefException
Ensures that all required properties are present on the node and copies the property values to the Node.

To remove a property, remove it from the map before calling this method. Null-valued properties are allowed.

If any of the values are null, a marker object is put in to mimic nulls. They will be turned back into a real nulls when the properties are requested again.

Parameters:
nodeRef - the node to chance
properties - all the properties of the node keyed by their qualified names
Throws:
InvalidNodeRefException - if the node could not be found
See Also:
Node.getProperties()

addProperties

public void addProperties(NodeRef nodeRef,
                          java.util.Map properties)
                   throws InvalidNodeRefException
Description copied from interface: NodeService
Add all given properties to the node.

NOTE: Null values are allowed and will replace the existing value.

Parameters:
nodeRef - the node to change
properties - the properties to change, keyed by their qualified names
Throws:
InvalidNodeRefException - if the node could not be found

removeProperty

public void removeProperty(NodeRef nodeRef,
                           QName qname)
                    throws InvalidNodeRefException
Description copied from interface: NodeService
Removes a property value completely.

Parameters:
nodeRef - a reference to an existing node
qname - the fully qualified name of the property
Throws:
InvalidNodeRefException - if the node could not be found

getParents

public java.util.Collection getParents(NodeRef nodeRef)
                                throws InvalidNodeRefException
Throws:
InvalidNodeRefException

getParentAssocs

public java.util.List getParentAssocs(NodeRef nodeRef,
                                      QNamePattern typeQNamePattern,
                                      QNamePattern qnamePattern)
Filters out any associations if their qname is not a match to the given pattern.

Parameters:
nodeRef - the child node
typeQNamePattern - the pattern that the type qualified name of the association must match
qnamePattern - the pattern that the qnames of the assocs must match
Returns:
Returns a list of all parent-child associations that exist where the given node is the child
See Also:
ChildAssociationRef.getNthSibling(), NodeService.setChildAssociationIndex(ChildAssociationRef, int), QName, RegexQNamePattern.MATCH_ALL

getChildAssocs

public java.util.List getChildAssocs(NodeRef nodeRef,
                                     QNamePattern typeQNamePattern,
                                     QNamePattern qnamePattern)
Filters out any associations if their qname is not a match to the given pattern.

Parameters:
nodeRef - the parent node - usually a container
typeQNamePattern - the pattern that the type qualified name of the association must match
qnamePattern - the pattern that the qnames of the assocs must match
Returns:
Returns a list of ChildAssociationRef instances. If the node is not a container then the result will be empty.
See Also:
QName, RegexQNamePattern.MATCH_ALL

getChildAssocs

public java.util.List getChildAssocs(NodeRef nodeRef,
                                     QNamePattern typeQNamePattern,
                                     QNamePattern qnamePattern,
                                     boolean preload)
Filters out any associations if their qname is not a match to the given pattern.

Parameters:
nodeRef - the parent node - usually a container
typeQNamePattern - the pattern that the type qualified name of the association must match
qnamePattern - the pattern that the qnames of the assocs must match
preload - should the nodes be preloaded into the cache?
Returns:
Returns a list of ChildAssociationRef instances. If the node is not a container then the result will be empty.
See Also:
QName, RegexQNamePattern.MATCH_ALL

getChildAssocs

public java.util.List getChildAssocs(NodeRef nodeRef,
                                     java.util.Set childNodeTypeQNames)
Description copied from interface: NodeService
Retrieve immediate children of a given node where the child nodes are in the given inclusive list and not in the given exclusive list.

Parameters:
nodeRef - the parent node - usually a container
Returns:
Returns a list of ChildAssociationRef instances.

getChildByName

public NodeRef getChildByName(NodeRef nodeRef,
                              QName assocTypeQName,
                              java.lang.String childName)
Description copied from interface: NodeService
Get the node with the given name within the context of the parent node. The name is case-insensitive as Alfresco has to support case-insensitive clients as standard.

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.

Parameters:
nodeRef - the parent node - usuall a container
assocTypeQName - the type of the association
childName - the name of the node as per the property cm:name
Returns:
Returns the child node or null if not found

getChildrenByName

public java.util.List getChildrenByName(NodeRef nodeRef,
                                        QName assocTypeQName,
                                        java.util.Collection childNames)
Description copied from interface: NodeService
Get the nodes with the given names within the context of the parent node.

childNames - a collection of up to 1000 child names to match on
See Also:
#getChildByName(NodeRef, QName, String)}

getPrimaryParent

public ChildAssociationRef getPrimaryParent(NodeRef nodeRef)
                                     throws InvalidNodeRefException
Description copied from interface: NodeService
Fetches the primary parent-child relationship.

For a root node, the parent node reference will be null.

Returns:
Returns the primary parent-child association of the node
Throws:
InvalidNodeRefException - if the node could not be found

createAssociation

public AssociationRef createAssociation(NodeRef sourceRef,
                                        NodeRef targetRef,
                                        QName assocTypeQName)
                                 throws InvalidNodeRefException,
                                        AssociationExistsException
Parameters:
sourceRef - a reference to a real node
targetRef - a reference to a node
assocTypeQName - the qualified name of the association type
Returns:
Returns a reference to the new association
Throws:
InvalidNodeRefException - if either of the nodes could not be found
AssociationExistsException

getChildAssocsWithoutParentAssocsOfType

public java.util.Collection getChildAssocsWithoutParentAssocsOfType(NodeRef parent,
                                                                    QName assocTypeQName)
Description copied from interface: NodeService
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.

Parameters:
parent - the parent node reference
assocTypeQName - the association type QName
Returns:
a set of child associations

removeAssociation

public void removeAssociation(NodeRef sourceRef,
                              NodeRef targetRef,
                              QName assocTypeQName)
                       throws InvalidNodeRefException
Parameters:
sourceRef - the associaton source node
targetRef - the association target node
assocTypeQName - the qualified name of the association type
Throws:
InvalidNodeRefException - if either of the nodes could not be found

getAssoc

public AssociationRef getAssoc(java.lang.Long id)
Description copied from interface: NodeService
Gets an association by ID.

Returns:
the association, or null if it does not exist

getTargetAssocs

public java.util.List getTargetAssocs(NodeRef sourceRef,
                                      QNamePattern qnamePattern)
Description copied from interface: NodeService
Fetches all associations from the given source where the associations' qualified names match the pattern provided.

Parameters:
sourceRef - the association source
qnamePattern - the association qname pattern to match against
Returns:
Returns a list of NodeAssocRef instances for which the given node is a source
See Also:
QName, RegexQNamePattern.MATCH_ALL

getSourceAssocs

public java.util.List getSourceAssocs(NodeRef targetRef,
                                      QNamePattern qnamePattern)
Description copied from interface: NodeService
Fetches all associations to the given target where the associations' qualified names match the pattern provided.

Parameters:
targetRef - the association target
qnamePattern - the association qname pattern to match against
Returns:
Returns a list of NodeAssocRef instances for which the given node is a target
See Also:
QName, RegexQNamePattern.MATCH_ALL

getPath

public Path getPath(NodeRef nodeRef)
             throws InvalidNodeRefException
Description copied from interface: NodeService
The root node has an entry in the path(s) returned. For this reason, there will always be at least one path element in the returned path(s). The first element will have a null parent reference and qname.

Returns:
Returns the path to the node along the primary node path
Throws:
InvalidNodeRefException - if the node could not be found
See Also:
DbNodeServiceImpl.getPaths(NodeRef, boolean), #prependPaths(Node, Path, Collection, Stack, boolean)

getPaths

public java.util.List getPaths(NodeRef nodeRef,
                               boolean primaryOnly)
                        throws InvalidNodeRefException
When searching for primaryOnly == true, checks that there is exactly one path.

primaryOnly - true if only the primary path must be retrieved. If true, the result will have exactly one entry.
Returns:
Returns a List of all possible paths to the given node
Throws:
InvalidNodeRefException - if the node could not be found
See Also:
#prependPaths(Node, Path, Collection, Stack, boolean)

restoreNode

public NodeRef restoreNode(NodeRef archivedNodeRef,
                           NodeRef destinationParentNodeRef,
                           QName assocTypeQName,
                           QName assocQName)
Description copied from interface: NodeService
Restore an individual node (along with its sub-tree nodes) to the target location. The archived node must have the archived aspect set against it.

Parameters:
archivedNodeRef - the archived node
destinationParentNodeRef - the parent to move the node into or null to use the original
assocTypeQName - the primary association type name to use in the new location or null to use the original
assocQName - the primary association name to use in the new location or null to use the original
Returns:
Returns the reference to the newly created node

moveNode

public ChildAssociationRef moveNode(NodeRef nodeToMoveRef,
                                    NodeRef newParentRef,
                                    QName assocTypeQName,
                                    QName assocQName)
Move Node Drops the old primary association and creates a new one

Parameters:
nodeToMoveRef - the node to move
newParentRef - the new parent of the moved node
assocTypeQName - the type of the association to create. This is used for verification against the data dictionary.
assocQName - the qualified name of the new child association
Returns:
Returns a reference to the newly created child association
See Also:
NodeService.getPrimaryParent(NodeRef)

indexChildren

public void indexChildren(org.alfresco.util.Pair nodePair,
                          boolean cascade)

getStoreArchiveNode

public NodeRef getStoreArchiveNode(StoreRef storeRef)
Description copied from interface: NodeService
Get the node where archived items will have gone when deleted from the given store.

Parameters:
storeRef - the store that items were deleted from
Returns:
Returns the archive node parent


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.