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 lu...@apache.org on 2005/01/10 19:08:48 UTC

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

luetzkendorf    2005/01/10 10:08:48

  Modified:    src/webdav/server/org/apache/slide/webdav/util/resourcekind
                        AbstractResourceKind.java
  Log:
  implementation of new methods of resourceKind
  cleanup
  
  Revision  Changes    Path
  1.37      +15 -118   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.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- AbstractResourceKind.java	3 Jan 2005 15:05:30 -0000	1.36
  +++ AbstractResourceKind.java	10 Jan 2005 18:08:48 -0000	1.37
  @@ -26,7 +26,6 @@
   import java.lang.reflect.Method;
   import java.util.ArrayList;
   import java.util.Arrays;
  -import java.util.Collections;
   import java.util.HashMap;
   import java.util.HashSet;
   import java.util.Iterator;
  @@ -75,56 +74,6 @@
       // computed properties
       protected static Set computedProperties = new HashSet();
       
  -    /**
  -     * A String array containing the names of the Elements supported as a
  -     * value of the <code>&lt;auto-version&gt;</code> property,
  -     * e.g. <code>checkout-checkin</code>.
  -     */
  -    protected final static String[] SUPPORTED_AUTO_VERSION_ELEMENTS =
  -        new String[] {EMPTY_STRING, E_CHECKOUT, E_CHECKOUT_IGNORE_UNLOCK, E_CHECKOUT_CHECKIN, E_CHECKOUT_UNLOCKED_CHECKIN, E_LOCKED_CHECKOUT};
  -    
  -    /**
  -     * A String array containing the names of the Elements supported as a
  -     * value of the <code>&lt;checkout-fork&gt;</code> property,
  -     * e.g. <code>discouraged</code>.
  -     */
  -    protected final static String[] SUPPORTED_CHECKOUT_FORK_ELEMENTS =
  -        new String[] {EMPTY_STRING, E_DISCOURAGED, E_FORBIDDEN};
  -    
  -    /**
  -     * A String array containing the names of the Elements supported as a
  -     * value of the <code>&lt;checkin-fork&gt;</code> property,
  -     * e.g. <code>discouraged</code>.
  -     */
  -    protected final static String[] SUPPORTED_CHECKIN_FORK_ELEMENTS =
  -        new String[] {EMPTY_STRING, E_DISCOURAGED, E_FORBIDDEN};
  -    
  -    /**
  -     * The values of {@link #SUPPORTED_AUTO_VERSION_ELEMENTS SUPPORTED_AUTO_VERSION_ELEMENTS}
  -     * as a (unmodifiable) List.
  -     */
  -    protected final static List SUPPORTED_AUTO_VERSION_ELEMENTS_LIST = Collections.unmodifiableList(Arrays.asList(SUPPORTED_AUTO_VERSION_ELEMENTS));
  -    
  -    /**
  -     * The values of {@link #SUPPORTED_CHECKOUT_FORK_ELEMENTS SUPPORTED_CHECKOUT_FORK_ELEMENTS}
  -     * as a (unmodifiable) List.
  -     */
  -    protected final static List SUPPORTED_CHECKOUT_FORK_ELEMENTS_LIST = Collections.unmodifiableList(Arrays.asList(SUPPORTED_CHECKOUT_FORK_ELEMENTS));
  -    
  -    /**
  -     * The values of {@link #SUPPORTED_CHECKIN_FORK_ELEMENTS SUPPORTED_CHECKIN_FORK_ELEMENTS}
  -     * as a (unmodifiable) List.
  -     */
  -    protected final static List SUPPORTED_CHECKIN_FORK_ELEMENTS_LIST = Collections.unmodifiableList(Arrays.asList(SUPPORTED_CHECKIN_FORK_ELEMENTS));
  -    
  -    /**
  -     * Maps the names of the properties that have a restricted set of supported
  -     * Element values to the List of names of these supported Elements
  -     * (e.g. {@link #SUPPORTED_AUTO_VERSION_ELEMENTS_LIST SUPPORTED_AUTO_VERSION_ELEMENTS_LIST}.
  -     */
  -    protected final static Map RESTRICTED_PROPERTY_VALUE_MAP = new HashMap();
  -    
  -    
       // static initialization
       static {
           // features
  @@ -148,73 +97,6 @@
           if (Configuration.useGlobalBinding()) {
               supportedFeatures.add( F_BINDING );
           }
  -        
  -//        // Computed properties
  -//        computedProperties.add( P_ACL);
  -//        computedProperties.add( P_ACL_RESTRICTIONS );
  -//        computedProperties.add( P_ACTIVITY_CHECKOUT_SET );
  -//        computedProperties.add( P_ACTIVITY_VERSION_SET );
  -//        computedProperties.add( P_BASELINE_CONTROLLED_COLLECTION_SET );
  -//        computedProperties.add( P_CREATIONUSER );
  -//        computedProperties.add( P_CURRENT_USER_PRIVILEGE_SET);
  -//        computedProperties.add( P_CURRENT_WORKSPACE_SET );
  -//        computedProperties.add( P_ECLIPSED_SET );
  -//        computedProperties.add( P_GROUP_MEMBERSHIP );
  -//        computedProperties.add( P_INHERITED_ACL_SET );
  -//        computedProperties.add( P_LOCKDISCOVERY );
  -//        computedProperties.add( P_MODIFICATIONUSER );
  -//        computedProperties.add( P_OWNER);
  -//        computedProperties.add( P_PRINCIPAL_COLLECTION_SET);
  -//        computedProperties.add( P_PRIVILEGE_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 );                   //"protected" in spec but made computed for BIND
  -//        computedProperties.add( P_WORKSPACE_CHECKOUT_SET );
  -        
  -        // Protected properties
  -//        protectedProperties.addAll( computedProperties );
  -//        protectedProperties.add( P_ALTERNATE_URI_SET );
  -//        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_CHECKOUT_SET ); //"computed" in spec but made protected for performance reasons
  -//        protectedProperties.add( P_CREATIONDATE );
  -//        protectedProperties.add( P_MODIFICATIONDATE );
  -//        protectedProperties.add( P_GETLASTMODIFIED );
  -////        protectedProperties.add( P_GETCONTENTTYPE ); // so what ... let the client set the content-type via PROPPATCH
  -//        protectedProperties.add( P_GETCONTENTLENGTH );
  -//        protectedProperties.add( P_GETETAG );
  -//        protectedProperties.add( P_LABEL_NAME_SET );
  -//        protectedProperties.add( P_PARENT_SET );
  -//        protectedProperties.add( P_PREDECESSOR_SET );
  -//        protectedProperties.add( P_RESOURCE_ID );
  -//        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_PRIVILEGE_MEMBERSHIP );  // TODO: make computed??
  -        
  -//        // Live properties
  -//        liveProperties.addAll( WebdavConstants.WEBDAV_PROPERTY_LIST );
  -//        liveProperties.addAll( AclConstants.ACL_PROPERTY_LIST );
  -//        liveProperties.addAll( DeltavConstants.DELTAV_PROPERTY_LIST );
  -//        liveProperties.addAll( BindConstants.BIND_PROPERTY_LIST );
  -        
  -        // restricted property values
  -        RESTRICTED_PROPERTY_VALUE_MAP.put(P_AUTO_VERSION, SUPPORTED_AUTO_VERSION_ELEMENTS_LIST);
  -        RESTRICTED_PROPERTY_VALUE_MAP.put(P_CHECKOUT_FORK, SUPPORTED_CHECKOUT_FORK_ELEMENTS_LIST);
  -        RESTRICTED_PROPERTY_VALUE_MAP.put(P_CHECKIN_FORK, SUPPORTED_CHECKIN_FORK_ELEMENTS_LIST);
       }
       
       /**
  @@ -269,6 +151,13 @@
       public static boolean isProtectedProperty(String propName) {
           return(protectedProperties.contains(PropertyName.getPropertyName(propName)));
       }
  +    /**
  +     * Returns <code>true</code> if the given property is protected at any resource kind.
  +     * @param propName property name to be tested.
  +     */
  +    static boolean isGlobalProtectedProperty(PropertyName propName) {
  +        return(protectedProperties.contains(propName));
  +    }
   
       /**
        * Return true if the specified property is a computed DAV: live property.
  @@ -460,6 +349,14 @@
           throw new IllegalArgumentException();
       }
       
  +    public Set getSupportedLivePropertyNames( String filter ) {
  +        if( Q_COMPUTED_ONLY.equals(filter) ) {
  +            return getSupportedComputedPropertyNames();
  +        } else if( Q_PROTECTED_ONLY.equals(filter) ) {
  +            return getSupportedProtectedPropertyNames();
  +        }
  +        throw new IllegalArgumentException();
  +    }
       
       
       /**
  
  
  

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