Getting the original path of document that is deleted from

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the original path of document that is deleted from

sjoshee
Active Member
1 0 290
We are working on a report which lists all the folders and documents deleted by the users of each site in Alfresco. We query the archive store to get the list of nodes that are deleted.  But displayPath on the node returns empty. 
In order to get the original path where it is deleted from you have to do following.
 
var deletedNodeRef = "archive://SpacesStore/b6651c4d-126e-4872-94ff-8a3f81acf5ee";
var node = search.findNode(deletedNodeRef );
var associationNode = node.properties["sys:archivedOriginalParentAssoc"];
if(associationNode){
      var parentNodeRef = associationNode.getChildAssociationRef().getParentRef();
      var parentNode = search.findNode(parentNodeRef);
      logger.log("Display Path " + parentNode.displayPath);
      logger.log("Folder Name " + parentNode.name);
}
Hope this might help some new Alfresco developer.