pnever      2002/07/15 05:25:34

  Modified:    src/webdav/server/org/apache/slide/webdav/util
                        VersioningHelper.java
  Log:
  - Fixed bug in the backup/restore of live properties
  - Ignore NrdNotFoundException in checkin, since implicit checkout does currently not 
create a backup
  
  Revision  Changes    Path
  1.64      +24 -8     
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.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- VersioningHelper.java     15 Jul 2002 06:19:09 -0000      1.63
  +++ VersioningHelper.java     15 Jul 2002 12:25:34 -0000      1.64
  @@ -1184,8 +1184,15 @@
               // Store changes
               if( keepCheckedOut || !isWorkingResource ) {
                   content.store( sToken, rUri, rNrd, null ); //revisionContent=null
  +                try {
                   // remove the hidden 0.0 revision and create new one if 
keepCheckedOut
                   content.remove( sToken, rUri, NodeRevisionNumber.HIDDEN_0_0 );
  +                }
  +                catch( RevisionDescriptorNotFoundException x ) {
  +                    // the implicit CHECKOUT from COPY (auto-versioning) does not 
create a
  +                    // backup descriptor.
  +                    Domain.info( "Checkin: no backup descriptor found at "+rUri );
  +                }
                   if( keepCheckedOut )
                       backupSpecificLiveProperties( rNrds, rNrd );
               }
  @@ -1422,7 +1429,8 @@
       
       /**
        * Backups specific live properties of the given <code>revisionDescriptor</code>
  -     * at the 0.0 revision of the NodeRevisionDescriptors of the VCR.
  +     * at the 0.0 revision of the NodeRevisionDescriptors of the VCR. A good idea 
seems to
  +     * be to backup the non-protected live properties.
        *
        * @param      rNrds         the NodeRevisionDescriptors of the
        *                           VCR to backup.
  @@ -1442,11 +1450,15 @@
           if( p != null )
               backupNrd.setProperty( p );
           
  -        p = rNrd.getProperty( P_OWNER );
  +        p = rNrd.getProperty( P_COMMENT );
           if( p != null )
               backupNrd.setProperty( p );
                   
  -        p = rNrd.getProperty( P_COMMENT );
  +        p = rNrd.getProperty( P_DISPLAYNAME );
  +        if( p != null )
  +            backupNrd.setProperty( p );
  +                
  +        p = rNrd.getProperty( P_CREATOR_DISPLAYNAME );
           if( p != null )
               backupNrd.setProperty( p );
           
  @@ -1481,11 +1493,15 @@
           if( p != null )
               rNrd.setProperty( p );
       
  -        p = backupNrd.getProperty( P_OWNER );
  +        p = backupNrd.getProperty( P_COMMENT );
           if( p != null )
               rNrd.setProperty( p );
           
  -        p = backupNrd.getProperty( P_COMMENT );
  +        p = backupNrd.getProperty( P_DISPLAYNAME );
  +        if( p != null )
  +            rNrd.setProperty( p );
  +        
  +        p = backupNrd.getProperty( P_CREATOR_DISPLAYNAME );
           if( p != null )
               rNrd.setProperty( p );
           
  
  
  

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

Reply via email to