Network Working Group                                           C. Daboo
Internet-Draft                                            Apple Computer
Intended status: Informational                          October 22, 2006
Expires: April 25, 2007


                  vCard Extensions to WebDAV (CardDAV)
                         draft-daboo-carddav-01

Status of this Memo

   By submitting this Internet-Draft, each author represents that any
   applicable patent or other IPR claims of which he or she is aware
   have been or will be disclosed, and any of which he or she becomes
   aware will be disclosed, in accordance with Section 6 of BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF), its areas, and its working groups.  Note that
   other groups may also distribute working documents as Internet-
   Drafts.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   The list of current Internet-Drafts can be accessed at
   http://www.ietf.org/ietf/1id-abstracts.txt.

   The list of Internet-Draft Shadow Directories can be accessed at
   http://www.ietf.org/shadow.html.

   This Internet-Draft will expire on April 25, 2007.

Copyright Notice

   Copyright (C) The Internet Society (2006).

Abstract

   This document specifies a set of methods, headers and resource types
   that define an extension to the WebDAV protocol to support vCard data
   stored as address books on the server.  The new protocol elements are
   intended to make WebDAV-based address book management an
   interoperable standard that supports address book access, address
   book sharing, and address book publishing.





Daboo                    Expires April 25, 2007                 [Page 1]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


Change History (to be removed prior to publication as an RFC)

   Changes from -00

   1.  Fixed various incorrect references and typos.

   2.  Major changes to sync with latest CalDAV spec behaviors.


Table of Contents

   1.  Introduction and Overview  . . . . . . . . . . . . . . . . . .  4
     1.1.  IMSP . . . . . . . . . . . . . . . . . . . . . . . . . . .  4
     1.2.  ACAP . . . . . . . . . . . . . . . . . . . . . . . . . . .  5
     1.3.  LDAP . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
     1.4.  WebDAV for Address Books . . . . . . . . . . . . . . . . .  6
     1.5.  vCard  . . . . . . . . . . . . . . . . . . . . . . . . . .  7
   2.  Conventions  . . . . . . . . . . . . . . . . . . . . . . . . .  7
     2.1.  Notational Conventions . . . . . . . . . . . . . . . . . .  7
     2.2.  XML Namespaces and Processing  . . . . . . . . . . . . . .  8
     2.3.  Method Preconditions and Postconditions  . . . . . . . . .  8
   3.  Requirements Overview  . . . . . . . . . . . . . . . . . . . .  9
   4.  Address Book Data Model  . . . . . . . . . . . . . . . . . . .  9
     4.1.  Address Book Server  . . . . . . . . . . . . . . . . . . . 10
   5.  Address Book Resources . . . . . . . . . . . . . . . . . . . . 10
     5.1.  vCard Object Resources . . . . . . . . . . . . . . . . . . 10
     5.2.  Address Book Collection  . . . . . . . . . . . . . . . . . 11
   6.  Address Book Feature . . . . . . . . . . . . . . . . . . . . . 12
     6.1.  Address Book Support . . . . . . . . . . . . . . . . . . . 12
       6.1.1.  Example: Using OPTIONS for the Discovery of
               Support for CardDAV  . . . . . . . . . . . . . . . . . 12
     6.2.  Address Book Properties  . . . . . . . . . . . . . . . . . 13
       6.2.1.  CARDDAV:adbk-description Property  . . . . . . . . . . 13
       6.2.2.  CARDDAV:supported-adbk-data Property . . . . . . . . . 13
       6.2.3.  CARDDAV:max-resource-size Property . . . . . . . . . . 14
     6.3.  Creating Resources . . . . . . . . . . . . . . . . . . . . 15
       6.3.1.  MKADBK Method  . . . . . . . . . . . . . . . . . . . . 15
         6.3.1.1.  Status Codes . . . . . . . . . . . . . . . . . . . 17
         6.3.1.2.  Example - Successful MKADBK request  . . . . . . . 18
       6.3.2.  Creating vCard Object Resources  . . . . . . . . . . . 18
         6.3.2.1.  Additional Preconditions for PUT, COPY and MOVE  . 20
   7.  Address Book Access Control  . . . . . . . . . . . . . . . . . 21
     7.1.  Additional Principal Property  . . . . . . . . . . . . . . 21
       7.1.1.  CARDDAV:adbk-home-set Property . . . . . . . . . . . . 21
   8.  Address Book Reports . . . . . . . . . . . . . . . . . . . . . 22
     8.1.  REPORT Method  . . . . . . . . . . . . . . . . . . . . . . 22
     8.2.  Ordinary collections . . . . . . . . . . . . . . . . . . . 22
     8.3.  Searching Text: Collations . . . . . . . . . . . . . . . . 22



Daboo                    Expires April 25, 2007                 [Page 2]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


       8.3.1.  CARDDAV:supported-collation-set Property . . . . . . . 23
     8.4.  Partial Retrieval  . . . . . . . . . . . . . . . . . . . . 24
     8.5.  Non-standard properties and parameters . . . . . . . . . . 24
     8.6.  CARDDAV:adbk-query Report  . . . . . . . . . . . . . . . . 25
       8.6.1.  Example: Partial retrieval of vCards matching a
               NICKNAME . . . . . . . . . . . . . . . . . . . . . . . 26
       8.6.2.  Example: Partial retrieval of vCards matching a
               full name  . . . . . . . . . . . . . . . . . . . . . . 28
     8.7.  CARDDAV:adbk-multiget Report . . . . . . . . . . . . . . . 31
       8.7.1.  Example: CARDDAV:adbk-multiget Report  . . . . . . . . 32
     8.8.  CARDDAV:adbk-sync Report . . . . . . . . . . . . . . . . . 33
       8.8.1.  Example: Initial CARDDAV:adbk-sync Report  . . . . . . 35
       8.8.2.  Example: CARDDAV:adbk-sync Report with token . . . . . 36
   9.  Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . 38
     9.1.  Restrict the Properties Returned . . . . . . . . . . . . . 38
     9.2.  Use of Locking . . . . . . . . . . . . . . . . . . . . . . 38
     9.3.  Finding address books  . . . . . . . . . . . . . . . . . . 38
   10. XML Element Definitions  . . . . . . . . . . . . . . . . . . . 40
     10.1. CARDDAV:adbk XML Element . . . . . . . . . . . . . . . . . 40
     10.2. CARDDAV:mkadbk XML Element . . . . . . . . . . . . . . . . 40
     10.3. CARDDAV:mkadbk-response XML Element  . . . . . . . . . . . 41
     10.4. CARDDAV:supported-collation XML Element  . . . . . . . . . 41
     10.5. CARDDAV:adbk-query XML Element . . . . . . . . . . . . . . 41
     10.6. CARDDAV:adbk-data XML Element  . . . . . . . . . . . . . . 42
       10.6.1. CARDDAV:allprop XML Element  . . . . . . . . . . . . . 43
       10.6.2. CARDDAV:prop XML Element . . . . . . . . . . . . . . . 43
     10.7. CARDDAV:filter XML Element . . . . . . . . . . . . . . . . 44
       10.7.1. CARDDAV:prop-filter XML Element  . . . . . . . . . . . 44
       10.7.2. CARDDAV:param-filter XML Element . . . . . . . . . . . 45
       10.7.3. CARDDAV:is-not-defined XML Element . . . . . . . . . . 46
       10.7.4. CARDDAV:text-match XML Element . . . . . . . . . . . . 46
     10.8. CARDDAV:adbk-multiget XML Element  . . . . . . . . . . . . 47
     10.9. CARDDAV:adbk-sync XML Element  . . . . . . . . . . . . . . 47
       10.9.1. CARDDAV:sync-token XML Element . . . . . . . . . . . . 47
   11. Internationalization Considerations  . . . . . . . . . . . . . 48
   12. Security Considerations  . . . . . . . . . . . . . . . . . . . 48
   13. IANA Consideration . . . . . . . . . . . . . . . . . . . . . . 49
     13.1. Namespace Registration . . . . . . . . . . . . . . . . . . 49
   14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 49
     14.1. Normative References . . . . . . . . . . . . . . . . . . . 49
     14.2. Informative References . . . . . . . . . . . . . . . . . . 50
   Appendix A.  Acknowledgments . . . . . . . . . . . . . . . . . . . 50
   Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 51
   Intellectual Property and Copyright Statements . . . . . . . . . . 52







Daboo                    Expires April 25, 2007                 [Page 3]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


1.  Introduction and Overview

   Address books are a key component of personal information management
   tools, such as email or calendaring and scheduling clients.  To date
   several protocols have been used for remote access to address data,
   including LDAP [RFC2251], IMSP and ACAP [RFC2244].

1.1.  IMSP

   IMSP, which was the predecessor to ACAP [RFC2244], received limited
   support from vendors, but those that did implement solutions based on
   it, found it to be a useful feature for large deployments of email
   clients at sites where users may roam from machine to machine.  IMSP
   provided for multiple personal, shared or public address books,
   organized in a hierarchy, and gave individual users the ability to
   control access to their address books so that they could grant read
   or write access rights to other specific users or groups.  This
   provided an easy and convenient way for users or workgroups to
   quickly setup and manage shared address information.  Address book
   support in IMSP suffers from a number of problems, including a
   limited format for the address data itself, and scalability issues
   with large address books.

   The key features of address book support in IMSP are:

   1.  Ability to use multiple address books with hierarchical layout.

   2.  Ability to control access to individual address books.

   3.  Server-side searching of address data, avoiding the need for
       clients to download an entire address book in order to do a quick
       address 'expansion' operation.

   4.  Ability to download/upload an individual address in an address
       book.

   The key disadvantages of address book support in IMSP are:

   1.  Limited schema for address data.

   2.  Does not scale to large address books (e.g. no way to page
       through the list of addresses in an address book).

   3.  Does not provide any type of synchronization capability, which
       easily leads to 'lost update' problems when multiple users are
       editing the same address book entries.





Daboo                    Expires April 25, 2007                 [Page 4]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   4.  Lack of internationalization support.

   5.  Does not provide per-address access control

   6.  Does not provide a simple way to lookup users on the system.

