pnever      02/04/29 06:22:19

  Modified:    src/webdav/server/org/apache/slide/webdav/util
                        VersioningHelper.java
  Log:
  Completed checkout for working resource feature
  
  Revision  Changes    Path
  1.38      +27 -6     
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.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- VersioningHelper.java     29 Apr 2002 12:10:07 -0000      1.37
  +++ VersioningHelper.java     29 Apr 2002 13:22:19 -0000      1.38
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java,v
 1.37 2002/04/29 12:10:07 juergen Exp $
  - * $Revision: 1.37 $
  - * $Date: 2002/04/29 12:10:07 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java,v
 1.38 2002/04/29 13:22:19 pnever Exp $
  + * $Revision: 1.38 $
  + * $Date: 2002/04/29 13:22:19 $
    *
    * ====================================================================
    *
  @@ -547,7 +547,7 @@
           
           if( rUh.isVersionUri() ) {
               NodeRevisionContent rNrc = content.retrieve( sToken, rNrds, rNrd );
  -            checkout( rNrds, rNrd, rNrc, forkOk, applyToVersion );
  +            checkout( rNrds, rNrd, rNrc, forkOk, null ); // autoUpdateUri=null
           }
           else {
           checkout( rNrds, rNrd, forkOk, applyToVersion, isAutoVersionCheckout);
  @@ -593,6 +593,14 @@
               NodeRevisionDescriptors cinNrds = content.retrieve(sToken, cinhUri);
               NodeRevisionDescriptor cinNrd = content.retrieve(sToken, cinNrds, 
cinNrn);
               
  +            // working resource feature
  +            if( applyToVersion ) {
  +                NodeRevisionContent cinNrc = content.retrieve( sToken, cinNrds, 
cinNrd );
  +                String rUri = getUri( rNrds, rNrd );
  +                checkout( cinNrds, cinNrd, cinNrc, forkOk, rUri ); // 
autoUpdateUri=rUri
  +                return;
  +            }
  +            
               ViolatedPrecondition violatedPrecondition = 
getCheckoutPreconditionViolation(cinNrds, cinNrd, forkOk);
               if (violatedPrecondition != null) {
                   throw new PreconditionViolationException(violatedPrecondition, 
rNrds.getUri());
  @@ -640,7 +648,7 @@
        * Checkout the specified version (workingresource feature)
        */
       public void checkout( NodeRevisionDescriptors rNrds, NodeRevisionDescriptor 
rNrd, NodeRevisionContent rNrc,
  -    boolean forkOk, boolean applyToVersion  )
  +                         boolean forkOk, String autoUpdateUri )
       throws SlideException, JDOMException, IOException, 
PreconditionViolationException  {
           
           Iterator i;
  @@ -682,7 +690,6 @@
                   wrNrd.setProperty( (NodeProperty)i.next() );
   
               // set specific live props
  -            wrNrd.setContentType(rNrd.getContentType()); // P_GETCONTENTTYPE
               wrNrd.setProperty(
                   new NodeProperty(P_CHECKED_OUT, pHelp.createHrefValue(rUri)) );
               NodeProperty predsetProp = rNrd.getProperty( P_PREDECESSOR_SET );
  @@ -694,6 +701,20 @@
               NodeProperty cinfProp = rNrd.getProperty(P_CHECKOUT_FORK);
               if( coutfProp != null )
                   wrNrd.setProperty( coutfProp );
  +            wrNrd.setContentType(rNrd.getContentType()); // P_GETCONTENTTYPE
  +            wrNrd.setContentLength( rNrd.getContentLength() ); // P_GETCONTENTLENGTH
  +            wrNrd.setETag( wrUri.hashCode()+"_"+rNrd.getContentLength() ); // 
P_GETETAG
  +            wrNrd.setLastModified( new Date() ); //P_GETLASTMODIFIED
  +            wrNrd.setCreationDate( new Date() ); // P_CREATIONDATE
  +            
  +            // set auto-update
  +            if( autoUpdateUri != null && autoUpdateUri.length() > 0 ) {
  +                wrNrd.setProperty(
  +                    new NodeProperty(P_AUTO_UPDATE, 
pHelp.createHrefValue(autoUpdateUri)) );
  +            }
  +            else {
  +                wrNrd.removeProperty( P_AUTO_UPDATE );
  +            }
           
               // Copy dead properties VR -> WR
               j = rNrd.enumerateProperties();
  
  
  

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

Reply via email to