- All Implemented Interfaces:
- QualifiedReport, Report
public class AddressBookQueryReport
extends Object
implements QualifiedReport
The CARDDAV:addressbook-query REPORT performs a search for all address object
resources that match a specified filter. The response of this report will
contain all the WebDAV properties and address object resource data specified
in the request. In the case of the CARDDAV:address-data XML element, one can
explicitly specify the vCard properties that should be returned in the address
object resource data that matches the filter.
The format of this report is modeled on the PROPFIND method. The request and
response bodies of the CARDDAV:addressbook-query report
use XML elements that are also used by PROPFIND. In particular, the
request can include XML elements to request WebDAV properties to be
returned. When that occurs, the response should follow the same
behavior as PROPFIND with respect to the DAV:multistatus response
elements used to return specific WebDAV property results. For
instance, a request to retrieve the value of a WebDAV property that
does not exist is an error and MUST be noted with a response XML
element that contains a 404 (Not Found) status value.
- Author:
- nabil.shams, charly-alinto
- See Also:
Examples :
Input request is like :
<?xml version="1.0" encoding="UTF-8"?>
<C:addressbook-query xmlns:C="urn:ietf:params:xml:ns:carddav" xmlns:D="DAV:">
<D:prop>
<D:getetag/>
<C:address-data/>
</D:prop>
<C:filter>
<C:prop-filter name="mail">
<C:text-match collation="i;unicasemap" match-type="starts-with">Laurie</C:text-match>
</C:prop-filter>
</C:filter>
</C:addressbook-query>
or more complex with many criterias
<?xml version="1.0" encoding="utf-8" ?>
<C:addressbook-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav">
<D:prop>
<D:getetag/>
<C:address-data>
<C:allprop/>
</C:address-data>
</D:prop>
<C:filter test="anyof">
<C:prop-filter name="sn">
<C:text-match collation="i;unicode-casemap" negate-condition="no" match-type="contains">Laurie</C:text-match>
</C:prop-filter>
<C:prop-filter name="givenname">
<C:text-match collation="i;unicode-casemap" negate-condition="no" match-type="contains">Laurie</C:text-match>
</C:prop-filter>
<C:prop-filter name="email">
<C:text-match collation="i;unicode-casemap" negate-condition="no" match-type="contains">Laurie</C:text-match>
</C:prop-filter>
</C:filter>
<C:limit>
<C:nresults>$limit</C:nresults>
</C:limit>
</C:addressbook-query>