Fixed AssociationRef.equals method that was causing association matching to fail

Fixed node tests that were hiding a NullPointerException when node associations weren't found
Fixed NodeAssoc AssociationRef caching for cases where the source or target nodes move stores
Removed storage of Path property for archived nodes


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2886 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-05-12 22:04:49 +00:00
parent 881f966ee8
commit d8878a46ed
8 changed files with 38 additions and 47 deletions

View File

@@ -1071,14 +1071,20 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
public void removeAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName)
throws InvalidNodeRefException
{
// Invoke policy behaviours
invokeBeforeUpdateNode(sourceRef);
Node sourceNode = getNodeNotNull(sourceRef);
Node targetNode = getNodeNotNull(targetRef);
// get the association
NodeAssoc assoc = nodeDaoService.getNodeAssoc(sourceNode, targetNode, assocTypeQName);
if (assoc == null)
{
// nothing to remove
return;
}
AssociationRef assocRef = assoc.getNodeAssocRef();
// Invoke policy behaviours
invokeBeforeUpdateNode(sourceRef);
// delete it
nodeDaoService.deleteNodeAssoc(assoc);
@@ -1302,7 +1308,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
{
Node node = getNodeNotNull(nodeRef);
ChildAssoc primaryParentAssoc = nodeDaoService.getPrimaryParentAssoc(node);
Path primaryPath = getPath(nodeRef);
// add the aspect
node.getAspects().add(ContentModel.ASPECT_ARCHIVED);
@@ -1319,10 +1324,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
dictionaryService.getProperty(ContentModel.PROP_ARCHIVED_ORIGINAL_PARENT_ASSOC),
primaryParentAssoc.getChildAssocRef());
properties.put(ContentModel.PROP_ARCHIVED_ORIGINAL_PARENT_ASSOC, archivedPrimaryParentNodeRefProperty);
PropertyValue archivedPrimaryPathProperty = makePropertyValue(
dictionaryService.getProperty(ContentModel.PROP_ARCHIVED_ORIGINAL_PATH),
primaryPath);
properties.put(ContentModel.PROP_ARCHIVED_ORIGINAL_PATH, archivedPrimaryPathProperty);
// move the node
NodeRef archiveStoreRootNodeRef = getRootNode(archiveStoreRef);
@@ -1559,7 +1560,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
// remove the aspect archived aspect
aspects.remove(ContentModel.ASPECT_ARCHIVED);
properties.remove(ContentModel.PROP_ARCHIVED_ORIGINAL_PARENT_ASSOC);
properties.remove(ContentModel.PROP_ARCHIVED_ORIGINAL_PATH);
properties.remove(ContentModel.PROP_ARCHIVED_BY);
properties.remove(ContentModel.PROP_ARCHIVED_DATE);