onDeleteNodePolicy

cancel
Showing results for 
Search instead for 
Did you mean: 
riadhazzouz
Active Member

onDeleteNodePolicy

I'm trying to get the filename of the deleted document using a behaviour, this is my function : 

public void onDeleteNode(ChildAssociationRef childAssocRef, boolean arg1) {
      NodeRef nodeRef = childAssocRef.getChildRef();
      String filename = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);

      System.out.println(filename);
}
the error in this line :
String filename = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);


5 Replies
riadhazzouz
Active Member

Re: onDeleteNodePolicy

I changed onDeleteNode with beforeDeleteNode and I'm still facing same issue "Node does not exist"
public void beforeDeleteNode(NodeRef nodeRef)

roberto_gamiz
Established Member II
riadhazzouz
Active Member

Re: onDeleteNodePolicy

Thanks.
It helps.

angelborroy
Alfresco Employee
riadhazzouz
Active Member

Re: onDeleteNodePolicy

Thanks.