unico       2004/06/23 06:17:15

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        PropPatchMethod.java
               src/conf/webapp web.xml
  Log:
  Make PROPPATCH change last modified date on a resource.
  See discussion here: http://marc.theaimsgroup.com/?l=slide-dev&m=108791970128403&w=2
  The servlet init parameter 'updateLastModified' can be set to disable this behavior.
  
  Revision  Changes    Path
  1.80      +16 -4     
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java
  
  Index: PropPatchMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- PropPatchMethod.java      16 Jun 2004 14:46:25 -0000      1.79
  +++ PropPatchMethod.java      23 Jun 2004 13:17:15 -0000      1.80
  @@ -25,6 +25,7 @@
   
   import java.io.IOException;
   import java.io.Writer;
  +import java.util.Date;
   import java.util.Iterator;
   import java.util.List;
   import java.util.StringTokenizer;
  @@ -101,6 +102,10 @@
        */
       private String resourcePath;
       
  +    /**
  +     * If true, the last modified date will be updated.
  +     */
  +    private boolean updateLastModified;
       
       // ----------------------------------------------------------- Constructors
       
  @@ -135,6 +140,8 @@
           
   //        readRequestContent();
           
  +        updateLastModified = getBooleanInitParameter( "updateLastModified" );
  +        
           resourcePath = requestUri;
           if (resourcePath == null) {
               resourcePath = "/";
  @@ -302,8 +309,13 @@
                   
               }
               
  -            if (allOperationsExcecuted)
  +            if (updateLastModified) {
  +                revisionDescriptor.setLastModified(new Date());
  +            }
  +            
  +            if (allOperationsExcecuted) {
                   content.store(slideToken, resourcePath, revisionDescriptor, null);
  +            }
               
               // Changed for DeltaV --start--
               if( Configuration.useVersionControl() && mustCheckIn) {
  
  
  
  1.30      +9 -0      jakarta-slide/src/conf/webapp/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/conf/webapp/web.xml,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- web.xml   17 Jun 2004 17:31:24 -0000      1.29
  +++ web.xml   23 Jun 2004 13:17:15 -0000      1.30
  @@ -190,6 +190,15 @@
                   of interoperability problems.
               </description>
           </init-param>
  +        <init-param>
  +            <param-name>updateLastModified</param-name>
  +            <param-value>true</param-value>
  +            <description>
  +                This parameter controls whether modifying properties via 
  +                PROPPATCH causes the last modification date of the 
  +                resource to be updated or not.
  +            </description>
  +        </init-param>
           <load-on-startup>1</load-on-startup>
           <!-- Uncomment this to get authentication -->
           <@[EMAIL PROTECTED]>
  
  
  

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

Reply via email to