As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist:
String fileName = (String) nodeService.getProperty(actionedUponNodeRef, ContentModel.PROP_NAME);
System.out.println("AtionedUponNodeRef Node:"+actionedUponNodeRef.getId()+actionedUponNodeRef.getStoreRef().getIdentifier()); NodeRef origNodeRef = archiveService.getArchivedNode(actionedUponNodeRef); System.out.println("Original Node:"+origNodeRef.getId()+origNodeRef.getStoreRef().getIdentifier());
AtionedUponNodeRef Node:7adb1a27-6fcf-4321-8807-448bb9edf928SpacesStore Original Node:7adb1a27-6fcf-4321-8807-448bb9edf928SpacesStore
public class DeleteAsset implements NodeServicePolicies.BeforeDeleteNodePolicy { private PolicyComponent policyComponent; private Behaviour beforeDeleteNode; public void init() { this.beforeDeleteNode = new JavaBehaviour(this,"beforeDeleteNode",NotificationFrequency.EVERY_EVENT); this.policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI,"beforeDeleteNode"), QName.createQName(MyModel.NAMESPACE,MyModel.ASSET_CONTENT_TYPE), this.beforeDeleteNode); } @Override public void beforeDeleteNode(NodeRef node) { System.out.println("beforeDeleteNode!"); try { your code here } catch(Exception e) { e.printStackTrace(); } } }