diff --git a/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java b/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java index a78b7432b3..9bafbfb430 100644 --- a/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java +++ b/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java @@ -2988,6 +2988,15 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD lockKeeper.removeLock(target); + if(nodeService.hasAspect(target, ContentModel.ASPECT_NO_CONTENT)) + { + if(logger.isDebugEnabled()) + { + logger.debug("removed no content aspect"); + } + nodeService.removeAspect(target, ContentModel.ASPECT_NO_CONTENT); + } + if(tempFile.isChanged()) { tempFile.flushFile(); @@ -3085,16 +3094,6 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD writer.setMimetype(mimetype); writer.setEncoding(encoding); writer.putContent(tempFile.getFile()); - - // remove ASPECT_NO_CONTENT after content is present - if(nodeService.hasAspect(target, ContentModel.ASPECT_NO_CONTENT)) - { - if(logger.isDebugEnabled()) - { - logger.debug("removed no content aspect"); - } - nodeService.removeAspect(target, ContentModel.ASPECT_NO_CONTENT); - } } // if content changed } } diff --git a/source/java/org/alfresco/repo/content/ContentServiceImpl.java b/source/java/org/alfresco/repo/content/ContentServiceImpl.java index c999c03f06..66d25fd0f7 100644 --- a/source/java/org/alfresco/repo/content/ContentServiceImpl.java +++ b/source/java/org/alfresco/repo/content/ContentServiceImpl.java @@ -44,7 +44,6 @@ import org.alfresco.repo.node.NodeServicePolicies; import org.alfresco.repo.policy.ClassPolicyDelegate; import org.alfresco.repo.policy.JavaBehaviour; import org.alfresco.repo.policy.PolicyComponent; -import org.alfresco.repo.policy.Behaviour.NotificationFrequency; import org.alfresco.repo.transaction.RetryingTransactionHelper; import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.dictionary.DictionaryService; @@ -214,10 +213,6 @@ public class ContentServiceImpl implements ContentService, ApplicationContextAwa NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME, this, new JavaBehaviour(this, "onUpdateProperties")); - this.policyComponent.bindClassBehaviour( - NodeServicePolicies.OnRemoveAspectPolicy.QNAME, - ContentModel.ASPECT_NO_CONTENT, - new JavaBehaviour(this, "onRemoveAspect", NotificationFrequency.EVERY_EVENT)); // Register on content update policy this.onContentUpdateDelegate = this.policyComponent.registerClassPolicy(OnContentUpdatePolicy.class); @@ -344,25 +339,7 @@ public class ContentServiceImpl implements ContentService, ApplicationContextAwa } } - /** - * MNT-10966: removing ASPECT_NO_CONTENT means that new content was uploaded - * - * @param nodeRef the node reference - * @param aspectTypeQName tha removed aspect - */ - public void onRemoveAspect(NodeRef nodeRef, QName aspectTypeQName) - { - if (!nodeService.exists(nodeRef)) - { - return; - } - // Fire the content update policy - Set types = getTypes(nodeRef, null); - OnContentUpdatePolicy policy = onContentUpdateDelegate.get(nodeRef, types); - policy.onContentUpdate(nodeRef, true); - } - /** * Helper method to lazily populate the types associated with a node *