jakarta-slide-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From juer...@apache.org
Subject cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method DeleteMethod.java
Date Thu, 04 Apr 2002 11:42:18 GMT
juergen     02/04/04 03:42:18

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        DeleteMethod.java
  Log:
  Update <checked-out> set of associated VR in case a checked-out VCR has been deleted.
  (ralf)
  
  Revision  Changes    Path
  1.16      +39 -3     jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java
  
  Index: DeleteMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DeleteMethod.java	3 Apr 2002 12:01:38 -0000	1.15
  +++ DeleteMethod.java	4 Apr 2002 11:42:18 -0000	1.16
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java,v
1.15 2002/04/03 12:01:38 juergen Exp $
  - * $Revision: 1.15 $
  - * $Date: 2002/04/03 12:01:38 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java,v
1.16 2002/04/04 11:42:18 juergen Exp $
  + * $Revision: 1.16 $
  + * $Date: 2002/04/04 11:42:18 $
    *
    * ====================================================================
    *
  @@ -83,6 +83,8 @@
   import org.apache.slide.webdav.util.UriHandler;
   import org.apache.slide.webdav.util.DeltavConstants;
   import org.apache.slide.webdav.util.XMLValue;
  +import org.apache.slide.webdav.util.VersioningHelper;
  +import org.apache.slide.webdav.util.PropertyHelper;
   
   import org.jdom.Element;
   import org.jdom.JDOMException;
  @@ -121,6 +123,18 @@
        */
       protected UriHandler uriHandler = null;
       
  +    /**
  +     * The VersioningHelper used by this instance.
  +     */
  +    protected VersioningHelper versioningHelper = null;
  +    
  +    /**
  +     * The URI of the VR associated with the checked-out VCR which is target
  +     * of the delete operation used in {@link #beforeDelete beforeDelete()} and
  +     * {@link #afterDelete afterDelete()}.
  +     */
  +    protected String uriOfAssociatedVR = null;
  +    
       // ----------------------------------------------------------- Constructors
       
       
  @@ -134,6 +148,11 @@
       public DeleteMethod(NamespaceAccessToken token, HttpServletRequest req,
                           HttpServletResponse resp, WebdavServletConfig config) {
           super(token, req, resp, config);
  +        versioningHelper = VersioningHelper.getVersioningHelper(slideToken,
  +                                                                token,
  +                                                                req,
  +                                                                resp,
  +                                                                config);
       }
       
       
  @@ -237,8 +256,11 @@
                                                                                 WebdavStatus.SC_FORBIDDEN),
                                                        targetUri);
           }
  +        
  +        uriOfAssociatedVR = versioningHelper.getUriOfAssociatedVR(targetUri);
       }
       
  +    
       /**
        * This method is called after deleting the resource associated by
        * the given <code>targetUri</code>.
  @@ -250,6 +272,20 @@
        *                             MacroDeleteException.
        */
       public void afterDelete(String targetUri) throws SlideException {
  +        
  +        if (uriOfAssociatedVR != null) {
  +            
  +            // remove the deleted VCR from the <checkout-set> from the
  +            // associated VR
  +            NodeRevisionDescriptors revisionDescriptors =
  +                versioningHelper.retrieveRevisionDescriptors(uriOfAssociatedVR);
  +            NodeRevisionDescriptor revisionDescriptor =
  +                versioningHelper.retrieveLatestRevisionDescriptor(uriOfAssociatedVR, revisionDescriptors);
  +            try {
  +                PropertyHelper.removeHrefFromProperty(revisionDescriptor, P_CHECKOUT_SET,
targetUri);
  +                content.store(slideToken, revisionDescriptors.getUri(), revisionDescriptor,
null);
  +            } catch (JDOMException e) {}
  +        }
       }
       
       
  
  
  

--
To unsubscribe, e-mail:   <mailto:slide-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:slide-dev-help@jakarta.apache.org>


Mime
View raw message