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 re...@locus.apache.org on 2000/09/19 06:21:15 UTC
cvs commit: jakarta-slide/src/share/org/apache/slide/webdav/method LockMethod.java MkcolMethod.java UnlockMethod.java WebdavMethod.java
remm 00/09/18 21:21:14
Modified: . STATUS.html build.xml
src/share/org/apache/slide/authenticate
CredentialsToken.java
src/share/org/apache/slide/webdav/method LockMethod.java
MkcolMethod.java UnlockMethod.java
WebdavMethod.java
Log:
- Lock-null resources support
- Proper handling of lock tokens (part 1)
- Status updates
Revision Changes Path
1.16 +112 -92 jakarta-slide/STATUS.html
Index: STATUS.html
===================================================================
RCS file: /home/cvs/jakarta-slide/STATUS.html,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- STATUS.html 2000/09/04 23:49:10 1.15
+++ STATUS.html 2000/09/19 04:21:03 1.16
@@ -1,6 +1,6 @@
<html>
<head>
- <title>Action Items List for Slide 1.x</title>
+ <title>Action Items List for Slide</title>
</head>
<body bgcolor="white">
@@ -56,10 +56,11 @@
<li><a href="#Webdav">WebDAV Server</a>
<li><a href="#Samples">Samples and Tests</a>
<li><a href="#Documentation">Documentation</a>
+ <li><a href="#Slide2">Slide 2.x</a>
</ul>
<br><br>
- <div align="center"><hr width="75%"</div>
+ <div align="center"><hr width="75%"></div>
<br>
<a name="Architecture"></a>
@@ -73,14 +74,6 @@
<tr>
<td align="center">High</td>
<td>
- Make the helpers pluggable.
- [org.apache.slide.common]
- </td>
- <td><a href="mailto:remm@apache.org">Remy Maucherat</a></td>
- </tr>
- <tr>
- <td align="center">High</td>
- <td>
Improve lifecycle handling of namespaces.
[org.apache.slide.common]
</td>
@@ -111,37 +104,6 @@
<tr>
<td align="center">Low</td>
<td>
- Add working revisions support.
- [org.apache.slide.content.NodeRevisionDescriptors]
- </td>
- <td>---</td>
- </tr>
- <tr>
- <td align="center">Low</td>
- <td>
- Design and implement a searching/indexing component.
- </td>
- <td>---</td>
- </tr>
- <tr>
- <td align="center">Low</td>
- <td>
- Implement a bare bone process engine to deal with approvals,
- acknowledgements, ...
- </td>
- <td><a href="mailto:remm@apache.org">Remy Maucherat</a></td>
- </tr>
- <tr>
- <td align="center">Low</td>
- <td>
- Add full role resolution (with caching).
- [org.apache.slide.content.NodeRevisionDescriptors]
- </td>
- <td>---</td>
- </tr>
- <tr>
- <td align="center">Low</td>
- <td>
Finish non linear versioning support (merging and branching).
[org.apache.slide.content]
</td>
@@ -191,23 +153,8 @@
</td>
</tr>
<tr>
- <td align="center">Medium</td>
- <td>
- Write a GUI based client using the DAV library.
- </td>
- <td>---</td>
- </tr>
- <tr>
<td align="center">Low</td>
<td>
- Design and develop a Slide JSP Taglib (see the jakarta-taglibs
- project for more details).
- </td>
- <td>---</td>
- </tr>
- <tr>
- <td align="center">Low</td>
- <td>
Do a Slide implementation of Catalina's Resources interface.
</td>
<td><a href="mailto:remm@apache.org">Remy Maucherat</a></td>
@@ -241,20 +188,6 @@
</td>
<td><a href="mailto:cvrc@netscape.com">Murthy Chintalapati</a></td>
</tr>
- <tr>
- <td align="center">Medium</td>
- <td>
- PVCS descriptors and content store.
- </td>
- <td><a href="mailto:bcholmes@interlog.com">B.C. Holmes</a></td>
- </tr>
- <tr>
- <td align="center">Medium</td>
- <td>
- CVS descriptors and content store.
- </td>
- <td>---</td>
- </tr>
</table>
@@ -280,27 +213,6 @@
<tr>
<td align="center">Medium</td>
<td>
- Locks related headers support.
- </td>
- <td><a href="mailto:remm@apache.org">Remy Maucherat</a></td>
- </tr>
- <tr>
- <td align="center">Medium</td>
- <td>
- Lock a non-existing resource.
- </td>
- <td>---</td>
- </tr>
- <tr>
- <td align="center">Medium</td>
- <td>
- MKCOL doesn't return 409 - Conflict.
- </td>
- <td>---</td>
- </tr>
- <tr>
- <td align="center">Medium</td>
- <td>
Add a nice collection browser (returned when someone does a GET on
a collection object), using Catalina code.
</td>
@@ -375,9 +287,117 @@
</table>
+ <br><br>
+ <div align="center"><hr width="75%"></div>
+ <br>
+
+ <a name="Slide2"></a>
+ <div align="center"><h1>Slide 2.x Wishlist</h1></div>
+ <table border="1" width="100%">
+ <tr>
+ <th width="10%">Priority</th>
+ <th width="60%">Action Item</th>
+ <th width="30%">Volunteers</th>
+ </tr>
+ <tr>
+ <td align="center"></td>
+ <td>
+ Rewrite of the core and of most of the helpers. Objective : cleaner
+ design with more functionality, while keeping the same API mostly
+ unchanged.
+ </td>
+ <td><a href="mailto:remm@apache.org">Remy Maucherat</a></td>
+ </tr>
+ <tr>
+ <td align="center"></td>
+ <td>
+ Make the helpers pluggable.
+ [org.apache.slide.common]
+ </td>
+ <td><a href="mailto:remm@apache.org">Remy Maucherat</a></td>
+ </tr>
+ <tr>
+ <td align="center"></td>
+ <td>
+ Add working revisions support.
+ [org.apache.slide.content.NodeRevisionDescriptors]
+ </td>
+ <td>---</td>
+ </tr>
+ <tr>
+ <td align="center"></td>
+ <td>
+ Design and implement a searching/indexing component.
+ </td>
+ <td>---</td>
+ </tr>
+ <tr>
+ <td align="center"></td>
+ <td>
+ Design and implement a bare bone process engine to deal with
+ approvals, acknowledgements, ...
+ </td>
+ <td><a href="mailto:remm@apache.org">Remy Maucherat</a></td>
+ </tr>
+ <tr>
+ <td align="center"></td>
+ <td>
+ Add full role resolution (with caching).
+ [org.apache.slide.content.NodeRevisionDescriptors]
+ </td>
+ <td>---</td>
+ </tr>
+ <tr>
+ <td align="center"></td>
+ <td>
+ Delta V support.
+ [org.apache.slide.webdav]
+ </td>
+ <td>---</td>
+ </tr>
+ <tr>
+ <td align="center"></td>
+ <td>
+ DASL support.
+ [org.apache.slide.webdav]
+ </td>
+ <td>---</td>
+ </tr>
+ <tr>
+ <td align="center"></td>
+ <td>
+ PVCS descriptors and content store.
+ </td>
+ <td><a href="mailto:bcholmes@interlog.com">B.C. Holmes</a></td>
+ </tr>
+ <tr>
+ <td align="center"></td>
+ <td>
+ CVS descriptors and content store.
+ </td>
+ <td>---</td>
+ </tr>
+ <tr>
+ <td align="center"></td>
+ <td>
+ Write a GUI based client using the DAV library.
+ </td>
+ <td>---</td>
+ </tr>
+ <tr>
+ <td align="center"></td>
+ <td>
+ Design and develop a Slide JSP Taglib (see the jakarta-taglibs
+ project for more details).
+ </td>
+ <td>---</td>
+ </tr>
+ </table>
+
+
<br>
<div align="center"><hr width="75%"><font size="2">
- $Id: STATUS.html,v 1.15 2000/09/04 23:49:10 remm Exp $
+ $Id: STATUS.html,v 1.16 2000/09/19 04:21:03 remm Exp $
</font></div>
</body>
1.41 +0 -2 jakarta-slide/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-slide/build.xml,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- build.xml 2000/09/13 23:04:27 1.40
+++ build.xml 2000/09/19 04:21:04 1.41
@@ -392,8 +392,6 @@
<jar jarfile="${dav.dist}/lib/webserver.jar"
basedir="${catalina.build}/classes"
includes="org/apache/catalina/**,**/*.properties" />
- <copyfile src="${catalina.dist}/server/catalina.jar"
- dest="${dav.dist}/lib/webserver.jar" />
<javac srcdir="src/clients/tomcat"
destdir="${slide.build}/classes"
debug="off" deprecation="off"
1.2 +77 -3 jakarta-slide/src/share/org/apache/slide/authenticate/CredentialsToken.java
Index: CredentialsToken.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/authenticate/CredentialsToken.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CredentialsToken.java 2000/05/09 02:47:18 1.1
+++ CredentialsToken.java 2000/09/19 04:21:06 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/authenticate/CredentialsToken.java,v 1.1 2000/05/09 02:47:18 remm Exp $
- * $Revision: 1.1 $
- * $Date: 2000/05/09 02:47:18 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/authenticate/CredentialsToken.java,v 1.2 2000/09/19 04:21:06 remm Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/09/19 04:21:06 $
*
* ====================================================================
*
@@ -64,6 +64,7 @@
package org.apache.slide.authenticate;
import java.security.Principal;
+import java.util.Hashtable;
/**
* Credentials token class.
@@ -82,6 +83,7 @@
public CredentialsToken(String credentials) {
this.credentials = credentials;
this.trusted = false;
+ this.enforceLockTokens = false;
}
@@ -93,6 +95,7 @@
public CredentialsToken(Principal principal) {
this.credentials = principal.getName();
this.trusted = true;
+ this.enforceLockTokens = false;
}
@@ -111,6 +114,18 @@
private boolean trusted;
+ /**
+ * Use lock tokens for lock resolution.
+ */
+ private boolean enforceLockTokens;
+
+
+ /**
+ * Lock tokens.
+ */
+ private Hashtable lockTokens = new Hashtable();
+
+
// ------------------------------------------------------------- Properties
@@ -143,5 +158,64 @@
public String getPublicCredentials() {
return credentials;
}
+
+ /**
+ * Use lock tokens in lock resolution ?
+ *
+ * @return boolean
+ */
+ public boolean isEnforceLockTokens() {
+ return enforceLockTokens;
+ }
+
+
+ /**
+ * Enforce lock tokens flag mutator.
+ *
+ * @param enforceLockTokens New flag value
+ */
+ public void setEnforceLockTokens(boolean enforceLockTokens) {
+ this.enforceLockTokens = enforceLockTokens;
+ }
+
+
+ /**
+ * Add a new lock token to the lock token list.
+ *
+ * @param lockToken Lock token to add
+ */
+ public void addLockToken(String lockId) {
+ lockTokens.put(lockId, lockId);
+ }
+
+
+ /**
+ * Removes a lock token from the lock token list.
+ *
+ * @param lockToken Lock token to remove
+ */
+ public void removeLockToken(String lockId) {
+ lockTokens.remove(lockId);
+ }
+
+
+ /**
+ * Clears the lock token list.
+ */
+ public void clearLockTokens() {
+ lockTokens.clear();
+ }
+
+
+ /**
+ * Checks if the given lock token is present.
+ *
+ * @param lockToken Lock token to check
+ * @return boolean True if the given lock token is present
+ */
+ public boolean checkLockToken(String lockToken) {
+ return lockTokens.contains(lockToken);
+ }
+
}
1.9 +36 -10 jakarta-slide/src/share/org/apache/slide/webdav/method/LockMethod.java
Index: LockMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/webdav/method/LockMethod.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- LockMethod.java 2000/09/05 05:38:10 1.8
+++ LockMethod.java 2000/09/19 04:21:08 1.9
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/webdav/method/LockMethod.java,v 1.8 2000/09/05 05:38:10 remm Exp $
- * $Revision: 1.8 $
- * $Date: 2000/09/05 05:38:10 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/webdav/method/LockMethod.java,v 1.9 2000/09/19 04:21:08 remm Exp $
+ * $Revision: 1.9 $
+ * $Date: 2000/09/19 04:21:08 $
*
* ====================================================================
*
@@ -325,11 +325,11 @@
case Node.ELEMENT_NODE:
String tempScope = currentNode.getNodeName();
if (tempScope.indexOf(':') != -1) {
- lockInfo_lockScope = "<d:"
+ lockInfo_lockScope = "<"
+ tempScope.substring(tempScope.indexOf(':')
+ 1) + "/>";
} else {
- lockInfo_lockScope = "<d:" + tempScope + "/>";
+ lockInfo_lockScope = "<" + tempScope + "/>";
}
System.out.println("Lock scope : "
+ lockInfo_lockScope);
@@ -358,11 +358,11 @@
case Node.ELEMENT_NODE:
String tempType = currentNode.getNodeName();
if (tempType.indexOf(':') != -1) {
- lockInfo_lockType = "<d:"
+ lockInfo_lockType = "<"
+ tempType.substring(tempType.indexOf(':') + 1)
+ "/>";
} else {
- lockInfo_lockType = "<d:" + tempType + "/>";
+ lockInfo_lockType = "<" + tempType + "/>";
}
System.out.println("Lock type : " + lockInfo_lockType);
break;
@@ -432,8 +432,34 @@
NamespaceConfig namespaceConfig = token.getNamespaceConfig();
- toLockSubject = (SubjectNode) structure
- .retrieve(credToken, lockInfo_lockSubject);
+ try {
+ toLockSubject = (SubjectNode) structure
+ .retrieve(credToken, lockInfo_lockSubject);
+ } catch (ObjectNotFoundException ex) {
+
+ // Creating a lock null resource
+ toLockSubject = new SubjectNode();
+
+ // Creating new subject
+ structure.create(credToken, toLockSubject,
+ lockInfo_lockSubject);
+
+ NodeRevisionDescriptor revisionDescriptor =
+ new NodeRevisionDescriptor(0);
+
+ NodeProperty property = null;
+
+ // Resource type
+ property = new NodeProperty("resourcetype",
+ "<lock-null/>", true);
+ revisionDescriptor.setProperty(property);
+
+ // Creating the revision descriptor
+ content.create(credToken, lockInfo_lockSubject,
+ revisionDescriptor, null);
+
+ }
+
SubjectNode credentialsSubject =
(SubjectNode) structure.retrieve
(credToken, namespaceConfig.getUsersPath() + "/"
@@ -443,7 +469,7 @@
boolean inheritance = (depth != 0);
boolean exclusive =
- !(lockInfo_lockScope.equals("<d:shared/>"));
+ !(lockInfo_lockScope.equals("<shared/>"));
Date lockDate = new Date((new Date()).getTime()
+ (lockDuration * 1000));
1.6 +4 -4 jakarta-slide/src/share/org/apache/slide/webdav/method/MkcolMethod.java
Index: MkcolMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/webdav/method/MkcolMethod.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MkcolMethod.java 2000/09/05 05:38:10 1.5
+++ MkcolMethod.java 2000/09/19 04:21:09 1.6
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/webdav/method/MkcolMethod.java,v 1.5 2000/09/05 05:38:10 remm Exp $
- * $Revision: 1.5 $
- * $Date: 2000/09/05 05:38:10 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/webdav/method/MkcolMethod.java,v 1.6 2000/09/19 04:21:09 remm Exp $
+ * $Revision: 1.6 $
+ * $Date: 2000/09/19 04:21:09 $
*
* ====================================================================
*
@@ -148,7 +148,7 @@
NodeProperty property = null;
// Resource type
- property = new NodeProperty("resourcetype", "<d:collection/>", true);
+ property = new NodeProperty("resourcetype", "<collection/>", true);
revisionDescriptor.setProperty(property);
// Creation date
1.4 +22 -43 jakarta-slide/src/share/org/apache/slide/webdav/method/UnlockMethod.java
Index: UnlockMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/webdav/method/UnlockMethod.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- UnlockMethod.java 2000/09/05 05:38:10 1.3
+++ UnlockMethod.java 2000/09/19 04:21:09 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/webdav/method/UnlockMethod.java,v 1.3 2000/09/05 05:38:10 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/09/05 05:38:10 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/webdav/method/UnlockMethod.java,v 1.4 2000/09/19 04:21:09 remm Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/09/19 04:21:09 $
*
* ====================================================================
*
@@ -156,48 +156,26 @@
lock.unlock(credToken, requestUri, lockId);
- /*
- Enumeration lockTokens =
- lock.enumerateLocks(credToken, toUnlock);
-
- NodeLock lockToUnlock = null;
- Date expirationDate = null;
- String lockOwner = null;
- NodeLock currentLockToken = null;
-
- while (lockTokens.hasMoreElements()) {
- currentLockToken = (NodeLock) lockTokens.nextElement();
- if (lockId.equals(currentLockToken.getLockId())) {
- lockToUnlock = currentLockToken;
- lockOwner = currentLockToken.getSubjectUri();
- expirationDate = currentLockToken.getExpirationDate();
- }
+ // 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(credToken, requestUri);
+ NodeRevisionDescriptors revisionDescriptors =
+ content.retrieve(credToken, requestUri);
+ NodeRevisionDescriptor revisionDescriptor =
+ content.retrieve(credToken, revisionDescriptors);
+ NodeProperty typeProperty =
+ revisionDescriptor.getProperty
+ (NodeRevisionDescriptor.TYPE);
+
+ if (typeProperty.getValue().toString()
+ .equals("<lock-null/>")) {
+
+ content.remove(credToken, requestUri, revisionDescriptor);
+ content.remove(credToken, revisionDescriptors);
+ structure.remove(credToken, node);
+
}
- if (lockToUnlock != null) {
- currentLockToken = null;
- lockTokens = lock.enumerateLocks(credToken, toUnlock);
- while (lockTokens.hasMoreElements()) {
- currentLockToken = (NodeLock) lockTokens.nextElement();
- if ((lockOwner.equals
- (currentLockToken.getSubjectUri()))
- && (expirationDate.equals
- (currentLockToken.getExpirationDate()))) {
- System.out.println("Unlock : " + currentLockToken);
- lock.unlock(credToken, currentLockToken);
- } else {
- System.out.println("Didn't unlock "
- + currentLockToken);
- System.out.println("Exp date : "
- + expirationDate.getTime());
- System.out.println("Exp date lock : "
- + currentLockToken
- .getExpirationDate().getTime());
-
- }
- }
- }
- */
resp.setStatus(WebdavStatus.SC_NO_CONTENT);
} catch (SlideException e) {
@@ -208,5 +186,6 @@
}
}
+
}
1.6 +21 -3 jakarta-slide/src/share/org/apache/slide/webdav/method/WebdavMethod.java
Index: WebdavMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/webdav/method/WebdavMethod.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- WebdavMethod.java 2000/09/04 23:49:12 1.5
+++ WebdavMethod.java 2000/09/19 04:21:09 1.6
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/webdav/method/WebdavMethod.java,v 1.5 2000/09/04 23:49:12 remm Exp $
- * $Revision: 1.5 $
- * $Date: 2000/09/04 23:49:12 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/webdav/method/WebdavMethod.java,v 1.6 2000/09/19 04:21:09 remm Exp $
+ * $Revision: 1.6 $
+ * $Date: 2000/09/19 04:21:09 $
*
* ====================================================================
*
@@ -234,8 +234,12 @@
this.credToken = new CredentialsToken("");
}
+ this.credToken.setEnforceLockTokens(true);
+
this.requestUri = getRelativePath(req);
+ parseHeaders();
+
System.out.println(System.currentTimeMillis() + " - "
+ req.getMethod() + " on object " + requestUri);
@@ -354,6 +358,20 @@
e.printStackTrace();
}
}
+
+ }
+
+
+ /**
+ * Parse lock token headers.
+ */
+ protected void parseHeaders() {
+
+ // Retrieve if header
+ String ifHeader = req.getHeader("If");
+
+ // Parse if header and extract the lock tokens
+
}