transfer service : now deals with restored nodes + unit tests.

work in progress on sync of folders containing alien nodes - incomplete so commented out.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21329 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2010-07-21 12:29:18 +00:00
parent ca58f8d202
commit 484e218e50
7 changed files with 1266 additions and 490 deletions

View File

@@ -218,30 +218,15 @@ public class RepoPrimaryManifestProcessorImpl extends AbstractManifestProcessorB
if (nodeService.exists(archiveNodeRef))
{
// We have found a node in the archive store that has the same
// UUID as the one that we've
// been sent. We'll restore that archived node to a temporary
// location and then try
// processing this node again
// UUID as the one that we've been sent. If it remains it may cause problems later on
// We delete from the archive store and treat the new node as a create.
if (log.isInfoEnabled())
{
log.info("Located an archived node with UUID matching transferred node: " + archiveNodeRef);
log.info("Attempting to restore " + archiveNodeRef);
}
logProgress("Restoring node from archive: " + archiveNodeRef);
ChildAssociationRef tempLocation = getTemporaryLocation(node.getNodeRef());
NodeRef restoredNodeRef = nodeService.restoreNode(archiveNodeRef, tempLocation.getParentRef(),
tempLocation.getTypeQName(), tempLocation.getQName());
if (log.isInfoEnabled())
{
log.info("Successfully restored node as " + restoredNodeRef + " - retrying transferred node");
}
//Check to see if the node we've just restored is the parent of any orphans
checkOrphans(restoredNodeRef);
//Process the received node information again now that we've restored it
//(should be handled as an update now)
processTransferManifestNode(node);
return;
logProgress("Delete node from archive: " + archiveNodeRef);
nodeService.deleteNode(archiveNodeRef);
}
if (log.isDebugEnabled())
@@ -304,6 +289,7 @@ public class RepoPrimaryManifestProcessorImpl extends AbstractManifestProcessorB
log.debug("injecting repositoryId property");
props.put(TransferModel.PROP_REPOSITORY_ID, header.getRepositoryId());
}
props.put(TransferModel.PROP_FROM_REPOSITORY_ID, header.getRepositoryId());
// Create the corresponding node...
ChildAssociationRef newNode = nodeService.createNode(parentNodeRef, parentAssocType, parentAssocName, node
@@ -425,6 +411,7 @@ public class RepoPrimaryManifestProcessorImpl extends AbstractManifestProcessorB
log.debug("injecting repositoryId property");
props.put(TransferModel.PROP_REPOSITORY_ID, header.getRepositoryId());
}
props.put(TransferModel.PROP_FROM_REPOSITORY_ID, header.getRepositoryId());
// Split out the content properties and sanitise the others
Map<QName, Serializable> contentProps = processProperties(nodeToUpdate, props, existingProps);