Merged DEV/TEMPORARY to HEAD

23222: ALF-3707: Alfresco Sharepoint protocol and Office 2010 issue
      Problem related to incorrect response of VTI WebDAV Lock method for Windows 7 clients was fixed. 
      Requested refactoring was done:
      - Code duplication was removed from VTI Lock, Unlock, PropPatch methods. 
      - Changes related to inheritance were added to original WebDAV methods.
      - VTI Propfind implementation was detached from original WebDAV PropFind
      - Logging was added for empty catch blocks 
      - Unused import was removed
      - Unnecessary empty catch blocks were removed


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@23225 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2010-10-22 11:21:40 +00:00
parent 61079d3769
commit ea8e5bdfc6
4 changed files with 87 additions and 15 deletions

View File

@@ -33,6 +33,7 @@ import org.alfresco.service.cmr.model.FileFolderUtil;
import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.model.FileNotFoundException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.dom4j.io.XMLWriter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -196,7 +197,7 @@ public class LockMethod extends WebDAVMethod
}
}
}
/**
* Execute the request
*
@@ -221,7 +222,7 @@ public class LockMethod extends WebDAVMethod
try
{
// Check if the path exists
lockNodeInfo = getDAVHelper().getNodeForPath(getRootNodeRef(), getPath(), m_request.getServletPath());
lockNodeInfo = getNodeForPath(getRootNodeRef(), getPath(), m_request.getServletPath());
}
catch (FileNotFoundException e)
{
@@ -252,7 +253,7 @@ public class LockMethod extends WebDAVMethod
}
// create the file
lockNodeInfo = fileFolderService.create(dirInfo.getNodeRef(), splitPath[1], ContentModel.TYPE_CONTENT);
lockNodeInfo = createNode(dirInfo.getNodeRef(), splitPath[1], ContentModel.TYPE_CONTENT);
if (logger.isDebugEnabled())
{
@@ -292,6 +293,20 @@ public class LockMethod extends WebDAVMethod
// We either created a new lock or refreshed an existing lock, send back the lock details
generateResponse(lockNodeInfo.getNodeRef(), userName);
}
/**
* Create a new node
*
* @param parentNodeRef the parent node.
* @param name the name of the node
* @param typeQName the type to create
* @return Returns the new node's file information
*
*/
protected FileInfo createNode(NodeRef parentNodeRef, String name, QName typeQName)
{
return getFileFolderService().create(parentNodeRef, name, ContentModel.TYPE_CONTENT);
}
/**
* Create a new lock
@@ -400,10 +415,9 @@ public class LockMethod extends WebDAVMethod
}
// Send the XML back to the client
xml.flush();
flushXML(xml);
}
/**
* Generates a list of namespace declarations for the response
*/