jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r230783 - in /incubator/jackrabbit/trunk/contrib/jcr-server: server/src/java/org/apache/jackrabbit/webdav/jcr/ server/src/java/org/apache/jackrabbit/webdav/jcr/lock/ server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/ server/src/java...
Date Mon, 08 Aug 2005 10:41:19 GMT
Author: tripod
Date: Mon Aug  8 03:40:56 2005
New Revision: 230783

URL: http://svn.apache.org/viewcvs?rev=230783&view=rev
Log:
- changed default jcr-webdav namespace prefix
- updated javadoc
- added namespace-prefix-collision resolver to simple/DavResourceImpl.java

Modified:
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/RootItemCollection.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/lock/JcrActiveLock.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeElement.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/search/SearchResultProperty.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/transaction/TxLockManagerImpl.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/ExportViewReport.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateByUuidReport.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/RegisteredNamespacesReport.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/RepositoryDescriptorsReport.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
    incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java
    incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/search/SearchInfo.java
    incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TransactionConstants.java
    incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TransactionInfo.java
    incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TxLockManager.java

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
Mon Aug  8 03:40:56 2005
@@ -103,8 +103,8 @@
 
     /**
      * This implementation of the <code>DavResource</code> does only allow
-     * to set the jcr:mixinnodetypes property. Please note that the existing list of
-     * mixin nodetypes will be completely replaces.<br>
+     * to set the mixinnodetypes property. Please note that the existing list of
+     * mixin nodetypes will be completely replaced.<br>
      * In order to add / set any other repository property on the underlaying
      * {@link javax.jcr.Node} use <code>addMember(DavResource)</code> or
      * <code>addMember(DavResource, InputStream)</code> or modify the value
@@ -167,7 +167,7 @@
 
     /**
      * This implementation of the <code>DavResource</code> does only allow
-     * to remove the jcr:mixinnodetypes property.
+     * to remove the mixinnodetypes property.
      *
      * @param propertyName
      * @throws org.apache.jackrabbit.webdav.DavException

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
Mon Aug  8 03:40:56 2005
@@ -52,7 +52,7 @@
     /**
      * The namespace for all jcr specific extensions.
      */
