You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ju...@apache.org on 2002/04/08 14:47:01 UTC
cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method UnlockMethod.java
juergen 02/04/08 05:47:00
Modified: src/webdav/server/org/apache/slide/webdav/method
UnlockMethod.java
Log:
Check-in resource if this has to be done due to auto-versioning semantics.
(ralf)
Revision Changes Path
1.17 +30 -6 jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java
Index: UnlockMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- UnlockMethod.java 28 Mar 2002 06:12:12 -0000 1.16
+++ UnlockMethod.java 8 Apr 2002 12:47:00 -0000 1.17
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java,v 1.16 2002/03/28 06:12:12 jericho Exp $
- * $Revision: 1.16 $
- * $Date: 2002/03/28 06:12:12 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java,v 1.17 2002/04/08 12:47:00 juergen Exp $
+ * $Revision: 1.17 $
+ * $Date: 2002/04/08 12:47:00 $
*
* ====================================================================
*
@@ -76,6 +76,16 @@
import org.apache.slide.content.*;
import org.apache.slide.security.AccessDeniedException;
import org.apache.slide.structure.*;
+import org.apache.slide.webdav.util.WebdavUtils;
+import org.apache.slide.webdav.util.DeltavConstants;
+import org.apache.slide.webdav.util.VersioningHelper;
+import org.apache.slide.webdav.util.PreconditionViolationException;
+import org.apache.slide.webdav.util.ViolatedPrecondition;
+import org.apache.slide.webdav.util.UriHandler;
+import org.apache.slide.webdav.util.resourcekind.ResourceKind;
+import org.apache.slide.webdav.util.resourcekind.AbstractResourceKind;
+import org.apache.slide.webdav.util.resourcekind.CheckedOutVersionControlled;
+import org.apache.slide.util.Configuration;
/**
* UNLOCK method.
@@ -162,13 +172,27 @@
lock.unlock(slideToken, requestUri, lockId);
- // Checking if the resource at the URI isn't a lock-null
- // resource, in which case we must attempt to delete it
- ObjectNode node = structure.retrieve(slideToken, requestUri);
NodeRevisionDescriptors revisionDescriptors =
content.retrieve(slideToken, requestUri);
NodeRevisionDescriptor revisionDescriptor =
content.retrieve(slideToken, revisionDescriptors);
+
+ // Check if resource must be checked in due to auto-versioning
+ // semantics.
+ ResourceKind resourceKind = AbstractResourceKind.determineResourceKind(revisionDescriptor);
+ if( Configuration.useVersionControl() &&
+ (resourceKind instanceof CheckedOutVersionControlled) ) {
+ NodeProperty checkinLocktokenProperty = revisionDescriptor.getProperty(VersioningHelper.P_CHECKIN_LOCKTOKEN);
+ if ( (checkinLocktokenProperty != null) && (checkinLocktokenProperty.getValue() != null) &&
+ lockId.equals(checkinLocktokenProperty.getValue().toString()) ) {
+ VersioningHelper versionHelper = VersioningHelper.getVersioningHelper(slideToken, token, req, resp, config);
+ versionHelper.checkin(revisionDescriptors, revisionDescriptor, false, false);
+ }
+ }
+
+ // Checking if the resource at the URI isn't a lock-null
+ // resource, in which case we must attempt to delete it
+ ObjectNode node = structure.retrieve(slideToken, requestUri);
// String typeProperty = revisionDescriptor.getResourceType();
// if (typeProperty.equals("<lock-null/>")) {
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>