cancel
Showing results for 
Search instead for 
Did you mean: 

onDeleteNodePolicy

riadhazzouz
Confirmed Champ
Confirmed Champ

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 5

riadhazzouz
Confirmed Champ
Confirmed Champ

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

roberto_gamiz
Star Contributor
Star Contributor

Hello,

Maybe this post will be helpful for you:

Policy method 'beforeDeleteNode' gives an invalid NodeRef 

Best,




 Roberto Gámiz Sánchez

Alfresco Content Services Engineer



Thanks.
It helps.

Thanks.

Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.