-    public static final Namespace NAMESPACE = Namespace.getNamespace("jcr", "http://www.day.com/jcr/webdav/1.0");
+    public static final Namespace NAMESPACE = Namespace.getNamespace("dcr", "http://www.day.com/jcr/webdav/1.0");
 
     // xml element names
     public static final String XML_PRIMARYNODETYPE = "primarynodetype";

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/RootItemCollection.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/RootItemCollection.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/RootItemCollection.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/RootItemCollection.java
Mon Aug  8 03:40:56 2005
@@ -130,7 +130,7 @@
                     throw new JcrDavException(e);
                 }
             } else {
-                log.warn("Unexpected structure of jcr:namespace property.");
+                log.warn("Unexpected structure of dcr:namespace property.");
                 throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR);
             }
         } else {

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/lock/JcrActiveLock.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/lock/JcrActiveLock.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/lock/JcrActiveLock.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/lock/JcrActiveLock.java
Mon Aug  8 03:40:56 2005
@@ -19,6 +19,7 @@
 import org.apache.jackrabbit.webdav.DavConstants;
 import org.apache.jackrabbit.webdav.jcr.ItemResourceConstants;
 import org.apache.jackrabbit.webdav.lock.*;
+import org.apache.jackrabbit.JcrConstants;
 
 import javax.jcr.lock.Lock;
 import javax.jcr.Node;
@@ -139,8 +140,8 @@
         Node n = lock.getNode();
         try {
             // find out about deepness. if node does not hold the lock its deep anyway
-            if (n.holdsLock() && n.hasProperty("jcr:lockIsDeep")) {
-                isDeep = n.getProperty("jcr:lockIsDeep").getBoolean();
+            if (n.holdsLock() && n.hasProperty(JcrConstants.JCR_LOCKISDEEP)) {
+                isDeep = n.getProperty(JcrConstants.JCR_LOCKISDEEP).getBoolean();
             }
         } catch (RepositoryException e) {
             // ignore and keep default depth settings

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeElement.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeElement.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeElement.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeElement.java
Mon Aug  8 03:40:56 2005
@@ -35,7 +35,7 @@
     public NodeTypeElement(Element ntElement) {
         super(XML_NODETYPE, NodeTypeConstants.NAMESPACE);
         if (!XML_NODETYPE.equals(ntElement.getName())) {
-            throw new IllegalArgumentException("jcr:nodetype element expected.");
+            throw new IllegalArgumentException("dcr:nodetype element expected.");
         }
         addNodeTypeNameElement(ntElement.getChildText(XML_NODETYPENAME, NodeTypeConstants.NAMESPACE));
     }

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/search/SearchResultProperty.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/search/SearchResultProperty.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/search/SearchResultProperty.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/search/SearchResultProperty.java
Mon Aug  8 03:40:56 2005
@@ -88,7 +88,7 @@
                     } else if (JCR_TYPE.getName().equals(((Element)el).getName())) {
                         int type = PropertyType.valueFromName(txt);
                         if (name == null) {
-                            throw new IllegalArgumentException("SearchResultProperty requires
a set of 'jcr:name','jcr:value' and 'jcr:type' xml elements.");
+                            throw new IllegalArgumentException("SearchResultProperty requires
a set of 'dcr:name','dcr:value' and 'dcr:type' xml elements.");
                         }
                         colList.add(name);
                         valList.add((value == null) ? null : ValueHelper.deserialize(value,
type, false));
@@ -100,7 +100,7 @@
                 }
             }
         } else {
-            new IllegalArgumentException("SearchResultProperty requires a set of 'jcr:name','jcr:value'
and 'jcr:type' xml elements.");
+            new IllegalArgumentException("SearchResultProperty requires a set of 'dcr:name','dcr:value'
and 'dcr:type' xml elements.");
         }
 
         columnNames = (String[]) colList.toArray(new String[colList.size()]);
@@ -131,11 +131,11 @@
     /**
      * Return the value of this webdav property i.e. an list of xml
      * {@link Element}s. For every value in the query result row represented by
-     * this webdav property a jcr:name, jcr:value and jcr:type element is created.
+     * this webdav property a dcr:name, dcr:value and dcr:type element is created.
      * Example:
      * <pre>
      * -----------------------------------------------------------
-     *   col-name  |   bla   |   bli   |  jcr:path  |  jcr:score
+     *   col-name  |   bla   |   bli   |  dcr:path  |  dcr:score
      * -----------------------------------------------------------
      *   value     |   xxx   |   111   |  /aNode    |    1
      *   type      |    1    |    3    |     8      |    3
@@ -143,18 +143,18 @@
      * </pre>
      * results in:
      * <pre>
-     * &lt;jcr:name&gt;bla&lt;jcr:name/&gt;
-     * &lt;jcr:value&gt;xxx&lt;jcr:value/&gt;
-     * &lt;jcr:type&gt;String&lt;jcr:value/&gt;
-     * &lt;jcr:name&gt;bli&lt;jcr:name/&gt;
-     * &lt;jcr:value&gt;111&lt;jcr:value/&gt;
-     * &lt;jcr:type&gt;Long&lt;jcr:value/&gt;
-     * &lt;jcr:name&gt;jcr:path&lt;jcr:name/&gt;
-     * &lt;jcr:value&gt;/aNode&lt;jcr:value/&gt;
-     * &lt;jcr:type&gt;Path&lt;jcr:value/&gt;
-     * &lt;jcr:name&gt;jcr:score&lt;jcr:name/&gt;
-     * &lt;jcr:value&gt;1&lt;jcr:value/&gt;
-     * &lt;jcr:type&gt;Long&lt;jcr:value/&gt;
+     * &lt;dcr:name&gt;bla&lt;dcr:name/&gt;
+     * &lt;dcr:value&gt;xxx&lt;dcr:value/&gt;
+     * &lt;dcr:type&gt;String&lt;dcr:value/&gt;
+     * &lt;dcr:name&gt;bli&lt;dcr:name/&gt;
+     * &lt;dcr:value&gt;111&lt;dcr:value/&gt;
+     * &lt;dcr:type&gt;Long&lt;dcr:value/&gt;
+     * &lt;dcr:name&gt;jcr:path&lt;dcr:name/&gt;
+     * &lt;dcr:value&gt;/aNode&lt;dcr:value/&gt;
+     * &lt;dcr:type&gt;Path&lt;dcr:value/&gt;
+     * &lt;dcr:name&gt;jcr:score&lt;dcr:name/&gt;
+     * &lt;dcr:value&gt;1&lt;dcr:value/&gt;
+     * &lt;dcr:type&gt;Long&lt;dcr:value/&gt;
      * </pre>
      *
      * @return value of this webdav property consisting of an list of xml elements.

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/transaction/TxLockManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/transaction/TxLockManagerImpl.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/transaction/TxLockManagerImpl.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/transaction/TxLockManagerImpl.java
Mon Aug  8 03:40:56 2005
@@ -46,7 +46,7 @@
 
 /**
  * <code>TxLockManagerImpl</code> manages locks with locktype
- * '{@link TransactionConstants#TRANSACTION jcr:transaction}'.
+ * '{@link TransactionConstants#TRANSACTION dcr:transaction}'.
  * <p/>
  * todo: removing all expired locks
  * todo: 'local' and 'global' are not accurate terms in the given context > replace

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/ExportViewReport.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/ExportViewReport.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/ExportViewReport.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/ExportViewReport.java
Mon Aug  8 03:40:56 2005
@@ -41,7 +41,8 @@
  * and {@link Session#exportSystemView(String, java.io.OutputStream, boolean, boolean) SysView}
  * of the {@link javax.jcr.Item item} represented by the requested resource.
  * <p/>
- * The request body must contain a jcr:exportview element:
+ * The request body must contain a {@link ItemResourceConstants#NAMESPACE dcr}:exportview
+ * element:
  * <pre>
  * &lt;!ELEMENT exportview  ( (sysview | docview)?, skipbinary?, norecurse ) &gt;
  * &lt;!ELEMENT sysview EMPTY &gt;
@@ -91,7 +92,7 @@
         }
         DavSession davSession = resource.getSession();
         if (davSession == null || davSession.getRepositorySession() == null) {
-            throw new IllegalArgumentException("The resource must provide a non-null session
object in order to create the jcr:nodetypes report.");
+            throw new IllegalArgumentException("The resource must provide a non-null session
object in order to create the exportview report.");
         }
         session = davSession.getRepositorySession();
         absPath = resource.getResourcePath();
@@ -100,12 +101,12 @@
     /**
      * @param info
      * @throws IllegalArgumentException if the specified {@link ReportInfo info}
-     * object does not contain a jcr:exportview element.
+     * object does not contain a {@link ItemResourceConstants#NAMESPACE dcr}:exportview element.
      * @see Report#setInfo(org.apache.jackrabbit.webdav.version.report.ReportInfo)
      */
     public void setInfo(ReportInfo info) {
         if (info == null || !REPORT_NAME.equals(info.getReportElement().getName())) {
-            throw new IllegalArgumentException("jcr:exportview element expected.");
+            throw new IllegalArgumentException("dcr:exportview element expected.");
         }
         this.info = info;
     }

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateByUuidReport.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateByUuidReport.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateByUuidReport.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateByUuidReport.java
Mon Aug  8 03:40:56 2005
@@ -31,7 +31,7 @@
  * <code>LocateByUuidReport</code> handles REPORT requests for the 'locate-by-uuid'
  * report.
  * <p/>
- * The request body must be a 'jcr:locate-by-uuid' XML element:
+ * The request body must be a 'dcr:locate-by-uuid' XML element:
  * <pre>
  * &lt;!ELEMENT locate-by-uuid ( href , prop? ) &gt;
  * </pre>
@@ -73,7 +73,7 @@
         }
         DavSession davSession = resource.getSession();
         if (davSession == null || davSession.getRepositorySession() == null) {
-            throw new IllegalArgumentException("The resource must provide a non-null session
object in order to create the jcr:nodetypes report.");
+            throw new IllegalArgumentException("The resource must provide a non-null session
object in order to create the locate-by-uuid report.");
         }
         this.resource = resource;
     }
@@ -81,12 +81,12 @@
     /**
      * @param info
      * @throws IllegalArgumentException if the specified {@link ReportInfo info}
-     * object does not contain a jcr:exportview element.
+     * object does not contain a {@link ItemResourceConstants#NAMESPACE dcr}:locate-by-uuid
element.
      * @see Report#setInfo(org.apache.jackrabbit.webdav.version.report.ReportInfo)
      */
     public void setInfo(ReportInfo info) {
         if (info == null || !REPORT_NAME.equals(info.getReportElement().getName())) {
-            throw new IllegalArgumentException("jcr:locate-by-uuid element expected.");
+            throw new IllegalArgumentException("dcr:locate-by-uuid element expected.");
         }
         this.info = info;
     }

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java
Mon Aug  8 03:40:56 2005
@@ -37,14 +37,14 @@
  * represents the corresponding node in another workspace.
  *
  * <p/>
- * The request body must be a 'jcr:locate-corresponding-node' XML element, that
+ * The request body must be a 'dcr:locate-corresponding-node' XML element, that
  * contains the href of the source workspace, where the corresponding node should
  * be searched:
  * <pre>
  * &lt;!ELEMENT locate-corresponding-node ( workspace ) &gt;
  * &lt;!ELEMENT workspace ( href ) &gt;  (as defined by <a href="http://www.webdav.org/specs/rfc3253.html#PROPERTY_workspace">RFC
3253</a>)
  * </pre>
- * The response to a successful report request must be a jcr:locate-corresponding-node-report
+ * The response to a successful report request must be a 'dcr:locate-corresponding-node-report'
  * element that contains the href of the corresponding node in the given source
  * workspace:
  *
@@ -87,7 +87,7 @@
         }
         DavSession davSession = resource.getSession();
         if (davSession == null || davSession.getRepositorySession() == null) {
-            throw new IllegalArgumentException("The resource must provide a non-null session
object in order to create the jcr:locate-corresponding-node report.");
+            throw new IllegalArgumentException("The resource must provide a non-null session
object in order to create the dcr:locate-corresponding-node report.");
         }
         this.resource = resource;
     }
@@ -97,7 +97,7 @@
      */
     public void setInfo(ReportInfo info) {
         if (info == null || !REPORT_NAME.equals(info.getReportElement().getName())) {
-            throw new IllegalArgumentException("jcr:locate-corresponding-node expected.");
+            throw new IllegalArgumentException("dcr:locate-corresponding-node expected.");
         }
         Element workspace = info.getReportElement().getChild(DeltaVConstants.WORKSPACE.getName(),
DeltaVConstants.WORKSPACE.getNamespace());
         if (workspace != null) {
@@ -110,7 +110,7 @@
      */
     public Document toXml() throws DavException {
         if (resource == null || workspaceHref == null) {
-            throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR, "Error while
running jcr:locate-corresponding-node report: resource must not be null and request body must
define the href of a source workspace");
+            throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR, "Error while
running dcr:locate-corresponding-node report: resource must not be null and request body must
define the href of a source workspace");
         }
         try {
             Item item = resource.getSession().getRepositorySession().getItem(resource.getResourcePath());
@@ -125,7 +125,7 @@
                 e.addContent(XmlUtil.hrefToXml(corrLoc.getHref(true)));
                 return new Document(e);
             } else {
-                throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR, "Error
while running jcr:locate-corresponding-node report: resource must represent a JCR node.");
+                throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR, "Error
while running dcr:locate-corresponding-node report: resource must represent a jcr node.");
             }
         } catch (RepositoryException e) {
             throw new JcrDavException(e);

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java
Mon Aug  8 03:40:56 2005
@@ -36,7 +36,7 @@
 
 /**
  * <code>NodeTypesReport</code> allows to retrieve the definition of a single
- * or multiple node types. The request body must be a 'jcr:nodetypes' element:
+ * or multiple node types. The request body must be a 'dcr:nodetypes' element:
  * <pre>
  * &lt;!ELEMENT nodetypes ( nodetype+ | all-nodetypes | mixin-nodetypes | primary-nodetypes
) &gt;
  *
@@ -48,6 +48,8 @@
  * &lt;!ELEMENT primary-nodetypes EMPTY &gt;
  * </pre>
  *
+ * @see NodeTypeConstants#NAMESPACE
+ *
  * @todo currently the nodetype report is not consistent with the general way of representing
nodetype names (with NodetypeElement) in order to be compatible with the jackrabbit nodetype
registry...
  * @todo for the same reason, not the complete nodetype-definition, but only the nodetype
def as stored is represented.
  * @todo no namespace definition with response (> jackrabbit)... and nodetype element
has same name as the one used with dav-properties
@@ -85,7 +87,7 @@
         }
         DavSession session = resource.getSession();
         if (session == null || session.getRepositorySession() == null) {
-            throw new IllegalArgumentException("The resource must provide a non-null session
object in order to create the jcr:nodetypes report.");
+            throw new IllegalArgumentException("The resource must provide a non-null session
object in order to create the nodetypes report.");
         }
         this.session = session.getRepositorySession();
     }
@@ -93,12 +95,12 @@
     /**
      * @param info
      * @throws IllegalArgumentException if the specified info does not contain
-     * a jcr:nodetypes element.
+     * a {@link org.apache.jackrabbit.webdav.jcr.ItemResourceConstants#NAMESPACE dcr}:{@link
NodeTypeConstants#XML_NODETYPES nodetypes} element.
      * @see Report#setInfo(org.apache.jackrabbit.webdav.version.report.ReportInfo)
      */
     public void setInfo(ReportInfo info) {
         if (info == null || !"nodetypes".equals(info.getReportElement().getName())) {
-            throw new IllegalArgumentException("jcr:nodetypes element expected.");
+            throw new IllegalArgumentException("dcr:nodetypes element expected.");
         }
         this.info = info;
     }
@@ -114,7 +116,7 @@
      */
     public Document toXml() throws DavException {
         if (info == null || session == null) {
-            throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR, "Error while
running jcr:nodetypes report");
+            throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR, "Error while
running nodetypes report");
         }
         try {
             Element report = new Element(XML_NODETYPES);
@@ -203,7 +205,7 @@
             List ntList = new ArrayList();
             List elemList = info.getReportElement().getChildren(XML_NODETYPE, NAMESPACE);
             if (elemList.isEmpty()) {
-                // throw exception if the request body does not contain a single jcr:nodetype
element
+                // throw exception if the request body does not contain a single nodetype
element
                 throw new DavException(DavServletResponse.SC_BAD_REQUEST, "NodeTypes report:
request body has invalid format.");
             }
             Iterator elemIter = elemList.iterator();

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/RegisteredNamespacesReport.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/RegisteredNamespacesReport.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/RegisteredNamespacesReport.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/RegisteredNamespacesReport.java
Mon Aug  8 03:40:56 2005
@@ -83,7 +83,7 @@
         try {
             DavSession session = resource.getSession();
             if (session == null || session.getRepositorySession() == null) {
-                throw new IllegalArgumentException("The resource must provide a non-null
session object in order to create the jcr:nodetypes report.");
+                throw new IllegalArgumentException("The resource must provide a non-null
session object in order to create the registerednamespaces report.");
             }
             nsReg = session.getRepositorySession().getWorkspace().getNamespaceRegistry();
         } catch (RepositoryException e) {
@@ -94,12 +94,12 @@
     /**
      * @param info
      * @throws IllegalArgumentException if the specified info does not contain
-     * a jcr:nodetypes element.
+     * a {@link ItemResourceConstants#NAMESPACE dcr}:registerednamespaces element.
      * @see org.apache.jackrabbit.webdav.version.report.Report#setInfo(org.apache.jackrabbit.webdav.version.report.ReportInfo)
      */
     public void setInfo(ReportInfo info) {
         if (info == null || !"registerednamespaces".equals(info.getReportElement().getName()))
{
-            throw new IllegalArgumentException("jcr:registerednamespaces element expected.");
+            throw new IllegalArgumentException("registerednamespaces element expected.");
         }
         this.info = info;
     }
@@ -115,7 +115,7 @@
      */
     public Document toXml() throws DavException {
         if (info == null || nsReg == null) {
-            throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR, "Error while
running jcr:registerednamespaces report");
+            throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR, "Error while
running registerednamespaces report");
         }
         try {
 	    String[] prefixes = nsReg.getPrefixes();

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/RepositoryDescriptorsReport.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/RepositoryDescriptorsReport.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/RepositoryDescriptorsReport.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/version/report/RepositoryDescriptorsReport.java
Mon Aug  8 03:40:56 2005
@@ -30,7 +30,7 @@
 
 /**
  * <code>RepositoryDescriptorsReport</code> allows to retrieve the repository
- * descriptors. The request body must be an empty 'jcr:repositorydescriptors' element:
+ * descriptors. The request body must be an empty 'dcr:repositorydescriptors' element:
  * <pre>
  * &lt;!ELEMENT repositorydescriptors EMPTY &gt;
  * </pre>
@@ -79,7 +79,7 @@
         }
         DavSession session = resource.getSession();
         if (session == null || session.getRepositorySession() == null) {
-            throw new IllegalArgumentException("The resource must provide a non-null session
object in order to create the jcr:nodetypes report.");
+            throw new IllegalArgumentException("The resource must provide a non-null session
object in order to create the repositorydescriptors report.");
         }
         repository = session.getRepositorySession().getRepository();
     }
@@ -87,12 +87,12 @@
     /**
      * @param info
      * @throws IllegalArgumentException if the specified info does not contain
-     * a jcr:nodetypes element.
+     * a {@link ItemResourceConstants#NAMESPACE dcr}:repositorydescriptors element.
      * @see org.apache.jackrabbit.webdav.version.report.Report#setInfo(org.apache.jackrabbit.webdav.version.report.ReportInfo)
      */
     public void setInfo(ReportInfo info) {
         if (info == null || !"repositorydescriptors".equals(info.getReportElement().getName()))
{
-            throw new IllegalArgumentException("jcr:repositorydescriptors element expected.");
+            throw new IllegalArgumentException("repositorydescriptors element expected.");
         }
     }
 

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
Mon Aug  8 03:40:56 2005
@@ -21,6 +21,8 @@
 import java.io.*;
 
 import org.apache.jackrabbit.webdav.*;
+import org.apache.jackrabbit.webdav.transaction.TransactionConstants;
+import org.apache.jackrabbit.webdav.observation.ObservationConstants;
 import org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock;
 import org.apache.jackrabbit.webdav.jcr.JcrDavException;
 import org.apache.jackrabbit.webdav.lock.*;
@@ -41,6 +43,13 @@
     /** the default logger */
     private static final Logger log = Logger.getLogger(DavResourceImpl.class);
 
+    private static final HashMap reservedNamespaces = new HashMap();
+    static {
+        reservedNamespaces.put(DavConstants.NAMESPACE.getPrefix(), DavConstants.NAMESPACE.getURI());
+        reservedNamespaces.put(ObservationConstants.NAMESPACE.getPrefix(), ObservationConstants.NAMESPACE.getURI());
+        reservedNamespaces.put(TransactionConstants.NAMESPACE.getPrefix(), TransactionConstants.NAMESPACE.getURI());
+    }
+
     private DavResourceFactory factory;
     private LockManager lockManager;
     private DavSession session;
@@ -256,10 +265,7 @@
                 while (it.hasNext()) {
                     Property p = it.nextProperty();
                     String pName = p.getName();
-                    String prefix = Text.getNamespacePrefix(pName);
-                    String uri = node.getSession().getNamespaceURI(prefix);
-                    Namespace namespace = Namespace.getNamespace(prefix, uri);
-                    DavPropertyName name = DavPropertyName.create(Text.getLocalName(pName),
namespace);
+                    DavPropertyName name = getDavName(pName, node.getSession());
                     if (p.getDefinition().isMultiple()) {
                         log.debug("Multivalued property '" + pName + "' not added to webdav
property set.");
                     } else {
@@ -761,6 +767,26 @@
     }
 
     /**
+     * Builds a webdav property name from the given jcrName. In case the jcrName
+     * contains a namespace prefix that would conflict with any of the predefined
+     * webdav namespaces a new prefix is assigned.
+     *
+     * @param jcrName
+     * @return namespace
+     */
+    private DavPropertyName getDavName(String jcrName, Session session) throws RepositoryException
{
+        String prefix = Text.getNamespacePrefix(jcrName);
+        String uri = session.getNamespaceURI(prefix);
+        // check for conflicts with reserved webdav-namespaces
+        if (reservedNamespaces.containsKey(prefix) && !reservedNamespaces.get(prefix).equals(uri))
{
+            prefix = prefix + "0";
+        }
+        Namespace namespace = Namespace.getNamespace(prefix, uri);
+        DavPropertyName name = DavPropertyName.create(Text.getLocalName(jcrName), namespace);
+        return name;
+    }
+
+    /**
      * Build jcr property name from dav property name
      *
      * @param propName
@@ -777,7 +803,11 @@
         return pName;
     }
 
-
+    /**
+     *
+     * @param property
+     * @throws RepositoryException
+     */
     private void setJcrProperty(DavProperty property) throws RepositoryException {
         // retrieve value
         String value = property.getValue().toString();
@@ -786,6 +816,11 @@
         node.setProperty(getJcrName(property.getName()), value);
     }
 
+    /**
+     *
+     * @param propertyName
+     * @throws RepositoryException
+     */
     private void removeJcrProperty(DavPropertyName propertyName) throws RepositoryException
{
         node.getProperty(getJcrName(propertyName)).remove();
     }

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java
Mon Aug  8 03:40:56 2005
@@ -29,7 +29,7 @@
     /**
      * The namespace
      */
-    public static final Namespace NAMESPACE = Namespace.getNamespace("jcr", "http://www.day.com/jcr/webdav/1.0");
+    public static final Namespace NAMESPACE = Namespace.getNamespace("dcr", "http://www.day.com/jcr/webdav/1.0");
 
     /**
      * The SubscriptionId request header<br>

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/search/SearchInfo.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/search/SearchInfo.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/search/SearchInfo.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/search/SearchInfo.java
Mon Aug  8 03:40:56 2005
@@ -29,8 +29,8 @@
  *
  * Example of a valid 'searchrequest' body
  * <pre>
- * &lt;d:searchrequest xmlns:d="DAV:" jcr:="http://www.day.com/jcr/webdav/1.0" &gt;
- *    &lt;jcr:xpath>//sv:node[@sv:name='myapp:paragraph'][1]&lt;/jcr:xpath&gt;
+ * &lt;d:searchrequest xmlns:d="DAV:" dcr:="http://www.day.com/jcr/webdav/1.0" &gt;
+ *    &lt;dcr:xpath>//sv:node[@sv:name='myapp:paragraph'][1]&lt;/dcr:xpath&gt;
  * &lt;/d:searchrequest&gt;
  * </pre>
  *

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TransactionConstants.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TransactionConstants.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TransactionConstants.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TransactionConstants.java
Mon Aug  8 03:40:56 2005
@@ -33,7 +33,7 @@
     /**
      * Namespace for transaction related xml elements
      */
-    public static final Namespace NAMESPACE = Namespace.getNamespace("jcr", "http://www.day.com/jcr/webdav/1.0");
+    public static final Namespace NAMESPACE = Namespace.getNamespace("dcr", "http://www.day.com/jcr/webdav/1.0");
 
     /**
      * TransactionId Header

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TransactionInfo.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TransactionInfo.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TransactionInfo.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TransactionInfo.java
Mon Aug  8 03:40:56 2005
@@ -52,7 +52,7 @@
         }
         Element tStatus = transactionInfo.getChild(XML_TRANSACTIONSTATUS, NAMESPACE);
         if (tStatus == null) {
-            throw new IllegalArgumentException("transactionInfo must contain a single 'jcr:transactionstatus'
element.");
+            throw new IllegalArgumentException("transactionInfo must contain a single 'transactionstatus'
element.");
         }
 
         // retrieve status: commit or rollback

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TxLockManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TxLockManager.java?rev=230783&r1=230782&r2=230783&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TxLockManager.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/transaction/TxLockManager.java
Mon Aug  8 03:40:56 2005
@@ -8,7 +8,7 @@
 
 /**
  * <code>TxLockManager</code> manages locks with locktype
- * '{@link TransactionConstants#TRANSACTION jcr:transaction}'.
+ * '{@link TransactionConstants#TRANSACTION dcr:transaction}'.
  *
  * todo: removing all expired locks
  * todo: 'local' and 'global' are not accurate terms in the given context > replace



Mime
View raw message