jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r899643 - /jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DavResourceFactoryImpl.java
Date Fri, 15 Jan 2010 14:28:25 GMT
Author: angela
Date: Fri Jan 15 14:28:25 2010
New Revision: 899643

URL: http://svn.apache.org/viewvc?rev=899643&view=rev
Log:
JCR-2262 - o.a.j.webdav.jcr.DavResourceFactoryImpl#createResource creates VersionControlledResource
instances regardless of mix:versionable status

Modified:
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DavResourceFactoryImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DavResourceFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DavResourceFactoryImpl.java?rev=899643&r1=899642&r2=899643&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DavResourceFactoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DavResourceFactoryImpl.java
Fri Jan 15 14:28:25 2010
@@ -33,6 +33,7 @@
 import org.apache.jackrabbit.webdav.transaction.TransactionResource;
 import org.apache.jackrabbit.webdav.version.DeltaVServletRequest;
 import org.apache.jackrabbit.webdav.version.VersionControlledResource;
+import org.apache.jackrabbit.JcrConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -98,13 +99,15 @@
             try {
                 resource = createResourceForItem(locator, session);
 
+                Item item = getItem(session, locator);
+                boolean versionable = item.isNode() && ((Node) item).isNodeType(JcrConstants.MIX_VERSIONABLE);
+
                 /* if the created resource is version-controlled and the request
                 contains a Label header, the corresponding Version must be used
                 instead.*/
-                if (request instanceof DeltaVServletRequest && isVersionControlled(resource))
{
+                if (request instanceof DeltaVServletRequest && versionable &&
isVersionControlled(resource)) {
                     String labelHeader = ((DeltaVServletRequest)request).getLabel();
                     if (labelHeader != null && DavMethods.isMethodAffectedByLabel(request))
{
-                        Item item = getItem(session, locator);
                         Version v = ((Node)item).getVersionHistory().getVersionByLabel(labelHeader);
                         DavResourceLocator vloc = locator.getFactory().createResourceLocator(locator.getPrefix(),
locator.getWorkspacePath(), v.getPath(), false);
                         resource =  new VersionItemCollection(vloc, session, this, v);



Mime
View raw message