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 Martin Dulisch <md...@s-und-n.de> on 2003/02/10 14:31:45 UTC

Contribution: principal-property-search report for client

Hello,

I have extended the client with a new method. It is the
principal-property-search report from the ACL specification.

I have created a new AclReportMethod class. This class at this moment
only supports the principal-property-search report. But it can be
extended with the other ACL reports.

In the first version no search criteria can be defined. But I could
add this feature if someone needs it. The report can be used to
request properties of all principals. We use it to get a list of
displaynames of all principals.

The two attached java files must be put to the package
org.apache.webdav.lib.methods

The following method must be added to the class WebdavResource:
-----------
/*
* Execute REPORT method.
* This method is for the special Access Control Reports:
* - acl-principal-prop-set (not supported yet)
* - principal-match (not supported yet)
* - principal-property-search
* - principal-search-property-set (not supported yet)
*
* @param path The path to request.
* @param properties The named properties.
* @param reportType Type from AclReportMethod
* @return an enumeration of <code>ResponseEntity</code>
* @exception HttpException
* @exception IOException
*/
public Enumeration aclReportMethod(
    String path,
    Collection properties,
    int reportType)
    throws HttpException, IOException {

  setClient();
  AclReportMethod method =
    new AclReportMethod(
    HttpURL.getPath(path),
    properties,
    DepthSupport.DEPTH_INFINITY,
    reportType);

  int status = client.executeMethod(method);
  // Set status code for this resource.
  if (thisResource == true) {
    // Set the status code.
    setStatusCode(method.getStatusLine().getStatusCode());
  }

  if (status != HttpStatus.SC_MULTI_STATUS && status !=
HttpStatus.SC_OK) {
    HttpException ex = new HttpException();
    ex.setReasonCode(status);
    throw ex;
  }
  thisResource = false;
  return method.getResponses();
}
-----------

Regards
Martin

-------------------------------------------------
s&n AG              Tel.: 05251/1581-75
netBank solutions   Fax : 05251/1581-71
Klingenderstr. 5    <ma...@s-und-n.de>
D-33100 Paderborn   http://www.s-und-n.de
-------------------------------------------------