Resolve WebDAV merge weirdness

- resynced with V3.4.1

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@26819 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2011-04-12 15:13:51 +00:00
parent 8739e205cb
commit 3312297afc
2 changed files with 10 additions and 33 deletions

View File

@@ -390,48 +390,29 @@ public class LockMethod extends WebDAVMethod
xml.startDocument();
String nsdec = generateNamespaceDeclarations(null);
xml.startElement(WebDAV.DAV_NS, WebDAV.XML_PROP + nsdec, WebDAV.XML_NS_PROP + nsdec, getDAVHelper().getNullAttributes());
// Output the lock details
String nsdec = "";
generateLockDiscoveryXML(xml, lockNode, false, scope, WebDAV.getDepthName(m_depth), lt, owner);
if (WebDAV.AGENT_MS_6_1_7600.equals(m_userAgent))
{
nsdec = generateNamespaceDeclarations(null, true);
xml.startElement(WebDAV.DAV_NS, WebDAV.XML_PROP + nsdec, WebDAV.XML_NS_PROP + nsdec, getDAVHelper().getNullAttributes());
// Close off the XML
xml.endElement(WebDAV.DAV_NS, WebDAV.XML_PROP, WebDAV.XML_NS_PROP);
// Output the lock details
generateLockDiscoveryXML(xml, lockNode, false, scope, WebDAV.getDepthName(m_depth), lt, owner);
// Close off the XML
xml.endElement(WebDAV.DAV_NS, WebDAV.XML_PROP, WebDAV.XML_NS_PROP);
}
else
{
nsdec = generateNamespaceDeclarations(null, false);
xml.startElement(EMPTY_NS, WebDAV.XML_PROP, WebDAV.XML_PROP + nsdec, getDAVHelper().getNullAttributes());
// Output the lock details
generateLockDiscoveryXML(xml, lockNode, true, scope, WebDAV.getDepthName(m_depth), lt, owner);
// Close off the XML
xml.endElement(EMPTY_NS, WebDAV.XML_PROP, WebDAV.XML_PROP);
}
}
/**
* Generates a list of namespace declarations for the response
*/
protected String generateNamespaceDeclarations(HashMap<String,String> nameSpaces, boolean withPrefix)
protected String generateNamespaceDeclarations(HashMap<String,String> nameSpaces)
{
StringBuilder ns = new StringBuilder();
ns.append(" ");
ns.append(WebDAV.XML_NS);
if (withPrefix)
{
ns.append(":");
ns.append(WebDAV.DAV_NS);
}
ns.append(":");
ns.append(WebDAV.DAV_NS);
ns.append("=\"");
ns.append(WebDAV.DEFAULT_NAMESPACE_URI);
ns.append("\"");