Added getArchivedNode(NodeRef originalNodeRef) method for quick retrieval of archived node reference

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3102 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-06-14 15:40:27 +00:00
parent 9040b30af5
commit df94f342d8
2 changed files with 20 additions and 0 deletions

View File

@@ -40,6 +40,15 @@ public interface NodeArchiveService
*/
public NodeRef getStoreArchiveNode(StoreRef originalStoreRef);
/**
* Get the likely node reference for the original node. There is no
* guarantee that the node exists in the archive store.
*
* @param originalNodeRef the original node reference
* @return Returns the node ref of the node if it was archived.
*/
public NodeRef getArchivedNode(NodeRef originalNodeRef);
/**
* Attempt to restore the given archived node into its original location.
* <p>

View File

@@ -72,6 +72,17 @@ public class NodeArchiveServiceImpl implements NodeArchiveService
return nodeService.getStoreArchiveNode(originalStoreRef);
}
public NodeRef getArchivedNode(NodeRef originalNodeRef)
{
StoreRef orginalStoreRef = originalNodeRef.getStoreRef();
NodeRef archiveRootNodeRef = nodeService.getStoreArchiveNode(orginalStoreRef);
// create the likely location of the archived node
NodeRef archivedNodeRef = new NodeRef(
archiveRootNodeRef.getStoreRef(),
originalNodeRef.getId());
return archivedNodeRef;
}
/**
* Get all the nodes that were archived <b>from</b> the given store.
*/