juergen     2002/07/31 05:24:01

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        CheckoutMethod.java
               src/webdav/server/org/apache/slide/webdav/util
                        VersioningHelper.java
  Log:
  Rollback to previous version (it was fine as it was)
  (ralf)
  
  Revision  Changes    Path
  1.15      +6 -19     
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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- CheckoutMethod.java       31 Jul 2002 12:13:09 -0000      1.14
  +++ CheckoutMethod.java       31 Jul 2002 12:24:00 -0000      1.15
  @@ -77,8 +77,6 @@
   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;
  @@ -102,8 +100,6 @@
       /** Marshalling variables */
       private boolean applyToVersion = false;
       private boolean forkOk = false;
  -    private String labeledVersionUri = null;
  -    private String label = null;
       
       /**
        * The VersioningHelper used by this instance.
  @@ -144,11 +140,9 @@
           // evaluate "Label" header
           if (Configuration.useVersionControl()) {
               try {
  -                label = req.getHeader(DeltavConstants.H_LABEL);
  -                if (label != null) {
  -                    labeledVersionUri = 
versioningHelper.getLabeledResourceUri(resourcePath,
  -                                                                               
label);
  -                }
  +                applyToVersion = (req.getHeader(DeltavConstants.H_LABEL) != null);
  +                resourcePath = versioningHelper.getLabeledResourceUri(resourcePath,
  +                                                                      
req.getHeader(DeltavConstants.H_LABEL));
               }
               catch (LabeledRevisionNotFoundException e) {
                   ViolatedPrecondition violatedPrecondition =
  @@ -223,14 +217,7 @@
           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);
  
  
  
  1.68      +5 -34     
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java
  
  Index: VersioningHelper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- VersioningHelper.java     31 Jul 2002 12:12:28 -0000      1.67
  +++ VersioningHelper.java     31 Jul 2002 12:24:01 -0000      1.68
  @@ -732,29 +732,6 @@
       public String checkout( NodeRevisionDescriptors rNrds,
                              NodeRevisionDescriptor rNrd, boolean forkOk, boolean 
applyToVersion, boolean isAutoVersionCheckout  )
           throws SlideException, JDOMException, IOException, 
PreconditionViolationException  {
  -        return checkout(rNrds, rNrd, null, forkOk, applyToVersion, 
isAutoVersionCheckout);
  -    }
  -    
  -    /**
  -     * Checkout a resource (for both: checkout-in-place and working-resource 
features).
  -     * Checkout a resource (for both: checkout-in-place and working-resource 
features).
  -     * @param rNrds the revision descriptors instance
  -     * @param rNrd the revision descriptor instance
  -     * @param versionUri if not <code>null</code> this the Uri of the version that
  -     *                   should be used for checkout instead of the one that is
  -     *                   contained in the &lt;checked-in&gt; property of the given 
descriptor.
  -     * @param forkOk true, if the request body contained a DAV:fork-ok element
  -     * @param applyToVersion true, if the request body contained a 
DAV:apply-to-version element
  -     * @param isAutoVersionCheckout true, if this is an implicit request due to 
auto-versioning
  -     * @return the URI of the created working resource, null if no resource was 
created
  -     * @throws SlideException
  -     * @throws JDOMException
  -     * @throws IOException
  -     * @throws PreconditionViolatedException
  -     */
  -    public String checkout( NodeRevisionDescriptors rNrds,
  -                           NodeRevisionDescriptor rNrd, String versionUri, boolean 
forkOk, boolean applyToVersion, boolean isAutoVersionCheckout  )
  -        throws SlideException, JDOMException, IOException, 
PreconditionViolationException  {
           
           Iterator i;
           String rUri = getUri( rNrds, rNrd );
  @@ -769,16 +746,9 @@
               throw new WebdavException(WebdavStatus.SC_FORBIDDEN);
           }
           
  -        NodeProperty cinProp = null;
  -        if (versionUri != null) {
  -            cinProp = new NodeProperty(P_CHECKED_IN, 
pHelp.createHrefValue(versionUri));
  -        }
  -        
           if( rRk instanceof CheckedInVersionControlled ) {
               // get checked-in VR
  -            if (cinProp == null) {
  -                cinProp = rNrd.getProperty( P_CHECKED_IN );
  -            }
  +            NodeProperty cinProp = rNrd.getProperty( P_CHECKED_IN );
               String cinHref = getElementValue((String)cinProp.getValue());
               UriHandler cinUriHandler = UriHandler.getUriHandler(cinHref);
               String cinhUri = cinUriHandler.getAssociatedHistoryUri();
  @@ -860,6 +830,7 @@
           Enumeration j;
           String rUri = getUri( rNrds, rNrd );
           ResourceKind rRk = AbstractResourceKind.determineResourceKind( nsaToken, 
rNrds, rNrd );
  +        
           if( !rRk.isSupportedMethod(req.getMethod()) ) {
               // check precondition C_MUST_BE_CHECKED_IN
               if( rRk instanceof CheckedOut ) {
  
  
  

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

Reply via email to