dirkv       01/10/07 13:51:47

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        PropFindMethod.java
  Log:
  fix 3928:
  Propfind with request for all properties should return DAV:owner
  
  Revision  Changes    Path
  1.38      +27 -3     
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java
  
  Index: PropFindMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- PropFindMethod.java       2001/09/23 11:19:02     1.37
  +++ PropFindMethod.java       2001/10/07 20:51:47     1.38
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java,v
 1.37 2001/09/23 11:19:02 dirkv Exp $
  - * $Revision: 1.37 $
  - * $Date: 2001/09/23 11:19:02 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java,v
 1.38 2001/10/07 20:51:47 dirkv Exp $
  + * $Revision: 1.38 $
  + * $Date: 2001/10/07 20:51:47 $
    *
    * ====================================================================
    *
  @@ -673,6 +673,25 @@
                       showAclSemantics(generatedXML);
                       showPrincipalCollectionSet(generatedXML);
                   }
  +
  +                { // Owner property
  +                    NodeProperty ownerProperty = 
revisionDescriptor.getProperty(OWNER, NodeProperty.DEFAULT_NAMESPACE);
  +                    String ownerHref;
  +                    NamespaceConfig config = token.getNamespaceConfig();
  +                    if ((ownerProperty != null) && (ownerProperty.getValue()!=null) 
&&
  +                        (!"".equals(ownerProperty.getValue().toString()))) {
  +                        ownerHref=config.getUsersPath() + "/" + 
ownerProperty.getValue().toString();
  +                    }
  +                    else {
  +                        ownerHref=config.getUsersPath() + "/" + 
config.getGuestPath();
  +                    }
  +                    generatedXML.writeElement(null, OWNER, XMLPrinter.OPENING);
  +                    generatedXML.writeElement(null, "href", XMLPrinter.OPENING);
  +                    generatedXML.writeText(ownerHref);
  +                    generatedXML.writeElement(null, "href", XMLPrinter.CLOSING);
  +                    generatedXML.writeElement(null, OWNER, XMLPrinter.CLOSING);
  +                }
  +
                   
                   // Other properties
                   Enumeration propertyList =
  @@ -682,7 +701,12 @@
                       NodeProperty currentProperty =
                           (NodeProperty) propertyList.nextElement();
                       if (currentProperty != null) {
  +                        String propertyName = currentProperty.getName();
                           String namespace = currentProperty.getNamespace();
  +                        if ((OWNER.equals(propertyName)) && 
(NodeProperty.DEFAULT_NAMESPACE.equals(namespace))) {
  +                            // skip owner property
  +                            continue;
  +                        }
                           generateNamespaceAbbreviation(namespace);
                           String namespaceAbbrev =
                               (String) namespaces.get(namespace);
  
  
  


Reply via email to