juergen     2002/07/31 05:13:09

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        CheckoutMethod.java
  Log:
  Fixed checkout with given label.
  (ralf)
  
  Revision  Changes    Path
  1.14      +19 -6     
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckoutMethod.java
  
  Index: CheckoutMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckoutMethod.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CheckoutMethod.java       27 Jun 2002 10:49:58 -0000      1.13
  +++ CheckoutMethod.java       31 Jul 2002 12:13:09 -0000      1.14
  @@ -77,6 +77,8 @@
   import org.apache.slide.common.Domain;
   import org.apache.slide.common.SlideException;
   import org.apache.slide.common.NamespaceAccessToken;
  +import org.apache.slide.content.NodeRevisionDescriptor;
  +import org.apache.slide.content.NodeRevisionDescriptors;
   import org.apache.slide.webdav.WebdavServletConfig;
   import org.apache.slide.webdav.WebdavException;
   import org.apache.slide.webdav.util.VersioningHelper;
  @@ -100,6 +102,8 @@
       /** Marshalling variables */
       private boolean applyToVersion = false;
       private boolean forkOk = false;
  +    private String labeledVersionUri = null;
  +    private String label = null;
       
       /**
        * The VersioningHelper used by this instance.
  @@ -140,9 +144,11 @@
           // evaluate "Label" header
           if (Configuration.useVersionControl()) {
               try {
  -                applyToVersion = (req.getHeader(DeltavConstants.H_LABEL) != null);
  -                resourcePath = versioningHelper.getLabeledResourceUri(resourcePath,
  -                                                                      
req.getHeader(DeltavConstants.H_LABEL));
  +                label = req.getHeader(DeltavConstants.H_LABEL);
  +                if (label != null) {
  +                    labeledVersionUri = 
versioningHelper.getLabeledResourceUri(resourcePath,
  +                                                                               
label);
  +                }
               }
               catch (LabeledRevisionNotFoundException e) {
                   ViolatedPrecondition violatedPrecondition =
  @@ -217,7 +223,14 @@
           slideToken.setForceStoreEnlistment(true);
           
           try {
  +            if (labeledVersionUri == null) {
               locationValue = versioningHelper.checkout( resourcePath, forkOk, 
applyToVersion );
  +            }
  +            else {
  +                NodeRevisionDescriptors rNrds = content.retrieve( slideToken, 
resourcePath );
  +                NodeRevisionDescriptor rNrd = content.retrieve( slideToken, rNrds );
  +                locationValue = versioningHelper.checkout( rNrds, rNrd, 
labeledVersionUri, forkOk, applyToVersion, false);
  +            }
           }
           catch (PreconditionViolationException e) {
               sendPreconditionViolation(e);
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to