I have already seen the CustomAspect of Alfresco SDK, it's ok to detect file modification and file creation, but still impossible to detect metadata modification. Moreover, it seems that my CustomAspect example of Alfresco SDK uses deprecated enumeration (ContentServicePolicies.ON_CONTENT_READ
and ContentServicePolicies.ON_CONTENT_UPDATE
) but it's no problem to replace them by ContentServicePolicies.OnContentReadPolicy.QNAME
and ContentServicePolicies.OnContentUpdatePolicy.QNAME
). These 3 behaviours work properly<java> // Register the policy behaviours this.policyComponent.bindClassBehaviour( QName.createQName(NamespaceService.ALFRESCO_URI, "onAddAspect"), ASPECT_CONTENT_HITS, new JavaBehaviour(this, "onAddAspect", NotificationFrequency.FIRST_EVENT)); this.policyComponent.bindClassBehaviour( ContentServicePolicies.OnContentReadPolicy.QNAME, ASPECT_CONTENT_HITS, new JavaBehaviour(this, "onContentRead", NotificationFrequency.TRANSACTION_COMMIT)); this.policyComponent.bindClassBehaviour( ContentServicePolicies.OnContentUpdatePolicy.QNAME, ASPECT_CONTENT_HITS, new JavaBehaviour(this, "onContentUpdate", NotificationFrequency.TRANSACTION_COMMIT));</java>but as I said in my first post, the fourth does not detect anything except if a file is modified:<java> this.policyComponent.bindClassBehaviour( ContentServicePolicies.OnContentPropertyUpdatePolicy.QNAME, ASPECT_CONTENT_HITS, new JavaBehaviour(this, "onContentPropertyUpdate", NotificationFrequency.TRANSACTION_COMMIT));</java>And that is the function which should be called when metadata is modified<java> public void onContentPropertyUpdate(NodeRef nodeRef, QName propertyQName, ContentData beforeValue, ContentData afterValue) { System.out.println("Metadata Modified!! "); System.out.println(" on node : " + nodeRef); System.out.println(" Propertie name : " + propertyQName.getLocalName()); System.out.println(" old value : " + beforeValue); System.out.println(" new value : " + afterValue); }</java>All of my methods seems to be correct but maybe I have forgot something