1.2.  ACAP

   ACAP [RFC2244] was meant as the successor to IMSP and as such was
   designed to be a more 'generic' data access protocol for general
   application use.  ACAP defined specific 'datasets' (basically formal
   schema definitions) for different anticipated areas of use, including
   address books, email accounts, application preferences, mime types
   etc.  The use of such formal schema definitions was intended to
   enhance interoperability between clients.  However, ACAP proved
   difficult to implement due to over complexity in the protocol itself,
   and this lead to few implementations.

   The key features of address book support in ACAP are:

   1.   Ability to use multiple address books with hierarchical layout.

   2.   Ability to control access to individual address books and
        address entries.

   3.   Server-side searching of address data, avoiding the need for
        clients to download an entire address book in order to do a
        quick address 'expansion' operation.

   4.   Ability to inherit address book data from others.

   5.   Ability to watch changes in address book data through use of
        'contexts'.

   6.   Ability to page through address book data through use of
        'contexts'.

   7.   Internationalization support through use of UTF-8 for all data.

   8.   Well defined address schema to enhance client interoperability.

   9.   Compatibility with vCard data format.

   10.  Users and groups dataset can be used to enumerate and find other
        users on the system.

   The key disadvantages of address book support in ACAP are:




Daboo                    Expires April 25, 2007                 [Page 5]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   1.  Inheritance, access control and contexts all together is hard,
       and ultimately proved one of the major hurdles to
       implementations.

1.3.  LDAP

   LDAP [RFC2251] is a generic directory access protocol that is
   specifically targeted at management applications and browser
   applications that provide read/write interactive access to
   directories.  Often such directories contain information about
   people, including contact/address data.

   The key features of address book support in LDAP are:

   1.  To do

   The key disadvantages of address book support in LDAP are:

   1.  Lack of schemas require overly complex client configuration to
       map expected fields in the client to directory entries in the
       server.

   2.  General reluctance to give 'ordinary' users write access to even
       a small portion of the directory as often sensitive information
       is included in directory entries and a small mistake in
       configuring access control can lead to a major security breach.

1.4.  WebDAV for Address Books

   WebDAV [RFC2518] offers a number of advantages as a framework or
   basis for address book access and management.  Most of these
   advantages boil down to a significant reduction in design costs,
   implementation costs, interoperability test costs and deployment
   costs.

   The key features of address book support with WebDAV are:

   1.  Ability to use multiple address books with hierarchical layout.

   2.  Ability to control access to individual address books and address
       entries.

   3.  Principal namespace can be used to enumerate and find other users
       on the system.

   4.  Server-side searching of address data, avoiding the need for
       clients to download an entire address book in order to do a quick
       address 'expansion' operation.



Daboo                    Expires April 25, 2007                 [Page 6]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   5.  Well-defined internationalization support through standard HTTP.

   6.  Use of vCards for well defined address schema to enhance client
       interoperability.

   7.  Many limited clients (e.g. mobile devices) contain an HTTP stack
       which makes implementing WebDAV much easier than other protocols.

   The key disadvantages of address book support in WebDAV are:

   1.  Lack of change notification.

   2.  Stateless nature of protocol can result in more data being sent
       with each transaction to maintain per-user session across
       requests.

1.5.  vCard

   vCard [RFC2426] is a MIME directory profile aimed at encapsulating
   personal addressing and contact information about people.  The
   specification of vCard was originally done by the Versit consortium,
   with a subsequent 3.0 version standardized by the IETF [RFC2426].
   vCard is in wide spread use in email clients and mobile devices as a
   means of encapsulating address information for transport via email,
   or for import/export and synchronization operations.


2.  Conventions

2.1.  Notational Conventions

   The augmented BNF used by this document to describe protocol elements
   is described in Section 2.1 of [RFC2616].  Because this augmented BNF
   uses the basic production rules provided in Section 2.2 of [RFC2616],
   those rules apply to this document as well.

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in [RFC2119].

   The term "protected" is used in the Conformance field of property
   definitions as defined in Section 1.4.2 of [RFC3253].

   When XML element types in the namespaces "DAV:" and
   "urn:ietf:params:xml:ns:carddav" are referenced in this document
   outside of the context of an XML fragment, the string "DAV:" and
   "CARDDAV:" will be prefixed to the element type names respectively.




Daboo                    Expires April 25, 2007                 [Page 7]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


2.2.  XML Namespaces and Processing

   Definitions of XML elements in this document use XML element type
   declarations (as found in XML Document Type Declarations), described
   in Section 3.2 of [W3C.REC-xml-20060816].

   The namespace "urn:ietf:params:xml:ns:carddav" is reserved for the
   XML elements defined in this specification, its revisions, and
   related CardDAV specifications.  XML elements defined by individual
   implementations MUST NOT use the "urn:ietf:params:xml:ns:carddav"
   namespace, and instead should use a namespace that they control.

   The XML declarations used in this document do not include namespace
   information.  Thus, implementers must not use these declarations as
   the only way to create valid CardDAV properties or to validate
   CardDAV XML element type.  Some of the declarations refer to XML
   elements defined by WebDAV [RFC2518] which use the "DAV:" namespace.
   Wherever such XML elements appear, they are explicitly prefixed with
   "DAV:" to avoid confusion.

   Also note that some CardDAV XML element names are identical to WebDAV
   XML element names, though their namespace differs.  Care must be
   taken not to confuse the two sets of names.

   Processing of XML by CardDAV clients and servers MUST follow the
   rules described in [RFC2518], in particular Section 14, and Appendix
   3 of that specification.

2.3.  Method Preconditions and Postconditions

   A "precondition" of a method describes the state of the server that
   must be true for that method to be performed.  A "postcondition" of a
   method describes the state of the server that must be true after that
   method has been completed.  If a method precondition or postcondition
   for a request is not satisfied, the response status of the request
   MUST be either 403 (Forbidden) if the request should not be repeated
   because it will always fail, or 409 (Conflict) if it is expected that
   the user might be able to resolve the conflict and resubmit the
   request.

   In order to allow better client handling of 403 and 409 responses, a
   distinct XML element type is associated with each method precondition
   and postcondition of a request.  When a particular precondition is
   not satisfied or a particular postcondition cannot be achieved, the
   appropriate XML element MUST be returned as the child of a top-level
   DAV:error element in the response body, unless otherwise negotiated
   by the request.  In a 207 Multi-Status response, the DAV:error
   element would appear in the appropriate DAV:responsedescription



Daboo                    Expires April 25, 2007                 [Page 8]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   element.


3.  Requirements Overview

   This section lists what functionality is required of a CardDAV
   server.

   To advertise support for the 'adbk-access' features of CardDAV, a
   server:

   o  MUST support WebDAV Class 1 [RFC2518] (note that
      [I-D.ietf-webdav-rfc2518bis] describes clarifications to [RFC2518]
      that aid interoperability);

   o  MUST support WebDAV ACLs [RFC3744].

   o  MUST support transport over TLS [RFC2246] as defined in [RFC2818]
      (note that [RFC2246] has been obsoleted by [RFC4346]);

   o  MUST support strong ETags to support disconnected operations.

   o  MUST support address book REPORTs as described in this document.

   o  MUST support the MKADBK method.

   To advertise support for the 'adbk-sync' features of CardDAV, a
   server:

   o  MUST support the 'adbk-access' features described above.

   o  MUST support the 'adbk-sync' REPORT on address book collections.


4.  Address Book Data Model

   As a brief overview, a CardDAV address book is modeled as a WebDAV
   collection with a well defined structure; each of these address book
   collections contain a number of resources representing vCard objects
   as their direct child resources.  Each resource representing a vCard
   object is called a "vCard object resource".  Each vCard object
   resource and each address book collection can be individually locked
   and have individual WebDAV properties.  Requirements derived from
   this model are provided in Section 5.1 and Section 5.2.







Daboo                    Expires April 25, 2007                 [Page 9]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


4.1.  Address Book Server

   A CardDAV server is a vCard-aware engine combined with a WebDAV
   repository.  A WebDAV repository is a set of WebDAV collections,
   containing other WebDAV resources, within a unified URL namespace.
   For example, the repository "http://example.org/webdav/" may contain
   WebDAV collections and resources, all of which have URLs beginning
   with "http://example.org/webdav/".  Note that the root URL
   "http://example.org/" may not itself be a WebDAV repository (for
   example, if the WebDAV support is implemented through a servlet or
   other Web server extension).

   A WebDAV repository MAY include address book data in some parts of
   its URL namespace, and non-address book data in other parts.

   A WebDAV repository can advertise itself as a CardDAV server if it
   supports the functionality defined in this specification at any point
   within the root of the repository.  That might mean that vCard data
   is spread throughout the repository and mixed with non-vCard data in
   nearby collections (e.g. vCard data may be found in /lisa/
   addressbook/ as well as in /bernard/addressbook/, and non-vCard data
   in /lisa/calendars/).  Or, it might mean that vCard data can be found
   only in certain sections of the repository (e.g. /addressbooks/
   user/).  Address book features are only required in the repository
   sections that are or contain vCard objects.  So a repository
   confining vCard data to the /carddav/ collection would only need to
   support the CardDAV required features within that collection.

   The CardDAV server or repository is the canonical location for vCard
   data and state information.  Clients may submit requests to change
   data or download data.  Clients may store vCard objects offline and
   attempt to synchronize at a later time.  However, clients MUST be
   prepared for vCard data on the server to change between the time of
   last synchronization and when attempting an update, as address book
   collections may be shared and accessible via multiple clients.
   Entity tags and other features help this work.


5.  Address Book Resources

5.1.  vCard Object Resources

   vCard object resources contained in address book collections MUST
   contain a single vCard component only.

   vCard components in an address book collection MUST have a UID
   property value that MUST be unique in the scope of the address book
   collection in which it is contained.



Daboo                    Expires April 25, 2007                [Page 10]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


