You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by pn...@apache.org on 2002/05/08 18:00:11 UTC

cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/resourcekind AbstractResourceKind.java

pnever      02/05/08 09:00:11

  Modified:    src/webdav/server/org/apache/slide/webdav/util/resourcekind
                        AbstractResourceKind.java
  Log:
  Is now aware of all standard live properties.
  
  Revision  Changes    Path
  1.11      +72 -32    jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/resourcekind/AbstractResourceKind.java
  
  Index: AbstractResourceKind.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/resourcekind/AbstractResourceKind.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- AbstractResourceKind.java	30 Apr 2002 12:40:11 -0000	1.10
  +++ AbstractResourceKind.java	8 May 2002 16:00:11 -0000	1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/resourcekind/AbstractResourceKind.java,v 1.10 2002/04/30 12:40:11 pnever Exp $
  - * $Revision: 1.10 $
  - * $Date: 2002/04/30 12:40:11 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/resourcekind/AbstractResourceKind.java,v 1.11 2002/05/08 16:00:11 pnever Exp $
  + * $Revision: 1.11 $
  + * $Date: 2002/05/08 16:00:11 $
    *
    * ====================================================================
    *
  @@ -71,6 +71,8 @@
   
   import org.apache.slide.content.NodeRevisionDescriptors;
   import org.apache.slide.content.NodeRevisionDescriptor;
  +import org.apache.slide.content.NodeProperty;
  +
   import org.apache.slide.webdav.util.WebdavConstants;
   import org.apache.slide.webdav.util.DeltavConstants;
   import org.apache.slide.webdav.util.AclConstants;
  @@ -87,6 +89,9 @@
       protected static Set supportedFeatures = new HashSet();
           
       // protected properties
  +    protected static Set liveProperties = new HashSet();
  +        
  +    // protected properties
       protected static Set protectedProperties = new HashSet();
           
       // computed properties
  @@ -109,46 +114,56 @@
           supportedFeatures.add( F_UPDATE );
           
           // Computed properties
  -        computedProperties.add( P_LOCKDISCOVERY );
  -        computedProperties.add( P_SUPPORTEDLOCK );
           computedProperties.add( P_ACL);
           computedProperties.add( P_ACL_SEMANTICS);
  -        computedProperties.add( P_PRINCIPAL_COLLECTION_SET);
  -        computedProperties.add( P_CURRENT_USER_PRIVILEGE_SET);
  -        computedProperties.add( P_SUPPORTED_PRIVILEGE_SET);
  -        computedProperties.add( P_OWNER);
  -        computedProperties.add( P_SUCCESSOR_SET );
  -        computedProperties.add( P_CHECKOUT_SET );
  -        computedProperties.add( P_ROOT_VERSION );
  -        computedProperties.add( P_VERSION_HISTORY );
  -        computedProperties.add( P_WORKSPACE_CHECKOUT_SET );
  -        computedProperties.add( P_VERSION_CONTROLLED_CONFIGURATION );
  -        computedProperties.add( P_BASELINE_CONTROLLED_COLLECTION_SET );
  -        computedProperties.add( P_ACTIVITY_VERSION_SET );
           computedProperties.add( P_ACTIVITY_CHECKOUT_SET );
  +        computedProperties.add( P_ACTIVITY_VERSION_SET );
  +        computedProperties.add( P_BASELINE_CONTROLLED_COLLECTION_SET );
  +        computedProperties.add( P_CHECKOUT_SET );
  +        computedProperties.add( P_CURRENT_USER_PRIVILEGE_SET);
           computedProperties.add( P_CURRENT_WORKSPACE_SET );
           computedProperties.add( P_ECLIPSED_SET );
  +        computedProperties.add( P_LOCKDISCOVERY );
  +        computedProperties.add( P_OWNER);
  +        computedProperties.add( P_PRINCIPAL_COLLECTION_SET);
  +        computedProperties.add( P_ROOT_VERSION );
  +        computedProperties.add( P_SUCCESSOR_SET );
  +        computedProperties.add( P_SUPPORTEDLOCK );
           computedProperties.add( P_SUPPORTED_LIVE_PROPERTY_SET ); //"protected" in spec but too long for some datastores
           computedProperties.add( P_SUPPORTED_METHOD_SET );        //"protected" in spec but too long for some datastores
  +        computedProperties.add( P_SUPPORTED_PRIVILEGE_SET);
           computedProperties.add( P_SUPPORTED_REPORT_SET );        //"protected" in spec but too long for some datastores
  +        computedProperties.add( P_VERSION_CONTROLLED_CONFIGURATION );
  +        computedProperties.add( P_VERSION_HISTORY );
           computedProperties.add( P_WORKSPACE_CHECKOUT_SET );
           
           // Protected properties
  -//        protectedProperties.add( P_SUPPORTED_METHOD_SET );
  -//        protectedProperties.add( P_SUPPORTED_LIVE_PROPERTY_SET );
  -//        protectedProperties.add( P_SUPPORTED_REPORT_SET );
  +        protectedProperties.addAll( computedProperties );
  +        protectedProperties.add( P_AUTO_UPDATE );
  +        protectedProperties.add( P_BASELINE_COLLECTION );
  +        protectedProperties.add( P_BASELINE_CONTROLLED_COLLECTION );
           protectedProperties.add( P_CHECKED_IN );
           protectedProperties.add( P_CHECKED_OUT );
  +        protectedProperties.add( P_CREATIONDATE );
  +        protectedProperties.add( P_GETCONTENTLANGUAGE );
  +        protectedProperties.add( P_GETLASTMODIFIED );
  +        protectedProperties.add( P_GETCONTENTTYPE );
  +        protectedProperties.add( P_GETCONTENTLENGTH );
  +        protectedProperties.add( P_GETETAG );
  +        protectedProperties.add( P_LABEL_NAME_SET );
           protectedProperties.add( P_PREDECESSOR_SET );
  +        protectedProperties.add( P_RESOURCETYPE );
  +        protectedProperties.add( P_SOURCE );
  +        protectedProperties.add( P_SUBBASELINE_SET );
  +        protectedProperties.add( P_VERSION_CONTROLLED_BINDING_SET );
           protectedProperties.add( P_VERSION_NAME );
           protectedProperties.add( P_VERSION_SET );
           protectedProperties.add( P_WORKSPACE );
  -        protectedProperties.add( P_LABEL_NAME_SET );
  -        protectedProperties.add( P_AUTO_UPDATE );
  -        protectedProperties.add( P_BASELINE_CONTROLLED_COLLECTION );
  -        protectedProperties.add( P_BASELINE_COLLECTION );
  -        protectedProperties.add( P_SUBBASELINE_SET );
  -        protectedProperties.add( P_VERSION_CONTROLLED_BINDING_SET );
  +        
  +        // Live properties
  +        liveProperties.addAll( WebdavConstants.WEBDAV_PROPERTY_LIST );
  +        liveProperties.addAll( AclConstants.ACL_PROPERTY_LIST );
  +        liveProperties.addAll( DeltavConstants.DELTAV_PROPERTY_LIST );
       }
       
       /**
  @@ -220,20 +235,47 @@
       }
       
       /**
  -     * Return true if the specified property is protected.
  +     * Return true if the specified property is a DAV: live property.
  +     */
  +    public static boolean isLiveProperty( String propName ) {
  +        return( liveProperties.contains(propName) );
  +    }
  +    
  +    /**
  +     * Return true if the specified property is a protected DAV: live property.
        */
       public static boolean isProtectedProperty( String propName ) {
  -        return( protectedProperties.contains(propName) ||
  -                computedProperties.contains(propName) );
  +        return( protectedProperties.contains(propName) );
       }
       
       /**
  -     * Return true if the specified property is computed.
  +     * Return true if the specified property is a computed DAV: live property.
        */
       public static boolean isComputedProperty( String propName ) {
           return( computedProperties.contains(propName) );
       }
       
  +    /**
  +     * Return the set of all DAV: live properties.
  +     */
  +    public static Set getAllLiveProperties() {
  +        return( Collections.unmodifiableSet(liveProperties) );
  +    }
  +    
  +    /**
  +     * Return the set of all DAV: protected live properties.
  +     */
  +    public static Set getAllProtectedProperties() {
  +        return( Collections.unmodifiableSet(protectedProperties) );
  +    }
  +    
  +    /**
  +     * Return the set of all DAV: computed live properties.
  +     */
  +    public static Set getAllComputedProperties() {
  +        return( Collections.unmodifiableSet(computedProperties) );
  +    }
  +    
       
       
       /**
  @@ -257,7 +299,6 @@
               s.retainAll( computedProperties );
           }
           if( Q_PROTECTED_ONLY.equals(filter) ) {
  -            s.retainAll( computedProperties );
               s.retainAll( protectedProperties );
           }
           return s;
  @@ -296,7 +337,6 @@
               s.retainAll( computedProperties );
           }
           if( Q_PROTECTED_ONLY.equals(filter) ) {
  -            s.retainAll( computedProperties );
               s.retainAll( protectedProperties );
           }
           return s;
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>