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 ju...@apache.org on 2001/12/07 14:50:56 UTC

cvs commit: jakarta-slide/src/share/org/apache/slide/content NodeProperty.java NodeRevisionDescriptor.java

juergen     01/12/07 05:50:56

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        LockMethod.java MkcolMethod.java
                        PropPatchMethod.java PutMethod.java
               src/share/org/apache/slide/content NodeProperty.java
                        NodeRevisionDescriptor.java
  Log:
  1) BUG: PropPatch did not rollback, if one action could not be executed
  2) The property itself decides, if it is read-only or can be modified by propPatch
  3) all live properties have get/set methods, they are now used.
  
  Revision  Changes    Path
  1.24      +4 -8      jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java
  
  Index: LockMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- LockMethod.java	2001/11/06 19:40:55	1.23
  +++ LockMethod.java	2001/12/07 13:50:56	1.24
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v 1.23 2001/11/06 19:40:55 remm Exp $
  - * $Revision: 1.23 $
  - * $Date: 2001/11/06 19:40:55 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v 1.24 2001/12/07 13:50:56 juergen Exp $
  + * $Revision: 1.24 $
  + * $Date: 2001/12/07 13:50:56 $
    *
    * ====================================================================
    *
  @@ -447,12 +447,8 @@
                       NodeRevisionDescriptor revisionDescriptor =
                           new NodeRevisionDescriptor(0);
                       
  -                    NodeProperty property = null;
  -                    
                       // Resource type
  -                    property = new NodeProperty("resourcetype",
  -                                                "<lock-null/>", true);
  -                    revisionDescriptor.setProperty(property);
  +                    revisionDescriptor.setResourceType("<lock-null/>");
                       
                       // Creating the revision descriptor
                       content.create(slideToken, lockInfo_lockSubject,
  
  
  
  1.15      +17 -19    jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MkcolMethod.java
  
  Index: MkcolMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MkcolMethod.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- MkcolMethod.java	2001/09/23 11:19:02	1.14
  +++ MkcolMethod.java	2001/12/07 13:50:56	1.15
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MkcolMethod.java,v 1.14 2001/09/23 11:19:02 dirkv Exp $
  - * $Revision: 1.14 $
  - * $Date: 2001/09/23 11:19:02 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MkcolMethod.java,v 1.15 2001/12/07 13:50:56 juergen Exp $
  + * $Revision: 1.15 $
  + * $Date: 2001/12/07 13:50:56 $
    *
    * ====================================================================
    *
  @@ -145,11 +145,9 @@
           NodeRevisionDescriptor revisionDescriptor =
               new NodeRevisionDescriptor(0);
           
  -        NodeProperty property = null;
           
           // Resource type
  -        property = new NodeProperty("resourcetype", "<collection/>", true);
  -        revisionDescriptor.setProperty(property);
  +        revisionDescriptor.setResourceType("<collection/>");
           
           // Creation date
           revisionDescriptor.setCreationDate(new Date());
  @@ -157,20 +155,20 @@
           // Last modification date
           revisionDescriptor.setLastModified(new Date());
           
  -        // Display name
  -        property = new NodeProperty("getcontentlength", "0", true);
  -        revisionDescriptor.setProperty(property);
  +        // Content length name
  +        revisionDescriptor.setContentLength(0);
           
           // Source
  -        property = new NodeProperty("source", "", true);
  -        revisionDescriptor.setProperty(property);
  +        revisionDescriptor.setSource("");
           
           // Owner
  -        String owner = slideToken.getCredentialsToken().getPublicCredentials();
  -        property = new NodeProperty("owner", owner, true);
  -        revisionDescriptor.setProperty(property);
  -
  +        revisionDescriptor.setOwner(
  +            slideToken.getCredentialsToken().getPublicCredentials());
  +            
  +            
           if (isMsProprietarySupport()) {
  +                
  +            NodeProperty property = null;
               
               // Name
               /*
  @@ -233,8 +231,8 @@
           // TODO : Initialize and create collection's properties.
           
       }
  -        
  -        
  +    
  +    
       /**
        * Get return status based on exception type.
        */
  @@ -250,9 +248,9 @@
           } catch (Exception e) {
               return super.getErrorCode(e);
           }
  -    
  +        
       }
  -
  +    
       
       
       /**
  
  
  
  1.23      +38 -46    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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- PropPatchMethod.java	2001/11/21 11:35:58	1.22
  +++ PropPatchMethod.java	2001/12/07 13:50:56	1.23
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v 1.22 2001/11/21 11:35:58 juergen Exp $
  - * $Revision: 1.22 $
  - * $Date: 2001/11/21 11:35:58 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v 1.23 2001/12/07 13:50:56 juergen Exp $
  + * $Revision: 1.23 $
  + * $Date: 2001/12/07 13:50:56 $
    *
    * ====================================================================
    *
  @@ -216,6 +216,7 @@
                   }
                   
               } catch (SAXException e) {
  +                e.printStackTrace();
                   resp.setStatus(WebdavStatus.SC_BAD_REQUEST);
                   throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
               } catch (ParserConfigurationException e) {
  @@ -251,6 +252,8 @@
       protected void executeRequest()
           throws WebdavException {
           
  +        boolean allOperationsExcecuted = true;
  +        
           // Prevent dirty reads
           slideToken.setForceStoreEnlistment(true);
           
  @@ -279,8 +282,7 @@
                   Property currentProperty =
                       (Property) propertyList.nextElement();
                   
  -                if (checkProperty(currentProperty, SET)) {
  -                    
  +                if (checkPropertyModification(currentProperty, revisionDescriptor)) {
                       NodeProperty newProperty =
                           new NodeProperty(currentProperty.name,
                                            currentProperty.value,
  @@ -288,6 +290,9 @@
                       revisionDescriptor.setProperty(newProperty);
                       
                   }
  +                else {
  +                    allOperationsExcecuted = false;
  +                }
               }
               
               propertyList = propertiesToRemove.elements();
  @@ -297,22 +302,25 @@
                   Property currentProperty =
                       (Property) propertyList.nextElement();
                   
  -                if (checkProperty(currentProperty, REMOVE)) {
  -                    
  +                if (checkPropertyModification(currentProperty, revisionDescriptor)) {
                       revisionDescriptor.removeProperty(currentProperty.name);
  -                    
  +                }
  +                else {
  +                    allOperationsExcecuted = false;
                   }
                   
               }
               
  -            content.store(slideToken, resourcePath, revisionDescriptor, null);
  +            if (allOperationsExcecuted)
  +                content.store(slideToken, resourcePath, revisionDescriptor, null);
               
  -        
  +            
               resp.setContentType("text/xml; charset=UTF-8");
  -        
  +            
               resp.setStatus(WebdavStatus.SC_MULTI_STATUS);
               
           } catch (Exception e) {
  +//          e.printStackTrace();
               resp.setStatus(getErrorCode(e));  // special handling needed
               throw new WebdavException(WebdavStatus.SC_ACCEPTED, false); // abort the TA
           }
  @@ -320,12 +328,16 @@
           
           // No serious errors. Printing the XML report.
           writeReport();
  +            
  +        if (!allOperationsExcecuted) {
  +            throw new WebdavException(WebdavStatus.SC_ACCEPTED, false); // abort the TA
  +        }
           
       }
       
  -        
  -        
  -        
  +    
  +    
  +    
       /**
        * Get return status based on exception type.
        */
  @@ -338,9 +350,9 @@
               return super.getErrorCode(e);
           }
       }
  -
  -
  -        
  +    
  +    
  +    
       // -------------------------------------------------------- Private Methods
       
       
  @@ -426,43 +438,23 @@
       }
       
       
  +    
       /**
        * Check if the property is a live property which should have its value
        * enforced by the server.
        *
        * @param property The property object
  -     * @param actionType Can be either SET or REMOVE
  +     * @param rd the revision descriptor containing all properties
        */
  -    private boolean checkProperty(Property property, int actionType) {
  -        
  -        // Checking the standard DAV properties which can't be modified using
  -        // a propatch.
  -        if (
  -               (property.name.equalsIgnoreCase("creationdate")) ||
  -               (property.name.equalsIgnoreCase("getcontentlength")) ||
  -               (property.name.equalsIgnoreCase("getetag")) ||
  -               (property.name.equalsIgnoreCase("getlastmodified")) ||
  -               (property.name.equalsIgnoreCase("lockdiscovery"))
  -        ) {
  -            property.status = WebdavStatus.SC_CONFLICT;
  -            return false;
  -        }
  +    private boolean checkPropertyModification(Property property, NodeRevisionDescriptor rd) {
  +        NodeProperty originalProperty = rd.getProperty(property.name, property.namespace);
  +        boolean result = originalProperty == null || !originalProperty.isProtected();
  +        if (!result) property.status = WebdavStatus.SC_CONFLICT;
  +System.out.println("########## " + property.name + " --> " + result);
  +        return result;
           
  -        switch (actionType) {
  -            
  -            case SET:
  -                
  -                break;
  -                
  -            case REMOVE:
  -                
  -                break;
  -                
  -        }
  -        
  -        return true;
  -        
       }
  +    
       
       
       /**
  
  
  
  1.21      +21 -47    jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java
  
  Index: PutMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- PutMethod.java	2001/10/11 08:24:52	1.20
  +++ PutMethod.java	2001/12/07 13:50:56	1.21
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v 1.20 2001/10/11 08:24:52 remm Exp $
  - * $Revision: 1.20 $
  - * $Date: 2001/10/11 08:24:52 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v 1.21 2001/12/07 13:50:56 juergen Exp $
  + * $Revision: 1.21 $
  + * $Date: 2001/12/07 13:50:56 $
    *
    * ====================================================================
    *
  @@ -175,34 +175,24 @@
                   //revisionContent.setContent(req.getReader());
                   revisionContent.setContent(req.getInputStream());
                   
  -                NodeProperty property = null;
  -                
                   // Get content length
  -                property = new NodeProperty
  -                    ("getcontentlength", new Long(req.getContentLength()),
  -                     true);
  -                revisionDescriptor.setProperty(property);
  +                revisionDescriptor.setContentLength(req.getContentLength());
                   
                   // Last modification date
                   revisionDescriptor.setLastModified(new Date());
                   
                   // Etag generation
  -                String etag = resourcePath.hashCode() + "_"
  +                revisionDescriptor.setETag(resourcePath.hashCode() + "_"
                       + revisionNumber.hashCode() + "_"
  -                    + revisionDescriptor.getContentLength();
  -                property = new NodeProperty("getetag", etag, true);
  -                revisionDescriptor.setProperty(property);
  +                    + revisionDescriptor.getContentLength());
                   
                   // Normally assume the 'getcontentlanguage' and
                   // 'getcontenttype' are set, however, before we clear the
                   // 'resourcetype' need to check for the case when a
                   // 'lock-null' is created just before the initial PUT. In
                   // that case need to add the missing properties.
  -                property = revisionDescriptor.getProperty("resourcetype");
  -                if (((String) property.getValue()).equals("<lock-null/>")) {
  -                    property =
  -                        new NodeProperty("getcontentlanguage", "en", true);
  -                    revisionDescriptor.setProperty(property);
  +                if (revisionDescriptor.getResourceType().equals("<lock-null/>")) {
  +                    revisionDescriptor.setContentLanguage("en");
                       
                       String contentType = req.getContentType();
                       if (contentType == null) {
  @@ -212,14 +202,11 @@
                       if (contentType == null) {
                           contentType = getConfig().getDefaultMimeType();
                       }
  -                    property = new NodeProperty("getcontenttype", contentType,
  -                                                true);
  -                    revisionDescriptor.setProperty(property);
  +                    revisionDescriptor.setContentType(contentType);
                   }
                   
                   // Resource type
  -                property = new NodeProperty("resourcetype", "", true);
  -                revisionDescriptor.setProperty(property);
  +                revisionDescriptor.setResourceType("");
                   
                   content.create(slideToken, resourcePath, revisionDescriptor,
                                  revisionContent);
  @@ -231,7 +218,7 @@
                   e.printStackTrace();
                   //
                   // make sure the transaction is aborted
  -                // throw any WebDAV exception to indicate 
  +                // throw any WebDAV exception to indicate
                   // the transaction wants to be aborted
                   //
                   throw new WebdavException(WebdavStatus.SC_ACCEPTED, false);
  @@ -245,27 +232,21 @@
                   NodeRevisionDescriptor revisionDescriptor =
                       new NodeRevisionDescriptor(req.getContentLength());
                   
  -                NodeProperty property = null;
  +                //NodeProperty property = null;
                   
                   // Creation date
                   
                   // Resource type
  -                property = new NodeProperty("resourcetype", "", true);
  -                revisionDescriptor.setProperty(property);
  +                revisionDescriptor.setResourceType("");
                   
                   // Source
  -                property = new NodeProperty("source", "", true);
  -                revisionDescriptor.setProperty(property);
  +                revisionDescriptor.setSource("");
                   
                   // Get content language
  -                property = new NodeProperty("getcontentlanguage", "en", true);
  -                revisionDescriptor.setProperty(property);
  +                revisionDescriptor.setContentLanguage("en");
                   
                   // Get content length
  -                property = new NodeProperty
  -                    ("getcontentlength",
  -                     new Long(req.getContentLength()), true);
  -                revisionDescriptor.setProperty(property);
  +                revisionDescriptor.setContentLength(req.getContentLength());
                   
                   // Get content type
                   String contentType = req.getContentType();
  @@ -276,28 +257,21 @@
                   if (contentType == null) {
                       contentType = getConfig().getDefaultMimeType();
                   }
  -                property = new NodeProperty("getcontenttype", contentType,
  -                                            true);
  -                revisionDescriptor.setProperty(property);
  +                revisionDescriptor.setContentType(contentType);
                   
                   // Last modification date
                   revisionDescriptor.setLastModified(new Date());
                   
                   // Etag generation
  -                String etag = resourcePath.hashCode() + "_"
  +                revisionDescriptor.setETag(resourcePath.hashCode() + "_"
                       + (new NodeRevisionNumber()).hashCode() + "_"
  -                    + req.getContentLength();
  -                property = new NodeProperty("getetag", etag, true);
  -                revisionDescriptor.setProperty(property);
  +                    + req.getContentLength());
                   
                   // Owner
  -                String owner = 
  -                    slideToken.getCredentialsToken().getPublicCredentials();
  -                property = new NodeProperty("owner", owner, true);
  -                revisionDescriptor.setProperty(property);
  +                revisionDescriptor.setOwner(slideToken.getCredentialsToken().getPublicCredentials());
                   
                   if (isMsProprietarySupport()) {
  -                    
  +                    NodeProperty property = null;
                       // Is hidden
                       property = new NodeProperty("ishidden", "0", "MICROSOFT");
                       revisionDescriptor.setProperty(property);
  
  
  
  1.7       +37 -37    jakarta-slide/src/share/org/apache/slide/content/NodeProperty.java
  
  Index: NodeProperty.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeProperty.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NodeProperty.java	2001/11/04 19:43:56	1.6
  +++ NodeProperty.java	2001/12/07 13:50:56	1.7
  @@ -1,13 +1,13 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeProperty.java,v 1.6 2001/11/04 19:43:56 remm Exp $
  - * $Revision: 1.6 $
  - * $Date: 2001/11/04 19:43:56 $
  + * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeProperty.java,v 1.7 2001/12/07 13:50:56 juergen Exp $
  + * $Revision: 1.7 $
  + * $Date: 2001/12/07 13:50:56 $
    *
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -15,7 +15,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -23,15 +23,15 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
  - *    any, must include the following acknowlegement:  
  - *       "This product includes software developed by the 
  + *    any, must include the following acknowlegement:
  + *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
  - *    from this software without prior written permission. For written 
  + *    from this software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache"
  @@ -59,7 +59,7 @@
    *
    * [Additional notices, if required by prior licensing conditions]
    *
  - */ 
  + */
   
   package org.apache.slide.content;
   
  @@ -72,9 +72,9 @@
   
   /**
    * Node property class
  - * 
  + *
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.6 $
  + * @version $Revision: 1.7 $
    */
   public final class NodeProperty implements Serializable, Cloneable {
       
  @@ -92,7 +92,7 @@
       
       /**
        * Constructor.
  -     * 
  +     *
        * @param name Name
        * @param value Value
        */
  @@ -108,20 +108,20 @@
       
       /**
        * Constructor.
  -     * 
  +     *
        * @param name Name
        * @param value Value
        * @param standard Standard
        */
  -    public NodeProperty(String name, Object value, boolean protectedProperty) {
  -        this(name, value);
  -        this.protectedProperty = true;
  -    }
  +  public NodeProperty(String name, Object value, boolean protectedProperty) {
  +      this(name, value);
  +      this.protectedProperty = protectedProperty;
  +  }
       
       
       /**
        * Constructor.
  -     * 
  +     *
        * @param name Name
        * @param value Value
        * @param namespace Namespace
  @@ -134,14 +134,14 @@
       
       /**
        * Constructor.
  -     * 
  +     *
        * @param name Name
        * @param value Value
        * @param namespace Namespace
        * @param type Type info
        * @param protectedProperty Protected property
        */
  -    public NodeProperty(String name, Object value, String namespace, 
  +    public NodeProperty(String name, Object value, String namespace,
                           String type, boolean protectedProperty) {
           this(name, value, namespace);
           setType(type);
  @@ -177,7 +177,7 @@
       
       
       /**
  -     * Value Type. If the value is stored as a String representation of the 
  +     * Value Type. If the value is stored as a String representation of the
        * value, the type field is used.
        * FIXME : Remove that
        */
  @@ -195,7 +195,7 @@
       
       /**
        * Protected accessor.
  -     * 
  +     *
        * @return boolean true
        */
       public boolean isProtected() {
  @@ -205,7 +205,7 @@
       
       /**
        * Property name accessor.
  -     * 
  +     *
        * @return String property name
        */
       public String getName() {
  @@ -215,7 +215,7 @@
       
       /**
        * Property name mutator.
  -     * 
  +     *
        * @param name Name
        */
       void setName(String name) {
  @@ -229,7 +229,7 @@
       
       /**
        * Namespace accessor.
  -     * 
  +     *
        * @return String definition
        */
       public String getNamespace() {
  @@ -239,7 +239,7 @@
       
       /**
        * Namespace mutator.
  -     * 
  +     *
        * @param definition Namepsace
        */
       void setNamespace(String namespace) {
  @@ -253,7 +253,7 @@
       
       /**
        * Value accessor.
  -     * 
  +     *
        * @return Object value
        */
       public Object getValue() {
  @@ -263,7 +263,7 @@
       
       /**
        * Value mutator.
  -     * 
  +     *
        * @param value Value
        */
       void setValue(Object value) {
  @@ -277,7 +277,7 @@
       
       /**
        * Type accessor.
  -     * 
  +     *
        * @return String type
        */
       public String getType() {
  @@ -287,7 +287,7 @@
       
       /**
        * Type mutator.
  -     * 
  +     *
        * @param type Type
        */
       void setType(String type) {
  @@ -301,7 +301,7 @@
       
       /**
        * Add permission.
  -     * 
  +     *
        * @param permission Permission
        */
       public void addPermission(NodePermission permission) {
  @@ -311,7 +311,7 @@
       
       /**
        * Remove permission.
  -     * 
  +     *
        * @param permission Permission to remove
        */
       public void removePermission(NodePermission permission) {
  @@ -321,7 +321,7 @@
       
       /**
        * Enumerate permissions.
  -     * 
  +     *
        * @return Enumeration permissions
        */
       public Enumeration enumeratePermissions() {
  @@ -334,7 +334,7 @@
       
       /**
        * Clone.
  -     * 
  +     *
        * @return Object clone
        */
       NodeProperty cloneObject() {
  @@ -349,7 +349,7 @@
       
       /**
        * Hash Code.
  -     * 
  +     *
        * @return int Hash code value
        */
       public int hashCode() {
  @@ -361,7 +361,7 @@
        * String representation of the permission.
        * <p/>
        * Format : ObjectUri-SubjectUri-ActionUri-InheritanceFlag
  -     * 
  +     *
        * @return String String representation
        */
       public String toString() {
  @@ -371,7 +371,7 @@
       
       /**
        * Equals.
  -     * 
  +     *
        * @param obj Object to test
        * @return boolean True if the two object are equal :
        * <li>obj is of type NodeProperty and is not null</li>
  
  
  
  1.20      +140 -17   jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptor.java
  
  Index: NodeRevisionDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptor.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- NodeRevisionDescriptor.java	2001/09/04 17:37:56	1.19
  +++ NodeRevisionDescriptor.java	2001/12/07 13:50:56	1.20
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptor.java,v 1.19 2001/09/04 17:37:56 juergen Exp $
  - * $Revision: 1.19 $
  - * $Date: 2001/09/04 17:37:56 $
  + * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptor.java,v 1.20 2001/12/07 13:50:56 juergen Exp $
  + * $Revision: 1.20 $
  + * $Date: 2001/12/07 13:50:56 $
    *
    * ====================================================================
    *
  @@ -81,7 +81,7 @@
    * Node Revision Descriptor class.
    *
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.19 $
  + * @version $Revision: 1.20 $
    */
   public final class NodeRevisionDescriptor implements Serializable, Cloneable {
       
  @@ -110,7 +110,8 @@
       /**
        * Type.
        */
  -    public static final String TYPE = "resourcetype";
  +    public static final String RESOURCE_TYPE = "resourcetype";
  +    public static final String TYPE = RESOURCE_TYPE;
       
       
       /**
  @@ -120,6 +121,12 @@
       
       
       /**
  +     * Owner.
  +     */
  +    public static final String OWNER = "owner";
  +    
  +    
  +    /**
        * MIME type of the content.
        */
       public static final String CONTENT_TYPE = "getcontenttype";
  @@ -424,7 +431,7 @@
        *
        * @param name Property name
        * @param value Property value
  -     * @param standard True if one of the standrad properties
  +     * @param standard True if one of the standard properties
        */
       protected void setProperty(String name, Object value, boolean standard) {
           setProperty(new NodeProperty(name, value, standard));
  @@ -542,10 +549,124 @@
        * @param name New name
        */
       public void setName(String name) {
  -        setProperty(NAME, "<![CDATA[" + name + "]]>", true);
  +        setProperty(NAME, "<![CDATA[" + name + "]]>", false);  // live property, but can be modified
  +    }
  +    
  +    
  +    /**
  +     * Get the ETAG property (if any).
  +     *
  +     * @return String
  +     */
  +    public String getETag() {
  +        NodeProperty contentType = getProperty(ETAG);
  +        if (contentType == null) {
  +            return new String();
  +        } else {
  +            return (String) contentType.getValue();
  +        }
  +    }
  +    
  +    
  +    /**
  +     * Set ETAG property.
  +     *
  +     * @param eTag  New etag
  +     */
  +    public void setETag(String eTag) {
  +        setProperty(ETAG, eTag, true);  // live property, can not be modified
  +    }
  +    
  +    
  +    
  +    
  +    
  +    /**
  +     * Get the owner property (if any).
  +     *
  +     * @return String
  +     */
  +    public String getOwner() {
  +        NodeProperty owner = getProperty(OWNER);
  +        if (owner == null) {
  +            return new String();
  +        } else {
  +            return (String) owner.getValue();
  +        }
  +    }
  +    
  +    
  +    /**
  +     * Set owner property.
  +     *
  +     * @param eTag  New etag
  +     */
  +    public void setOwner(String owner) {
  +        setProperty(OWNER, owner, true);  // live property, can not be modified
  +    }
  +    
  +    
  +    
  +    
  +    
  +    
  +    
  +    /**
  +     * Get the source property (if any).
  +     *
  +     * @return String
  +     */
  +    public String getSource() {
  +        NodeProperty source = getProperty(SOURCE);
  +        if (source == null) {
  +            return new String();
  +        } else {
  +            return (String) source.getValue();
  +        }
  +    }
  +    
  +    
  +    /**
  +     * Set owner property.
  +     *
  +     * @param eTag  New etag
  +     */
  +    public void setSource(String source) {
  +        setProperty(SOURCE, source, true);  // live property, can not be modified
  +    }
  +    
  +    
  +    
  +    
  +    
  +    
  +    /**
  +     * Get the ResourceType property (if any).
  +     *
  +     * @return String
  +     */
  +    public String getResourceType() {
  +        NodeProperty resourceType = getProperty(RESOURCE_TYPE);
  +        if (resourceType == null) {
  +            return new String();
  +        } else {
  +            return (String) resourceType.getValue();
  +        }
  +    }
  +    
  +    
  +    /**
  +     * Set ResourceType property.
  +     *
  +     * @param ResourceType  New ResourceType
  +     */
  +    public void setResourceType(String resourceType) {
  +        setProperty(RESOURCE_TYPE, resourceType, true);  // live property, can not be modified
       }
       
       
  +    
  +    
       /**
        * Get the MIME content type of the data (if any).
        *
  @@ -567,7 +688,7 @@
        * @param contentType New content type
        */
       public void setContentType(String contentType) {
  -        setProperty(CONTENT_TYPE, contentType, true);
  +        setProperty(CONTENT_TYPE, contentType, true);  // live property, can not be modified
       }
       
       
  @@ -592,7 +713,7 @@
        * @param contentLanguage New content language
        */
       public void setContentLanguage(String contentLanguage) {
  -        setProperty(CONTENT_LANGUAGE, contentLanguage, true);
  +        setProperty(CONTENT_LANGUAGE, contentLanguage, true);  // live property, can not be modified
       }
       
       
  @@ -650,8 +771,9 @@
        * @param creationDate New creation date
        */
       public void setCreationDate(Date creationDate) {
  -        setProperty
  -            (CREATION_DATE, creationDateFormat.format(creationDate), true);
  +        // live property, can not be modified
  +        setProperty(
  +            CREATION_DATE, creationDateFormat.format(creationDate), true);
       }
       
       
  @@ -661,7 +783,7 @@
        * @param creationDate New creation date
        */
       public void setCreationDate(String creationDate) {
  -        setProperty(CREATION_DATE, creationDate, true);
  +        setProperty(CREATION_DATE, creationDate, true);  // live property, can not be modified
       }
       
       
  @@ -719,6 +841,7 @@
        * @param lastModified New last modified date
        */
       public void setLastModified(Date lastModified) {
  +        // live property, can not be modified
           setProperty(LAST_MODIFIED, format.format(lastModified), true);
       }
       
  @@ -729,7 +852,7 @@
        * @param lastModified New last modified
        */
       public void setLastModified(String lastModified) {
  -        setProperty(LAST_MODIFIED, lastModified, true);
  +        setProperty(LAST_MODIFIED, lastModified, true);   // live property, can not be modified
       }
       
       
  @@ -739,7 +862,7 @@
        * @param creationLength New content length
        */
       public void setContentLength(long contentLength) {
  -        setProperty(CONTENT_LENGTH, new Long(contentLength), true);
  +        setProperty(CONTENT_LENGTH, new Long(contentLength), true);  // live property, can not be modified
       }
       
       
  @@ -758,7 +881,7 @@
           if (contentLengthValue == null) {
               contentLengthValue = new Long(0);
           }
  -        setProperty(CONTENT_LENGTH, contentLengthValue, true);
  +        setProperty(CONTENT_LENGTH, contentLengthValue, true);  // live property, can not be modified
       }
       
       
  @@ -811,8 +934,8 @@
           setCreationDate(new Date());
           setName("");
           // By default, a resource is a collection
  -        setProperty(TYPE, "<collection/>", true);
  -        setProperty(SOURCE, "", true);
  +        setResourceType("<collection/>");
  +        setProperty(SOURCE, "", true);  // live property, can not be modified
           setContentLength(-1);
           setLastModified(new Date());
           
  
  
  

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