juergen 02/05/21 01:57:45
Modified: src/webdav/server/org/apache/slide/webdav/method
CopyMethod.java
Log:
Fixed implementation of precondition <DAV:must-not-copy-versioning-property>:
Some DeltaV properties still had been copied.
(ralf)
Revision Changes Path
1.38 +21 -21
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CopyMethod.java
Index: CopyMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CopyMethod.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- CopyMethod.java 20 May 2002 12:10:14 -0000 1.37
+++ CopyMethod.java 21 May 2002 08:57:45 -0000 1.38
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CopyMethod.java,v
1.37 2002/05/20 12:10:14 pnever Exp $
- * $Revision: 1.37 $
- * $Date: 2002/05/20 12:10:14 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CopyMethod.java,v
1.38 2002/05/21 08:57:45 juergen Exp $
+ * $Revision: 1.38 $
+ * $Date: 2002/05/21 08:57:45 $
*
* ====================================================================
*
@@ -342,38 +342,39 @@
NodeRevisionDescriptors destinationRevisionDescriptors =
content.retrieve( slideToken, destinationUri);
NodeRevisionDescriptor destinationRevisionDescriptor =
content.retrieve( slideToken, destinationRevisionDescriptors);
- ResourceKind resourceKind =
AbstractResourceKind.determineResourceKind(token, destinationUri,
destinationRevisionDescriptor);
+ // DAV:must-not-copy-versioning-property
String checkedOutPropertyValue =
(String)checkedOutDestinationsMap.get(destinationUri);
if (checkedOutPropertyValue != null) {
- // destination was checked-out, so copy must be a checked-out
- // resource too.
- resourceKind = CheckedOutVersionControlledImpl.getInstance();
- }
-
- if (resourceKind instanceof DeltavCompliant) {
-
- // DAV:must-not-copy-versioning-property
+ // use initial values for DeltaV properties
PropertyHelper propertyHelper =
PropertyHelper.getPropertyHelper(slideToken, token);
- Iterator initialPropertyIterator =
propertyHelper.createInitialProperties(resourceKind).iterator();
+ Iterator initialPropertyIterator =
+
propertyHelper.createInitialProperties(CheckedOutVersionControlledImpl.getInstance()).iterator();
NodeProperty property = null;
while (initialPropertyIterator.hasNext()) {
property = (NodeProperty)initialPropertyIterator.next();
if
(DeltavConstants.DELTAV_PROPERTY_LIST.contains(property.getName())) {
- if (checkedOutPropertyValue != null) {
- // use initial value
destinationRevisionDescriptor.setProperty(property);
}
- else {
- destinationRevisionDescriptor.removeProperty(property);
- }
- }
}
// restore <checked-out> property
- if (checkedOutPropertyValue != null) {
destinationRevisionDescriptor.setProperty(
new NodeProperty(P_CHECKED_OUT, checkedOutPropertyValue) );
}
+ else {
+ // this is not a checked-out VCR so remove all DeltaV properties
+ Enumeration propertyNamesEnum =
+ destinationRevisionDescriptor.getPropertiesNames();
+ String propertyName = null;
+ while (propertyNamesEnum.hasMoreElements()) {
+ propertyName = (String)propertyNamesEnum.nextElement();
+ if
(DeltavConstants.DELTAV_PROPERTY_LIST.contains(propertyName)) {
+ destinationRevisionDescriptor.removeProperty(propertyName);
+ }
+ }
+ }
+
+
// set <workspace> property
versioningHelper.setWorkspaceProperty(destinationUri,
destinationRevisionDescriptor);
@@ -390,7 +391,6 @@
}
catch (JDOMException e) {
throw new SlideException("Checkin failed: " +
e.getMessage());
- }
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>