Network Working Group C. Daboo Internet-Draft Expires: October 7, 2006 B. Desruisseaux Oracle L. Dusseault OSAF April 5, 2006 Calendaring Extensions to WebDAV (CalDAV) draft-dusseault-caldav-11 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 October 7, 2006. Copyright Notice Copyright (C) The Internet Society (2006). Abstract This document specifies a set of methods, headers, message bodies, properties, and reports that define calendar access extensions to the WebDAV protocol. The new protocol elements are intended to make WebDAV-based calendaring and scheduling an interoperable standard that supports calendar access, calendar management, calendar sharing, Daboo, et al. Expires October 7, 2006 [Page 1] Internet-Draft CalDAV April 2006 and calendar publishing. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 5 1.2. XML Namespaces and Processing . . . . . . . . . . . . . . 5 2. Requirements Overview . . . . . . . . . . . . . . . . . . . . 6 3. Calendaring Data Model . . . . . . . . . . . . . . . . . . . 7 3.1. Calendar Server . . . . . . . . . . . . . . . . . . . . . 7 3.2. Recurrence and the Data Model . . . . . . . . . . . . . . 8 4. Calendar Resources . . . . . . . . . . . . . . . . . . . . . 8 4.1. Calendar Object Resources . . . . . . . . . . . . . . . . 8 4.2. Calendar Collection . . . . . . . . . . . . . . . . . . . 10 5. Calendar Access Feature . . . . . . . . . . . . . . . . . . . 11 5.1. Calendar Access Support . . . . . . . . . . . . . . . . . 11 5.1.1. Example: Using OPTIONS for the Discovery of Calendar Access Support . . . . . . . . . . . . . . . 11 5.2. Calendar Collection Properties . . . . . . . . . . . . . 11 5.2.1. CALDAV:calendar-description Property . . . . . . . . 11 5.2.2. CALDAV:calendar-timezone Property . . . . . . . . . . 12 5.2.3. CALDAV:supported-calendar-component-set Property . . 14 5.2.4. CALDAV:supported-calendar-data Property . . . . . . . 15 5.2.5. CALDAV:max-resource-size Property . . . . . . . . . . 15 5.2.6. CALDAV:min-date-time Property . . . . . . . . . . . . 16 5.2.7. CALDAV:max-date-time Property . . . . . . . . . . . . 17 5.2.8. CALDAV:max-instances Property . . . . . . . . . . . . 18 5.2.9. CALDAV:max-attendees-per-instance Property . . . . . 19 5.2.10. Additional Precondition for PROPPATCH . . . . . . . . 19 5.3. Creating Resources . . . . . . . . . . . . . . . . . . . 20 5.3.1. MKCALENDAR Method . . . . . . . . . . . . . . . . . . 20 5.3.1.1. Status Codes . . . . . . . . . . . . . . . . . . 21 5.3.1.2. Example: Successful MKCALENDAR request . . . . . 22 5.3.2. Creating Calendar Object Resources . . . . . . . . . 24 5.3.2.1. Additional Preconditions for PUT, COPY and MOVE . 25 5.3.3. Non-standard components, properties and parameters . 27 5.3.4. Calendar Object Resource Entity Tag . . . . . . . . . 27 6. Calendaring Access Control . . . . . . . . . . . . . . . . . 28 6.1. Calendaring Privilege . . . . . . . . . . . . . . . . . . 28 6.1.1. CALDAV:read-free-busy Privilege . . . . . . . . . . . 28 6.2. Additional Principal Property . . . . . . . . . . . . . . 29 6.2.1. CALDAV:calendar-home-set Property . . . . . . . . . . 29 7. Calendaring Reports . . . . . . . . . . . . . . . . . . . . . 30 7.1. REPORT Method . . . . . . . . . . . . . . . . . . . . . . 30 7.2. Ordinary collections . . . . . . . . . . . . . . . . . . 30 7.3. Date and floating time . . . . . . . . . . . . . . . . . 30 7.4. Time range filtering . . . . . . . . . . . . . . . . . . 31 Daboo, et al. Expires October 7, 2006 [Page 2] Internet-Draft CalDAV April 2006 7.5. Partial Retrieval . . . . . . . . . . . . . . . . . . . . 32 7.6. Non-standard components, properties and parameters . . . 32 7.7. CALDAV:calendar-query Report . . . . . . . . . . . . . . 33 7.7.1. Example: Partial retrieval of events by time range . 35 7.7.2. Example: Partial retrieval of recurring events . . . 39 7.7.3. Example: Expanded retrieval of recurring events . . . 42 7.7.4. Example: Partial retrieval of stored free busy components . . . . . . . . . . . . . . . . . . . . . 44 7.7.5. Example: Retrieval of to-dos by alarm time range . . 46 7.7.6. Example: Retrieval of event by UID . . . . . . . . . 48 7.7.7. Example: Retrieval of events by PARTSTAT . . . . . . 50 7.7.8. Example: Retrieval of events only . . . . . . . . . . 52 7.7.9. Example: Retrieval of all pending to-dos . . . . . . 56 7.7.10. Example: Attempt to query unsupported property . . . 59 7.8. CALDAV:calendar-multiget Report . . . . . . . . . . . . . 60 7.8.1. Example: Successful CALDAV:calendar-multiget Report . 61 7.9. CALDAV:free-busy-query Report . . . . . . . . . . . . . . 63 7.9.1. Example: Successful CALDAV:free-busy-query Report . . 65 8. Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . 65 8.1. Client-to-client Interoperability . . . . . . . . . . . . 66 8.2. Synchronization Operations . . . . . . . . . . . . . . . 66 8.2.1. Use of Reports . . . . . . . . . . . . . . . . . . . 66 8.2.1.1. Restrict the Time Range . . . . . . . . . . . . . 66 8.2.1.2. Synchronize by Time Range . . . . . . . . . . . . 66 8.2.1.3. Synchronization Process . . . . . . . . . . . . . 67 8.2.2. Restrict the Properties Returned . . . . . . . . . . 69 8.3. Use of Locking . . . . . . . . . . . . . . . . . . . . . 69 8.4. Finding calendars . . . . . . . . . . . . . . . . . . . . 69 8.5. Storing and Using Attachments . . . . . . . . . . . . . . 71 8.5.1. Inline attachments . . . . . . . . . . . . . . . . . 71 8.5.2. External attachments . . . . . . . . . . . . . . . . 72 8.6. Storing and Using Alarms . . . . . . . . . . . . . . . . 73 9. XML Element Definitions . . . . . . . . . . . . . . . . . . . 74 9.1. CALDAV:calendar XML Element . . . . . . . . . . . . . . . 74 9.2. CALDAV:mkcalendar XML Element . . . . . . . . . . . . . . 74 9.3. CALDAV:mkcalendar-response XML Element . . . . . . . . . 74 9.4. CALDAV:calendar-query XML Element . . . . . . . . . . . . 75 9.5. CALDAV:calendar-data XML Element . . . . . . . . . . . . 75 9.5.1. CALDAV:comp XML Element . . . . . . . . . . . . . . . 76 9.5.2. CALDAV:allcomp XML Element . . . . . . . . . . . . . 77 9.5.3. CALDAV:allprop XML Element . . . . . . . . . . . . . 77 9.5.4. CALDAV:prop XML Element . . . . . . . . . . . . . . . 78 9.5.5. CALDAV:expand XML Element . . . . . . . . . . . . . . 78 9.5.6. CALDAV:limit-recurrence-set XML Element . . . . . . . 79 9.5.7. CALDAV:limit-freebusy-set XML Element . . . . . . . . 80 9.6. CALDAV:filter XML Element . . . . . . . . . . . . . . . . 81 9.6.1. CALDAV:comp-filter XML Element . . . . . . . . . . . 81 9.6.2. CALDAV:prop-filter XML Element . . . . . . . . . . . 82 Daboo, et al. Expires October 7, 2006 [Page 3] Internet-Draft CalDAV April 2006 9.6.3. CALDAV:param-filter XML Element . . . . . . . . . . . 83 9.6.4. CALDAV:is-not-defined XML Element . . . . . . . . . . 83 9.6.5. CALDAV:text-match XML Element . . . . . . . . . . . . 84 9.7. CALDAV:timezone XML Element . . . . . . . . . . . . . . . 84 9.8. CALDAV:time-range XML Element . . . . . . . . . . . . . . 85 9.9. CALDAV:calendar-multiget XML Element . . . . . . . . . . 89 9.10. CALDAV:free-busy-query XML Element . . . . . . . . . . . 90 10. Internationalization Considerations . . . . . . . . . . . . . 90 11. Security Considerations . . . . . . . . . . . . . . . . . . . 90 12. IANA Consideration . . . . . . . . . . . . . . . . . . . . . 91 12.1. Namespace Registration . . . . . . . . . . . . . . . . . 91 13. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 91 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 92 14.1. Normative References . . . . . . . . . . . . . . . . . . 92 14.2. Informative References . . . . . . . . . . . . . . . . . 93 Appendix A. CalDAV Method Privilege Table (Normative) . . . . . 93 Appendix B. Calendar collections used in the examples . . . . . 93 Appendix C. Changes (to be removed prior to publication as an RFC) . . . . . . . . . . . . . . . . . . . . . . . . 100 C.1. Changes in -11 . . . . . . . . . . . . . . . . . . . . . 100 C.2. Changes in -10 . . . . . . . . . . . . . . . . . . . . . 101 C.3. Changes in -09 . . . . . . . . . . . . . . . . . . . . . 102 C.4. Changes in -08 . . . . . . . . . . . . . . . . . . . . . 104 C.5. Changes in -07 . . . . . . . . . . . . . . . . . . . . . 104 C.6. Changes in -06 . . . . . . . . . . . . . . . . . . . . . 105 C.7. Changes in -05 . . . . . . . . . . . . . . . . . . . . . 106 C.8. Changes in -04 . . . . . . . . . . . . . . . . . . . . . 106 C.9. Changes in -03 . . . . . . . . . . . . . . . . . . . . . 107 C.10. Changes in -02 . . . . . . . . . . . . . . . . . . . . . 107 C.11. Changes in -01 . . . . . . . . . . . . . . . . . . . . . 107 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 108 Intellectual Property and Copyright Statements . . . . . . . . . 109 Daboo, et al. Expires October 7, 2006 [Page 4] Internet-Draft CalDAV April 2006 1. Introduction The concept of using HTTP [RFC2616] and WebDAV [I-D.ietf-webdav- rfc2518bis] as a basis for a calendar access protocol is by no means a new concept: it was discussed in the IETF CALSCH working group as early as 1997 or 1998. Several companies have implemented calendar access protocols using HTTP to upload and download iCalendar [RFC2445] objects, and using WebDAV to get listings of resources. However, those implementations do not interoperate because there are many small and big decisions to be made in how to model calendaring data as WebDAV resources, as well as how to implement required features that aren't already part of WebDAV. This document proposes a way to model calendar data in WebDAV, with additional features to make an interoperable calendar access protocol. Discussion of this Internet-Draft is taking place on the mailing list . 1.1. Notational Conventions 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:caldav" are referenced in this document outside of the context of an XML fragment, the string "DAV:" and "CALDAV:" will be prefixed to the element type names respectively. 1.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-20040204]. The namespace "urn:ietf:params:xml:ns:caldav" is reserved for the XML elements defined in this specification, its revisions, and related CalDAV specifications. XML elements defined by individual implementations MUST NOT use the "urn:ietf:params:xml:ns:caldav" 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 CalDAV properties or to validate CalDAV XML element type. Some of the declarations refer to XML elements Daboo, et al. Expires October 7, 2006 [Page 5] Internet-Draft CalDAV April 2006 defined by WebDAV [I-D.ietf-webdav-rfc2518bis] which use the "DAV:" namespace. Wherever such XML elements appear, they are explicitly prefixed with "DAV:" to avoid confusion. Also note that some CalDAV 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 CalDAV clients and servers MUST follow the rules described in [I-D.ietf-webdav-rfc2518bis], in particular Sections 8.2 and 17, and Appendix A of that specification. 2. Requirements Overview This section lists what functionality is required of a CalDAV server. To advertise support for CalDAV, a server: o MUST support iCalendar [RFC2445] as a media type for calendar object resource format; o MUST support WebDAV Class 1 and Class 3 [I-D.ietf-webdav- rfc2518bis]; o MUST support WebDAV ACL [RFC3744] with the additional privilege defined in Section 6.1 of this document; o MUST support transport over TLS [RFC2246] as defined in [RFC2818]; o MUST support ETags [RFC2616] with additional requirements specified in Section 5.3.4 of this document; o MUST support all calendaring REPORTs defined in Section 7 of this document; and o MUST advertise support on all calendar collections and calendar object resources for the calendaring REPORTs in the DAV:supported- report-set property as defined in Versioning Extensions to WebDAV [RFC3253]. In addition, a server: o SHOULD support the MKCALENDAR method defined in Section 5.3.1 of this document. Daboo, et al. Expires October 7, 2006 [Page 6] Internet-Draft CalDAV April 2006 3. Calendaring Data Model One of the features which has made WebDAV a successful protocol is its firm data model. This makes it a useful framework for other applications such as calendaring. This specification follows the same pattern by developing all features based on a well-described data model. As a brief overview, a CalDAV calendar is modeled as a WebDAV collection with a defined structure; each calendar collection contains a number of resources representing calendar objects as its direct child resource. Each resource representing a calendar object (event or to-do, or journal entry, or other calendar components) is called a "calendar object resource". Each calendar object resource and each calendar collection can be individually locked and have individual WebDAV properties. Requirements derived from this model are provided in Section 4.1 and Section 4.2. 3.1. Calendar Server A CalDAV server is a calendaring-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://www.example.com/webdav/" may contain WebDAV collections and resources, all of which have URLs beginning with "http://www.example.com/webdav/". Note that the root URL "http://www.example.com/" 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 calendar data in some parts of its URL namespace, and non-calendaring data in other parts. A WebDAV repository can advertise itself as a CalDAV server if it supports the functionality defined in this specification at any point within the root of the repository. That might mean that calendaring data is spread throughout the repository and mixed with non-calendar data in nearby collections (e.g., calendar data may be found in /home/lisa/calendars/ as well as in /home/bernard/calendars/, and non-calendar data in /home/lisa/contacts/). Or, it might mean that calendar data can be found only in certain sections of the repository (e.g., /calendar/). Calendaring features are only required in the repository sections that are or contain calendar object resources. So a repository confining calendar data to the /calendar/ collection would only need to support the CalDAV required features within that collection. The CalDAV server or repository is the canonical location for Daboo, et al. Expires October 7, 2006 [Page 7] Internet-Draft CalDAV April 2006 calendar data and state information. Both CalDAV servers and clients MUST ensure that the data is consistent and compliant. Clients may submit requests to change data or download data. Clients may store calendar objects offline and attempt to synchronize at a later time. However, clients MUST be prepared for calendar data on the server to change between the time of last synchronization and when attempting an update, as calendar collections may be shared and accessible via multiple clients. Entity tags and other features make this possible. 3.2. Recurrence and the Data Model Recurrence is an important part of the data model because it governs how many resources are expected to exist. This specification models a recurring calendar component and its recurrence exceptions as a single resource. In this model, recurrence rules, recurrence dates, exception rules, and exception dates are all part of the data in a single calendar object resource. This model avoids problems of limiting how many recurrence instances to store in the repository, how to keep recurrence instances in sync with the recurring calendar component, and how to link recurrence exceptions with the recurring calendar component. It also results in less data to synchronize between client and server, and makes it easier to make changes to all recurrence instances or to a recurrence rule. It makes it easier to create a recurring calendar component, and easier to delete all recurrence instances. Clients are not forced to retrieve information about all recurrence instances of a recurring component. The CALDAV:calendar-query and CALDAV:calendar-multiget REPORTs defined in this document allow clients to retrieve only recurrence instances that overlap a given time range. 4. Calendar Resources 4.1. Calendar Object Resources Calendar object resources contained in calendar collections MUST NOT contain more than one type of calendar component (e.g., VEVENT, VTODO, VJOURNAL, VFREEBUSY, etc.) with the exception of VTIMEZONE components which MUST be specified for each unique TZID parameter value specified in the iCalendar object. For instance, a calendar object resource can contain two VEVENT components and one VTIMEZONE component, but it cannot contain one VEVENT component and one VTODO component. Instead the VEVENT and VTODO components would have to be stored in separate calendar object resources in the same collection. Calendar object resources contained in calendar collections MUST NOT Daboo, et al. Expires October 7, 2006 [Page 8] Internet-Draft CalDAV April 2006 specify the iCalendar METHOD property. The UID property value of the calendar components contained in a calendar object resource MUST be unique in the scope of the calendar collection in which they are stored. Calendar components in a calendar collection that have different UID property values MUST be stored in separate calendar object resources. Calendar components with the same UID property value, in a given calendar collection, MUST be contained in the same calendar object resource. This ensures that all components in a recurrence "set" are contained in the same calendar object resource. It is possible for a calendar object resource to just contain components that represent "overridden" instances (ones which modify the behavior of a regular instance, and thus include a RECURRENCE-ID property), without also including the "master" recurring component (the one that defines the recurrence "set" and does not contain any "RECURRENCE-ID" property). For example, given the following iCalendar object: BEGIN:VCALENDAR PRODID:-//Example Corp.//CalDAV Client//EN VERSION:2.0 BEGIN:VEVENT UID:1@example.com SUMMARY:One-off Meeting DTSTAMP:20041210T183904Z DTSTART:20041207T120000Z DTEND:20041207T130000Z END:VEVENT BEGIN:VEVENT UID:2@example.com SUMMARY:Weekly Meeting DTSTAMP:20041210T183838Z DTSTART:20041206T120000Z DTEND:20041206T130000Z RRULE:FREQ=WEEKLY END:VEVENT BEGIN:VEVENT UID:2@example.com SUMMARY:Weekly Meeting RECURRENCE-ID:20041213T120000Z DTSTAMP:20041210T183838Z DTSTART:20041213T130000Z DTEND:20041213T140000Z END:VEVENT END:VCALENDAR Daboo, et al. Expires October 7, 2006 [Page 9] Internet-Draft CalDAV April 2006 The VEVENT component with the UID value "1@example.com", would be stored in its own calendar object resource. The two VEVENT components with the UID value "2@example.com", which represent a recurring event where one recurrence instance has been overridden, would be stored in the same calendar object resource. 4.2. Calendar Collection A calendar collection contains calendar object resources that represent calendar components within a calendar. A calendar collection is manifested to clients as a WebDAV resource collection identified by a URL. A calendar collection MUST report the DAV: collection and CALDAV:calendar XML elements in the value of the DAV: resourcetype property. The element type declaration for CALDAV: calendar is: A calendar collection can be created through provisioning (e.g., automatically created when a user's account is provisioned), or it can be created with the MKCALENDAR method (see Section 5.3.1). This method can be useful for a user to create additional calendars (e.g., soccer schedule) or for users to share a calendar (e.g., team events or conference room). Note however that this document doesn't define what extra calendar collections are for. Users must rely on non- standard cues to find out what a calendar collection is for, or use the CALDAV:calendar-description property defined in Section 5.2.1 to provide such a cue. The following restrictions are applied to the resources within a calendar collection: a. Calendar collections MUST only contain calendar object resources and collections that are not calendar collections. i.e., the only "top-level" non-collection resources allowed in a calendar collection are calendar object resources. This ensures that calendar clients do not have to deal with non-calendar data in a calendar collection, though they do have to distinguish between calendar object resources and collections when using standard WebDAV techniques to examine the contents of a collection. b. Collections contained in calendar collections MUST NOT contain calendar collections at any depth. i.e., "nesting" of calendar collections within other calendar collections at any depth is not allowed. This specification does not define how collections contained in a calendar collection are used or how they relate to any calendar object resources contained in the calendar collection. Daboo, et al. Expires October 7, 2006 [Page 10] Internet-Draft CalDAV April 2006 Multiple calendar collections MAY be children of the same collection. 5. Calendar Access Feature 5.1. Calendar Access Support A server supporting the features described in this document MUST include "calendar-access" as a field in the DAV response header from an OPTIONS request on any resource that supports any calendar properties, reports, method, or privilege. A value of "calendar- access" in the DAV response header MUST indicate that the server supports all MUST level requirements specified in this document. 5.1.1. Example: Using OPTIONS for the Discovery of Calendar Access Support >> Request << OPTIONS /home/bernard/calendars/ HTTP/1.1 Host: cal.example.com >> Response << HTTP/1.1 200 OK Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE Allow: PROPFIND, PROPPATCH, LOCK, UNLOCK, REPORT, ACL DAV: 1, 2, 3, access-control, calendar-access Date: Fri, 11 Nov 2005 09:32:12 GMT Content-Length: 0 In this example, the OPTIONS method returns the value "calendar- access" in the DAV response header to indicate that the collection "/home/bernard/calendars/" supports the properties, reports, methods, or privileges defined in this specification. 5.2. Calendar Collection Properties This section defines properties that MAY be defined on calendar collections. 5.2.1. CALDAV:calendar-description Property Name: calendar-description Daboo, et al. Expires October 7, 2006 [Page 11] Internet-Draft CalDAV April 2006 Namespace: urn:ietf:params:xml:ns:caldav Purpose: Provides a human-readable description of the calendar collection. Conformance: This property MAY be defined on any calendar collection. If defined, it MAY be protected and SHOULD NOT be returned by a PROPFIND DAV:allprop request (as defined in Section 14.2 of [I-D.ietf-webdav-rfc2518bis]). 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 calendar collection that is suitable for presentation to a user. If not present, the client should assume no description for the calendar collection. Definition: PCDATA value: string Example: Calendrier de Mathilde Desruisseaux 5.2.2. CALDAV:calendar-timezone Property Name: calendar-timezone Namespace: urn:ietf:params:xml:ns:caldav Purpose: Specifies a time zone on a calendar collection. Conformance: This property SHOULD be defined on all calendar collections. If defined, it SHOULD NOT be returned by a PROPFIND DAV:allprop request (as defined in Section 14.2 of [I-D.ietf- webdav-rfc2518bis]). Description: The CALDAV:calendar-timezone property is used to specify the time zone the server should rely on to resolve "date" values and "date with local time" values (i.e., floating time) to "date with UTC time" values. The server will require this information to determine if a calendar component scheduled with "date" values or "date with local time" values overlaps a CALDAV:time-range Daboo, et al. Expires October 7, 2006 [Page 12] Internet-Draft CalDAV April 2006 specified in a CALDAV:calendar-query REPORT. The server will also require this information to compute the proper FREEBUSY time period as "date with UTC time" in the VFREEBUSY component returned in a response to a CALDAV:free-busy-query REPORT request that takes into account calendar components scheduled with "date" values or "date with local time" values. In the absence of this property the server MAY rely on the time zone of their choice. Note: The iCalendar data embedded within the CALDAV:calendar-timezone XML element MUST follow the standard XML character data encoding rules, including use of <, >, & etc entity encoding or the use of a <[!CDATA[ ... ]]> construct. In the later case the iCalendar data cannot contain the character sequence "]]>" which is the end delimiter for the CDATA section. Definition: PCDATA value: an iCalendar object with exactly one VTIMEZONE component. Example: BEGIN:VCALENDAR PRODID:-//Example Corp.//CalDAV Client//EN VERSION:2.0 BEGIN:VTIMEZONE TZID:US-Eastern LAST-MODIFIED:19870101T000000Z BEGIN:STANDARD DTSTART:19671029T020000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 TZOFFSETFROM:-0400 TZOFFSETTO:-0500 TZNAME:Eastern Standard Time (US & Canada) END:STANDARD BEGIN:DAYLIGHT DTSTART:19870405T020000 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 TZOFFSETFROM:-0500 TZOFFSETTO:-0400 TZNAME:Eastern Daylight Time (US & Canada) END:DAYLIGHT END:VTIMEZONE END:VCALENDAR Daboo, et al. Expires October 7, 2006 [Page 13] Internet-Draft CalDAV April 2006 5.2.3. CALDAV:supported-calendar-component-set Property Name: supported-calendar-component-set Namespace: urn:ietf:params:xml:ns:caldav Purpose: Specifies the calendar component types (e.g., VEVENT, VTODO, etc.) that calendar object resources can contain in the calendar collection. Conformance: This property MAY be defined on any calendar collection. If defined, it MUST be protected and SHOULD NOT be returned by a PROPFIND DAV:allprop request (as defined in Section 14.2 of [I-D.ietf-webdav-rfc2518bis]). Description: The CALDAV:supported-calendar-component-set property is used to specify restrictions on the calendar component types that calendar object resources may contain in a calendar collection. Any attempt by the client to store calendar object resources with component types not listed in this property, if it exists, MUST result in an error, with the CALDAV:supported-calendar-component precondition (Section 5.3.2.1) being violated. Since this property is protected it cannot be changed by clients using a PROPPATCH request. However, clients can initialize the value of this property when creating a new calendar collection with MKCALENDAR. The empty-element tag MUST only be specified if support for calendar object resources that only contain VTIMEZONE components is provided or desired. Support for VTIMEZONE components in calendar object resources that contain VEVENT or VTODO components is always assumed. In the absence of this property the server MUST accept all component types, and the client can assume that. Definition: Example: Daboo, et al. Expires October 7, 2006 [Page 14] Internet-Draft CalDAV April 2006 5.2.4. CALDAV:supported-calendar-data Property Name: supported-calendar-data Namespace: urn:ietf:params:xml:ns:caldav Purpose: Specifies what media types are allowed for calendar object resources in a calendar collection. Conformance: This property MAY be defined on any calendar collection. If defined, it MUST be protected and SHOULD NOT be returned by a PROPFIND DAV:allprop request (as defined in Section 14.2 of [I-D.ietf-webdav-rfc2518bis]). Description: The CALDAV:supported-calendar-data property is used to specify the media type supported for the calendar object resources contained in a given calendar collection (e.g., iCalendar version 2.0). Any attempt by the client to store calendar object resources with a media type not listed in this property MUST result in an error, with the CALDAV:supported-calendar-data precondition (Section 5.3.2.1) being violated. In the absence of this property the server MUST accept data with the media type "text/calendar" and iCalendar version 2.0, and clients can assume that. Definition: Example: 5.2.5. CALDAV:max-resource-size Property Name: max-resource-size Namespace: urn:ietf:params:xml:ns:caldav Purpose: Provides a numeric value indicating the maximum size of resource in octets that the server is willing to accept when a calendar object resource is stored in a calendar collection. Daboo, et al. Expires October 7, 2006 [Page 15] Internet-Draft CalDAV April 2006 Conformance: This property MAY be defined on any calendar collection. If defined, it MUST be protected and SHOULD NOT be returned by a PROPFIND DAV:allprop request (as defined in Section 14.2 of [I-D.ietf-webdav-rfc2518bis]). Description: The CALDAV: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 calendar object resource is stored in a calendar collection. Any attempt to store a calendar object resource exceeding this size MUST result in an error, with the CALDAV:max-resource-size precondition (Section 5.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 reasonable size. Definition: PCDATA value: a numeric value (positive integer) Example: 102400 5.2.6. CALDAV:min-date-time Property Name: min-date-time Namespace: urn:ietf:params:xml:ns:caldav Purpose: Provides a date-time value indicating the earliest date and time (in UTC) that the server is willing to accept for any date or time value in a calendar object resource stored in a calendar collection. Conformance: This property MAY be defined on any calendar collection. If defined, it MUST be protected and SHOULD NOT be returned by a PROPFIND DAV:allprop request (as defined in Section 14.2 of [I-D.ietf-webdav-rfc2518bis]). Description: The CALDAV:min-date-time is used to specify an iCalendar DATE-TIME value in UTC that indicates the earliest inclusive date that the server is willing to accept for any explicit date or time value in a calendar object resource stored in a calendar collection. Any attempt to store a calendar object resource using a date or time value earlier than this value MUST result in an error, with the CALDAV:min-date-time precondition Daboo, et al. Expires October 7, 2006 [Page 16] Internet-Draft CalDAV April 2006 (Section 5.3.2.1) being violated. Note that servers MUST accept recurring components that specify instances beyond this limit, provided none of those instances have been overridden. In that case the server MAY simply ignore those instances outside of the acceptable range when processing reports on the calendar object resource. In the absence of this property the client can assume any valid iCalendar date may be used at least up to the CALDAV: max-date-time value if that is defined. Definition: PCDATA value: an iCalendar format DATE-TIME value in UTC Example: 19000101T000000Z 5.2.7. CALDAV:max-date-time Property Name: max-date-time Namespace: urn:ietf:params:xml:ns:caldav Purpose: Provides a date-time value indicating the latest date and time (in UTC) that the server is willing to accept for any date or time value in a calendar object resource stored in a calendar collection. Conformance: This property MAY be defined on any calendar collection. If defined, it MUST be protected and SHOULD NOT be returned by a PROPFIND DAV:allprop request (as defined in Section 14.2 of [I-D.ietf-webdav-rfc2518bis]). Description: The CALDAV:max-date-time is used to specify an iCalendar DATE-TIME value in UTC that indicates the inclusive latest date that the server is willing to accept for any date or time value in a calendar object resource stored in a calendar collection. Any attempt to store a calendar object resource using a date or time value later than this value MUST result in an error, with the CALDAV:max-date-time precondition (Section 5.3.2.1) being violated. Note that servers MUST accept recurring components that specify instances beyond this limit, provided none of those instances have been overridden. In that case the server MAY simply ignore those instances outside of the acceptable range when processing reports on the calendar object resource. In the absence of this property the client can assume any valid iCalendar Daboo, et al. Expires October 7, 2006 [Page 17] Internet-Draft CalDAV April 2006 date may be used at least down to the CALDAV:min-date-time value if that is defined. Definition: PCDATA value: an iCalendar format DATE-TIME value in UTC Example: 20491231T235959Z 5.2.8. CALDAV:max-instances Property Name: max-instances Namespace: urn:ietf:params:xml:ns:caldav Purpose: Provides a numeric value indicating the maximum number of recurrence instances that a calendar object resource stored in a calendar collection can generate. Conformance: This property MAY be defined on any calendar collection. If defined, it MUST be protected and SHOULD NOT be returned by a PROPFIND DAV:allprop request (as defined in Section 14.2 of [I-D.ietf-webdav-rfc2518bis]). Description: The CALDAV:max-instances is used to specify a numeric value that indicates the maximum number of recurrence instances that a calendar object resource stored in a calendar collection can generate. Any attempt to store a calendar object resource with a recurrence pattern that generates more instances than this value MUST result in an error, with the CALDAV:max-instances precondition (Section 5.3.2.1) being violated. In the absence of this property the client can assume that the server has no limits on the number of recurrence instances it can handle or expand. Definition: PCDATA value: a numeric value (integer greater than zero) Example: 100 Daboo, et al. Expires October 7, 2006 [Page 18] Internet-Draft CalDAV April 2006 5.2.9. CALDAV:max-attendees-per-instance Property Name: max-attendees-per-instance Namespace: urn:ietf:params:xml:ns:caldav Purpose: Provides a numeric value indicating the maximum number of ATTENDEE properties in any instance of a calendar object resource stored in a calendar collection. Conformance: This property MAY be defined on any calendar collection. If defined, it MUST be protected and SHOULD NOT be returned by a PROPFIND DAV:allprop request (as defined in Section 14.2 of [I-D.ietf-webdav-rfc2518bis]). Description: The CALDAV:max-attendees-per-instance is used to specify a numeric value that indicates the maximum number of iCalendar ATTENDEE properties on any one instance of a calendar object resource stored in a calendar collection. Any attempt to store a calendar object resource with more ATTENDEE properties per instance than this value MUST result in an error, with the CALDAV: max-attendees-per-instance precondition (Section 5.3.2.1) being violated. In the absence of this property the client can assume that the server can handle any number of ATTENDEE properties in a calendar component. Definition: PCDATA value: a numeric value (integer greater than zero) Example: 25 5.2.10. Additional Precondition for PROPPATCH This specification requires an additional Precondition (see Section 16 of [I-D.ietf-webdav-rfc2518bis] for the PROPPATCH method. The precondition is: (CALDAV:valid-calendar-data): The time zone specified in CALDAV: calendar-timezone property MUST be a valid iCalendar object containing a single valid VTIMEZONE component. Daboo, et al. Expires October 7, 2006 [Page 19] Internet-Draft CalDAV April 2006 5.3. Creating Resources The creation of calendar collections and calendar object resources may be initiated by either a CalDAV client or by the CalDAV server. For example, a server might come pre-configured with a user's calendar collection, or the CalDAV client might request the server to create a new calendar collection for a given user. Servers might populate events as calendar objects inside a calendar collection, or clients might request the server to create events. Either way, both client and server MUST comply with the requirements in this document, and MUST understand objects appearing in calendar collections or according to the data model defined here. 5.3.1. MKCALENDAR Method An HTTP request using the MKCALENDAR method creates a new calendar collection resource. A server MAY restrict calendar collection creation to particular collections. Support for MKCALENDAR on the server is only RECOMMENDED and not REQUIRED because some calendar stores only support one calendar per user (or principal) and those are typically pre-created for each account. However, servers and clients are strongly encouraged to support MKCALENDAR whenever possible to allow users to create multiple calendar collections to better help organize their data. Clients SHOULD use the DAV:displayname property for a human-readable name of the calendar. Clients can either specify the value of the DAV:displayname property in the request body of the MKCALENDAR request, or alternatively issue a PROPPATCH request to change the DAV:displayname property to the appropriate value immediately after issuing the MKCALENDAR request. Clients SHOULD NOT set the DAV: displayname property to be the same as any other calendar collection at the same URI "level". When displaying calendar collections to users, clients SHOULD check the DAV:displayname property and use that value as the name of the calendar. In the event that the DAV: displayname property is empty, the client MAY use the last part of the calendar collection URI as the name, however that path segment may be "opaque" and not represent any meaningful human-readable text. If a MKCALENDAR request fails, the server state preceding the request MUST be restored. Marshalling: If a request body is included, it MUST be a CALDAV:mkcalendar XML element. Instruction processing MUST occur in the order instructions are received (i.e., from top to bottom). Daboo, et al. Expires October 7, 2006 [Page 20] Internet-Draft CalDAV April 2006 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 14.26 of [I-D.ietf-webdav-rfc2518bis]. If a response body for a successful request is included, it MUST be a CALDAV:mkcalendar-response XML element. 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; (CALDAV:calendar-collection-location-ok): The Request-URI MUST identify a location where a calendar collection can be created; (CALDAV:valid-calendar-data): The time zone specified in the CALDAV:calendar-timezone property MUST be a valid iCalendar object containing a single valid VTIMEZONE component; (DAV:needs-privilege): The DAV:bind privilege MUST be granted to the current user on the parent collection of the Request-URI. Postconditions: (CALDAV:initialize-calendar-collection): A new calendar collection exists at the Request-URI. The DAV:resourcetype of the calendar collection MUST contain both DAV:collection and CALDAV:calendar XML elements. 5.3.1.1. Status Codes The following are examples of response codes one would expect to get in a response to a MKCALENDAR request. Note that this list is by no means exhaustive. 201 (Created) - The calendar collection resource was created in its entirety; 207 (Multi-Status) - The calendar collection resource was not created since one or more DAV:set instructions specified in the Daboo, et al. Expires October 7, 2006 [Page 21] Internet-Draft CalDAV April 2006 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 in this situation: 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; and 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 calendar collections at the given location in its namespace, or 2) the parent collection of the Request-URI exists but cannot accept members; 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; and 507 (Insufficient Storage) - The resource does not have sufficient space to record the state of the resource after the execution of this method. 5.3.1.2. Example: Successful MKCALENDAR request This example creates a calendar collection called /home/lisa/ calendars/events/ on the server cal.example.com with specific values for the properties DAV:displayname, CALDAV:calendar-description, CALDAV:supported-calendar-component-set, and CALDAV:calendar- timezone. Daboo, et al. Expires October 7, 2006 [Page 22] Internet-Draft CalDAV April 2006 >> Request << MKCALENDAR /home/lisa/calendars/events/ HTTP/1.1 Host: cal.example.com Content-Type: application/xml; charset="utf-8" Content-Length: xxxx Lisa's Events Calendar restricted to events. Daboo, et al. Expires October 7, 2006 [Page 23] Internet-Draft CalDAV April 2006 >> Response << HTTP/1.1 201 Created Cache-Control: no-cache Date: Fri, 11 Nov 2005 09:32:12 GMT Content-Length: 0 5.3.2. Creating Calendar Object Resources Clients populate calendar collections with calendar object resources. The URL for each calendar object resource is entirely arbitrary, and does not need to bear a specific relationship to the calendar object resource's iCalendar properties or other metadata. New calendar 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 calendar object resource. When servers create new resources, it's not hard for the server to choose an unmapped URI. 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 resource isn't created with a name collision. However, there is an HTTP feature to mitigate this. If the client intends to create a new non-collection resource, such as a new VEVENT, the client SHOULD use the HTTP request 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: *" request header ensures that the client will not inadvertently overwrite an existing resource, if the last path segment turned out to already be used. Daboo, et al. Expires October 7, 2006 [Page 24] Internet-Draft CalDAV April 2006 >> Request << PUT /home/lisa/calendars/events/qwue23489.ics HTTP/1.1 If-None-Match: * Host: cal.example.com Content-Type: text/calendar Content-Length: xxxx BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VEVENT UID:20010712T182145Z-123401@example.com DTSTAMP:20060712T182145Z DTSTART:20060714T170000Z DTEND:20060715T040000Z SUMMARY:Bastille Day Party END:VEVENT END:VCALENDAR >> Response << HTTP/1.1 201 Created Content-Length: 0 Date: Fri, 11 Nov 2005 09:32:12 GMT ETag: "123456789-000-111" The request to change an existing event is the same, but with a specific ETag in the "If-Match" header, rather than the "If-None- Match" header. As indicated in Section 3.10 of [RFC2445], the URL of calendar object resources containing (an arbitrary set of) calendaring and scheduling information may be suffixed by ".ics", and the URL of calendar object resources containing free or busy time information may be suffixed by ".ifb". 5.3.2.1. Additional Preconditions for PUT, COPY and MOVE This specification creates additional Preconditions (see Section 16 of [I-D.ietf-webdav-rfc2518bis] for PUT, COPY and MOVE methods. These preconditions apply: When a PUT operation of a calendar object resource into a calendar collection occurs. When a COPY or MOVE operation of a calendar object resource into a calendar collection occurs. Daboo, et al. Expires October 7, 2006 [Page 25] Internet-Draft CalDAV April 2006 The new preconditions are: (CALDAV:supported-calendar-data): The resource submitted in the PUT request, or targeted by a COPY or MOVE request MUST be a supported media type (i.e., iCalendar) for calendar object resources; (CALDAV:valid-calendar-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 iCalendar data); (CALDAV:valid-calendar-object-resource): The resource submitted in the PUT request, or targeted by a COPY or MOVE request MUST obey all restrictions specified in Section 4.1 (e.g., calendar object resources MUST NOT contain more than one type of calendar component, calendar object resources MUST NOT specify the iCalendar METHOD property, etc.); (CALDAV:supported-calendar-component): The resource submitted in the PUT request, or targeted by a COPY or MOVE request MUST contain a type of calendar component that is supported in the targeted calendar collection; (CALDAV:no-uid-conflict): The resource submitted in the PUT request, or targeted by a COPY or MOVE request MUST NOT specify an iCalendar UID property value already in use in the targeted calendar collection or overwrite an existing calendar 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; (CALDAV:calendar-collection-location-ok): In a COPY or MOVE request, when the Request-URI is a calendar collection, the Destination-URI MUST identify a location where a calendar collection can be created; (CALDAV: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 CALDAV:max-resource- size property value (Section 5.2.5) on the calendar collection where the resource will be stored; (CALDAV:min-date-time): The resource submitted in the PUT request, or targeted by a COPY or MOVE request MUST have all of its iCalendar date or time property values (for each recurring Daboo, et al. Expires October 7, 2006 [Page 26] Internet-Draft CalDAV April 2006 instance) greater than or equal to the value of the CALDAV:min- date-time property value (Section 5.2.6) on the calendar collection where the resource will be stored; (CALDAV:max-date-time): The resource submitted in the PUT request, or targeted by a COPY or MOVE request MUST have all of its iCalendar date or time property values (for each recurring instance) less than the value of the CALDAV:max-date-time property value (Section 5.2.7) on the calendar collection where the resource will be stored; (CALDAV:max-instances): The resource submitted in the PUT request, or targeted by a COPY or MOVE request MUST generate a number of recurring instances less than or equal to the value of the CALDAV: max-instances property value (Section 5.2.8) on the calendar collection where the resource will be stored; (CALDAV:max-attendees-per-instance): The resource submitted in the PUT request, or targeted by a COPY or MOVE request MUST have a number of ATTENDEE properties on any one instance less than or equal to the value of the CALDAV:max-attendees-per-instance property value (Section 5.2.9) on the calendar collection where the resource will be stored; 5.3.3. Non-standard components, properties and parameters iCalendar provides a "standard mechanism for doing non-standard things". This extension support allows implementers to make use of non-standard components, properties and parameters whose names are prefixed with the text "X-". Servers MUST support the use of non-standard components, properties and parameters in calendar object resources stored via the PUT method. Servers may need to enforce rules for their own "private" components, properties or parameters, so servers MAY reject any attempt by the client to change those or use values for those outside of any restrictions the server may have. Servers SHOULD ensure that any "private" components, properties or parameters it uses follow the convention of including a vendor id in the "X-" name as described in Section 4.2 of [RFC2445], e.g., "X-ABC-Private". 5.3.4. Calendar Object Resource Entity Tag The DAV:getetag property MUST be defined and set to a strong entity tag on all calendar object resources. Daboo, et al. Expires October 7, 2006 [Page 27] Internet-Draft CalDAV April 2006 A response to a GET request targeted at a calendar object resource MUST contain an ETag response header field indicating the current value of the strong entity tag of the calendar object resource. A response to a PUT request MAY contain an ETag response header field indicating the current value of the entity tag for the calendar object resource just created or modified. As required by [RFC2616], a response to a PUT request with a strong entity tag MUST mean that the server will return on a subsequent GET request a calendar object resource that is equivalent by octet equality. A response to a PUT request MUST NOT contain an ETag response header field if the server will return on a subsequent GET request a calendar object resource that is not equivalent by octet equality to the submitted calendar object resource. In this case, the client SHOULD retrieve the new entity (and ETag) as a basis for further changes, rather than use the entity it had sent with the PUT request. 6. Calendaring Access Control 6.1. Calendaring Privilege CalDAV 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. CalDAV servers MUST also support the calendaring privilege defined in this section. 6.1.1. CALDAV:read-free-busy Privilege Calendar users often wish to allow other users to see their busy time information, without viewing the other details of the calendar components (e.g., location, summary, attendees). This allows a significant amount of privacy while still allowing other users to schedule meetings at times when the user is likely to be free. The CALDAV:read-free-busy privilege controls which calendar collections and calendar object resources are examined when a CALDAV: free-busy-query REPORT request is processed (see Section 7.9). This privilege can be granted on calendar collections or calendar object resources. Servers MUST support this privilege on all calendar collections and calendar object resources. Daboo, et al. Expires October 7, 2006 [Page 28] Internet-Draft CalDAV April 2006 The CALDAV:read-free-busy privilege MUST be aggregated in the DAV: read privilege. Servers MUST allow the CALDAV:read-free-busy to be granted without the DAV:read privilege being granted. Clients should note that when only the CALDAV:read-free-busy privilege has been granted on a resource, this does not imply access to GET, HEAD, OPTIONS and PROPFIND on the resource -- those operations are governed by the DAV:read privilege. 6.2. Additional Principal Property This section defines an additional property for WebDAV principal resources as defined in [RFC3744]. 6.2.1. CALDAV:calendar-home-set Property Name: calendar-home-set Namespace: urn:ietf:params:xml:ns:caldav Purpose: Identifies the URL of any WebDAV collections that contain calendar collections owned by the associated principal resource. Conformance: This property MAY be defined in a principal resource. If defined, it MAY be protected and SHOULD NOT be returned by a PROPFIND DAV:allprop request (as defined in Section 14.2 of [I-D.ietf-webdav-rfc2518bis]). Support for this property is RECOMMENDED. Description: The CALDAV:calendar-home-set property is meant to allow users to easily find the calendar collections owned by the principal. Typically, users will group all the calendar collections that they own under a common collection. This property specifies the URL of collections that either are calendar collections or ordinary collections that have child or descendant calendar collections owned by the principal. Definition: Example: http://cal.example.com/home/bernard/calendars/ Daboo, et al. Expires October 7, 2006 [Page 29] Internet-Draft CalDAV April 2006 7. Calendaring Reports This section defines the REPORTs that CalDAV servers MUST support on calendar collections and calendar object resources. CalDAV servers MUST advertise support for these REPORTs on all calendar collections and calendar object resources with the DAV: supported-report-set property defined in Section 3.1.5 of [RFC3253]. CalDAV servers MAY also advertise support for these REPORTs on ordinary collections. Some of these REPORTs allow calendar data (from possibly multiple resources) to be returned. 7.1. REPORT Method The REPORT method (defined in Section 3.6 of [RFC3253]) provides an extensible mechanism for obtaining information about one or more resources. 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. CalDAV servers MUST support the DAV:expand-property REPORT defined in Section 3.8 of [RFC3253]. 7.2. Ordinary collections Servers MAY support the REPORTs defined in this document on ordinary collections (collections that are not calendar collections) in addition to calendar collections or calendar object resources. In computing responses to the REPORTs on ordinary collections, servers MUST only consider calendar object resources contained in calendar collections that are targeted by the REPORT based on the value of the Depth request header. 7.3. Date and floating time iCalendar provides a way to specify DATE and DATE-TIME values that are not bound to any time zone in particular, hereafter called "floating date" and "floating time" respectively. These values are used to represent the same day, hour, minute and second value regardless of which time zone is being observed. For instance, the DATE value "20051111", represents November 11th, 2005 in no specific time zone, while the DATE-TIME value "20051111T111100" represents Daboo, et al. Expires October 7, 2006 [Page 30] Internet-Draft CalDAV April 2006 November 11th, 2005 at 11:11 AM in no specific time zone. CalDAV servers may need to convert "floating date" and "floating time" values in date with UTC time values in the processing of calendaring REPORT requests. For the CALDAV:calendar-query REPORT, CalDAV servers MUST rely on the value of the CALDAV:timezone XML element, if specified as part of the request body, to perform the proper conversion of "floating date" and "floating time" values to date with UTC time values. If the CALDAV: timezone XML element is not specified in the request body, CalDAV servers MUST rely on the value of the CALDAV:calendar-timezone property, if defined, else the CalDAV servers MAY rely on the time zone of their choice. For the CALDAV:free-busy-query REPORT, CalDAV servers MUST rely on the value of the CALDAV:calendar-timezone property, if defined, to compute the proper FREEBUSY time period value as date with UTC time, for calendar components scheduled with "floating date" or "floating time". If the CALDAV:calendar-timezone property is not defined, CalDAV servers MAY rely on the time zone of their choice. 7.4. Time range filtering Some of the reports defined in this section can include a time range filter that is used to restrict the set of calendar object resources returned to just those that overlap the specified time range. The time range filter can be applied to a calendar component as a whole, or to specific calendar component properties with date or date-time value types. To determine whether a calendar object resource matches the time range filter element, the start and end times for the targeted component or property are determined and then compared to the requested time range. If there is an overlap with the requested time range, then the calendar object resource matches the filter element. The rules defined in [RFC2445] for determining the actual start and end times of calendar components MUST be used, and these are fully enumerated in Section 9.8 of this document. When such time range filtering is used, special consideration must be given to recurring calendar components such as VEVENT and VTODO components. The server MUST expand recurring components to determine whether any recurrence instances overlap the specified time range. If one or more recurrence instances overlap the time range, then the calendar object resource matches the filter element. Daboo, et al. Expires October 7, 2006 [Page 31] Internet-Draft CalDAV April 2006 7.5. Partial Retrieval Some calendaring REPORTs defined in this document allow partial retrieval of calendar object resources. A CalDAV client MAY specify what information to return in the body of a calendaring REPORT request. A CalDAV client MAY request particular WebDAV property values, all WebDAV property values, or a list of the names of the resource's WebDAV properties. A CalDAV client MAY also request calendar data to be returned and whether all calendar components and properties should be returned or only particular ones. See CALDAV:calendar-data in Section 9.5. By default, the returned calendar data will include the component that defines the recurrence set, referred to as the "master component", as well as the components that define exceptions to the recurrence set, referred to as the "overridden components". A CalDAV client only interested in the recurrence instances that overlap a specified time range MAY request to receive only the "master component" along with the "overridden components" that impact the specified time range and thus limit the data returned by the server. See CALDAV:limit-recurrence-set in Section 9.5.6. An overridden component impacts a time range if its current start and end times overlap the time range, or if the original start and end times - the ones that would have been used if the instance were not overridden - overlap the time range. A CalDAV client with no support for recurrence properties (i.e., EXDATE, EXRULE, RDATE and RRULE) and possibly VTIMEZONE components, or a client not willing to perform recurrence expansion because of limited processing capability MAY request to receive only the recurrence instances that overlap a specified time range as separate calendar components that each define exactly one recurrence instance. See CALDAV:expand in Section 9.5.5. Finally, in the case of VFREEBUSY components, a CalDAV client MAY request to receive only the FREEBUSY property values that overlap a specified time range. See CALDAV:limit-freebusy-set in Section 9.5.7. 7.6. Non-standard components, properties and parameters Servers MUST support the use of non-standard component, property or parameter names in the CALDAV:calendar-data XML element in calendaring REPORT requests to allow clients to request that non- standard components, properties and parameters be returned in the Daboo, et al. Expires October 7, 2006 [Page 32] Internet-Draft CalDAV April 2006 calendar data provided in the response. Servers MAY support the use of non-standard component, property or parameter names in the CALDAV:comp-filter, CALDAV:prop-filter and CALDAV:param-filter XML elements specified in the CALDAV:filter XML element of calendaring REPORT requests. Servers MUST fail with the CALDAV:supported-filter precondition if a calendaring REPORT request uses a CALDAV:comp-filter, CALDAV:prop- filter or CALDAV:param-filter XML element that makes reference to a non-standard component, property or parameter name which the server does not support queries on. 7.7. CALDAV:calendar-query Report The CALDAV:calendar-query REPORT performs a search for all calendar object resources that match a specified filter. The response of this REPORT will contain all the WebDAV properties and calendar object resource data specified in the request. In the case of the CALDAV: calendar-data XML element, one can explicitly specify the calendar components and properties that should be returned in the calendar 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 CALDAV:calendar-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 CALDAV:calendar-query REPORT is REQUIRED. Marshalling: The request body MUST be a CALDAV:calendar-query XML element as defined in Section 9.4. 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 Daboo, et al. Expires October 7, 2006 [Page 33] Internet-Draft CalDAV April 2006 empty. The response body for a successful CALDAV:calendar-query REPORT request MUST contain a DAV:response element for each iCalendar object that matched the search filter. Calendar data is being returned in the CALDAV:calendar-data XML element inside the DAV: propstat XML element. Preconditions: (CALDAV:supported-calendar-data): The attributes "content-type" and "version" of the CALDAV:calendar-data XML element (see Section 9.5) specify a media type supported by the server for calendar object resources. (CALDAV:valid-filter): The CALDAV:filter XML element (see Section 9.6) specified in the REPORT request MUST be valid. For instance, a CALDAV:filter cannot nest a element in a element, or a CALDAV:filter cannot nest a element in a element. (CALDAV:supported-filter): The CALDAV:comp-filter (see Section 9.6.1), CALDAV:prop-filter (see Section 9.6.2) and CALDAV: param-filter (see Section 9.6.3) XML elements used in the CALDAV: filter XML element (see Section 9.6) in the REPORT request only make reference to components, properties and parameters for which queries are supported by the server. i.e., if the CALDAV:filter element attempts to reference an unsupported component, property or parameter, this precondition is violated. Servers SHOULD report the CALDAV:comp-filter, CALDAV:prop-filter or CALDAV:param- filter for which it does not provide support. (CALDAV:valid-calendar-data): The time zone specified in the REPORT request MUST be a valid iCalendar object containing a single valid VTIMEZONE component. (CALDAV:min-date-time): Any XML element specifying a range of time MUST have its start or end date or time values greater than or equal to the value of the CALDAV:min-date-time property value (Section 5.2.6) on the calendar collections being targeted by the REPORT; Daboo, et al. Expires October 7, 2006 [Page 34] Internet-Draft CalDAV April 2006 (CALDAV:max-date-time): Any XML element specifying a range of time MUST have its start or end date or time values less than or equal to the value of the CALDAV:max-date-time property value (Section 5.2.7) on the calendar collections being targeted by the REPORT; Postconditions: (DAV:number-of-matches-within-limits): The number of matching calendar 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. 7.7.1. Example: Partial retrieval of events by time range In this example, the client requests the server to return specific components and properties of the VEVENT components that overlap the time range from January 4th, 2006 at 00:00:00 AM UTC to January 5th, 2006 at 00:00:00 AM UTC. In addition the DAV:getetag property is also requested and returned as part of the response. Note that the first calendar object returned is a recurring event whose first instance lies outside of the requested time range, but whose third instance does overlap the time range. Note that due to the CALDAV: calendar-data element restrictions, the DTSTAMP property in VEVENT components has not been returned, and the only property returned in the VCALENDAR object is VERSION. See Appendix B for the calendar data being targeted by this example. Daboo, et al. Expires October 7, 2006 [Page 35] Internet-Draft CalDAV April 2006 >> Request << REPORT /bernard/work/ HTTP/1.1 Host: cal.example.com Depth: 1 Content-Type: application/xml; charset="utf-8" Content-Length: xxxx >> Response << HTTP/1.1 207 Multi-Status Date: Fri, 11 Nov 2005 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx Daboo, et al. Expires October 7, 2006 [Page 36] Internet-Draft CalDAV April 2006 http://cal.example.com/bernard/work/abcd2.ics "fffff-abcd2" BEGIN:VCALENDAR VERSION:2.0 BEGIN:VTIMEZONE LAST-MODIFIED:20040110T032845Z TZID:US/Eastern BEGIN:DAYLIGHT DTSTART:20000404T020000 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 TZNAME:EDT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 END:DAYLIGHT BEGIN:STANDARD DTSTART:20001026T020000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 TZNAME:EST TZOFFSETFROM:-0400 TZOFFSETTO:-0500 END:STANDARD END:VTIMEZONE BEGIN:VEVENT DTSTART;TZID=US/Eastern:20060102T120000 DURATION:PT1H RRULE:FREQ=DAILY;COUNT=5 SUMMARY:Event #2 UID:00959BC664CA650E933C892C@example.com END:VEVENT BEGIN:VEVENT DTSTART;TZID=US/Eastern:20060104T140000 DURATION:PT1H RECURRENCE-ID;TZID=US/Eastern:20060104T120000 SUMMARY:Event #2 bis UID:00959BC664CA650E933C892C@example.com END:VEVENT BEGIN:VEVENT DTSTART;TZID=US/Eastern:20060106T140000 DURATION:PT1H RECURRENCE-ID;TZID=US/Eastern:20060106T120000 SUMMARY:Event #2 bis bis UID:00959BC664CA650E933C892C@example.com Daboo, et al. Expires October 7, 2006 [Page 37] Internet-Draft CalDAV April 2006 END:VEVENT END:VCALENDAR HTTP/1.1 200 OK http://cal.example.com/bernard/work/abcd3.ics "fffff-abcd3" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTIMEZONE LAST-MODIFIED:20040110T032845Z TZID:US/Eastern BEGIN:DAYLIGHT DTSTART:20000404T020000 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 TZNAME:EDT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 END:DAYLIGHT BEGIN:STANDARD DTSTART:20001026T020000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 TZNAME:EST TZOFFSETFROM:-0400 TZOFFSETTO:-0500 END:STANDARD END:VTIMEZONE BEGIN:VEVENT DTSTART;TZID=US/Eastern:20060104T100000 DURATION:PT1H SUMMARY:Event #3 UID:DC6C50A017428C5216A2F1CD@example.com END:VEVENT END:VCALENDAR HTTP/1.1 200 OK Daboo, et al. Expires October 7, 2006 [Page 38] Internet-Draft CalDAV April 2006 7.7.2. Example: Partial retrieval of recurring events In this example, the client requests the server to return VEVENT components that overlap the time range from January 3rd, 2006 at 00: 00:00 AM UTC to January 5th, 2006 at 00:00:00 AM UTC. Use of the CALDAV:limit-recurrence-set element causes the server to only return overridden recurrence components that overlap the time range specified in that element, or that affect other instances that overlap the time range (e.g., in the case of a "THISANDFUTURE" behavior). In this example the first overridden component in the matching resource is returned but the second one is not. See Appendix B for the calendar data being targeted by this example. >> Request << REPORT /bernard/work/ HTTP/1.1 Host: cal.example.com Depth: 1 Content-Type: application/xml; charset="utf-8" Content-Length: xxxx >> Response << HTTP/1.1 207 Multi-Status Date: Fri, 11 Nov 2006 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx Daboo, et al. Expires October 7, 2006 [Page 39] Internet-Draft CalDAV April 2006 http://cal.example.com/bernard/work/abcd2.ics "fffff-abcd2" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTIMEZONE LAST-MODIFIED:20040110T032845Z TZID:US/Eastern BEGIN:DAYLIGHT DTSTART:20000404T020000 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 TZNAME:EDT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 END:DAYLIGHT BEGIN:STANDARD DTSTART:20001026T020000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 TZNAME:EST TZOFFSETFROM:-0400 TZOFFSETTO:-0500 END:STANDARD END:VTIMEZONE BEGIN:VEVENT DTSTAMP:20060206T001121Z DTSTART;TZID=US/Eastern:20060102T120000 DURATION:PT1H RRULE:FREQ=DAILY;COUNT=5 SUMMARY:Event #2 UID:00959BC664CA650E933C892C@example.com END:VEVENT BEGIN:VEVENT DTSTAMP:20060206T001121Z DTSTART;TZID=US/Eastern:20060104T140000 DURATION:PT1H RECURRENCE-ID;TZID=US/Eastern:20060104T120000 SUMMARY:Event #2 bis UID:00959BC664CA650E933C892C@example.com END:VEVENT END:VCALENDAR Daboo, et al. Expires October 7, 2006 [Page 40] Internet-Draft CalDAV April 2006 HTTP/1.1 200 OK http://cal.example.com/bernard/work/abcd3.ics "fffff-abcd3" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTIMEZONE LAST-MODIFIED:20040110T032845Z TZID:US/Eastern BEGIN:DAYLIGHT DTSTART:20000404T020000 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 TZNAME:EDT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 END:DAYLIGHT BEGIN:STANDARD DTSTART:20001026T020000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 TZNAME:EST TZOFFSETFROM:-0400 TZOFFSETTO:-0500 END:STANDARD END:VTIMEZONE BEGIN:VEVENT ATTENDEE;PARTSTAT=ACCEPTED;ROLE=CHAIR:mailto:cyrus@example.com ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:lisa@example.com DTSTAMP:20060206T001220Z DTSTART;TZID=US/Eastern:20060104T100000 DURATION:PT1H LAST-MODIFIED:20060206T001330Z ORGANIZER:mailto:cyrus@example.com SEQUENCE:1 STATUS:TENTATIVE SUMMARY:Event #3 UID:DC6C50A017428C5216A2F1CD@example.com X-ABC-GUID:E1CX5Dr-0007ym-Hz@example.com END:VEVENT END:VCALENDAR HTTP/1.1 200 OK Daboo, et al. Expires October 7, 2006 [Page 41] Internet-Draft CalDAV April 2006 7.7.3. Example: Expanded retrieval of recurring events In this example, the client requests the server to return VEVENT components that overlap the time range from January 2nd, 2006 at 00: 00:00 AM UTC to January 5th, 2006 at 00:00:00 AM UTC and to return recurring calendar components expanded into individual recurrence instance calendar components. Use of the CALDAV:expand element causes the server to only return overridden recurrence instances that overlap the time range specified in that element. See Appendix B for the calendar data being targeted by this example. >> Request << REPORT /bernard/work/ HTTP/1.1 Host: cal.example.com Depth: 1 Content-Type: application/xml; charset="utf-8" Content-Length: xxxx >> Response << HTTP/1.1 207 Multi-Status Date: Fri, 11 Nov 2006 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx Daboo, et al. Expires October 7, 2006 [Page 42] Internet-Draft CalDAV April 2006 http://cal.example.com/bernard/work/abcd2.ics "fffff-abcd2" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VEVENT DTSTAMP:20060206T001121Z DTSTART:20060103T170000 DURATION:PT1H RECURRENCE-ID:20060103T170000 SUMMARY:Event #2 UID:00959BC664CA650E933C892C@example.com END:VEVENT BEGIN:VEVENT DTSTAMP:20060206T001121Z DTSTART:20060104T190000 DURATION:PT1H RECURRENCE-ID:20060104T170000 SUMMARY:Event #2 bis UID:00959BC664CA650E933C892C@example.com END:VEVENT END:VCALENDAR HTTP/1.1 200 OK http://cal.example.com/bernard/work/abcd3.ics "fffff-abcd3" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VEVENT ATTENDEE;PARTSTAT=ACCEPTED;ROLE=CHAIR:mailto:cyrus@example.com ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:lisa@example.com DTSTAMP:20060206T001220Z DTSTART:20060104T150000 DURATION:PT1H LAST-MODIFIED:20060206T001330Z Daboo, et al. Expires October 7, 2006 [Page 43] Internet-Draft CalDAV April 2006 ORGANIZER:mailto:cyrus@example.com SEQUENCE:1 STATUS:TENTATIVE SUMMARY:Event #3 UID:DC6C50A017428C5216A2F1CD@example.com X-ABC-GUID:E1CX5Dr-0007ym-Hz@example.com END:VEVENT END:VCALENDAR HTTP/1.1 200 OK 7.7.4. Example: Partial retrieval of stored free busy components In this example, the client requests the server to return the VFREEBUSY components that have free busy information that overlap the time range from January 2nd, 2006 at 00:00:00 AM UTC (inclusively) to January 3rd, 2006 at 00:00:00 AM UTC (exclusively). Use of the CALDAV:limit-freebusy-set element causes the server to only return the FREEBUSY property values that overlap the time range specified in that element. Note that this is not an example of discovering when the calendar owner is busy. See Appendix B for the calendar data being targeted by this example. Daboo, et al. Expires October 7, 2006 [Page 44] Internet-Draft CalDAV April 2006 >> Request << REPORT /bernard/work/ HTTP/1.1 Host: cal.example.com Depth: 1 Content-Type: application/xml; charset="utf-8" Content-Length: xxxx Daboo, et al. Expires October 7, 2006 [Page 45] Internet-Draft CalDAV April 2006 >> Response << HTTP/1.1 207 Multi-Status Date: Fri, 11 Nov 2006 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx http://cal.example.com/bernard/work/abcd8.ics "fffff-abcd8" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VFREEBUSY ORGANIZER;CN="Bernard Desruisseaux":mailto:bernard@example.com UID:76ef34-54a3d2@example.com DTSTAMP:20050530T123421Z DTSTART:20060101T100000Z DTEND:20060108T100000Z FREEBUSY;FBTYPE=BUSY-TENTATIVE:20060102T100000Z/20060102T120000Z END:VFREEBUSY END:VCALENDAR HTTP/1.1 200 OK 7.7.5. Example: Retrieval of to-dos by alarm time range In this example, the client requests the server to return the VTODO components that have an alarm trigger scheduled in the specified time range. See Appendix B for the calendar data being targeted by this example. Daboo, et al. Expires October 7, 2006 [Page 46] Internet-Draft CalDAV April 2006 >> Request << REPORT /bernard/work/ HTTP/1.1 Host: cal.example.com Depth: 1 Content-Type: application/xml; charset="utf-8" Content-Length: xxxx Daboo, et al. Expires October 7, 2006 [Page 47] Internet-Draft CalDAV April 2006 >> Response << HTTP/1.1 207 Multi-Status Date: Fri, 11 Nov 2006 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx http://cal.example.com/bernard/work/abcd4.ics "fffff-abcd4" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTODO DTSTAMP:20060205T235300Z DUE;TZID=US/Eastern:20060106T120000 LAST-MODIFIED:20060205T235308Z SEQUENCE:1 STATUS:NEEDS-ACTION SUMMARY:Task #2 UID:E10BA47467C5C69BB74E8720@example.com BEGIN:VALARM ACTION:AUDIO TRIGGER;RELATED=START:-PT10M END:VALARM END:VTODO END:VCALENDAR HTTP/1.1 200 OK 7.7.6. Example: Retrieval of event by UID In this example, the client requests the server to return the VEVENT component that has the UID property set to "DC6C50A017428C5216A2F1CD@example.com". See Appendix B for the calendar data being targeted by this example. Daboo, et al. Expires October 7, 2006 [Page 48] Internet-Draft CalDAV April 2006 >> Request << REPORT /bernard/work/ HTTP/1.1 Host: cal.example.com Depth: 1 Content-Type: application/xml; charset="utf-8" Content-Length: xxxx DC6C50A017428C5216A2F1CD@example.com >> Response << HTTP/1.1 207 Multi-Status Date: Fri, 11 Nov 2006 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx http://cal.example.com/bernard/work/abcd3.ics "fffff-abcd3" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTIMEZONE LAST-MODIFIED:20040110T032845Z TZID:US/Eastern BEGIN:DAYLIGHT Daboo, et al. Expires October 7, 2006 [Page 49] Internet-Draft CalDAV April 2006 DTSTART:20000404T020000 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 TZNAME:EDT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 END:DAYLIGHT BEGIN:STANDARD DTSTART:20001026T020000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 TZNAME:EST TZOFFSETFROM:-0400 TZOFFSETTO:-0500 END:STANDARD END:VTIMEZONE BEGIN:VEVENT ATTENDEE;PARTSTAT=ACCEPTED;ROLE=CHAIR:mailto:cyrus@example.com ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:lisa@example.com DTSTAMP:20060206T001220Z DTSTART;TZID=US/Eastern:20060104T100000 DURATION:PT1H LAST-MODIFIED:20060206T001330Z ORGANIZER:mailto:cyrus@example.com SEQUENCE:1 STATUS:TENTATIVE SUMMARY:Event #3 UID:DC6C50A017428C5216A2F1CD@example.com X-ABC-GUID:E1CX5Dr-0007ym-Hz@example.com END:VEVENT END:VCALENDAR HTTP/1.1 200 OK 7.7.7. Example: Retrieval of events by PARTSTAT In this example, the client requests the server to return the VEVENT components that have the ATTENDEE property with the value "mailto:lisa@example.com" and for which the PARTSTAT parameter is set to "NEEDS-ACTION". See Appendix B for the calendar data being targeted by this example. Daboo, et al. Expires October 7, 2006 [Page 50] Internet-Draft CalDAV April 2006 >> Request << REPORT /bernard/work/ HTTP/1.1 Host: cal.example.com Depth: 1 Content-Type: application/xml; charset="utf-8" Content-Length: xxxx mailto:lisa@example.com NEEDS-ACTION >> Response << HTTP/1.1 207 Multi-Status Date: Fri, 11 Nov 2006 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx http://cal.example.com/bernard/work/abcd3.ics "fffff-abcd3" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTIMEZONE Daboo, et al. Expires October 7, 2006 [Page 51] Internet-Draft CalDAV April 2006 LAST-MODIFIED:20040110T032845Z TZID:US/Eastern BEGIN:DAYLIGHT DTSTART:20000404T020000 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 TZNAME:EDT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 END:DAYLIGHT BEGIN:STANDARD DTSTART:20001026T020000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 TZNAME:EST TZOFFSETFROM:-0400 TZOFFSETTO:-0500 END:STANDARD END:VTIMEZONE BEGIN:VEVENT ATTENDEE;PARTSTAT=ACCEPTED;ROLE=CHAIR:mailto:cyrus@example.com ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:lisa@example.com DTSTAMP:20060206T001220Z DTSTART;TZID=US/Eastern:20060104T100000 DURATION:PT1H LAST-MODIFIED:20060206T001330Z ORGANIZER:mailto:cyrus@example.com SEQUENCE:1 STATUS:TENTATIVE SUMMARY:Event #3 UID:DC6C50A017428C5216A2F1CD@example.com X-ABC-GUID:E1CX5Dr-0007ym-Hz@example.com END:VEVENT END:VCALENDAR HTTP/1.1 200 OK 7.7.8. Example: Retrieval of events only In this example, the client requests the server to return all VEVENT components. See Appendix B for the calendar data being targeted by this example. Daboo, et al. Expires October 7, 2006 [Page 52] Internet-Draft CalDAV April 2006 >> Request << REPORT /bernard/work/ HTTP/1.1 Host: cal.example.com Depth: 1 Content-Type: application/xml; charset="utf-8" Content-Length: xxxx >> Response << HTTP/1.1 207 Multi-Status Date: Fri, 11 Nov 2006 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx http://cal.example.com/bernard/work/abcd1.ics "fffff-abcd1" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTIMEZONE LAST-MODIFIED:20040110T032845Z TZID:US/Eastern BEGIN:DAYLIGHT DTSTART:20000404T020000 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 TZNAME:EDT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 Daboo, et al. Expires October 7, 2006 [Page 53] Internet-Draft CalDAV April 2006 END:DAYLIGHT BEGIN:STANDARD DTSTART:20001026T020000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 TZNAME:EST TZOFFSETFROM:-0400 TZOFFSETTO:-0500 END:STANDARD END:VTIMEZONE BEGIN:VEVENT DTSTAMP:20060206T001102Z DTSTART;TZID=US/Eastern:20060102T100000 DURATION:PT1H SUMMARY:Event #1 Description:Go Steelers! UID:74855313FA803DA593CD579A@example.com END:VEVENT END:VCALENDAR HTTP/1.1 200 OK http://cal.example.com/bernard/work/abcd2.ics "fffff-abcd2" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTIMEZONE LAST-MODIFIED:20040110T032845Z TZID:US/Eastern BEGIN:DAYLIGHT DTSTART:20000404T020000 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 TZNAME:EDT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 END:DAYLIGHT BEGIN:STANDARD DTSTART:20001026T020000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 TZNAME:EST TZOFFSETFROM:-0400 TZOFFSETTO:-0500 END:STANDARD Daboo, et al. Expires October 7, 2006 [Page 54] Internet-Draft CalDAV April 2006 END:VTIMEZONE BEGIN:VEVENT DTSTAMP:20060206T001121Z DTSTART;TZID=US/Eastern:20060102T120000 DURATION:PT1H RRULE:FREQ=DAILY;COUNT=5 SUMMARY:Event #2 UID:00959BC664CA650E933C892C@example.com END:VEVENT BEGIN:VEVENT DTSTAMP:20060206T001121Z DTSTART;TZID=US/Eastern:20060104T140000 DURATION:PT1H RECURRENCE-ID;TZID=US/Eastern:20060104T120000 SUMMARY:Event #2 bis UID:00959BC664CA650E933C892C@example.com END:VEVENT BEGIN:VEVENT DTSTAMP:20060206T001121Z DTSTART;TZID=US/Eastern:20060106T140000 DURATION:PT1H RECURRENCE-ID;TZID=US/Eastern:20060106T120000 SUMMARY:Event #2 bis bis UID:00959BC664CA650E933C892C@example.com END:VEVENT END:VCALENDAR HTTP/1.1 200 OK http://cal.example.com/bernard/work/abcd3.ics "fffff-abcd3" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTIMEZONE LAST-MODIFIED:20040110T032845Z TZID:US/Eastern BEGIN:DAYLIGHT DTSTART:20000404T020000 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 TZNAME:EDT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 Daboo, et al. Expires October 7, 2006 [Page 55] Internet-Draft CalDAV April 2006 END:DAYLIGHT BEGIN:STANDARD DTSTART:20001026T020000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 TZNAME:EST TZOFFSETFROM:-0400 TZOFFSETTO:-0500 END:STANDARD END:VTIMEZONE BEGIN:VEVENT ATTENDEE;PARTSTAT=ACCEPTED;ROLE=CHAIR:mailto:cyrus@example.com ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:lisa@example.com DTSTAMP:20060206T001220Z DTSTART;TZID=US/Eastern:20060104T100000 DURATION:PT1H LAST-MODIFIED:20060206T001330Z ORGANIZER:mailto:cyrus@example.com SEQUENCE:1 STATUS:TENTATIVE SUMMARY:Event #3 UID:DC6C50A017428C5216A2F1CD@example.com X-ABC-GUID:E1CX5Dr-0007ym-Hz@example.com END:VEVENT END:VCALENDAR HTTP/1.1 200 OK 7.7.9. Example: Retrieval of all pending to-dos In this example, the client requests the server to return all VTODO components that do not include a "COMPLETED" property and do not have a "STATUS" property value matching "CANCELLED". i.e., VTODOs that still need to be worked on. See Appendix B for the calendar data being targeted by this example. Daboo, et al. Expires October 7, 2006 [Page 56] Internet-Draft CalDAV April 2006 >> Request << REPORT /bernard/work/ HTTP/1.1 Host: cal.example.com Depth: 1 Content-Type: application/xml; charset="utf-8" Content-Length: xxxx CANCELLED >> Response << HTTP/1.1 207 Multi-Status Date: Fri, 11 Nov 2006 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx http://cal.example.com/bernard/work/abcd4.ics "fffff-abcd4" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTODO Daboo, et al. Expires October 7, 2006 [Page 57] Internet-Draft CalDAV April 2006 DTSTAMP:20060205T235335Z DUE;VALUE=DATE:20060104 STATUS:NEEDS-ACTION SUMMARY:Task #1 UID:DDDEEB7915FA61233B861457@example.com BEGIN:VALARM ACTION:AUDIO TRIGGER;RELATED=START:-PT10M END:VALARM END:VTODO END:VCALENDAR HTTP/1.1 200 OK http://cal.example.com/bernard/work/abcd5.ics "fffff-abcd5" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTODO DTSTAMP:20060205T235300Z DUE;VALUE=DATE:20060106 LAST-MODIFIED:20060205T235308Z SEQUENCE:1 STATUS:NEEDS-ACTION SUMMARY:Task #2 UID:E10BA47467C5C69BB74E8720@example.com BEGIN:VALARM ACTION:AUDIO TRIGGER;RELATED=START:-PT10M END:VALARM END:VTODO END:VCALENDAR HTTP/1.1 200 OK Daboo, et al. Expires October 7, 2006 [Page 58] Internet-Draft CalDAV April 2006 7.7.10. Example: Attempt to query unsupported property In this example, the client requests the server to return all VEVENT components that include an "X-ABC-GUID" property with a value matching "ABC". However, the server does not support querying that non-standard property and instead returns and error response. See Appendix B for the calendar data being targeted by this example. >> Request << REPORT /bernard/work/ HTTP/1.1 Host: cal.example.com Depth: 1 Content-Type: application/xml; charset="utf-8" Content-Length: xxxx ABC >> Response << HTTP/1.1 403 Forbidden Date: Fri, 11 Nov 2005 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx Daboo, et al. Expires October 7, 2006 [Page 59] Internet-Draft CalDAV April 2006 7.8. CALDAV:calendar-multiget Report The CALDAV:calendar-multiget REPORT is used to retrieve specific calendar object resources from within a collection, if the Request- URI is a collection, or to retrieve a specific calendar object resource, if the Request-URI is a calendar object resource. This REPORT is similar to the CALDAV:calendar-query REPORT (see Section 7.7), except that it takes a list of DAV:href elements instead of a CALDAV:filter element to determine which calendar object resources to return. Support for the calendar-multiget REPORT is REQUIRED. Marshalling: The request body MUST be a CALDAV:calendar-multiget XML element (see Section 9.9). If the Request-URI is a collection resource, then the DAV:href elements MUST refer to calendar object resources within that collection, and they MAY refer to calendar object 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 CALDAV:calendar-multiget REPORT request MUST contain a DAV:response element for each calendar object resource referenced by the provided set of DAV:href elements. Calendar data is being returned in the CALDAV:calendar- 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: (CALDAV:supported-calendar-data): The attributes "content-type" and "version" of the CALDAV:calendar-data XML elements (see Section 9.5) specify a media type supported by the server for calendar object resources. (CALDAV:min-date-time): Any XML element specifying a range of time MUST have its start or end date or time values greater than or Daboo, et al. Expires October 7, 2006 [Page 60] Internet-Draft CalDAV April 2006 equal to the value of the CALDAV:min-date-time property value (Section 5.2.6) on the calendar collections being targeted by the REPORT; (CALDAV:max-date-time): Any XML element specifying a range of time MUST have its start or end date or time values less than or equal to the value of the CALDAV:max-date-time property value (Section 5.2.7) on the calendar collections being targeted by the REPORT; Postconditions: None. 7.8.1. Example: Successful CALDAV:calendar-multiget Report In this example, the client requests the server to return specific properties of the VEVENT 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://cal.example.com/bernard/work/mtg1.ics does not exist, resulting in an error status response. See Appendix B for the calendar data being targeted by this example. >> Request << REPORT /bernard/work/ HTTP/1.1 Host: cal.example.com Content-Type: application/xml; charset="utf-8" Content-Length: xxxx /bernard/work/abcd1.ics /bernard/work/mtg1.ics >> Response << HTTP/1.1 207 Multi-Status Date: Fri, 11 Nov 2006 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Daboo, et al. Expires October 7, 2006 [Page 61] Internet-Draft CalDAV April 2006 Content-Length: xxxx http://cal.example.com/bernard/work/abcd1.ics "fffff-abcd1" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VTIMEZONE LAST-MODIFIED:20040110T032845Z TZID:US/Eastern BEGIN:DAYLIGHT DTSTART:20000404T020000 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 TZNAME:EDT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 END:DAYLIGHT BEGIN:STANDARD DTSTART:20001026T020000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 TZNAME:EST TZOFFSETFROM:-0400 TZOFFSETTO:-0500 END:STANDARD END:VTIMEZONE BEGIN:VEVENT DTSTAMP:20060206T001102Z DTSTART;TZID=US/Eastern:20060102T100000 DURATION:PT1H SUMMARY:Event #1 Description:Go Steelers! UID:74855313FA803DA593CD579A@example.com END:VEVENT END:VCALENDAR HTTP/1.1 200 OK http://cal.example.com/bernard/work/mtg1.ics HTTP/1.1 404 Not Found Daboo, et al. Expires October 7, 2006 [Page 62] Internet-Draft CalDAV April 2006 7.9. CALDAV:free-busy-query Report The CALDAV:free-busy-query REPORT generates a VFREEBUSY component containing free busy information for all the calendar object resources targeted by the request and which have the CALDAV:read- free-busy or DAV:read privilege granted to the current user. Only VEVENT components without a TRANSP property or with the TRANSP property set to "OPAQUE", and VFREEBUSY components SHOULD be considered to generate the free busy time information. In the case of VEVENT components, the free or busy time type (FBTYPE) of the FREEBUSY properties in the returned VFREEBUSY component SHOULD be derived from the value of the TRANSP and STATUS properties as outlined in the table below: +---------------------------++------------------+ | VEVENT || VFREEBUSY | +-------------+-------------++------------------+ | TRANSP | STATUS || FBTYPE | +=============+=============++==================+ | | CONFIRMED || BUSY | | | (default) || | | OPAQUE +-------------++------------------+ | (default) | CANCELLED || FREE | | +-------------++------------------+ | | TENTATIVE || BUSY-TENTATIVE | | +-------------++------------------+ | | x-name || BUSY or | | | || x-name | +-------------+-------------++------------------+ | | CONFIRMED || | | TRANSPARENT | CANCELLED || FREE | | | TENTATIVE || | | | x-name || | +-------------+-------------++------------------+ Duplicate busy time periods with the same FBTYPE parameter value SHOULD NOT be specified in the returned VFREEBUSY component. Servers SHOULD coalesce consecutive or overlapping busy time period of the same type. Busy time periods with different FBTYPE parameter values MAY overlap. Support for the CALDAV:free-busy-query REPORT is REQUIRED. Daboo, et al. Expires October 7, 2006 [Page 63] Internet-Draft CalDAV April 2006 Marshalling: The request body MUST be a CALDAV:free-busy-query XML element (see Section 9.10, which MUST contain exactly one CALDAV:time-range XML element, as defined in Section 9.8. 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 an iCalendar object that contains exactly one VFREEBUSY component that describes the busy time intervals for the calendar object resources containing VEVENT or VFREEBUSY components that satisfy the Depth value and for which the current user is at least granted the CALDAV:read-free-busy privilege. If no calendar object resources are found to satisfy these conditions a VFREEBUSY component with no FREEBUSY property MUST be returned. This REPORT only returns busy time information. Free time information can be inferred from the returned busy time information. If the current user is not granted the CALDAV:read-free-busy or DAV:read privileges on the Request-URI, the CALDAV:free-busy-query REPORT request MUST fail and return a 404 (Not Found) status value. This restriction will prevent users from discovering URLs of resources for which they are only granted the CALDAV:read-free- busy privilege. The CALDAV:free-busy-query REPORT request can only be run against a collection (either a regular collection or a calendar collection). An attempt to run the report on a calendar object resource MUST fail and return a 403 (Forbidden) status value. Preconditions: None. Postconditions: (DAV:number-of-matches-within-limits): The number of matching calendar object resources must fall within server-specific, predefined limits. For example, this postcondition might fail if the specified CALDAV:time-range would cause an extremely large number calendar object resources to be considered to compute the response. Daboo, et al. Expires October 7, 2006 [Page 64] Internet-Draft CalDAV April 2006 7.9.1. Example: Successful CALDAV:free-busy-query Report In this example, the client requests the server to return free busy information on the calendar collection /bernard/work/, between 9:00 AM and 5:00 PM EST (2:00 PM and 10:00 PM UTC) on the 4th January 2006. The server responds indicating two busy time intervals of one hour, one of which is tentative. See Appendix B for the calendar data being targeted by this example. >> Request << REPORT /bernard/work/ HTTP/1.1 Host: cal.example.com Depth: 1 Content-Type: application/xml; charset="utf-8" Content-Length: xxxx >> Response << HTTP/1.1 200 OK Date: Fri, 11 Nov 2006 09:32:12 GMT Content-Type: text/calendar Content-Length: xxxx BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Server//EN BEGIN:VFREEBUSY DTSTAMP:20050125T090000Z DTSTART:20060104T140000Z DTEND:20060105T220000Z FREEBUSY;FBTYPE=BUSY-TENTATIVE:20060104T150000Z/PT1H FREEBUSY:20060104T190000Z/PT1H END:VFREEBUSY END:VCALENDAR 8. Guidelines Daboo, et al. Expires October 7, 2006 [Page 65] Internet-Draft CalDAV April 2006 8.1. Client-to-client Interoperability There are a number of actions clients can take which will be legal (the server will not return errors) but which can degrade interoperability with other client implementations accessing the same data. For example, a recurrence rule could be replaced with a set of recurrence dates, a single recurring event could be replaced with a set of independent resources to represent each recurrence, or the start/end time values can be translated from the original time zone to another time zone. Although this advice amounts to iCalendar interoperability best practices and is not limited only to CalDAV usage, interoperability problems are likely to be more evident in CalDAV use cases. 8.2. Synchronization Operations WebDAV already provides functionality required to synchronize a collection or set of collections, make changes offline, and a simple way to resolve conflicts when reconnected. ETags are the key to making this work, but these are not required of all WebDAV servers. Since offline functionality is more important to calendar applications than to some other WebDAV applications, CalDAV servers MUST support ETags as specified in Section 5.3.4. 8.2.1. Use of Reports 8.2.1.1. Restrict the Time Range The REPORTs provided in CalDAV can be used by clients to optimize their performance in terms of network bandwidth usage, and resource consumption on the local client machine. Both are certainly major considerations for mobile or handheld devices with limited capacity, but they are also relevant to desktop client applications in cases where the calendar collections contain large amounts of data. Typically clients present calendar data to users in views that span a finite time interval, so whenever possible clients should only retrieve calendar components from the server using CALDAV:calendar- query REPORT combined with a CALDAV:time-range element to limit the set of returned components to just those needed to populate the current view. 8.2.1.2. Synchronize by Time Range Typically in a calendar, historical data (events, to-dos etc. that have completed prior to the current date) do not change, though they may be deleted. As a result, a client can speed up the synchronization process by only considering data for the present time Daboo, et al. Expires October 7, 2006 [Page 66] Internet-Draft CalDAV April 2006 and the future up to a reasonable limit (e.g., one week, one month). If the user then tries to examine a portion of the calendar outside of the range that has been synchronized, the client can perform another synchronization operation on the new time interval being examined. This "just-in-time" synchronization can minimize bandwidth for common user interaction behaviors. 8.2.1.3. Synchronization Process If a client wants to support calendar data synchronization, as opposed to downloading calendar data each time it is needed, it needs to cache the calendar object resource's URI and ETag along with the actual calendar data. While the URI remains static for the lifetime of the calendar object resource, the ETag will change with each successive change to the calendar object resource. Thus to synchronize a local data cache with the server, the client can first fetch the URI/ETag pairs for the time interval being considered, and compare those results with the cached data. Any cached component whose ETag differs from that on the server needs to be refreshed. In order to properly detect the changes between the server and client data, the client will need to keep a record of which calendar object resources have been created, changed or deleted since the last synchronization operation so that it can reconcile those changes with the data on the server. Here's an example of how to do that: The client issues a CALDAV:calendar-query REPORT request for a specific time range, and asks for only the DAV:getet