juergen     02/04/15 04:02:36

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        MoveMethod.java
  Log:
  Do deltaV specific stuff only if versioning is enabled.
  (ralf)
  
  Revision  Changes    Path
  1.26      +17 -4     
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MoveMethod.java
  
  Index: MoveMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MoveMethod.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- MoveMethod.java   12 Apr 2002 14:23:18 -0000      1.25
  +++ MoveMethod.java   15 Apr 2002 11:02:36 -0000      1.26
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MoveMethod.java,v
 1.25 2002/04/12 14:23:18 juergen Exp $
  - * $Revision: 1.25 $
  - * $Date: 2002/04/12 14:23:18 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MoveMethod.java,v
 1.26 2002/04/15 11:02:36 juergen Exp $
  + * $Revision: 1.26 $
  + * $Date: 2002/04/15 11:02:36 $
    *
    * ====================================================================
    *
  @@ -318,6 +318,8 @@
        */
       public void beforeCopy(String sourceUri, String destinationUri) throws 
SlideException {
           
  +        if( Configuration.useVersionControl() ) {
  +            
           UriHandler uriHandler = UriHandler.getUriHandler(token, sourceUri);
           if (uriHandler.isVersionUri()) {
               throw new PreconditionViolationException(new 
ViolatedPrecondition(DeltavConstants.C_CANNOT_RENAME_VERSION,
  @@ -330,6 +332,7 @@
                                                        sourceUri);
           }
       }
  +    }
       
       /**
        * This method is called after copying the resource to
  @@ -344,6 +347,8 @@
        */
       public void afterCopy(String sourceUri, String destinationUri) throws 
SlideException {
           
  +        if( Configuration.useVersionControl() ) {
  +            
           NodeRevisionDescriptors destinationRevisionDescriptors =
               versioningHelper.retrieveRevisionDescriptors(destinationUri);
           NodeRevisionDescriptor destinationRevisionDescriptor =
  @@ -358,7 +363,6 @@
           }
           catch (SlideException e) {}
           
  -        if( Configuration.useVersionControl() ) {
               handleWorkspacePostconditions(destinationRevisionDescriptor, 
destinationUri);
               updateCheckoutSets(destinationRevisionDescriptor, destinationUri);
           }
  @@ -378,6 +382,8 @@
        */
       private void handleWorkspacePostconditions(NodeRevisionDescriptor 
revisionDescriptor, String resourceUri) throws SlideException {
   
  +        if( Configuration.useVersionControl() ) {
  +            
           if (isSourceWorkspace) {
               // DAV:workspace-moved
               revisionDescriptor.setProperty(new NodeProperty(P_WORKSPACE, 
propertyHelper.createHrefValue(this.destinationUri), true));
  @@ -404,6 +410,7 @@
           }
           content.store(slideToken, resourceUri, revisionDescriptor, null);
       }
  +    }
       
       /**
        * If the resource specified by the given <code>revisionDescriptor</code>
  @@ -469,6 +476,8 @@
        */
       public void beforeDelete(String targetUri) throws SlideException {
           
  +        if( Configuration.useVersionControl() ) {
  +            
           uriOfAssociatedVR = null;
           uriOfAssociatedWorkspace = null;
           
  @@ -487,6 +496,7 @@
               }
           }
       }
  +    }
       
       /**
        * This method is called after deleting the resource associated by
  @@ -500,6 +510,8 @@
        */
       public void afterDelete(String targetUri) throws SlideException {
           
  +        if( Configuration.useVersionControl() ) {
  +            
           if (uriOfAssociatedVR != null) {
               
               // remove the deleted VCR from the <checkout-set> from the
  @@ -525,6 +537,7 @@
                   PropertyHelper.removeHrefFromProperty(workspaceRevisionDescriptor, 
P_WORKSPACE_CHECKOUT_SET, targetUri);
                   content.store(slideToken, workspaceRevisionDescriptors.getUri(), 
workspaceRevisionDescriptor, null);
               } catch (JDOMException e) {}
  +            }
           }
       }
       
  
  
  

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

Reply via email to