Added 'nodeArchiveService' bean

- Added tests around transaction visibility
 - TODO: Need to set the owner of archived and restored nodes


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2786 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-05-08 13:47:19 +00:00
parent 7ae60915a5
commit 501f4b02a4
12 changed files with 384 additions and 68 deletions

View File

@@ -1514,7 +1514,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
}
public NodeRef restoreNode(NodeRef archivedNodeRef, NodeRef targetParentNodeRef, QName assocTypeQName, QName assocQName)
public NodeRef restoreNode(NodeRef archivedNodeRef, NodeRef destinationParentNodeRef, QName assocTypeQName, QName assocQName)
{
Node archivedNode = getNodeNotNull(archivedNodeRef);
Set<QName> aspects = archivedNode.getAspects();
@@ -1533,10 +1533,10 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
properties.remove(ContentModel.PROP_ARCHIVED_BY);
properties.remove(ContentModel.PROP_ARCHIVED_DATE);
if (targetParentNodeRef == null)
if (destinationParentNodeRef == null)
{
// we must restore to the original location
targetParentNodeRef = originalPrimaryParentAssocRef.getParentRef();
destinationParentNodeRef = originalPrimaryParentAssocRef.getParentRef();
}
// check the associations
if (assocTypeQName == null)
@@ -1551,7 +1551,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
// move the node to the target parent, which may or may not be the original parent
moveNode(
archivedNodeRef,
targetParentNodeRef,
destinationParentNodeRef,
assocTypeQName,
assocQName);
@@ -1572,7 +1572,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
logger.debug("Restored node: \n" +
" original noderef: " + archivedNodeRef + "\n" +
" restored noderef: " + restoredNodeRef + "\n" +
" new parent: " + targetParentNodeRef);
" new parent: " + destinationParentNodeRef);
}
return restoredNodeRef;
}