5.2.  Address Book Collection

   CardDAV defines the following new resource type for use in WebDAV
   repositories holding vCard data.

   Address book collections appear to clients as a WebDAV collection
   resource, identified by a URL.  An address book collection MUST
   report the DAV:collection and CARDDAV:adbk XML elements in the value
   of the DAV:resourcetype property.  The element type declaration for
   CARDDAV:adbk is:


   <!ELEMENT adbk EMPTY>


   An address book collection can be created through provisioning (e.g.,
   automatically created when a user's account is provisioned), or it
   can be created with the MKADBK method (see Section 6.3.1).  This
   method can be useful for a user to create additional address books
   (e.g., "soccer team members") or for users to share an address book
   (e.g., "sales team contacts").  Note however that this document
   doesn't define what extra address book collections are for.  Users
   must rely on non-standard cues to find out what an address book
   collection is for, or use the CARDDAV:adbk-description property
   defined in Section 6.2.1 to provide such a cue.

   The following restrictions are applied to the resources within an
   address book collection:

   a.  Address book collections MUST only contain vCard object resources
       and collections that are not address book collections. i.e., the
       only "top-level" non-collection resources allowed in an address
       book collection are vCard object resources.  This ensures that
       address book clients do not have to deal with non-vCard data in
       an address book collection, though they do have to distinguish
       between vCard object resources and collections when using
       standard WebDAV techniques to examine the contents of a
       collection.

   b.  Collections contained in address book collections MUST NOT
       contain address book collections at any depth. i.e., "nesting" of
       address book collections within other address book collections at
       any depth is not allowed.  This specification does not define how
       collections contained in an address book collection are used or
       how they relate to any vCard object resources contained in the
       address book collection.

   Multiple address book collections MAY be children of the same



Daboo                    Expires April 25, 2007                [Page 11]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   collection.


6.  Address Book Feature

6.1.  Address Book Support

   If the server supports the CardDAV features described in this
   document, it MUST include "adbk-access" as a field in the DAV
   response header from an OPTIONS request on any resource that supports
   any address book properties, reports, or methods.  A value of "adbk-
   access" in the DAV header MUST indicate that the server supports all
   MUST level requirements and REQUIRED features specified in this
   document, with the exception of the CARDDAV:adbk-sync REPORT.

   CardDAV includes a special report to allow better client/server
   synchronization performance.  Support for this feature is OPTIONAL,
   though RECOMMENDED.  If a server supports this feature then it MUST
   include "adbk-sync" as a field in the DAV response header from an
   OPTIONS request on any address book collection resource that supports
   the report.

6.1.1.  Example: Using OPTIONS for the Discovery of Support for CardDAV

   >> Request <<


   OPTIONS /addressbooks/users/ HTTP/1.1
   Host: adbk.example.com


   >> Response <<


   HTTP/1.1 200 OK
   Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
   Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, REPORT
   Allow: MKADBK, ACL
   DAV: 1, 2, access-control, adbk-access
   Content-Length: 0


   In this example, the OPTIONS response indicates that the server
   supports CardDAV in this namespace, therefore the '/addressbooks/
   users/' collection may be used as a parent for address book
   collections as the MKADBK method is available, and as a possible
   target for REPORT requests for address book reports.




Daboo                    Expires April 25, 2007                [Page 12]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


6.2.  Address Book Properties

6.2.1.  CARDDAV:adbk-description Property

   Name:  adbk-description

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Provides a human-readable description of the address book
      collection.

   Conformance:  This property MAY be defined on any address book
      collection.  If defined, it MAY be protected and SHOULD NOT be
      returned by a PROPFIND DAV:allprop request (as defined in Section
      12.14.1 of [RFC2518]).  An xml:lang attribute indicating the human
      language of the description SHOULD be set for this property by
      clients or through server provisioning.  Servers MUST return any
      xml:lang attribute if set for the property.

   Description:  If present, the property contains a description of the
      address book collection that is suitable for presentation to a
      user.  If not present, the client should assume no description for
      the address book collection.


         <!ELEMENT adbk-description (#PCDATA)>
         PCDATA value: string


         <C:adbk-description xml:lang="fr-CA"
            xmlns:C="urn:ietf:params:xml:ns:carddav"
         >Address de Oliver Daboo</C:adbk-description>

6.2.2.  CARDDAV:supported-adbk-data Property

   Name:  supported-adbk-data

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Specifies what media types are allowed for address book
      object resources in an address book collection.

   Conformance:  This property MAY be defined on any address book
      collection.  If defined, it MUST be protected and SHOULD NOT be
      returned by a PROPFIND DAV:allprop request (as defined in Section
      12.14.1 of [RFC2518] ).





Daboo                    Expires April 25, 2007                [Page 13]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   Description:  The CARDDAV:supported-adbk-data property is used to
      specify the media type supported for the address (vCard) object
      resources contained in a given address book collection (e.g.,
      vCard version 3.0).  Any attempt by the client to store vCard
      object resources with a media type not listed in this property
      MUST result in an error, with the CARDDAV:supported-adbk-data
      precondition ( Section 6.3.2.1 ) being violated.  In the absence
      of this property the server MUST only accept data with the media
      type "text/vcard" and vCard version 3.0, and clients can assume
      that.

   Definition:


         <!ELEMENT supported-adbk-data (adbk-data*)>


   Example:


       <C:supported-adbk-data xmlns:C="urn:ietf:params:xml:ns:carddav">
         <C:adbk-data content-type="text/vcard" version="3.0"/>
       </C:supported-adbk-data>


6.2.3.  CARDDAV:max-resource-size Property

   Name:  max-resource-size

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Provides a numeric value indicating the maximum size of a
      resource in octets that the server is willing to accept when a
      vCard object resource is stored in an address book collection.

   Conformance:  This property MAY be defined on any address book
      collection.  If defined, it MUST be protected and SHOULD NOT be
      returned by a PROPFIND DAV:allprop request (as defined in Section
      12.14.1 of [RFC2518] ).

   Description:  The CARDDAV:max-resource-size is used to specify a
      numeric value that represents the maximum size in octets that the
      server is willing to accept when a vCard object resource is stored
      in an address book collection.  Any attempt to store an address
      book object resource exceeding this size MUST result in an error,
      with the CARDDAV:max-resource-size precondition ( Section 6.3.2.1
      ) being violated.  In the absence of this property the client can
      assume that the server will allow storing a resource of any



Daboo                    Expires April 25, 2007                [Page 14]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


      reasonable size.

   Definition:


         <!ELEMENT max-resource-size (#PCDATA)>
         PCDATA value: a numeric value (positive integer)


   Example:


         <C:max-resource-size xmlns:C="urn:ietf:params:xml:ns:carddav"
         >102400</C:max-resource-size>


6.3.  Creating Resources

   The creation of address book collections and vCard object resources
   may be initiated by either a CardDAV client or by the CardDAV server.
   For example, a server might come pre-configured with a user's address
   book collection, or the CardDAV client might request the server to
   create a new address book collection for a given user.  Servers might
   populate vCard objects inside an address book collection, or clients
   might request the server to create vCards.  Either way, both client
   and server MUST comply with the requirements in this document, and
   MUST understand objects appearing in address book collections or
   according to the data model defined here.

6.3.1.  MKADBK Method

   An HTTP request using the MKADBK method creates a new address book
   collection resource.  A server MAY restrict address book collection
   creation to particular collections.

   Clients SHOULD use the DAV:displayname property for a human-readable
   name of the address book.  Clients can either specify the value of
   the DAV:displayname property in the request body of the MKADBK
   request, or alternatively issue a PROPPATCH request to change the
   DAV:displayname property to the appropriate value immediately after
   using the MKADBK request.  Clients SHOULD NOT set the DAV:
   displayname property to be the same as any other address book
   collection at the same URI "level".  When displaying address book
   collections to users, clients SHOULD check the DAV:displayname
   property and use that value as the name of the address book.  In the
   event that the DAV: displayname property is empty, the client MAY use
   the last part of the address book collection URI as the name, however
   that path segment may be "opaque" and not represent any meaningful



Daboo                    Expires April 25, 2007                [Page 15]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   human-readable text.

   If a MKADBK request fails, the server state preceding the request
   MUST be restored.

   Marshalling:

      If a request body is included, it MUST be a CARDDAV:mkadbk XML
      element.  Instruction processing MUST occur in the order
      instructions are received (i.e., from top to bottom).
      Instructions MUST either all be executed or none executed.  Thus
      if any error occurs during processing all executed instructions
      MUST be undone and a proper error result returned.  Instruction
      processing details can be found in the definition of the DAV:set
      instruction in section 12.13 of [RFC2518].

         <!ELEMENT mkadbk (DAV:set)>

      If a response body for a successful request is included, it MUST
      be a CARDDAV:mkadbk-response XML element.

         <!ELEMENT mkadbk-response ANY>

      The response MUST include a Cache-Control:no-cache header.

   Preconditions:

      (DAV:resource-must-be-null): A resource MUST NOT exist at the
      Request-URI.

      (CARDDAV:adbk-collection-location-bad): The Request-URI MUST
      identify a location where an address book collection can be
      created.

      (DAV:needs-privilege): The DAV:bind privilege MUST be granted to
      the current user.

   Postconditions:

      (CARDDAV:initialize-adbk-collection): A new address book
      collection exists at the Request-URI.  The DAV:resourcetype of the
      address book collection MUST contain both DAV:collection and
      CARDDAV:adbk XML elements.








Daboo                    Expires April 25, 2007                [Page 16]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


6.3.1.1.  Status Codes

   The following are examples of response codes one would expect to get
   in a response to a MKADBK request.  Note that this list is by no
   means exhaustive.

      201 (Created) - The address book collection resource was created
      in its entirety.

      207 (Multi-Status) - The address book collection resource was not
      created since one or more DAV:set instructions specified in the
      request body could not be processed successfully.  The following
      are examples of response codes one would expect to be used in a
      207 (Multi-Status) response:

         403 (Forbidden) - The client, for reasons the server chooses
         not to specify, cannot alter one of the properties.

         409 (Conflict) - The client has provided a value whose
         semantics are not appropriate for the property.  This includes
         trying to set read-only properties.

         424 (Failed Dependency) - The DAV:set instruction on the
         specified resource would have succeeded if it were not for the
         failure of another DAV:set instruction specified in the request
         body.

         423 (Locked) - The specified resource is locked and the client
         either is not a lock owner or the lock type requires a lock
         token to be submitted and the client did not submit it.

         507 (Insufficient Storage) - The server did not have sufficient
         space to record the property.

      403 (Forbidden) - This indicates at least one of two conditions:
      1) the server does not allow the creation of address book
      collections at the given location in its namespace, or 2) the
      parent collection of the Request-URI exists but cannot accept
      members.

      405 (Method Not Allowed) - MKADBK can only be executed on a null
      resource.

      409 (Conflict) - A collection cannot be made at the Request-URI
      until one or more intermediate collections have been created.

      415 (Unsupported Media Type) - The server does not support the
      request type of the body.



Daboo                    Expires April 25, 2007                [Page 17]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


      507 (Insufficient Storage) - The resource does not have sufficient
      space to record the state of the resource after the execution of
      this method.

6.3.1.2.  Example - Successful MKADBK request

   This example creates an address book collection called /home/lisa/
   addressbook/ on the server adbk.example.com with specific values for
   the properties DAV:displayname and CARDDAV:adbk-description.

   >> Request <<


   MKADBK /home/lisa/addressbook/ HTTP/1.1
   Host: adbk.example.com
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxx

   <?xml version="1.0" encoding="utf-8" ?>
   <C:mkadbk xmlns:D="DAV:"
                 xmlns:C="urn:ietf:params:xml:ns:carddav">
     <D:set>
       <D:prop>
         <D:displayname>Lisa's Address Book</D:displayname>
         <C:adbk-description xml:lang="en"
   >My primary address book.</C:adbk-description>
       </D:prop>
     </D:set>
   </C:mkadbk>


   >> Response <<


   HTTP/1.1 201 Created Date: Fri, 22 Oct 2004 12:17:08 GMT
   Content-Length: 0
   Cache-Control: no-cache


6.3.2.  Creating vCard Object Resources

   Clients populate address book collections with vCard object
   resources.  The URL for each vCard object resource is entirely
   arbitrary, and does not need to bear a specific relationship (but
   might) to the vCard object resource's vCard properties or other
   metadata.  New vCard object resources MUST be created with a PUT
   request targeted at an unmapped URI.  A PUT request targeted at a
   mapped URI updates an existing vCard object resource.



Daboo                    Expires April 25, 2007                [Page 18]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   When servers create new resources, it's not hard for the server to
   choose a unique URL.  It's slightly tougher for clients, because a
   client might not want to examine all resources in the collection, and
   might not want to lock the entire collection to ensure that a new one
   isn't created with a name collision.  However, there is an HTTP
   feature to mitigate this.  If the client intends to create a new
   vCard resource the client SHOULD use the HTTP header "If-None-Match:
   *" on the PUT request.  The Request-URI on the PUT request MUST
   include the target collection, where the resource is to be created,
   plus the name of the resource in the last path segment.  The "If-
   None-Match" header ensures that the client will not inadvertently
   overwrite an existing resource even, if the last path segment turned
   out to already be used.

   >> Request <<

   PUT /lisa/addressbook/newvcard.vcf HTTP/1.1
   If-None-Match: *
   Host: adbk.example.com
   Content-Type: text/vcard
   Content-Length: xxx

   BEGIN:VCARD
   VERSION:3.0
   FN:Cyrus Daboo
   N:Daboo;Cyrus
   ADR;TYPE=POSTAL:;2822 Email HQ;Suite 2821;RFCVille;PA;15213;USA
   EMAIL;TYPE=INTERNET,PREF:cyrus@daboo.name
   NICKNAME:me
   NOTE:Example VCard.
   ORG:Self Employed
   TEL;TYPE=WORK,VOICE:412 605 0499
   TEL;TYPE=FAX:412 605 0705
   URL:http://www.daboo.name
   END:VCARD

   >> Response <<

   HTTP/1.1 201 Created
   Date: Thu, 02 Sep 2004 16:53:32 GMT
   Content-Length: 0
   ETag: "123456789-000-111"

   The request to change an existing vCard is the same, but with a
   specific ETag in the "If-Match" header, rather than the "If-None-
   Match" header.

   File names for vCards are commonly suffixed by ".vcf", and clients



Daboo                    Expires April 25, 2007                [Page 19]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   may choose to use the same convention for URLs.

6.3.2.1.  Additional Preconditions for PUT, COPY and MOVE

   This specification creates additional Preconditions for PUT, COPY and
   MOVE methods.  These preconditions apply:

      When a PUT operation of a vCard object resource into an address
      book collection occurs.

      When a COPY or MOVE operation of a vCard object resource into an
      address book collection occurs.

   The new preconditions are:

      (CARDDAV:supported-adbk-data): The resource submitted in the PUT
      request, or targeted by a COPY or MOVE request MUST be a supported
      media type (i.e., vCard) for vCard object resources;

      (CARDDAV:valid-adbk-data): The resource submitted in the PUT
      request, or targeted by a COPY or MOVE request MUST be valid data
      for the media type being specified (i.e., MUST contain valid vCard
      data);

      (CARDDAV:no-uid-conflict): The resource submitted in the PUT
      request, or targeted by a COPY or MOVE request MUST NOT specify a
      vCard UID property value already in use in the targeted address
      book collection or overwrite an existing vCard object resource
      with one that has a different UID property value.  Servers SHOULD
      report the URL of the resource that is already making use of the
      same UID property value in the DAV:href element;

          <!ELEMENT no-uid-conflict (DAV:href)>

      (CARDDAV:adbk-collection-location-ok): In a COPY or MOVE request,
      when the Request-URI is an address book collection, the
      Destination-URI MUST identify a location where an address book
      collection can be created;

      (CARDDAV:max-resource-size): The resource submitted in the PUT
      request, or targeted by a COPY or MOVE request MUST have an octet
      size less than or equal to the value of the CARDDAV:max-resource-
      size property value ( Section 6.2.3 ) on the address book
      collection where the resource will be stored;







Daboo                    Expires April 25, 2007                [Page 20]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


7.  Address Book Access Control

   CardDAV servers MUST support and adhere to the requirements of WebDAV
   ACL [RFC3744].  WebDAV ACL provides a framework for an extensible set
   of privileges that can be applied to WebDAV collections and ordinary
   resources.

7.1.  Additional Principal Property

   This section defines an additional property for WebDAV principal
   resources as defined in [RFC3744].

7.1.1.  CARDDAV:adbk-home-set Property

   Name:  adbk-home-set

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Identifies the URL of any WebDAV collections that contain
      address book collections owned by the associated principal
      resource.

   Conformance:  This property SHOULD be defined on a principal
      resource.  If defined, it MAY be protected and SHOULD NOT be
      returned by a PROPFIND DAV:allprop request (as defined in Section
      12.14.1 of [RFC2518]).

   Description:  The CARDDAV:adbk-home-set property is meant to allow
      users to easily find the address book collections owned by the
      principal.  Typically, users will group all the address book
      collections that they own under a common collection.  This
      property specifies the URL of collections that either are address
      book collections or ordinary collections that have child or
      descendant address book collections owned by the principal.

   Definition:

      <!ELEMENT adbk-home-set (DAV:href*)>

   Example:

      <C:adbk-home-set xmlns:D="DAV:"
                       xmlns:C="urn:ietf:params:xml:ns:carddav">
        <D:href>http://adbk.example.com/bernard/addressbooks/</D:href>
      </C:addk-home-set>






Daboo                    Expires April 25, 2007                [Page 21]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


8.  Address Book Reports

   This section defines the reports that CardDAV servers MUST support on
   address book collections and vCard object resources.

   CardDAV servers MUST advertise support for these REPORTs on all
   address book collections and vCard object resources with the DAV:
   supported-report-set property defined in Section 3.1.5 of [RFC3253].
   CardDAV servers MAY also advertise support for these REPORTs on
   ordinary collections.

   Some of these REPORTs allow vCard data (from possibly multiple
   resources) to be returned.

8.1.  REPORT Method

   The REPORT method (defined in Section 3.6 of [RFC3253]) provides an
   extensible mechanism for obtaining information about a resource.
   Unlike the PROPFIND method, which returns the value of one or more
   named properties, the REPORT method can involve more complex
   processing.  REPORT is valuable in cases where the server has access
   to all of the information needed to perform the complex request (such
   as a query), and where it would require multiple requests for the
   client to retrieve the information needed to perform the same
   request.

   A server that supports adbk-access MUST support the DAV:expand-
   property report (defined in Section 3.8 of [RFC3253]).

8.2.  Ordinary collections

   Servers MAY support the REPORTs defined in this document on ordinary
   collections (collections that are not address book collections) in
   addition to address book collections or vCard object resources.  In
   computing responses to the REPORTs on ordinary collections, servers
   MUST only consider vCard object resources contained in address book
   collections that are targeted by the REPORT based on the value of the
   Depth request header.

8.3.  Searching Text: Collations

   Some of the reports defined in this section do text matches of
   character strings provided by the client and compared to stored vCard
   data.  Since vCard data is by default encoded in the UTF-8 charset
   and may include characters outside of the US-ASCII charset range in
   some property and parameter values, there is a need to ensure that
   text matching follows well-defined rules.




Daboo                    Expires April 25, 2007                [Page 22]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   To deal with this, this specification makes use of the IANA Collation
   Registry defined in [I-D.newman-i18n-comparator] to specify
   collations that may be used to carry out the text comparison
   operations with a well-defined rule.

   The comparisons used in CardDAV are all "substring" matches as per
   [I-D.newman-i18n-comparator] Section 4.2.  Collations supported by
   the server MUST support "substring" match operations.

   CardDAV servers are REQUIRED to support the "i;ascii-casemap" and
   "i;octet" collations as described in [I-D.newman-i18n-comparator],
   and MAY support other collations.

   Servers MUST advertise the set of collations that they support via
   the CARDDAV:supported-collation-set property defined on any resource
   that supports reports that use collations.

   Clients MUST only use collations from the list advertised by the
   server.

   In the absence of a collation explicitly specified by the client, or
   if the client specifies the "default" collation identifier (as
   defined in [I-D.newman-i18n-comparator] Section 3.1), the server MUST
   default to using "i;ascii-casemap" as the collation.

   Wildcards (as defined in [I-D.newman-i18n-comparator] Section 3.2)
   MUST NOT be used in the collation identifier.

   If the client chooses a collation not supported by the server, the
   server MUST respond with a CARDDAV:supported-collation precondition
   error response.

8.3.1.  CARDDAV:supported-collation-set Property

   Name:  supported-collation-set

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Identifies the set of collations supported by the server
      for text matching operations.

   Conformance:  This property MUST be defined on any resource that
      supports a REPORT that does text matching.  If defined, it MUST be
      protected and SHOULD NOT be returned by a PROPFIND DAV:allprop
      request (as defined in Section 12.14.1 of [RFC2518]).






Daboo                    Expires April 25, 2007                [Page 23]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   Description:  The CARDDAV:supported-collation-set property contains
      zero or more CARDDAV:supported-collation elements which specify
      the collection identifiers of the collations supported by the
      server.

   Definition:

         <!ELEMENT supported-collation-set (supported-collation*)>
           <!ELEMENT supported-collation (#PCDATA)>

   Example:

      <C:supported-collation-set
        xmlns:C="urn:ietf:params:xml:ns:carddav">
        <C:supported-collation>i;ascii-casemap</C:supported-collation>
        <C:supported-collation>i;octet</C:supported-collation>
      </C:supported-collation-set>

8.4.  Partial Retrieval

   Some address book REPORTs defined in this document allow partial
   retrieval of vCard object resources.  A CardDAV client can specify
   what information to return in the body of an address book REPORT
   request.

   A CardDAV client can request particular WebDAV property values, all
   WebDAV property values, or a list of the names of the resource's
   WebDAV properties.  A CardDAV client can also request vCard data to
   be returned and whether all vCard properties should be returned or
   only particular ones.  See CARDDAV:abbk-data in Section 10.6.

8.5.  Non-standard properties and parameters

   Servers MUST support the use of non-standard property or parameter
   names in the CARDDAV:adbk-data XML element in address book REPORT
   requests to allow clients to request that non-standard properties and
   parameters be returned in the vCard data provided in the response.

   Servers MAY support the use of non-standard property or parameter
   names in the CARDDAV:prop-filter and CARDDAV:param-filter XML
   elements specified in the CARDDAV:filter XML element of address book
   REPORT requests.

   Servers MUST fail with the CARDDAV:supported-filter precondition if
   an address book REPORT request uses a CARDDAV:prop-filter or CARDDAV:
   param-filter XML element that makes reference to a non-standard
   property or parameter name which the server does not support queries
   on.



Daboo                    Expires April 25, 2007                [Page 24]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


8.6.  CARDDAV:adbk-query Report

   The CARDDAV:adbk-query REPORT performs a search for all vCard object
   resources that match a specified filter.  The response of this REPORT
   will contain all the WebDAV properties and vCard object resource data
   specified in the request.  In the case of the CARDDAV:adbk-data XML
   element, one can explicitly specify the vCard properties that should
   be returned in the vCard 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 CARDAV:adbk-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 property results.  For instance, a request to
   retrieve the value of a property which does not exist is an error and
   MUST be noted with a response XML element which contains a 404 (Not
   Found) status value.

   Support for the CARDDAV:adbk-query REPORT is REQUIRED.

   Marshalling:

      The request body MUST be a CARDDAV:adbk-query XML element as
      defined in Section 10.5.

      The request MAY include a Depth header.  If no Depth header is
      included, Depth:0 is assumed.

      The response body for a successful request MUST be a DAV:
      multistatus XML element (i.e., the response uses the same format
      as the response for PROPFIND).  In the case where there are no
      response elements, the returned DAV:multistatus XML element is
      empty.

      The response body for a successful CARDDAV:adbk-query REPORT
      request MUST contain a DAV:response element for each vCard object
      that matched the search filter. vCard data is being returned in
      the CARDDAV:adbk-data XML element inside the DAV:propstat XML
      element.

   Preconditions:

      (CARDDAV:supported-adbk-data): The attributes "content-type" and
      "version" of the CARDDAV:adbk-data XML element (see Section 10.6)
      specify a media type supported by the server for vCard object



Daboo                    Expires April 25, 2007                [Page 25]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


      resources.

      (CARDDAV:supported-filter): The CARDDAV:prop-filter (see
      Section 10.7.1) and CARDDAV:param-filter (see Section 10.7.2) XML
      elements used in the CARDDAV:filter XML element (see Section 10.7)
      in the REPORT request only make reference to properties and
      parameters for which queries are supported by the server. i.e., if
      the CARDDAV:filter element attempts to reference an unsupported
      property or parameter, this precondition is violated.  Servers
      SHOULD report the CARDDAV:prop-filter or CARDDAV:param-filter for
      which it does not provide support.

          <!ELEMENT supported-filter (prop-filter*,
                                      param-filter*)>

      (CARDDAV:supported-collation): Any XML attribute specifying a
      collation MUST specify a collation supported by the server as
      described in Section 8.3.

   Postconditions:

      (DAV:number-of-matches-within-limits): The number of matching
      vCard object resources must fall within server-specific,
      predefined limits.  For example, this condition might be triggered
      if a search specification would cause the return of an extremely
      large number of responses.

8.6.1.  Example: Partial retrieval of vCards matching a
        NICKNAME

   In this example, the client requests the server to search for vCard
   object resources that contain a NICKNAME property whose value equals
   some specific text, and to return specific vCard properties for those
   vCards found.  In addition the DAV:getetag property is also requested
   and returned as part of the response.
















Daboo                    Expires April 25, 2007                [Page 26]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   >> Request <<


   REPORT /home/bernard/addressbook/ HTTP/1.1
   Host: adbk.example.com
   Depth: 1
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxxx

   <?xml version="1.0" encoding="utf-8" ?>
   <C:adbk-query xmlns:D="DAV:"
                     xmlns:C="urn:ietf:params:xml:ns:carddav">
     <D:prop>
       <D:getetag/>
       <C:adbk-data>
         <C:prop name="VERSION"/>
         <C:prop name="UID"/>
         <C:prop name="NICKNAME"/>
         <C:prop name="EMAIL"/>
         <C:prop name="FN"/>
       </C:adbk-data>
     </D:prop>
     <C:filter>
       <C:prop-filter name="NICKNAME">
         <C:text-match collation="i;octet"
                       match-type="equality"
         >me</C:text-match>
       </C:prop-filter>
     </C:filter>
   </C:adbk-query>





















Daboo                    Expires April 25, 2007                [Page 27]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   >> Response <<


   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxxx

   <?xml version="1.0" encoding="utf-8" ?>
   <D:multistatus xmlns:D="DAV:"
                  xmlns:C="urn:ietf:params:xml:ns:carddav">
     <D:response>
       <D:href
   >http://adbk.example.com/home/bernard/addressbook/v102.vcf</D:href>
       <D:propstat>
         <D:prop>
           <D:getetag>"23ba4d-ff11fb"</D:getetag>
           <C:adbk-data>BEGIN:VCARD
   VERSION:3.0
   NICKNAME:me
   UID:34222-232@example.com
   FN:Cyrus Daboo
   EMAIL:daboo@example.com
   END:VCARD
   </C:adbk-data>
         </D:prop>
         <D:status>HTTP/1.1 200 OK</D:status>
       </D:propstat>
     </D:response>
   </D:multistatus>


8.6.2.  Example: Partial retrieval of vCards matching a             full
        name

   In this example, the client requests the server to search for vCard
   object resources that contain a FN property whose value contains some
   specific text, and to return specific vCard properties for those
   vCards found.  In addition the DAV:getetag property is also requested
   and returned as part of the response.












Daboo                    Expires April 25, 2007                [Page 28]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   >> Request <<


   REPORT /home/bernard/addressbook/ HTTP/1.1
   Host: adbk.example.com
   Depth: 1
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxxx

   <?xml version="1.0" encoding="utf-8" ?>
   <C:adbk-query xmlns:D="DAV:"
                     xmlns:C="urn:ietf:params:xml:ns:carddav">
     <D:prop>
       <D:getetag/>
       <C:adbk-data>
         <C:prop name="VERSION"/>
         <C:prop name="UID"/>
         <C:prop name="NICKNAME"/>
         <C:prop name="EMAIL"/>
         <C:prop name="FN"/>
       </C:adbk-data>
     </D:prop>
     <C:filter>
       <C:prop-filter name="FN">
         <C:text-match collation="i;ascii-casemap"
                       match-type="substring"
         >Daboo</C:text-match>
       </C:prop-filter>
     </C:filter>
   </C:adbk-query>





















Daboo                    Expires April 25, 2007                [Page 29]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   >> Response <<


   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxxx

   <?xml version="1.0" encoding="utf-8" ?>
   <D:multistatus xmlns:D="DAV:"
                  xmlns:C="urn:ietf:params:xml:ns:carddav">
     <D:response>
       <D:href
   >http://adbk.example.com/home/bernard/addressbook/v102.vcf</D:href>
       <D:propstat>
         <D:prop>
           <D:getetag>"23ba4d-ff11fb"</D:getetag>
           <C:adbk-data>BEGIN:VCARD
   VERSION:3.0
   NICKNAME:me
   UID:34222-232@example.com
   FN:Cyrus Daboo
   EMAIL:daboo@example.com
   END:VCARD
   </C:adbk-data>
         </D:prop>
         <D:status>HTTP/1.1 200 OK</D:status>
       </D:propstat>
     </D:response>
     <D:response>
       <D:href
   >http://adbk.example.com/home/bernard/addressbook/v104.vcf</D:href>
       <D:propstat>
         <D:prop>
           <D:getetag>"23ba4d-ff11fc"</D:getetag>
           <C:adbk-data>BEGIN:VCARD
   VERSION:3.0
   NICKNAME:oliver
   UID:34222-23222@example.com
   FN:Oliver Daboo
   EMAIL:oliver@example.com
   END:VCARD
   </C:adbk-data>
         </D:prop>
         <D:status>HTTP/1.1 200 OK</D:status>
       </D:propstat>
     </D:response>
   </D:multistatus>




Daboo                    Expires April 25, 2007                [Page 30]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


8.7.  CARDDAV:adbk-multiget Report

   The CARDDAV:adbk-multiget REPORT is used to retrieve specific vCard
   object resources from within a collection, if the Request-URI is a
   collection, or to retrieve a specific vCard object resource, if the
   Request-URI is a vCard object resource.  This report is similar to
   the CARDDAV:adbk-query REPORT (see Section 8.6), except that it takes
   a list of DAV:href elements instead of a CARDDAV:filter element to
   determine which vCard object resources to return.

   Support for the adbk-multiget REPORT is REQUIRED.

   Marshalling:

      The request body MUST be a CARDDAV:adbk-multiget XML element (see
      Section 10.8, which MUST contain at least one DAV:href XML
      element, and one optional CARDDAV:adbk-data element as defined in
      Section 10.6.  If the Request-URI is a collection resource, then
      the DAV:href elements MUST refer to resources within that
      collection, and they MAY refer to resources at any depth within
      the collection.  As a result the "Depth" header MUST be ignored by
      the server and SHOULD NOT be sent by the client.  If the Request-
      URI refers to a non-collection resource, then there MUST be a
      single DAV:href element that is equivalent to the Request-URI.

      The response body for a successful request MUST be a DAV:
      multistatus XML element.

      The response body for a successful CARDDAV:adbk-multiget REPORT
      request MUST contain a DAV:response element for each vCard object
      resource referenced by the provided set of DAV:href elements.
      vCard data is being returned in the CARDDAV:adbk-data element
      inside the DAV:prop element.

      In the case of an error accessing any of the provided DAV:href
      resources, the server MUST return the appropriate error status
      code in the DAV:status element of the corresponding DAV:response
      element.

   Preconditions:

      (CARDAV:supported-adbk-data): The attributes "content-type" and
      "version" of the CARDDAV:adbk-data XML elements (see Section 10.6
      ) specify a media type supported by the server for vCard object
      resources.

   Postconditions:




Daboo                    Expires April 25, 2007                [Page 31]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


      None.

8.7.1.  Example: CARDDAV:adbk-multiget Report

   In this example, the client requests the server to return specific
   properties of the vCards components referenced by specific URIs.  In
   addition the DAV:getetag property is also requested and returned as
   part of the response.  Note that in this example, the resource at
   http://adbk.example.com/home/bernard/addressbook/vcf1.vcf does not
   exist, resulting in an error status response.

   >> Request <<


   REPORT /home/bernard/addressbook/ HTTP/1.1
   Host: adbk.example.com
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxxx

   <?xml version="1.0" encoding="utf-8" ?>
   <C:adbk-multiget xmlns:D="DAV:"
                        xmlns:C="urn:ietf:params:xml:ns:carddav">
     <D:prop>
       <D:getetag/>
       <C:adbk-data>
         <C:prop name="VERSION"/>
         <C:prop name="UID"/>
         <C:prop name="NICKNAME"/>
         <C:prop name="EMAIL"/>
         <C:prop name="FN"/>
       </C:adbk-data>
     </D:prop>
     <D:href
   >http://adbk.example.com/home/bernard/addressbook/vcf102.vcf</D:href>
     <D:href
   >http://adbk.example.com/home/bernard/addressbook/vcf1.vcf</D:href>
   </C:adbk-multiget>














Daboo                    Expires April 25, 2007                [Page 32]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   >> Response <<


   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxxx

   <?xml version="1.0" encoding="utf-8" ?>
   <D:multistatus xmlns:D="DAV:"
                  xmlns:C="urn:ietf:params:xml:ns:carddav">
     <D:response>
       <D:href
   >http://adbk.example.com/home/bernard/addressbook/vcf102.vcf</D:href>
       <D:propstat>
         <D:prop>
           <D:getetag>"23ba4d-ff11fb"</D:getetag>
           <C:adbk-data>BEGIN:VCARD
   VERSION:3.0
   NICKNAME:me
   UID:34222-232@example.com
   FN:Cyrus Daboo
   EMAIL:daboo@example.com
   END:VCARD
   </C:adbk-data>
         </D:prop>
         <D:status>HTTP/1.1 200 OK</D:status>
       </D:propstat>
     </D:response>
     <D:response>
       <D:href
   >http://adbk.example.com/home/bernard/addressbook/vcf1.vcf</D:href>
       <D:status>HTTP/1.1 404 Resource not found</D:status>
     </D:response>
   </D:multistatus>


8.8.  CARDDAV:adbk-sync Report

   Support for this report is OPTIONAL but RECOMMENDED.

   The CARDDAV:adbk-sync REPORT is used to provide an overview of what
   has changed on the server since a previous execution of this report.
   The primary purpose of this is to aid the client in synchronizing its
   local cache of data with the server, in an efficient manner with as
   few round trips as possible.

   Support for the adbk-sync REPORT is OPTIONAL.  If this report is
   implemented by the CardDAV server, then the server MUST include



Daboo                    Expires April 25, 2007                [Page 33]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   "adbk-sync" in any DAV: response header to an OPTIONS request as per
   Section 6.1 .  If the report is not available, clients MUST NOT
   attempt to execute one.

   To implement the behaviour for this report a server needs to keep
   track of changes to vCard data in an address book collection.  This
   includes noting the addition of new vCards, noting changes to vCards
   and noting removal of vCards (where "removal" could be the result of
   a DELETE or MOVE operation).  The server will track each change and
   provide a synchronization "token" to the client that describes the
   state of the server at a specific point in time.  This "token" is
   returned as part of the response to the "adbk-sync" report.  Clients
   include the last token they got from the server in the next "adbk-
   sync" report that they execute and the server provides the changes
   from the previous state represented by the token to the current
   state, represented by the new token returned.

   The synchronization token itself is an "opaque" string - i.e., the
   actual string data has no specific meaning or syntax.  A simple
   implementation of such a token would be a numeric counter that counts
   each change as it occurs and relates that change to the specific
   object that changed.

   The "adbk-sync" reports allows the client to specify whether it
   should receive vCard data for those objects that are new or have
   changed, and it uses the "adbk-data" element (also used in the "adbk-
   query" and "adbk-multiget" reports) for that purpose.

   Marshalling:

      The request URI MUST be an address book collection.  The "Depth"
      header MUST be ignored by the server and SHOULD NOT be sent by the
      client.  The request body MUST be a CARDDAV:adbk-sync XML element
      (see Section 10.9 , which MUST contain one CARDDAV:sync-token XML
      element, and one optional CARDDAV:adbk-data element as defined in
      Section 10.6 .

      The response body for a successful request MUST be a DAV:
      multistatus XML element, which MUST contain one CADRDDAV:sync-
      token element in addition to any DAV:response elements.

      The response body for a successful CARDDAV:adbk-multiget REPORT
      request MUST contain a DAV:response element for each vCard object
      resource that was created, has changed or been deleted since the
      last syncrhonization operation as specified by the CARDDAV:sync-
      token provided in the request. vCard data is returned in the
      CARDDAV:adbk-data element inside the DAV:prop element.




Daboo                    Expires April 25, 2007                [Page 34]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


      The DAV:status element in each DAV:response element is used to
      indicate how the vCard resource may have changed:

         A status code of '201 Created' is used to indicate vCards that
         are new.

         A status code of '200 OK' is used to indicate vCards that have
         changed.

         A status code of '404 Not Found' is used to indicate vCards
         that have been removed.

      If the synchronization token element is not empty and not
      recognized by the server, then the server MUST respond with 400
      Bad Request response.

   Preconditions:

      None.

   Postconditions:

      None.

8.8.1.  Example: Initial CARDDAV:adbk-sync Report

   In this example, the client is making its first synchronization
   request to the server, so the CARDDAV:sync-token element in the
   request is empty.  The server responds with the items currently in
   the targetted address book collection (indicating that they are 'new'
   via the '201 Created' status code).  The current synchronzation token
   is also returned.

   >> Request <<


   REPORT /home/bernard/addressbook/ HTTP/1.1
   Host: adbk.example.com
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxxx

   <?xml version="1.0" encoding="utf-8" ?>
   <C:adbk-sync xmlns:D="DAV:"
                        xmlns:C="urn:ietf:params:xml:ns:carddav">
     <C:sync-token/>
   </C:adbk-sync>





Daboo                    Expires April 25, 2007                [Page 35]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   >> Response <<


   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxxx

   <?xml version="1.0" encoding="utf-8" ?>
   <D:multistatus xmlns:D="DAV:"
                  xmlns:C="urn:ietf:params:xml:ns:carddav">
     <D:response>
       <D:href
   >http://adbk.example.com/home/bernard/addressbook/vcf100.vcf</D:href>
       <D:status>HTTP/1.1 201 Created</D:status>
     </D:response>
     <D:response>
       <D:href
   >http://adbk.example.com/home/bernard/addressbook/vcf105.vcf</D:href>
       <D:status>HTTP/1.1 201 Created</D:status>
     </D:response>
     <D:response>
       <D:href
   >http://adbk.example.com/home/bernard/addressbook/vcf106.vcf</D:href>
       <D:status>HTTP/1.1 201 Created</D:status>
     </D:response>
     <C:sync-token>1234</C:sync-token>
   </D:multistatus>


8.8.2.  Example: CARDDAV:adbk-sync Report with token

   In this example, the client is making a synchronization request to
   the server and is using the CARDDAV:sync-token element returned from
   the last report it ran on this address book collection.  The server
   responds listing the items that have been added, changed or removed.
   The (new) current synchronzation token is also returned.















Daboo                    Expires April 25, 2007                [Page 36]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   >> Request <<


   REPORT /home/bernard/addressbook/ HTTP/1.1
   Host: adbk.example.com
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxxx

   <?xml version="1.0" encoding="utf-8" ?>
   <C:adbk-sync xmlns:D="DAV:"
                        xmlns:C="urn:ietf:params:xml:ns:carddav">
     <C:sync-token>1234</C:sync-token>
   </C:adbk-sync>


   >> Response <<


   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxxx

   <?xml version="1.0" encoding="utf-8" ?>
   <D:multistatus xmlns:D="DAV:"
                  xmlns:C="urn:ietf:params:xml:ns:carddav">
     <D:response>
       <D:href
   >http://adbk.example.com/home/bernard/addressbook/vcf107.vcf</D:href>
       <D:status>HTTP/1.1 201 Created</D:status>
     </D:response>
     <D:response>
       <D:href
   >http://adbk.example.com/home/bernard/addressbook/vcf100.vcf</D:href>
       <D:status>HTTP/1.1 200 OK</D:status>
     </D:response>
     <D:response>
       <D:href
   >http://adbk.example.com/home/bernard/addressbook/vcf105.vcf</D:href>
       <D:status>HTTP/1.1 404 Not Found</D:status>
     </D:response>
     <C:sync-token>1238</C:sync-token>
   </D:multistatus>









Daboo                    Expires April 25, 2007                [Page 37]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


9.  Guidelines

9.1.  Restrict the Properties Returned

   Clients may not need all the properties in a vCard object when
   presenting information to the user, or looking up specific items for
   their email address, for example.  Since some property data can be
   large (e.g., PHOTO or SOUND with inline content) clients can choose
   to ignore those by only requesting the specific items it knows it
   will use, through use of the CARDDAV:adbk-data XML element in the
   relevant reports.

   However, if a client needs to make a change to a vCard, it can only
   change the entire vCard data via a PUT request.  There is no way to
   incrementally make a change to a set of properties within a vCard
   object resource.  As a result the client will have to cache the
   entire set of properties on a resource that is being changed.

9.2.  Use of Locking

   WebDAV locks can be used to prevent two clients modifying the same
   resource from either overwriting each others' changes (though that
   problem can also be solved by using ETags) and also to prevent the
   user from making changes that will conflict with another set of
   changes.  In a multi-user address book system, the address book
   client could lock a vCard while the user is editing the vCard data,
   and unlock the vCard when the user finishes or cancels.  Locks can
   also be used to prevent changes while data is being reorganized.  For
   example, an address book client might lock two address book
   collections prior to moving a bunch of vCard object resources from
   one to another.

   Clients may request a lock timeout period that is appropriate to the
   use case.  When the user explicitly decides to reserve a resource and
   prevent other changes, a long timeout might be appropriate, but in
   cases when the client automatically decides to lock the resource the
   timeout should be short (and the client can always refresh the lock
   should it need to).  A short lock timeout means that if the client is
   unable to remove the lock, the other address book users aren't
   prevented from making changes.

9.3.  Finding address books

   Much of the time an address book client (or agent) will discover a
   new address book's location by being provided directly with the URL.
   E.g. a user will type his or her own address book location into
   client configuration information, or cut and paste a URL from email
   into the address book application.  The client need only confirm that



Daboo                    Expires April 25, 2007                [Page 38]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   the URL points to a resource which is an address book.  The client
   may also be able to browse WebDAV collections to find address book
   collections.

   The choice of HTTP URLs means that vCard object resources are
   backward compatible with existing software, but does have the
   disadvantage that existing software does not usually know to look at
   the OPTIONS response to that URL to determine what can be done with
   it.  This is somewhat of a barrier for WebDAV usage as well as with
   CardDAV usage.  This specification does not offer a way through this
   other than making the information available in the OPTIONS response
   should this be requested.

   For address book sharing use cases, one might wish to find the
   address book belonging to another user.  If the other user has an
   address book in the same repository, that address book can be found
   by using the principal namespace required by WebDAV ACL support.

   Because CardDAV requires servers to support WebDAV ACL [RFC3744]
   including principal namespaces, and with the addition of the CARDDAV:
   adbk-home-set property, there are a couple options for CardDAV
   clients to find one's own address book or another user's address
   book.

   In this case, a DAV:principal-match REPORT is used to find a named
   property (the CARDDAV:adbk-home-set) on the Principal-URL of the
   current user.  Using this, a WebDAV client can learn "who am I" and
   "where are my address books".  The REPORT request body looks like
   this:

   <?xml version="1.0" encoding="utf-8" ?>
   <D:principal-match xmlns:D="DAV:">
     <D:self/>
     <D:prop>
       <C:adbk-home-set
          xmlns:C="urn:ietf:params:xml:ns:carddav"/>
     </D:prop>
   </D:principal-match>

   To find other users' address books, the DAV:principal-property-search
   REPORT can be used to filter on some properties and return others.
   To search for an address book owned by a user named "Laurie", the
   REPORT request body would look like this:








Daboo                    Expires April 25, 2007                [Page 39]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   <?xml version="1.0" encoding="utf-8" ?>
   <D:principal-property-search xmlns:D="DAV:">
     <D:property-search>
       <D:prop>
         <D:displayname/>
       </D:prop>
       <D:match>Laurie</D:match>
     </D:property-search>
     <D:prop>
       <C:adbk-home-set
          xmlns:C="urn:ietf:params:xml:ns:carddav"/>
       <D:displayname/>
     </D:prop>
   </D:principal-property-search>

   The server performs a case-sensitive or caseless search for a
   matching string subset of "Laurie" within the DAV:displayname
   property.  Thus, the server might return "Laurie Dusseault", "Laurier
   Desruisseaux" or "Wilfrid Laurier" all as matching DAV:displayname
   values, and the address books for each of these.


10.  XML Element Definitions

10.1.  CARDDAV:adbk XML Element

   Name:  adbk

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Specifies the resource type of an address book collection.

   Description:  See Section 5.2.

   Definition:

   <!ELEMENT adbk EMPTY>

10.2.  CARDDAV:mkadbk XML Element

   Name:  mkadbk

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Specifies a request that includes the WebDAV property
      values to be set for an address book collection resource when it
      is created.




Daboo                    Expires April 25, 2007                [Page 40]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   Description:  See Section 6.3.1 .

   Definition:

   <!ELEMENT mkadbk (DAV:set)>

10.3.  CARDDAV:mkadbk-response XML Element

   Name:  mkadbk-response

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Specifies a response body for a successful MKADBK request.

   Description:  See Section 6.3.1 .

   Definition:

   <!ELEMENT mkadbk-response ANY>

10.4.  CARDDAV:supported-collation XML Element

   Name:  supported-collation

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Identifies a single collation via its collation identifier
      as defined by [I-D.newman-i18n-comparator].

   Description:  The CARDDAV:supported-collation contains the text of a
      collation identifier as described in Section 8.3.1.

   Definition:

   <!ELEMENT supported-collation (#PCDATA)>
   PCDATA value: collation identifier

10.5.  CARDDAV:adbk-query XML Element

   Name:  adbk-query

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Defines a report for querying address book data







Daboo                    Expires April 25, 2007                [Page 41]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   Description:  See Section 8.6.

   Definition:

   <!ELEMENT adbk-query ((DAV:allprop | DAV:propname | DAV:prop)?,
                            filter)>

10.6.  CARDDAV:adbk-data XML Element

   Name:  adbk-data

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Used to (1) specify a supported media type for vCard object
      resources when nested in the CARDDAV:supported-adbk-data property;
      (2) specify which parts of a vCard object resource should be
      returned by a given address book REPORT; and (3) specify the
      content of a vCard object resource in a response to an address
      book REPORT.

   Description:  When nested in the CARDDAV:supported-adbk-data
      property, the CARDDAV:adbk-data XML element specifies a media type
      supported by the CardDAV server for vCard object resources.

      When used in an address book REPORT request, the CARDDAV:adbk-data
      XML element specifies which parts of vCard object resources need
      to be returned in the response.  If the CARDDAV:adbk-data XML
      element doesn't contain any CARDDAV:prop elements, vCard object
      resources will be returned in their entirety.

      Finally, when used in an address book REPORT response, the
      CARDDAV:adbk-data XML element specifies the content of a vCard
      object resource.  Given that XML parsers normalize the two-
      character sequence CRLF (US-ASCII decimal 13 and US-ASCII decimal
      10) to a single LF character (US-ASCII decimal 10), the CR
      character (US-ASCII decimal 13) MAY be omitted in vCard object
      resources specified in the CARDDAV:adbk-data XML element.
      Furthermore, vCard object resources specified in the CARDDAV:adbk-
      data XML element MAY be invalid per their media type specification
      if the CARDAV:adbk-data XML element part of the address book
      REPORT request did not specify required properties (e.g., UID,
      etc.) or specified a CARDDAV:prop XML element with the "novalue"
      attribute set to "yes".

   Note:  The CARDDAV:adbk-data XML element is specified in requests and
      responses inside the DAV:prop XML element as if it were a WebDAV
      property.  However, the CARDDAV:adbk-data XML element is not a
      WebDAV property and as such it is not returned in PROPFIND



Daboo                    Expires April 25, 2007                [Page 42]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


      responses nor used in PROPPATCH requests.

   Note:  The vCard data embedded within the CARDDAV:adbk-data XML
      element MUST follow the standard XML character data encoding
      rules, including use of &lt;, &gt;, &amp; etc entity encoding or
      the use of a <![CDATA[ ... ]]> construct.  In the later case the
      vCard data cannot contain the character sequence "]]>" which is
      the end delimiter for the CDATA section.

   Definition:

   <!ELEMENT adbk-data ((allprop | prop*) | #PCDATA)?>
   PCDATA value: vCard object

   <!ATTLIST adbk-data content-type CDATA "text/vcard">
                       version CDATA "3.0">
   content-type value: a MIME media type
   version value: a version string

10.6.1.  CARDDAV:allprop XML Element

   Name:  allprop

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Specifies that all properties shall be returned.

   Description:  This element can be used when the client wants all
      properties of components returned by a report.

   Definition:

   <!ELEMENT allprop EMPTY>

   NOTE: The CARDDAV:allprop element defined here has the same name as
   the DAV:allprop element defined in WebDAV.  However, the CARDDAV:
   allprop element defined here uses the
   "urn:ietf:params:xml:ns:carddav" namespace, as opposed to the "DAV:"
   namespace used for the DAV:allprop element defined in WebDAV.

10.6.2.  CARDDAV:prop XML Element

   Name:  prop

   Namespace:  urn:ietf:params:xml:ns:carddav






Daboo                    Expires April 25, 2007                [Page 43]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   Purpose:  Defines which properties to return in the response.

   Description:  The "name" attribute specifies the name of the adbk
      property to return (e.g., "NICKNAME").  The "novalue" attribute
      can be used by clients to request that the actual value of the
      property not be returned (if the "novalue" attribute is set to
      "yes").  In that case the server will return just the vCard
      property name and any vCard parameters and a trailing ":" without
      the subsequent value data.

   Definition:

   <!ELEMENT prop EMPTY>

   <!ATTLIST prop name CDATA #REQUIRED
                  novalue (yes|no) "no">
   name value: a vCard property name
   novalue value: "yes" or "no"

   NOTE: The CARDDAV:prop element defined here has the same name as the
   DAV:prop element defined in WebDAV.  However, the CARDDAV:prop
   element defined here uses the "urn:ietf:params:xml:ns:carddav"
   namespace, as opposed to the "DAV:" namespace used for the DAV:prop
   element defined in WebDAV.

10.7.  CARDDAV:filter XML Element

   Name:  filter

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Determines which matching objects are returned.

   Description:  The "filter" element specifies the search filter used
      to match vCard objects that should be returned by a report.

   Definition:

   <!ELEMENT filter prop-filter>

10.7.1.  CARDDAV:prop-filter XML Element

   Name:  prop-filter

   Namespace:  urn:ietf:params:xml:ns:carddav






Daboo                    Expires April 25, 2007                [Page 44]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   Purpose:  Limits the search to specific properties.

   Description:  The CARDDAV:prop-filter XML element specifies a search
      criteria on a specific vCard property (e.g., NICKNAME).  A vCard
      object is said to match a CARDDAV:prop-filter if:

      *  A property of the type specified by the "name" attribute
         exists, and the CARDDAV:prop-filter is empty, or it matches the
         CARDDAV:text-match conditions if specified, and that any
         CARDDAV:param-filter child elements also match.

      or:

      *  A property of the type specified by the "name" attribute does
         not exist, and the CARDAV:is-not-defined element is specified.

   Definition:

   <!ELEMENT prop-filter (is-not-defined |
                          (text-match?, param-filter*))>

   <!ATTLIST prop-filter name CDATA #REQUIRED>
   name value: a vCard property name (e.g., "NICKNAME")

10.7.2.  CARDDAV:param-filter XML Element

   Name:  param-filter

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Limits the search to specific parameter values.

   Description:  The CARDDAV:param-filter XML element specifies a search
      criteria on a specific vCard property parameter (e.g., TYPE) in
      the scope of a given CARDDAV:prop-filter.  A vCard property is
      said to match a CARDDAV:param-filter if:

      *  A parameter of the type specified by the "name" attribute
         exists, and the CARDDAV:param-filter is empty, or it matches
         the CARDDAV:text-match conditions if specified.

      or:

      *  A parameter of the type specified by the "name" attribute does
         not exist, and the CARDDAV:is-not-defined element is specified.






Daboo                    Expires April 25, 2007                [Page 45]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   Definition:

   <!ELEMENT param-filter (is-not-defined | text-match)?>

   <!ATTLIST param-filter name CDATA #REQUIRED>
   name value: a property parameter name (e.g., "TYPE")

10.7.3.  CARDDAV:is-not-defined XML Element

   Name:  is-not-defined

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Specifies that a match should occur if the enclosing
      property or parameter does not exist.

   Description:  The CARDDAV:is-not-defined XML element specifies that a
      match occurs if the enclosing property or parameter value
      specified in an address book REPORT request does not exist in the
      vCard data being tested.

   Definition:

   <!ELEMENT is-not-defined EMPTY>

10.7.4.  CARDDAV:text-match XML Element

   Name:  text-match

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  Specifies a substring match on a property or parameter
      value.

   Description:  The CARDDAV:text-match XML element specifies text used
      for a substring match against the property or parameter value
      specified in an address book REPORT request.

      The "collation" attribute is used to select the collation that the
      server MUST use for character string matching.  In the absence of
      this attribute the server MUST use the "i;ascii-casemap"
      collation.

      The "negate-condition" attribute is used to indicate that this
      test returns a match if the text matches, when the attribute value
      is set to "no", or return a match if the text does not match, if
      the attribute value is set to "yes".  For example, this can be
      used to match components with a CATEGORIES property not set to



Daboo                    Expires April 25, 2007                [Page 46]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


      PERSON.

   Definition:

   <!ELEMENT text-match (#PCDATA)>
   PCDATA value: string

   <!ATTLIST text-match collation        CDATA "i;ascii-casemap"
                        negate-condition (yes | no) "no">

10.8.  CARDDAV:adbk-multiget XML Element

   Name:  adbk-multiget

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  CardDAV report used to retrieve specific vCard objects via
      their URIs.

   Description:  See Section 8.7.

   Definition:

   <!ELEMENT adbk-multiget (DAV:allprop | DAV:propname | DAV:prop)?
                            DAV:href+>

10.9.  CARDDAV:adbk-sync XML Element

   Name:  adbk-sync

   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  CardDAV report used to synchronize data between client and
      server.

   Description:  See Section 8.8.

   Definition:

   <!ELEMENT adbk-sync (sync-token)>

10.9.1.  CARDDAV:sync-token XML Element

   Name:  sync-token







Daboo                    Expires April 25, 2007                [Page 47]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   Namespace:  urn:ietf:params:xml:ns:carddav

   Purpose:  The synchronization token provided by the server and
      returned by the client.

   Description:  See Section 8.8.

   Definition:

   <!ELEMENT sync-token CDATA>


11.  Internationalization Considerations

   CardDAV allows internationalized strings to be stored and retrieved
   for the description of address book collections (see Section 6.2.1).

   The CARDDAV:adbk-query report ( Section 8.6 ) includes a text
   searching option controlled by the CARDDAV:text-match element and
   details of character handling are covered in the description of that
   element (see Section 10.7.4 ).


12.  Security Considerations

   HTTP protocol transactions are sent in the clear over the network
   unless protection from snooping is negotiated.  This can be
   accomplished by use of TLS as defined in [RFC2818].  In particular,
   if HTTP Basic authentication is available, the server MUST allow TLS
   to be used at the same time, and SHOULD prevent use of Basic
   authentication when TLS is not in use.

   With the ACL extension present, WebDAV allows control over who can
   access (read or write) any resource on the WebDAV server.  In
   addition, WebDAV ACL provides for an "inheritance" mechanism, whereby
   resources may inherit access privileges from other resources.  Often
   the "other" resource is a parent collection of the resource itself.
   Clients MUST take care to ensure users are aware of which address
   books may be "private" (i.e. only accessible to them) and which are
   "shared" (i.e. accessible to others).

   Since webservers are often the target of automated indexing
   applications that gather data from the server, analyse it and extract
   'interesting' parts, great care must be taken when allowing
   unauthenticated access to any address book or vCard object data.
   Clients MAY choose to warn users when they create vCard data in a
   public address book, copy or move vCard data into public address
   books, or change access privileges in such a way as to expose vCard



Daboo                    Expires April 25, 2007                [Page 48]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   data to unauthenticated users.

   This specification currently relies on standard HTTP authentication
   mechanisms for identifying users.  These comprise Basic and Digest
   authentication as well as SSL using client-side certificates.


13.  IANA Consideration

   In addition to the namespaces defined by RFC2518 [RFC2518] for XML
   elements, this document uses a URN to describe a new XML namespace
   conforming to a registry mechanism described in RFC3688 [RFC3688] .
   All other IANA considerations mentioned in RFC2518 [RFC2518] also
   apply to this document.

13.1.  Namespace Registration

   Registration request for the carddav namespace:

   URI: urn:ietf:params:xml:ns:carddav

   Registrant Contact: See the "Author's Address" section of this
   document.

   XML: None.  Namespace URIs do not represent an XML specification.


14.  References

14.1.  Normative References

   [I-D.newman-i18n-comparator]
              Newman, C., "Internet Application Protocol Collation
              Registry", draft-newman-i18n-comparator-13 (work in
              progress), August 2006.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC2246]  Dierks, T. and C. Allen, "The TLS Protocol Version 1.0",
              RFC 2246, January 1999.

   [RFC2426]  Dawson, F. and T. Howes, "vCard MIME Directory Profile",
              RFC 2426, September 1998.

   [RFC2518]  Goland, Y., Whitehead, E., Faizi, A., Carter, S., and D.
              Jensen, "HTTP Extensions for Distributed Authoring --
              WEBDAV", RFC 2518, February 1999.



Daboo                    Expires April 25, 2007                [Page 49]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


   [RFC2616]  Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
              Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
              Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.

   [RFC2818]  Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000.

   [RFC3253]  Clemm, G., Amsden, J., Ellison, T., Kaler, C., and J.
              Whitehead, "Versioning Extensions to WebDAV (Web
              Distributed Authoring and Versioning)", RFC 3253,
              March 2002.

   [RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
              January 2004.

   [RFC3744]  Clemm, G., Reschke, J., Sedlar, E., and J. Whitehead, "Web
              Distributed Authoring and Versioning (WebDAV) Access
              Control Protocol", RFC 3744, May 2004.

   [RFC4346]  Dierks, T. and E. Rescorla, "The Transport Layer Security
              (TLS) Protocol Version 1.1", RFC 4346, April 2006.

   [W3C.REC-xml-20060816]
              Yergeau, F., Paoli, J., Bray, T., Sperberg-McQueen, C.,
              and E. Maler, "Extensible Markup Language (XML) 1.0
              (Fourth Edition)", World Wide Web Consortium
              Recommendation REC-xml-20060816, August 2006,
              <http://www.w3.org/TR/2006/REC-xml-20060816>.

14.2.  Informative References

   [I-D.ietf-webdav-rfc2518bis]
              Dusseault, L., "HTTP Extensions for Distributed Authoring
              - WebDAV", draft-ietf-webdav-rfc2518bis-15 (work in
              progress), May 2006.

   [RFC2244]  Newman, C. and J. Myers, "ACAP -- Application
              Configuration Access Protocol", RFC 2244, November 1997.

   [RFC2251]  Wahl, M., Howes, T., and S. Kille, "Lightweight Directory
              Access Protocol (v3)", RFC 2251, December 1997.


Appendix A.  Acknowledgments

   Thanks go to Lisa Dusseault and Bernard Desruisseaux for their work
   on CalDAV, on which CardDAV is heavily based.





Daboo                    Expires April 25, 2007                [Page 50]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


Author's Address

   Cyrus Daboo
   Apple Computer, Inc.
   1 Infinite Loop
   Cupertino, CA  95014
   USA

   Email: cyrus@daboo.name
   URI:   http://www.apple.com/









































Daboo                    Expires April 25, 2007                [Page 51]


Internet-Draft    vCard Extensions to WebDAV (CardDAV)      October 2006


Full Copyright Statement

   Copyright (C) The Internet Society (2006).

   This document is subject to the rights, licenses and restrictions
   contained in BCP 78, and except as set forth therein, the authors
   retain all their rights.

   This document and the information contained herein are provided on an
   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.


Intellectual Property

   The IETF takes no position regarding the validity or scope of any
   Intellectual Property Rights or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; nor does it represent that it has
   made any independent effort to identify any such rights.  Information
   on the procedures with respect to rights in RFC documents can be
   found in BCP 78 and BCP 79.

   Copies of IPR disclosures made to the IETF Secretariat and any
   assurances of licenses to be made available, or the result of an
   attempt made to obtain a general license or permission for the use of
   such proprietary rights by implementers or users of this
   specification can be obtained from the IETF on-line IPR repository at
   http://www.ietf.org/ipr.

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights that may cover technology that may be required to implement
   this standard.  Please address the information to the IETF at
   ietf-ipr@ietf.org.


Acknowledgment

   Funding for the RFC Editor function is provided by the IETF
   Administrative Support Activity (IASA).





Daboo                    Expires April 25, 2007                [Page 52]