From 20d475b91fe2d8dd7fbfda1e52d1b0c4997bc8e2 Mon Sep 17 00:00:00 2001 From: Dave Ward Date: Mon, 15 Aug 2011 10:19:30 +0000 Subject: [PATCH] Merged V3.4-BUG-FIX to HEAD 29702: ALF-5607: Possible fix from Bitrock 29746: Merged V3.4 to V3.4-BUG-FIX 29726: ALF-9233 and ALF-9846 Versions 0.1 and 0.2 of a new doc created via SPP had no cm:content property. - Changed code so that the first version of the doc would be 1.0 rather than 0.1 - Changed code so that an existing document without ASPECT_VERSIONABLE would be saved as 1.0, before the 1.1 version from SPP is created. When an existing document had ASPECT_VERSIONABLE there was no need to create a new version. - The creation of the version from SPP is now created after the content property is set. 29748: ALF-3681: Webdav lock issue returned on 3.3g git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29750 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/repo/webdav/WebDAVMethod.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/source/java/org/alfresco/repo/webdav/WebDAVMethod.java b/source/java/org/alfresco/repo/webdav/WebDAVMethod.java index cd0c5d9e1e..a1edd39c0e 100644 --- a/source/java/org/alfresco/repo/webdav/WebDAVMethod.java +++ b/source/java/org/alfresco/repo/webdav/WebDAVMethod.java @@ -25,6 +25,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; +import java.io.Serializable; import java.util.Date; import java.util.HashMap; import java.util.Iterator; @@ -884,7 +885,21 @@ public abstract class WebDAVMethod } else { - throw new WebDAVServerException(WebDAV.WEBDAV_SC_LOCKED); + // ALF-3681 fix. WebDrive 10 client doesn't send If header when locked resource is updated so check the node by lockOwner. + if (m_userAgent != null && m_userAgent.equals(WebDAV.AGENT_MICROSOFT_DATA_ACCESS_INTERNET_PUBLISHING_PROVIDER_DAV)) + { + String currentUser = getAuthenticationService().getCurrentUserName(); + Serializable lockOwner = fileInfo.getProperties().get(ContentModel.PROP_LOCK_OWNER); + + if (lockOwner.equals(currentUser)) + { + return nodeLockInfo; + } + } + else + { + throw new WebDAVServerException(WebDAV.WEBDAV_SC_LOCKED); + } } }