juergen     2003/08/05 01:54:59

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        ReportMethod.java
  Log:
  fixed bug in Report (eckehard)
  
  Revision  Changes    Path
  1.53      +17 -12    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java
  
  Index: ReportMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- ReportMethod.java 22 May 2003 07:43:59 -0000      1.52
  +++ ReportMethod.java 5 Aug 2003 08:54:59 -0000       1.53
  @@ -623,12 +623,12 @@
               }
               else if (R_PRINCIPAL_SEARCH_PROPERTY_SET.equals(requestedReport)) {
                   resultElement = new Element(R_PRINCIPAL_SEARCH_PROPERTY_SET, 
NamespaceCache.DEFAULT_NAMESPACE);
  -                getResponse().setStatus(WebdavStatus.SC_OK);
  +                getResponse().setStatus(WebdavStatus.SC_MULTI_STATUS);
                   executePrincipalSearchPropertySetReport (requestUri, resultElement);
               }
               else if (R_PRINCIPAL_PROPERTY_SEARCH.equals(requestedReport)) {
                   //resultElement = new Element(E_MULTISTATUS, 
NamespaceCache.DEFAULT_NAMESPACE);
  -                getResponse().setStatus(WebdavStatus.SC_OK);
  +                getResponse().setStatus(WebdavStatus.SC_MULTI_STATUS);
                   resultElement = executePrincipalSearchPropertyReport (getDepth());
                   
               }
  @@ -1099,6 +1099,13 @@
           char seperator = '/';
           boolean self = false;
           
  +        String userPrefix = "/";
  +        String configParam = 
token.getNamespaceConfig().getParameter(AclConstants.P_USER_COLLECTION);
  +        if ( configParam != null ) {
  +        if ( configParam.length() > 0 )
  +                userpath = userpath + "/" + configParam +"/";
  +        }
  +        
           currentUri = req.getRequestURI();
           // check if self or principal-property is searched
           if ((principalProperty.getName()).equalsIgnoreCase(E_SELF)) {
  @@ -1126,11 +1133,11 @@
           
           if (self) {
               // build query for self
  -            searchDocument = C_SEARCHREQUEST_OPEN + C_SELECT_OPEN + 
C_PROP_DISPLAYNAME +
  +            searchDocument = C_SEARCHREQUEST_OPEN + C_SELECT_OPEN + 
C_PROP_PRINCIPAL_URL +
                   C_SELECT_CLOSE + C_FROM_SCOPE_OPEN + currentUri + 
C_FROM_SCOPE_CLOSE +
                   C_WHERE_ISPRINCIPAL + C_SEARCHREQUEST_CLOSE;
           } else {
  -            searchDocument = C_SEARCHREQUEST_OPEN + C_SELECT_OPEN + 
C_PROP_DISPLAYNAME +
  +            searchDocument = C_SEARCHREQUEST_OPEN + C_SELECT_OPEN + 
C_PROP_PRINCIPAL_URL +
                   C_SELECT_CLOSE + C_FROM_SCOPE_OPEN + currentUri + 
C_FROM_SCOPE_CLOSE +
                   C_SEARCHREQUEST_CLOSE;
           }
  @@ -1184,14 +1191,12 @@
               
               // remove not matching principals
               if ((uri != null)) {
  -                if (currentUser.startsWith(uri)) {
  -                    if (currentUser.startsWith(uri)) {
  +                if (uri.endsWith("/" + userID)) {
                           getPropertiesForResponse(currentIntUrl, parentElement);
                       }
                   }
               }
           }
  -    }
       
       /**
        * Executes a requested <code>principal-search-property</code> report.
  @@ -1326,7 +1331,7 @@
           while (principalCollectionSetIter.hasNext()) {
               // build dasel query
               String searchDocument = C_SEARCHREQUEST_OPEN + C_SELECT_OPEN
  -                + C_PROP_DISPLAYNAME + C_SELECT_CLOSE + 
(String)principalCollectionSetIter.next()
  +                + C_PROP_PRINCIPAL_URL + C_SELECT_CLOSE + 
(String)principalCollectionSetIter.next()
                   + whereElement + C_SEARCHREQUEST_CLOSE;
               queryResult = searchPrincipal(searchDocument, depth);
               Iterator it = queryResult.iterator();
  
  
  

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

Reply via email to