jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r453121 - /jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/version/UpdateInfo.java
Date Thu, 05 Oct 2006 07:14:10 GMT
Author: angela
Date: Thu Oct  5 00:14:09 2006
New Revision: 453121

URL: http://svn.apache.org/viewvc?view=rev&rev=453121
Log:
- update type not when creating from xml
- building update-elmenent for workspace-update not consistent with 
  parsing.

Modified:
    jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/version/UpdateInfo.java

Modified: jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/version/UpdateInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/version/UpdateInfo.java?view=diff&rev=453121&r1=453120&r2=453121
==============================================================================
--- jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/version/UpdateInfo.java
(original)
+++ jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/version/UpdateInfo.java
Thu Oct  5 00:14:09 2006
@@ -107,12 +107,14 @@
                 hrefList.add(DomUtil.getText(hrefs.nextElement()));
             }
             source = (String[])hrefList.toArray(new String[hrefList.size()]);
+            type = UPDATE_BY_VERSION;
             done = true;
         }
 
         // alternatively 'DAV:label-name' elements may be present.
         if (!done && DomUtil.hasChildElement(updateElement, XML_LABEL_NAME, NAMESPACE))
{
             source = new String[] {DomUtil.getChildText(updateElement, XML_LABEL_NAME, NAMESPACE)};
+            type = UPDATE_BY_LABEL;
             done = true;
         }
 
@@ -121,6 +123,7 @@
             Element wspElem = DomUtil.getChildElement(updateElement, XML_WORKSPACE, NAMESPACE);
             if (wspElem != null) {
                 source = new String[] {DomUtil.getChildTextTrim(wspElem, DavConstants.XML_HREF,
DavConstants.NAMESPACE)};
+                type = UPDATE_BY_WORKSPACE;
             } else {
                 log.warn("DAV:update element must contain either DAV:version, DAV:label-name
or DAV:workspace child element.");
                 throw new DavException(DavServletResponse.SC_BAD_REQUEST);
@@ -228,7 +231,8 @@
                 DomUtil.addChildElement(elem, XML_LABEL_NAME, NAMESPACE, updateSource[0]);
                 break;
             case UPDATE_BY_WORKSPACE:
-                DomUtil.addChildElement(elem, XML_WORKSPACE, NAMESPACE, updateSource[0]);
+                Element wspEl = DomUtil.addChildElement(elem, XML_WORKSPACE, NAMESPACE, updateSource[0]);
+                wspEl.appendChild(DomUtil.hrefToXml(updateSource[0], factory));
                 break;
             // no default.
             default:



Mime
View raw message