Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)

124145 amorarasu: Merged 5.0.N (5.0.4) to 5.1.N (5.1.2)
      124106 rmunteanu: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4)
         124105 amorarasu: Merged V4.1-BUG-FIX (4.1.11) to V4.2-BUG-FIX (4.2.7)
            123915 rmunteanu: Merged V4.1.7 (4.1.7.18) to V4.1-BUG-FIX (4.1.11)
               MNT-15801 : onContentUpdate policies not working for updates via webdav
                  - Reverted changes made for MNT-11185 and MNT-10966 , reverts that will fix MNT-15746
                  - Changed fix for MNT-5882 by adding the ASPECT_NO_CONTENT after the content is updated, this way preventing MNT-10966 from reproducing


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@124228 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-03-18 12:50:49 +00:00
parent 6c52227384
commit 0fd5997ed2

View File

@@ -231,11 +231,6 @@ public class PutMethod extends WebDAVMethod implements ActivityPostProducer
getDAVHelper().getPolicyBehaviourFilter().disableBehaviour(nodeRef, ContentModel.ASPECT_VERSIONABLE);
disabledVersioning = true;
}
// ALF-16756: To avoid firing inbound rules too early (while a node is still locked) apply the no content aspect
if (nodeLockInfo != null && nodeLockInfo.isExclusive() && !(ContentData.hasContent(contentData) && contentData.getSize() > 0))
{
getNodeService().addAspect(contentNodeInfo.getNodeRef(), ContentModel.ASPECT_NO_CONTENT, null);
}
// Access the content
ContentWriter writer = fileFolderService.getWriter(contentNodeInfo.getNodeRef());
@@ -245,10 +240,20 @@ public class PutMethod extends WebDAVMethod implements ActivityPostProducer
// Get the input stream from the request data
InputStream is = m_request.getInputStream();
// Write the new data to the content node
writer.putContent(is);
// ALF-16756: To avoid firing inbound rules too early (while a node is still locked) apply the no content aspect
// Note, for MNT-15801, that the aspect is only applied if:
// - the node is locked AND
// - the node does not have any content (zero length binaries included)
if (nodeLockInfo != null && nodeLockInfo.getToken() != null && !(ContentData.hasContent(contentData) && contentData.getSize() > 0))
{
getNodeService().addAspect(contentNodeInfo.getNodeRef(), ContentModel.ASPECT_NO_CONTENT, null);
}
// Ask for the document metadata to be extracted
Action extract = getActionService().createAction(ContentMetadataExtracter.EXECUTOR_NAME);
if(extract != null)