pnever 2003/03/26 08:21:19
Modified: proposals/wvcm/src/javax/wvcm PropertyNameList.java
proposals/wvcm/src/org/apache/webdav/methods
DeleteMethod.java GetMethod.java HeadMethod.java
MkactivityMethod.java MkcolMethod.java
MkworkspaceMethod.java OptionsMethod.java
PropfindMethod.java PutMethod.java
ReportMethod.java VersionControlMethod.java
proposals/wvcm/src/org/apache/wvcm ActivityImpl.java
BaselineImpl.java ConfigurationImpl.java
ControllableResourceImpl.java FolderImpl.java
FolderVersionImpl.java LocationImpl.java
ProviderImpl.java ResourceImpl.java
VersionHistoryImpl.java VersionImpl.java
WorkspaceImpl.java
proposals/wvcm/src/org/apache/wvcm/model
PropertyDescriptor.java
proposals/wvcm/src/org/apache/wvcm/store Accessor.java
AccessorFactory.java ActivityAccessor.java
BaselineAccessor.java ConfigurationAccessor.java
ControllableResourceAccessor.java
FolderAccessor.java FolderVersionAccessor.java
ResourceAccessor.java VersionAccessor.java
VersionHistoryAccessor.java WorkspaceAccessor.java
proposals/wvcm/src/org/apache/wvcm/store/webdav
ActivityWebdavAccessor.java
BaselineWebdavAccessor.java
ConfigurationWebdavAccessor.java
ControllableResourceWebdavAccessor.java
ErrorResponse.java FolderVersionWebdavAccessor.java
FolderWebdavAccessor.java MultistatusResponse.java
OptionsRequest.java OptionsResponse.java
Properties.java PropfindRequest.java
ReportRequest.java ResourceWebdavAccessor.java
VersionHistoryWebdavAccessor.java
VersionWebdavAccessor.java WebdavAccessor.java
WorkspaceWebdavAccessor.java
Added: proposals/wvcm/src/javax/wvcm package.html
proposals/wvcm/src/org/apache/webdav/methods
CheckinMethod.java CheckoutMethod.java package.html
proposals/wvcm/src/org/apache/wvcm package.html
proposals/wvcm/src/org/apache/wvcm/model package.html
proposals/wvcm/src/org/apache/wvcm/store package.html
proposals/wvcm/src/org/apache/wvcm/store/webdav
CheckinRequest.java CheckoutRequest.java
DateRepresentations.java package.html
Log:
More for WVCM
Revision Changes Path
1.3 +3 -0
jakarta-slide/proposals/wvcm/src/javax/wvcm/PropertyNameList.java
Index: PropertyNameList.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/javax/wvcm/PropertyNameList.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PropertyNameList.java 24 Mar 2003 18:05:04 -0000 1.2
+++ PropertyNameList.java 26 Mar 2003 16:21:12 -0000 1.3
@@ -194,6 +194,9 @@
/** @see ControllableResource#getControlledConfiguration */
public static final PropertyName VERSION_CONTROLLED_CONFIGURATION =
new PropertyName("version-controlled-configuration");
+ /** @see Version#getCheckoutList */
+ public static final PropertyName CHECKOUT_LIST =
+ new PropertyName("checkout-list");
// Non-RFC3253 Property Names
1.1 jakarta-slide/proposals/wvcm/src/javax/wvcm/package.html
Index: package.html
===================================================================
<!-- $Id: package.html,v 1.1 2003/03/26 16:21:12 pnever Exp $ -->
<html>
<head>
<title>Package Documentation for javax.wvcm</title>
</head>
<body>
The interfaces of the WVCM standard.
</body>
</html>
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/DeleteMethod.java
Index: DeleteMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/DeleteMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/GetMethod.java
Index: GetMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/GetMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/HeadMethod.java
Index: HeadMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/HeadMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/MkactivityMethod.java
Index: MkactivityMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/MkactivityMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/MkcolMethod.java
Index: MkcolMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/MkcolMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/MkworkspaceMethod.java
Index: MkworkspaceMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/MkworkspaceMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/OptionsMethod.java
Index: OptionsMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/OptionsMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/PropfindMethod.java
Index: PropfindMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/PropfindMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/PutMethod.java
Index: PutMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/PutMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/ReportMethod.java
Index: ReportMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/ReportMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/VersionControlMethod.java
Index: VersionControlMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/VersionControlMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.1
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/CheckinMethod.java
Index: CheckinMethod.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/CheckinMethod.java,v
1.1 2003/03/26 16:21:13 pnever Exp $
* $Revision: 1.1 $
* $Date: 2003/03/26 16:21:13 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Slide", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.webdav.methods;
/**
* Implements the WebDAV CHECKIN specification.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Nevermann</a>
* @version $Revision: 1.1 $
*/
public class CheckinMethod extends
org.apache.commons.httpclient.methods.EntityEnclosingMethod {
/**
* Constructor
*/
public CheckinMethod() {
super();
}
/**
* Constructor
*/
public CheckinMethod( String uri ) {
super( uri );
}
/**
* Returns "CHECKIN"
*
* @return "CHECKIN"
*/
public String getName() {
return "CHECKIN";
}
}
1.1
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/CheckoutMethod.java
Index: CheckoutMethod.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/CheckoutMethod.java,v
1.1 2003/03/26 16:21:13 pnever Exp $
* $Revision: 1.1 $
* $Date: 2003/03/26 16:21:13 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Slide", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.webdav.methods;
/**
* Implements the WebDAV CHECKOUT specification.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Nevermann</a>
* @version $Revision: 1.1 $
*/
public class CheckoutMethod extends
org.apache.commons.httpclient.methods.EntityEnclosingMethod {
/**
* Constructor
*/
public CheckoutMethod() {
super();
}
/**
* Constructor
*/
public CheckoutMethod( String uri ) {
super( uri );
}
/**
* Returns "CHECKOUT"
*
* @return "CHECKOUT"
*/
public String getName() {
return "CHECKOUT";
}
}
1.1
jakarta-slide/proposals/wvcm/src/org/apache/webdav/methods/package.html
Index: package.html
===================================================================
<!-- $Id: package.html,v 1.1 2003/03/26 16:21:13 pnever Exp $ -->
<html>
<head>
<title>Package Documentation for org.apache.webdav.methods</title>
</head>
<body>
Extends Jakarta's commons-httpclient library by WebDAV method
implementations.
</body>
</html>
1.3 +4 -4
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/ActivityImpl.java
Index: ActivityImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/ActivityImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +4 -4
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/BaselineImpl.java
Index: BaselineImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/BaselineImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +4 -4
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/ConfigurationImpl.java
Index: ConfigurationImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/ConfigurationImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +15 -10
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/ControllableResourceImpl.java
Index: ControllableResourceImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/ControllableResourceImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ControllableResourceImpl.java 24 Mar 2003 18:05:05 -0000 1.2
+++ ControllableResourceImpl.java 26 Mar 2003 16:21:14 -0000 1.3
@@ -79,7 +79,7 @@
* @version $Revision$
*/
public class ControllableResourceImpl extends ResourceImpl implements
ControllableResource {
-
+
/**
* Constructor
*/
@@ -253,6 +253,7 @@
* version in one of the activities specified in the activityList.
*/
public void doCheckout(boolean forkOK, List activityList, boolean newActivity,
boolean unreserved) throws WvcmException {
+ ((ControllableResourceAccessor)accessor()).doCheckout( forkOK,
activityList, newActivity, unreserved );
}
/**
@@ -270,6 +271,7 @@
* is discouraged.
*/
public void doCheckin(boolean keepCheckedOut, boolean forkOK) throws
WvcmException {
+ ((ControllableResourceAccessor)accessor()).doCheckin( keepCheckedOut,
forkOK );
}
/**
@@ -277,6 +279,7 @@
* doCheckin(false, true)}
*/
public void doCheckin() throws WvcmException {
+ doCheckin( false, true );
}
/**
@@ -316,7 +319,8 @@
* <code>PropertyName.IS_CHECKED_OUT</code> as a wanted property.
*/
public boolean getIsCheckedOut() throws WvcmException {
- return false;
+ Boolean co = (Boolean)loadedProperties().get( PropertyName.IS_CHECKED_OUT );
+ return co.booleanValue();
}
/**
@@ -356,8 +360,8 @@
* <code>PropertyName.UNRESERVED</code> as a wanted property.
*/
public boolean getUnreserved() throws WvcmException {
- String ur = (String)loadedProperties().get( PropertyName.UNRESERVED );
- return new Boolean(ur).booleanValue();
+ Boolean ur = (Boolean)loadedProperties().get( PropertyName.UNRESERVED );
+ return ur.booleanValue();
}
/**
@@ -480,6 +484,7 @@
* doCheckout(true, null, false, false)}
*/
public void doCheckout() throws WvcmException {
+ doCheckout( true, null, false, false );
}
/**
@@ -513,8 +518,8 @@
* @see #doControl doControl
*/
public boolean getVersionControllable() throws WvcmException {
- String vc = (String)loadedProperties().get(
PropertyName.VERSION_CONTROLLABLE );
- return new Boolean(vc).booleanValue();
+ Boolean vc = (Boolean)loadedProperties().get(
PropertyName.VERSION_CONTROLLABLE );
+ return vc.booleanValue();
}
/**
1.3 +6 -6 jakarta-slide/proposals/wvcm/src/org/apache/wvcm/FolderImpl.java
Index: FolderImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/FolderImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FolderImpl.java 24 Mar 2003 18:05:05 -0000 1.2
+++ FolderImpl.java 26 Mar 2003 16:21:14 -0000 1.3
@@ -109,8 +109,8 @@
* @see #doBaselineControl
*/
public boolean getBaselineControllable() throws WvcmException {
- String bc = (String)loadedProperties().get(
PropertyName.BASELINE_CONTROLLABLE );
- return new Boolean(bc).booleanValue();
+ Boolean bc =
(Boolean)loadedProperties().get(PropertyName.BASELINE_CONTROLLABLE);
+ return bc.booleanValue();
}
/**
1.3 +5 -5
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/FolderVersionImpl.java
Index: FolderVersionImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/FolderVersionImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FolderVersionImpl.java 24 Mar 2003 18:05:05 -0000 1.2
+++ FolderVersionImpl.java 26 Mar 2003 16:21:14 -0000 1.3
@@ -93,7 +93,7 @@
* as a wanted property.
*/
public List getVersionControlledBindingList() throws WvcmException {
- return null;
+ return (List)loadedProperties().get(
PropertyName.VERSION_CONTROLLED_BINDING_LIST );
}
}
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/LocationImpl.java
Index: LocationImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/LocationImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/ProviderImpl.java
Index: ProviderImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/ProviderImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +11 -30
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/ResourceImpl.java
Index: ResourceImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/ResourceImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ResourceImpl.java 24 Mar 2003 18:05:06 -0000 1.2
+++ ResourceImpl.java 26 Mar 2003 16:21:14 -0000 1.3
@@ -149,8 +149,7 @@
* <code>PropertyName.CREATION_DATE </code> as a wanted property
*/
public Date getCreationDate() throws WvcmException {
- String cd = (String)loadedProperties().get( PropertyName.CONTENT_IDENTIFIER
);
- return new Date( cd );
+ return (Date)loadedProperties().get( PropertyName.CREATION_DATE );
}
/**
@@ -172,8 +171,8 @@
* <code>PropertyName.CONTENT_LENGTH</code> as a wanted property
*/
public long getContentLength() throws WvcmException {
- String cl = (String)loadedProperties().get( PropertyName.CONTENT_IDENTIFIER
);
- return Long.parseLong( cl );
+ Long cl = (Long)loadedProperties().get( PropertyName.CONTENT_LENGTH );
+ return cl.longValue();
}
/**
@@ -342,8 +341,7 @@
* <code>PropertyName.COMMENT</code> as a wanted property.
*/
public Locale getContentLanguage() throws WvcmException {
- String cl = (String)loadedProperties().get( PropertyName.CONTENT_LANGUAGE );
- return new Locale( cl );
+ return (Locale)loadedProperties().get( PropertyName.CONTENT_LANGUAGE );
}
/**
@@ -368,7 +366,7 @@
* does not exist.
*/
public void doWriteContent(InputStream content, String contentIdentifier)
throws WvcmException {
- accessor.doWriteContent( content );
+ accessor.doWriteContent( content, contentIdentifier );
}
/**
@@ -384,8 +382,7 @@
* <code>PropertyName.LAST_MODIFIED</code> as a wanted property.
*/
public Date getLastModified() throws WvcmException {
- String lm = (String)loadedProperties().get( PropertyName.CONTENT_IDENTIFIER
);
- return new Date( lm );
+ return (Date)loadedProperties().get( PropertyName.LAST_MODIFIED );
}
// -------------------------------------------------------------------------
@@ -421,23 +418,7 @@
}
/**
- * Returns a string representation of the object. In general, the
- * <code>toString</code> method returns a string that
- * "textually represents" this object. The result should
- * be a concise but informative representation that is easy for a
- * person to read.
- * It is recommended that all subclasses override this method.
- * <p>
- * The <code>toString</code> method for class <code>Object</code>
- * returns a string consisting of the name of the class of which the
- * object is an instance, the at-sign character `<code>@</code>', and
- * the unsigned hexadecimal representation of the hash code of the
- * object. In other words, this method returns a string equal to the
- * value of:
- * <blockquote>
- * <pre>
- * getClass().getName() + '@' + Integer.toHexString(hashCode())
- * </pre></blockquote>
+ * Returns a string representation of the object.
*
* @return a string representation of the object.
*/
1.3 +5 -5
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/VersionHistoryImpl.java
Index: VersionHistoryImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/VersionHistoryImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- VersionHistoryImpl.java 24 Mar 2003 18:05:06 -0000 1.2
+++ VersionHistoryImpl.java 26 Mar 2003 16:21:14 -0000 1.3
@@ -102,7 +102,7 @@
* <code>PropertyName.ROOT_VERSION</code> as a wanted property.
*/
public Version getRootVersion() throws WvcmException {
- return null;
+ return (Version)loadedProperties().get( PropertyName.ROOT_VERSION );
}
/**
1.3 +14 -12
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/VersionImpl.java
Index: VersionImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/VersionImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- VersionImpl.java 24 Mar 2003 18:05:06 -0000 1.2
+++ VersionImpl.java 26 Mar 2003 16:21:14 -0000 1.3
@@ -102,7 +102,7 @@
* @see ControllableResource#getCheckedOut ControllableResource.getCheckedOut
*/
public List getCheckoutList() throws WvcmException {
- return null;
+ return (List)loadedProperties().get( PropertyName.CHECKOUT_LIST );
}
/**
@@ -111,7 +111,7 @@
* <code>PropertyName.VERSION_HISTORY</code> as a wanted property.
*/
public VersionHistory getVersionHistory() throws WvcmException {
- return null;
+ return (VersionHistory)loadedProperties().get( PropertyName.VERSION_HISTORY
);
}
/**
@@ -129,7 +129,7 @@
* <code>PropertyName.LABEL_NAME_LIST</code> as a wanted property.
*/
public List getLabelNameList() throws WvcmException {
- return null;
+ return (List)loadedProperties().get( PropertyName.LABEL_NAME_LIST );
}
/**
@@ -146,7 +146,7 @@
* <code>PropertyName.SUCCESSOR_LIST</code> as a wanted property.
*/
public List getSuccessorList() throws WvcmException {
- return null;
+ return (List)loadedProperties().get( PropertyName.SUCCESSOR_LIST );
}
/**
@@ -179,7 +179,8 @@
* <code>PropertyName.CHECKIN_FORK</code> as a wanted property.
*/
public int getCheckinFork() throws WvcmException {
- return 0;
+ Integer cf = (Integer)loadedProperties().get( PropertyName.CHECKIN_FORK );
+ return cf.intValue();
}
/**
@@ -189,7 +190,7 @@
* <code>PropertyName.PREDECESSOR_LIST</code> as a wanted property.
*/
public List getPredecessorList() throws WvcmException {
- return null;
+ return (List)loadedProperties().get( PropertyName.PREDECESSOR_LIST );
}
/**
@@ -207,7 +208,8 @@
* <code>PropertyName.CHECKOUT_FORK</code> as a wanted property.
*/
public int getCheckoutFork() throws WvcmException {
- return 0;
+ Integer cf = (Integer)loadedProperties().get( PropertyName.CHECKOUT_FORK );
+ return cf.intValue();
}
/**
@@ -218,7 +220,7 @@
* <code>PropertyName.ACTIVITY_LIST</code> as a wanted property.
*/
public List getActivityList() throws WvcmException {
- return null;
+ return (List)loadedProperties().get( PropertyName.ACTIVITY_LIST );
}
}
1.3 +11 -10
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/WorkspaceImpl.java
Index: WorkspaceImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/WorkspaceImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- WorkspaceImpl.java 24 Mar 2003 18:05:06 -0000 1.2
+++ WorkspaceImpl.java 26 Mar 2003 16:21:14 -0000 1.3
@@ -64,6 +64,7 @@
package org.apache.wvcm;
import javax.wvcm.*;
+import javax.wvcm.PropertyNameList.*;
import org.apache.wvcm.store.*;
import org.apache.wvcm.store.webdav.*;
import java.util.*;
@@ -111,7 +112,7 @@
* <code>PropertyName.WORKSPACE_CHECKOUT_LIST</code> as a wanted property.
*/
public List getWorkspaceCheckoutList() throws WvcmException {
- return null;
+ return (List)loadedProperties().get( PropertyName.WORKSPACE_CHECKOUT_LIST );
}
/**
@@ -124,7 +125,7 @@
* as a wanted property.
*/
public List getActivityFolderList() throws WvcmException {
- return null;
+ return (List)loadedProperties().get( PropertyName.ACTIVITY_FOLDER_LIST );
}
/**
@@ -167,7 +168,7 @@
* as a wanted property.
*/
public List getVersionHistoryFolderList() throws WvcmException {
- return null;
+ return (List)loadedProperties().get(
PropertyName.VERSION_HISTORY_FOLDER_LIST );
}
/**
@@ -179,7 +180,7 @@
* as a wanted property.
*/
public List getBaselineControlledFolderList() throws WvcmException {
- return null;
+ return (List)loadedProperties().get(
PropertyName.BASELINE_CONTROLLED_FOLDER_LIST );
}
/**
@@ -206,7 +207,7 @@
* <code>PropertyName.CURRENT_ACTIVITY_LIST</code> as a wanted property.
*/
public List getCurrentActivityList() throws WvcmException {
- return null;
+ return (List)loadedProperties().get( PropertyName.CURRENT_ACTIVITY_LIST );
}
/**
@@ -237,7 +238,7 @@
*
*/
public List getWorkspaceFolderList() throws WvcmException {
- return null;
+ return (List)loadedProperties().get( PropertyName.WORKSPACE_FOLDER_LIST );
}
}
1.1 jakarta-slide/proposals/wvcm/src/org/apache/wvcm/package.html
Index: package.html
===================================================================
<!-- $Id: package.html,v 1.1 2003/03/26 16:21:14 pnever Exp $ -->
<html>
<head>
<title>Package Documentation for org.apache.wvcm</title>
</head>
<body>
Contains the implementations of the WVCM API interfaces. This package
provides the storage-independent parts of the implementation.
</body>
</html>
1.3 +8 -4
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/model/PropertyDescriptor.java
Index: PropertyDescriptor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/model/PropertyDescriptor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PropertyDescriptor.java 24 Mar 2003 18:05:06 -0000 1.2
+++ PropertyDescriptor.java 26 Mar 2003 16:21:15 -0000 1.3
@@ -113,6 +113,9 @@
propertyDescriptors.put( PropertyName.CURRENT_WORKSPACE_LIST, new
PropertyDescriptor(WorkspaceImpl.class, ArrayList.class, true) );
propertyDescriptors.put( PropertyName.DISPLAY_NAME, new
PropertyDescriptor(String.class, null, false) );
propertyDescriptors.put( PropertyName.ECLIPSED_LIST, new
PropertyDescriptor(String.class, ArrayList.class, false) );
+ propertyDescriptors.put( PropertyName.IS_CHECKED_OUT, new
PropertyDescriptor(Boolean.class, null, false) );
+ propertyDescriptors.put( PropertyName.IS_DIRTY_CONTENT, new
PropertyDescriptor(Boolean.class, null, false) );
+ propertyDescriptors.put( PropertyName.IS_STALE_CONTENT, new
PropertyDescriptor(Boolean.class, null, false) );
propertyDescriptors.put( PropertyName.LABEL_NAME_LIST, new
PropertyDescriptor(String.class, ArrayList.class, false) );
propertyDescriptors.put( PropertyName.LAST_MODIFIED, new
PropertyDescriptor(Date.class, null, false) );
propertyDescriptors.put( PropertyName.MERGE_LIST, new
PropertyDescriptor(VersionImpl.class, ArrayList.class, true) );
@@ -123,6 +126,7 @@
propertyDescriptors.put( PropertyName.SUBBASELINE_LIST, new
PropertyDescriptor(Baseline.class, ArrayList.class, true) );
propertyDescriptors.put( PropertyName.SUCCESSOR_LIST, new
PropertyDescriptor(VersionImpl.class, ArrayList.class, true) );
propertyDescriptors.put( PropertyName.UNRESERVED, new
PropertyDescriptor(Boolean.class, null, false) );
+ propertyDescriptors.put( PropertyName.VERSION_CONTROLLABLE, new
PropertyDescriptor(Boolean.class, null, false) );
propertyDescriptors.put( PropertyName.VERSION_CONTROLLED_BINDING_LIST, new
PropertyDescriptor(FolderVersion.Binding.class, ArrayList.class, true) );
propertyDescriptors.put( PropertyName.VERSION_CONTROLLED_CONFIGURATION, new
PropertyDescriptor(Configuration.class, null, true) );
propertyDescriptors.put( PropertyName.VERSION_HISTORY, new
PropertyDescriptor(VersionHistoryImpl.class, null, true) );
1.1
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/model/package.html
Index: package.html
===================================================================
<!-- $Id: package.html,v 1.1 2003/03/26 16:21:15 pnever Exp $ -->
<html>
<head>
<title>Package Documentation for org.apache.wvcm.model</title>
</head>
<body>
Handling for the metadata of the WVCM model, for example the metadata of
the WVCM properties.
</body>
</html>
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/Accessor.java
Index: Accessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/Accessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/AccessorFactory.java
Index: AccessorFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/AccessorFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/ActivityAccessor.java
Index: ActivityAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/ActivityAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/BaselineAccessor.java
Index: BaselineAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/BaselineAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/ConfigurationAccessor.java
Index: ConfigurationAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/ConfigurationAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +31 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/ControllableResourceAccessor.java
Index: ControllableResourceAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/ControllableResourceAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ControllableResourceAccessor.java 24 Mar 2003 18:05:06 -0000 1.2
+++ ControllableResourceAccessor.java 26 Mar 2003 16:21:15 -0000 1.3
@@ -65,6 +65,7 @@
import javax.wvcm.*;
import java.io.*;
+import java.util.*;
import org.apache.wvcm.*;
/**
@@ -89,5 +90,35 @@
* @throws WvcmException
*/
public void doControl() throws WvcmException;
+
+ /**
+ * Checkout the associated resource so that its content can be modified.
+ * @param forkOK Indicates whether to do the checkout even if the
+ * version already has a successor or a checkout.
+ * @param activityList A list of [EMAIL PROTECTED] Activity} objects that
identify
+ * the activities to which the work on the
+ * checked-out resource will contribute.
+ * @param newActivity Indicates whether to create a new activity
+ * for the checkout.
+ * @param unreserved Indicates whether to do the checkout even
+ * if there already is a checkout from the currently selected
+ * version in one of the activities specified in the activityList.
+ */
+ public void doCheckout(boolean forkOK, List activityList, boolean newActivity,
boolean unreserved) throws WvcmException;
+
+ /**
+ * Changes the state of the resource identified by the associated [EMAIL
PROTECTED] ControllableResource}
+ * to be checked-in. If version history is being tracked for the
+ * resource, the current content of the resource is captured
+ * in a new version resource at a server-defined location.
+ * @param keepCheckedOut indicates whether to checkout the
+ * resource again immediately after checking it in.
+ * If keepCheckedOut is <code>true</code>, the ActivityList
+ * and Unreserved properties should not be changed by the checkout.
+ * @param forkOK indicates whether to fork even if forking
+ * is discouraged.
+ */
+ public void doCheckin(boolean keepCheckedOut, boolean forkOK) throws
WvcmException;
}
+
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/FolderAccessor.java
Index: FolderAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/FolderAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/FolderVersionAccessor.java
Index: FolderVersionAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/FolderVersionAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +9 -2
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/ResourceAccessor.java
Index: ResourceAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/ResourceAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ResourceAccessor.java 24 Mar 2003 18:05:06 -0000 1.2
+++ ResourceAccessor.java 26 Mar 2003 16:21:15 -0000 1.3
@@ -96,20 +96,27 @@
* @throws WvcmException
*/
public Resource doReadContent(PropertyNameList wantedPropertyList, OutputStream
content) throws WvcmException;
+
/**
* Persists content changes to a resource.
+ * If <code>contentIdentifier</code> matches the current
+ * state identifier of the persistent resource,
+ * the content of the resource is replaced with the
+ * bytes read from <code>content</code>, and <code>content</code>
+ * is then closed.
* If reading from the stream throws a <code>java.io.IOException</code>,
* then no further data will be read from the stream,
* and after attempting to close the stream, a <code>WvcmException</code>
* wrapping the <code> IOException</code> will be thrown,
- * possibly leading to incomplete data being stored on the resource.</p>
+ * possibly leading to incomplete data being stored on the resource.
* @throws WvcmException if the resource identified by this [EMAIL PROTECTED]
Resource}
* does not exist.
*
* @param content the content input stream
+ * @param contentIdentifier the content identifier to match the current
identifier
* @throws WvcmException
*/
- public void doWriteContent( InputStream content ) throws WvcmException;
+ public void doWriteContent( InputStream content, String contentIdentifier )
throws WvcmException;
/**
* Return a new resource proxy at the location of the associated resource
containing
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/VersionAccessor.java
Index: VersionAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/VersionAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/VersionHistoryAccessor.java
Index: VersionHistoryAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/VersionHistoryAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/WorkspaceAccessor.java
Index: WorkspaceAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/WorkspaceAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.1
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/package.html
Index: package.html
===================================================================
<!-- $Id: package.html,v 1.1 2003/03/26 16:21:15 pnever Exp $ -->
<html>
<head>
<title>Package Documentation for org.apache.wvcm.store</title>
</head>
<body>
Definition of the storage accessor interfaces.
</body>
</html>
1.3 +4 -4
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ActivityWebdavAccessor.java
Index: ActivityWebdavAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ActivityWebdavAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/BaselineWebdavAccessor.java
Index: BaselineWebdavAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/BaselineWebdavAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ConfigurationWebdavAccessor.java
Index: ConfigurationWebdavAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ConfigurationWebdavAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.4 +107 -10
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ControllableResourceWebdavAccessor.java
Index: ControllableResourceWebdavAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ControllableResourceWebdavAccessor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ControllableResourceWebdavAccessor.java 24 Mar 2003 18:05:08 -0000 1.3
+++ ControllableResourceWebdavAccessor.java 26 Mar 2003 16:21:18 -0000 1.4
@@ -133,6 +133,106 @@
}
}
+ /**
+ * Checkout the associated resource so that its content can be modified.
+ * @param forkOK Indicates whether to do the checkout even if the
+ * version already has a successor or a checkout.
+ * @param activityList A list of [EMAIL PROTECTED] Activity} objects that
identify
+ * the activities to which the work on the
+ * checked-out resource will contribute.
+ * @param newActivity Indicates whether to create a new activity
+ * for the checkout.
+ * @param unreserved Indicates whether to do the checkout even
+ * if there already is a checkout from the currently selected
+ * version in one of the activities specified in the activityList.
+ */
+ public void doCheckout(boolean forkOK, List activityList, boolean newActivity,
boolean unreserved) throws WvcmException {
+ LocationImpl loc = (LocationImpl)resource().location();
+ String resourcepath = loc.path();
+ CheckoutMethod method = new CheckoutMethod( resourcepath );
+ CheckoutRequest req = new CheckoutRequest( forkOK );
+ method.setRequestBody( req.reqBodyAsString() );
+ method.addRequestHeader( "Content-Type", "text/xml; charset=\"utf-8\"" );
+
+ try {
+ client().executeMethod( method );
+ int sc = method.getStatusCode();
+ String st = method.getStatusText();
+ switch( sc ) {
+ case HttpStatus.SC_OK:
+ break;
+ case HttpStatus.SC_FORBIDDEN:
+ case HttpStatus.SC_CONFLICT:
+ ErrorResponse errorRsp = new ErrorResponse(
method.getResponseBodyAsStream() );
+ throw new WvcmException(
+ st, resourcepath, errorRsp.getWvcmReasonCode(), null);
+ case HttpStatus.SC_UNAUTHORIZED:
+ throw new WvcmException(
+ st, resourcepath, WvcmException.UNAUTHORIZED, null);
+ case HttpStatus.SC_NOT_FOUND:
+ throw new WvcmException(
+ st, resourcepath, WvcmException.NOT_FOUND, null);
+ default:
+ throw new WvcmException(
+ st, resourcepath, WvcmException.CANNOT_CHECK_OUT, null);
+ }
+ }
+ catch (java.io.IOException e) {
+ throw new WvcmException(
+ "Write failed", resourcepath, WvcmException.WRITE_FAILED, new
Exception[]{e});
+ }
+ }
+
+ /**
+ * Changes the state of the resource identified by the associated [EMAIL
PROTECTED] ControllableResource}
+ * to be checked-in. If version history is being tracked for the
+ * resource, the current content of the resource is captured
+ * in a new version resource at a server-defined location.
+ * @param keepCheckedOut indicates whether to checkout the
+ * resource again immediately after checking it in.
+ * If keepCheckedOut is <code>true</code>, the ActivityList
+ * and Unreserved properties should not be changed by the checkout.
+ * @param forkOK indicates whether to fork even if forking
+ * is discouraged.
+ */
+ public void doCheckin(boolean keepCheckedOut, boolean forkOK) throws
WvcmException {
+ LocationImpl loc = (LocationImpl)resource().location();
+ String resourcepath = loc.path();
+ CheckinMethod method = new CheckinMethod( resourcepath );
+ CheckinRequest req = new CheckinRequest( keepCheckedOut, forkOK );
+ method.setRequestBody( req.reqBodyAsString() );
+ method.addRequestHeader( "Content-Type", "text/xml; charset=\"utf-8\"" );
+
+ try {
+ client().executeMethod( method );
+ int sc = method.getStatusCode();
+ String st = method.getStatusText();
+ switch( sc ) {
+ case HttpStatus.SC_CREATED:
+ break;
+ case HttpStatus.SC_FORBIDDEN:
+ case HttpStatus.SC_CONFLICT:
+ ErrorResponse errorRsp = new ErrorResponse(
method.getResponseBodyAsStream() );
+ throw new WvcmException(
+ st, resourcepath, errorRsp.getWvcmReasonCode(), null);
+ case HttpStatus.SC_UNAUTHORIZED:
+ throw new WvcmException(
+ st, resourcepath, WvcmException.UNAUTHORIZED, null);
+ case HttpStatus.SC_NOT_FOUND:
+ throw new WvcmException(
+ st, resourcepath, WvcmException.NOT_FOUND, null);
+ default:
+ throw new WvcmException(
+ st, resourcepath, WvcmException.CANNOT_CHECK_IN, null);
+ }
+ }
+ catch (java.io.IOException e) {
+ throw new WvcmException(
+ "Write failed", resourcepath, WvcmException.WRITE_FAILED, new
Exception[]{e});
+ }
+ }
+
+
private void preResourceMustBeNull() throws WvcmException {
LocationImpl loc = (LocationImpl)resource().location();
String resourcepath = loc.path();
@@ -146,12 +246,6 @@
*
* @throws WvcmException
*/
- /**
- * Method doControl
- *
- * @throws WvcmException
- *
- */
public void doControl() throws WvcmException {
LocationImpl loc = (LocationImpl)resource().location();
String resourcepath = loc.path();
@@ -172,6 +266,9 @@
case HttpStatus.SC_UNAUTHORIZED:
throw new WvcmException(
st, resourcepath, WvcmException.UNAUTHORIZED, null);
+ case HttpStatus.SC_NOT_FOUND:
+ throw new WvcmException(
+ st, resourcepath, WvcmException.NOT_FOUND, null);
default:
throw new WvcmException(
st, resourcepath, WvcmException.CANNOT_PUT_UNDER_CONTROL,
null);
1.3 +30 -13
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ErrorResponse.java
Index: ErrorResponse.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ErrorResponse.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ErrorResponse.java 24 Mar 2003 18:05:08 -0000 1.2
+++ ErrorResponse.java 26 Mar 2003 16:21:18 -0000 1.3
@@ -86,22 +86,39 @@
// WebDAV condition -> WVCM reason code
private static Map davcond2code = new HashMap();
static {
- davcond2code.put( "resource-must-be-null", new
Integer(WvcmException.CANNOT_CREATE_RESOURCE_MUST_BE_NULL) );
- davcond2code.put( "location-ok", new
Integer(WvcmException.CANNOT_CREATE_RESOURCE_AT_LOCATION) );
davcond2code.put( "activity-location-ok", new
Integer(WvcmException.CANNOT_CREATE_RESOURCE_AT_LOCATION) );
- davcond2code.put( "initialize-activity", new
Integer(WvcmException.CANNOT_INITIALIZE_RESOURCE) );
+ davcond2code.put( "atomic-activity-checkin", new
Integer(WvcmException.CANNOT_CHECKIN_ACTIVITY) );
davcond2code.put( "cannot-add-to-existing-history", new
Integer(WvcmException.CANNOT_ADD_TO_EXISTING_HISTORY) );
- davcond2code.put( "must-be-version", new Integer(WvcmException.BAD_VERSION)
);
- davcond2code.put(
"one-version-controlled-resource-per-history-per-workspace", new
Integer(WvcmException.ONE_CONTROLLED_RESOURCE_PER_HISTORY_PER_WORKSPACE) );
davcond2code.put( "cannot-modify-checked-in-parent", new
Integer(WvcmException.CANNOT_MODIFY_CHECKED_IN_PARENT) );
- davcond2code.put( "put-under-version-control", new
Integer(WvcmException.CANNOT_PUT_UNDER_CONTROL) );
+// davcond2code.put( "cannot-modify-version-controlled-configuration", new
Integer(WvcmException.???) );
+ davcond2code.put( "checkin-fork-discouraged", new
Integer(WvcmException.CANNOT_CHECKIN_FORK_DISCOURAGED) );
+ davcond2code.put( "checkin-fork-forbidden", new
Integer(WvcmException.CANNOT_FORK) );
+ davcond2code.put( "checkout-of-checked-out-version-is-discouraged", new
Integer(WvcmException.CANNOT_CHECKOUT_MULTI_CHECKOUT_IS_DISCOURAGED) );
+ davcond2code.put( "checkout-of-checked-out-version-is-forbidden", new
Integer(WvcmException.CANNOT_CHECKOUT_MULTI_CHECKOUT_IS_FORBIDDEN) );
+ davcond2code.put( "checkout-of-version-with-descendant-is-discouraged", new
Integer(WvcmException.CHECKOUT_OF_VERSION_WITH_DESCENDANT_IS_DISCOURAGED) );
+ davcond2code.put( "checkout-of-version-with-descendant-is-forbidden", new
Integer(WvcmException.CANNOT_CHECKOUT_FORKING_IS_FORBIDDEN) );
+ davcond2code.put( "initialize-activity", new
Integer(WvcmException.CANNOT_INITIALIZE_RESOURCE) );
+ davcond2code.put( "initialize-workspace", new
Integer(WvcmException.CANNOT_INITIALIZE_RESOURCE) );
+ davcond2code.put( "linear-activity", new
Integer(WvcmException.CANNOT_CREATE_BRANCH_IN_ACTIVITY) );
+ davcond2code.put( "location-ok", new
Integer(WvcmException.CANNOT_CREATE_RESOURCE_AT_LOCATION) );
+ davcond2code.put( "merge-must-be-complete", new
Integer(WvcmException.CANNOT_CHECKIN_MERGE_NOT_COMPLETE) );
+ davcond2code.put( "must-be-checked-in", new
Integer(WvcmException.MUST_BE_CHECKED_IN) );
+ davcond2code.put( "must-be-checked-out", new
Integer(WvcmException.MUST_BE_CHECKED_OUT) );
+ davcond2code.put( "must-be-version", new Integer(WvcmException.BAD_VERSION)
);
davcond2code.put( "must-not-change-existing-checked-in-out", new
Integer(WvcmException.CANNOT_CHANGE_EXISTING_CHECKED_IN_OUT) );
- davcond2code.put( "new-version-history", new
Integer(WvcmException.NEW_VERSION_HISTORY) );
- davcond2code.put( "new-version-controlled-resource", new
Integer(WvcmException.CANNOT_CREATE_NEW_CONTROLLED_RESOURCE) );
+ davcond2code.put( "must-not-update-baseline-collection", new
Integer(WvcmException.CANNOT_UPDATE_BASELINE_FOLDER) );
davcond2code.put( "new-version-controlled-collection", new
Integer(WvcmException.CANNOT_INITIALIZE_NEW_CONTROLLED_FOLDER) );
+ davcond2code.put( "new-version-controlled-resource", new
Integer(WvcmException.CANNOT_CREATE_NEW_CONTROLLED_RESOURCE) );
+ davcond2code.put( "new-version-history", new
Integer(WvcmException.NEW_VERSION_HISTORY) );
+ davcond2code.put( "no-checked-out-baseline-controlled-collection-members",
new Integer(WvcmException.NO_CHECKED_OUT_BASELINE_CONTROLLED_FOLDER_MEMBERS) );
+ davcond2code.put( "one-checkout-per-activity-per-history", new
Integer(WvcmException.ONE_CHECKOUT_PER_ACTIVITY_PER_HISTORY) );
+ davcond2code.put(
"one-version-controlled-resource-per-history-per-workspace", new
Integer(WvcmException.ONE_CONTROLLED_RESOURCE_PER_HISTORY_PER_WORKSPACE) );
+ davcond2code.put( "one-version-per-history-per-baseline", new
Integer(WvcmException.ONE_VERSION_PER_HISTORY_PER_BASELINE) );
+ davcond2code.put( "put-under-version-control", new
Integer(WvcmException.CANNOT_PUT_UNDER_CONTROL) );
+ davcond2code.put( "resource-must-be-null", new
Integer(WvcmException.CANNOT_CREATE_RESOURCE_MUST_BE_NULL) );
davcond2code.put( "supported-report", new Integer(WvcmException.BAD_REPORT)
);
+ davcond2code.put( "version-history-is-tree", new
Integer(WvcmException.VERSION_HISTORY_IS_NOT_TREE) );
davcond2code.put( "workspace-location-ok", new
Integer(WvcmException.CANNOT_CREATE_RESOURCE_AT_LOCATION) );
- davcond2code.put( "initialize-workspace", new
Integer(WvcmException.CANNOT_INITIALIZE_RESOURCE) );
}
private Document respBodyDoc;
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/FolderVersionWebdavAccessor.java
Index: FolderVersionWebdavAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/FolderVersionWebdavAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +6 -4
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/FolderWebdavAccessor.java
Index: FolderWebdavAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/FolderWebdavAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FolderWebdavAccessor.java 24 Mar 2003 18:05:08 -0000 1.2
+++ FolderWebdavAccessor.java 26 Mar 2003 16:21:18 -0000 1.3
@@ -142,6 +142,8 @@
ReportMethod method = new ReportMethod( resourcepath );
ReportRequest req = new ReportRequest( wantedPropertyList );
method.setRequestBody( req.reqBodyAsString() );
+ method.addRequestHeader( "Content-Type", "text/xml; charset=\"utf-8\"" );
+
if( deep )
method.addRequestHeader( "Depth", "infinity" );
else
1.3 +44 -19
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/MultistatusResponse.java
Index: MultistatusResponse.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/MultistatusResponse.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MultistatusResponse.java 24 Mar 2003 18:05:08 -0000 1.2
+++ MultistatusResponse.java 26 Mar 2003 16:21:18 -0000 1.3
@@ -176,6 +176,8 @@
Map wantedProperties = new HashMap();
Map webdavProperties = new HashMap();
+ wantedProperties.put( PropertyName.IS_CHECKED_OUT, new Boolean(false) );
+
// get the properties
xp = XPath.newInstance(
"d:propstat[contains(string(d:status),\"200\")]/d:prop/*");
@@ -193,23 +195,46 @@
continue;
PropertyDescriptor propdescriptor =
PropertyDescriptor.getInstance(propname);
- if( propdescriptor != null && propdescriptor.isHref() ) {
- // this is a href property
- xp = XPath.newInstance("d:response");
- xp.addNamespace(dnsp);
- Iterator j = xp.selectNodes(p).iterator();
- propvalue = propdescriptor.collectiontypeInstance();
- boolean multipleValued = (propvalue != null);
-
- while( j.hasNext() ) {
- Element re2 = (Element)j.next();
- if( multipleValued )
- ((Collection)propvalue).add(
createResourceProxy(re2, propdescriptor.basetype()) );
- else
- propvalue = createResourceProxy( re2,
propdescriptor.basetype() );
+ if( propdescriptor != null ) {
+ if( propdescriptor.isHref() ) {
+ // this is a href property
+ xp = XPath.newInstance("d:response");
+ xp.addNamespace(dnsp);
+ Iterator j = xp.selectNodes(p).iterator();
+ propvalue = propdescriptor.collectiontypeInstance();
+ boolean multipleValued = (propvalue != null);
+
+ while( j.hasNext() ) {
+ Element re2 = (Element)j.next();
+ if( multipleValued )
+ ((Collection)propvalue).add(
createResourceProxy(re2, propdescriptor.basetype()) );
+ else
+ propvalue = createResourceProxy( re2,
propdescriptor.basetype() );
+ }
+ }
+ else if( propdescriptor.basetype() == Date.class &&
propdescriptor.collectiontype() == null ) {
+ propvalue = DateRepresentations.parseDate(
(String)propvalue );
+ }
+ else if( propdescriptor.basetype() == Boolean.class &&
propdescriptor.collectiontype() == null ) {
+ propvalue = new Boolean( (String)propvalue );
+ }
+ else if( propdescriptor.basetype() == Locale.class &&
propdescriptor.collectiontype() == null ) {
+ propvalue = new Locale( (String)propvalue );
+ }
+ else if( propdescriptor.basetype() == Long.class &&
propdescriptor.collectiontype() == null ) {
+ propvalue = new Long( (String)propvalue );
+ }
+ else if( propdescriptor.basetype() == Integer.class &&
propdescriptor.collectiontype() == null ) {
+ propvalue = new Integer( (String)propvalue );
}
}
wantedProperties.put( propname, propvalue );
+
+ // special handling for non-WebDAV properties
+ if( propname == PropertyName.CHECKED_OUT ) {
+ wantedProperties.put( PropertyName.IS_CHECKED_OUT, new
Boolean(true) );
+ }
+ // TODO: more handling for non-WebDAV properties
}
if( cls == null )
cls = determineResourceType( webdavProperties );
@@ -223,7 +248,7 @@
}
}
-
+
/**
* Determine the resource type from the specified set of selected WebDAV
properties.
*
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/OptionsRequest.java
Index: OptionsRequest.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/OptionsRequest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/OptionsResponse.java
Index: OptionsResponse.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/OptionsResponse.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/Properties.java
Index: Properties.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/Properties.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.2 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/PropfindRequest.java
Index: PropfindRequest.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/PropfindRequest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
1.3 +10 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ReportRequest.java
Index: ReportRequest.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ReportRequest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ReportRequest.java 24 Mar 2003 18:05:08 -0000 1.2
+++ ReportRequest.java 26 Mar 2003 16:21:18 -0000 1.3
@@ -147,6 +147,16 @@
propElm = new Element( "property", dnsp );
propElm.setAttribute( "name", webdavname );
}
+ else {
+ if( pname == PropertyName.IS_CHECKED_OUT ) {
+ if( !Arrays.asList(pnames).contains(PropertyName.CHECKED_OUT) )
{
+ webdavname = Properties.webdavNameForPropertyName(
PropertyName.CHECKED_OUT );
+ propElm = new Element( "property", dnsp );
+ propElm.setAttribute( "name", webdavname );
+ }
+ }
+ // TODO: special handling for other non-WebDAV properties
+ }
if( propElm != null )
contextElm.addContent( propElm );
1.3 +19 -10
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ResourceWebdavAccessor.java
Index: ResourceWebdavAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ResourceWebdavAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ResourceWebdavAccessor.java 24 Mar 2003 18:05:08 -0000 1.2
+++ ResourceWebdavAccessor.java 26 Mar 2003 16:21:18 -0000 1.3
@@ -177,6 +177,7 @@
ReportMethod method = new ReportMethod( resourcepath );
ReportRequest req = new ReportRequest( wantedPropertyList );
method.setRequestBody( req.reqBodyAsString() );
+ method.addRequestHeader( "Content-Type", "text/xml; charset=\"utf-8\"" );
try {
client.executeMethod( method );
@@ -206,25 +207,33 @@
/**
* Persists content changes to a resource.
+ * If <code>contentIdentifier</code> matches the current
+ * state identifier of the persistent resource,
+ * the content of the resource is replaced with the
+ * bytes read from <code>content</code>, and <code>content</code>
+ * is then closed.
* If reading from the stream throws a <code>java.io.IOException</code>,
* then no further data will be read from the stream,
* and after attempting to close the stream, a <code>WvcmException</code>
* wrapping the <code> IOException</code> will be thrown,
- * possibly leading to incomplete data being stored on the resource.</p>
+ * possibly leading to incomplete data being stored on the resource.
* @throws WvcmException if the resource identified by this [EMAIL PROTECTED]
Resource}
* does not exist.
*
* @param content the content input stream
+ * @param contentIdentifier the content identifier to match the current
identifier
* @throws WvcmException
*/
- public void doWriteContent( InputStream content ) throws WvcmException {
+ public void doWriteContent( InputStream content, String contentIdentifier )
throws WvcmException {
LocationImpl loc = (LocationImpl)resource.location();
String resourcepath = loc.path();
- PutMethod putMethod = new PutMethod( resourcepath );
- putMethod.setRequestBody( content );
+ PutMethod method = new PutMethod( resourcepath );
+ method.setRequestHeader( "If", "(["+contentIdentifier+"])" );
+ method.setRequestBody( content );
+
try {
- client.executeMethod( putMethod );
- if( putMethod.getStatusCode() != HttpStatus.SC_NO_CONTENT )
+ client.executeMethod( method );
+ if( method.getStatusCode() != HttpStatus.SC_NO_CONTENT )
throw new WvcmException(
"Not found", resourcepath, WvcmException.NOT_FOUND, null);
}
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/VersionHistoryWebdavAccessor.java
Index: VersionHistoryWebdavAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/VersionHistoryWebdavAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/VersionWebdavAccessor.java
Index: VersionWebdavAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/VersionWebdavAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +1 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/WebdavAccessor.java
Index: WebdavAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/WebdavAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- WebdavAccessor.java 24 Mar 2003 18:05:08 -0000 1.2
+++ WebdavAccessor.java 26 Mar 2003 16:21:18 -0000 1.3
@@ -178,6 +178,7 @@
String resourcepath = rootFolderPath();
OptionsMethod method = new OptionsMethod( resourcepath );
method.setRequestBody( req.reqBodyAsString() );
+ method.addRequestHeader( "Content-Type", "text/xml; charset=\"utf-8\"" );
try {
client.executeMethod( method );
1.3 +0 -0
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/WorkspaceWebdavAccessor.java
Index: WorkspaceWebdavAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/WorkspaceWebdavAccessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.1
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/CheckinRequest.java
Index: CheckinRequest.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/CheckinRequest.java,v
1.1 2003/03/26 16:21:18 pnever Exp $
* $Revision: 1.1 $
* $Date: 2003/03/26 16:21:18 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Slide", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.wvcm.store.webdav;
import java.io.*;
import java.util.*;
import org.jdom.*;
import org.jdom.input.*;
import org.jdom.output.*;
import org.jdom.xpath.*;
import org.apache.wvcm.*;
import javax.wvcm.*;
import javax.wvcm.PropertyNameList.*;
/**
* Handler for CHECKIN request bodies.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Nevermann</a>
* @version $Revision: 1.1 $
*/
public class CheckinRequest {
private static Namespace dnsp = Namespace.getNamespace("d", "DAV:");
private Document reqBodyDoc;
private String reqBodyAsString;
/**
* Constructor
*/
public CheckinRequest( boolean keepCheckedOut, boolean forkOK ) {
Element cinElm = new Element( "checkin", dnsp );
if( keepCheckedOut ) {
Element keepcoutElm = new Element( "keep-checked-out", dnsp );
cinElm.addContent( keepcoutElm );
}
if( forkOK ) {
Element forkokElm = new Element( "fork-ok", dnsp );
cinElm.addContent( forkokElm );
}
this.reqBodyDoc = new Document( cinElm );
this.reqBodyAsString = new XMLOutputter(" ", true, "utf-8").outputString(
reqBodyDoc );
}
/**
* Get the request body as string
*
* @return the request body
*/
public String reqBodyAsString() {
return reqBodyAsString;
}
}
1.1
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/CheckoutRequest.java
Index: CheckoutRequest.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/CheckoutRequest.java,v
1.1 2003/03/26 16:21:18 pnever Exp $
* $Revision: 1.1 $
* $Date: 2003/03/26 16:21:18 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Slide", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.wvcm.store.webdav;
import java.io.*;
import java.util.*;
import org.jdom.*;
import org.jdom.input.*;
import org.jdom.output.*;
import org.jdom.xpath.*;
import org.apache.wvcm.*;
import javax.wvcm.*;
import javax.wvcm.PropertyNameList.*;
/**
* Handler for CHECKOUT request bodies.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Nevermann</a>
* @version $Revision: 1.1 $
*/
public class CheckoutRequest {
private static Namespace dnsp = Namespace.getNamespace("d", "DAV:");
private Document reqBodyDoc;
private String reqBodyAsString;
/**
* Constructor
*/
public CheckoutRequest( boolean forkOK ) {
Element coutElm = new Element( "checkout", dnsp );
if( forkOK ) {
Element forkokElm = new Element( "fork-ok", dnsp );
coutElm.addContent( forkokElm );
}
this.reqBodyDoc = new Document( coutElm );
this.reqBodyAsString = new XMLOutputter(" ", true, "utf-8").outputString(
reqBodyDoc );
}
/**
* Get the request body as string
*
* @return the request body
*/
public String reqBodyAsString() {
return reqBodyAsString;
}
}
1.1
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/DateRepresentations.java
Index: DateRepresentations.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/DateRepresentations.java,v
1.1 2003/03/26 16:21:18 pnever Exp $
* $Revision: 1.1 $
* $Date: 2003/03/26 16:21:18 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Slide", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.wvcm.store.webdav;
import java.util.*;
import java.text.*;
/**
* Parses date representations as specified in RFC2068 and RFC2518.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Nevermann</a>
* @version $Revision: 1.1 $
*/
public class DateRepresentations {
/**
* Date formats using for Date parsing.
*/
private static final SimpleDateFormat formats[] = {
new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US),
new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US),
new SimpleDateFormat("EEEEEE, dd-MMM-yy HH:mm:ss zzz", Locale.US),
new SimpleDateFormat("EEE MMMM d HH:mm:ss yyyy", Locale.US),
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US),
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.sss'Z'", Locale.US)
};
static {
for( int i = 0; i < formats.length; i++ ) {
formats[i].setTimeZone( TimeZone.getTimeZone("GMT") );
}
}
/**
* Parse the <code>java.util.Date</code> string for HTTP-date.
*
* @return the parsed date.
*/
public static Date parseDate( String dateValue ) {
Date date = null;
for( int i = 0; (date == null) && (i < formats.length); i++ ) {
try {
synchronized (formats[i]) {
date = formats[i].parse(dateValue);
}
}
catch (ParseException e) {
}
}
return date;
}
}
1.1
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/package.html
Index: package.html
===================================================================
<!-- $Id: package.html,v 1.1 2003/03/26 16:21:18 pnever Exp $ -->
<html>
<head>
<title>Package Documentation for org.apache.wvcm.store.webdav</title>
</head>
<body>
WebDAV-specific.
</body>
</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]