<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="../../rfc2629.xslt"?><!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [<!ENTITY rfc2119 PUBLIC '' 'bibxml/reference.RFC.2119.xml'><!ENTITY rfc4791 PUBLIC '' 'bibxml/reference.RFC.4791.xml'><!ENTITY rfc4918 PUBLIC '' 'bibxml/reference.RFC.4918.xml'><!ENTITY rfc5545 PUBLIC '' 'bibxml/reference.RFC.5545.xml'><!ENTITY rfc5689 PUBLIC '' 'bibxml/reference.RFC.5689.xml'><!ENTITY rfc6352 PUBLIC '' 'bibxml/reference.RFC.6352.xml'><!ENTITY idWebDAVSync SYSTEM 'bibxml3/reference.I-D.daboo-webdav-sync.xml'>]> <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?><?rfc toc="yes"?><?rfc comments="yes"?><?rfc inline="yes"?><?rfc symrefs="yes"?><?rfc sortrefs="yes"?><?rfc compact="yes"?><?rfc subcompact="no"?><?rfc tocdepth="2"?><?rfc strict="yes"?><rfc category="std" ipr='trust200902' docName='draft-daboo-caldav-extensions-01'>    <front>        <title abbrev="CalDAV Extensions">Collected Extensions to CalDAV</title>        <author initials="C." surname="Daboo" fullname="Cyrus Daboo">            <organization abbrev="Apple">                Apple Inc.            </organization>            <address>                <postal>                    <street>                        1 Infinite Loop                    </street>                    <city>                        Cupertino                    </city>                    <region>                        CA                    </region>                    <code> 95014 </code>                    <country>                        USA                    </country>                </postal>                <email>                    cyrus@daboo.name                </email>                <uri>                    http://www.apple.com/                </uri>            </address>        </author>        <date />        <area>Applications</area>        <keyword>CalDAV</keyword>        <keyword>calendaring</keyword>        <keyword>iCalendar</keyword>        <abstract>            <t>                This document defines a set of extensions to the CalDAV calendar access protocol.            </t>        </abstract>    </front>    <middle>        <section title='Introduction'>            <t>                <xref target="RFC4791"/> defines the CalDAV Calendar Access protocol for accessing calendar data stored on a server. With the popularity of CalDAV increasing, a number of useful extensions have been proposed to improve the protocol. This specification collects several of those extensions into one document for convenience. Each extension defined in this specification can be implemented independently of any of the others.            </t>            <t>              Discussion of this Internet-Draft is taking place on the mailing              list &lt;https://www.ietf.org/mailman/listinfo/caldav&gt;.            </t>        </section>        <section title='Conventions Used in This Document'>            <t>                The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <xref target='RFC2119' />.            </t>            <t>                Other notations used in this memo follow the notations of <xref target='RFC4791'/>.              </t>        </section>        <section title="Extended Calendar Query Report">            <t>                The CALDAV:calendar-query report defined in Section 7.8 of <xref target="RFC4791" /> allows a client to search calendar data for a match to iCalendar component, property or parameter details. As defined, this option supports querying multiple attributes of the iCalendar data at various "nesting" levels based on the syntactic structure of iCalendar itself. When multiple attributes are queried at the same level, each has to match for the query to be successful - effectively defining a logical "and" operation. This does not allow clients to execute a single query to match different attributes of different component types (e.g., clients cannot search for VEVENTs with a particular time-range, or VTODOs that are not completed). Since there is a need to be able to execute such queries, a logical "or" operation is needed.            </t>            <t>                This specification adds a "test" XML attribute to the CALDAV:comp-filter and CALDAV:prop-filter XML elements that accepts values of "allof" or "anyof" to indicate logical "and" or "or" operations respectively. This copies the behavior defined for CARDDAV:addressbook-query reports defined in Section 10.5 of <xref target='RFC6352'/>, with the exception that the default value for the attribute is "allof" to match the current behavior.            </t>            <t>                The text comparison operation in <xref target="RFC4791"/> is a simple "contains" operation, however more sophisticated comparisons are sometimes needed (e.g., 'starts with', 'equals', etc).            </t>            <t>                This specification adds a "match-type" XML attribute to the CALDAV:text-match XML element that accepts values of "equals", "contains", "starts-with", or "ends-with", to indicate the comparison operation to be used. This copies the behavior defined for CARDDAV:addressbook-query reports defined in Section 10.5.4 of <xref target='RFC6352'/>.            </t>            <t>                Sometimes clients want to search all component types for a match (e.g., clients cannot find all calendar object resources that contain a SUMMARY property value matching some text irrespective of the top-level component type).            </t>            <t>                This specification allows the use of a single "*" character in the "name" attribute of "comp-filter" elements to require the server to match any component type.            </t>            <t>                Servers advertise support for this extension by including the token "calendar-query-extended" in the DAV response header to an OPTIONS request on any resource supporting the extended query report. Clients MUST check for the presence of that token before using the "test" or "match-type" XML attributes.            </t>            <t>                This specification extends the <xref target="RFC4791"/> XML syntax for the CALDAV:comp-filter, CALDAV:prop-filter and CALDAV:text-match XML elements as follows.            </t>            <section title="CALDAV:comp-filter XML Element">            <t>                <list style='hanging'>                    <t hangText="XML Element:">CALDAV:comp-filter</t>                    <t hangText="Updated Definition:">           <figure><artwork type="application/xml-dtd"><![CDATA[<!ELEMENT comp-filter (is-not-defined | (time-range?,                       prop-filter*, comp-filter*))><!ATTLIST comp-filter name CDATA #REQUIRED                      test (allof | anyof) "allof"><!-- name value:        a calendar object or calendar component type (e.g., VEVENT),        or the value "*" to indicate a match against any type     test value:        allof logical AND for matches        anyof logical OR for matches -->]]></artwork></figure>                    </t>                    <t hangText="Additional Description:">                        The "test" attribute specifies whether any (logical OR) or all (logical AND) of the is-not-defined, time-range, comp-filter or param-filter tests need to match in order for the overall filter to match.                    </t>                </list>            </t>            </section>            <section title="CALDAV:prop-filter XML Element">            <t>                <list style='hanging'>                    <t hangText="XML Element:">CALDAV:prop-filter</t>                    <t hangText="Updated Definition:">           <figure><artwork type="application/xml-dtd"><![CDATA[<!ELEMENT prop-filter (is-not-defined |                       ((time-range | text-match)?,                        param-filter*))><!ATTLIST prop-filter name CDATA #REQUIRED                      test (allof | anyof) "allof"><!-- name value:        a calendar property name (e.g., ATTENDEE)     test value:        allof logical AND for matches        anyof logical OR for matches -->]]></artwork></figure>                    </t>                    <t hangText="Additional Description:">                        The "test" attribute specifies whether any (logical OR) or all (logical AND) of the is-not-defined, time-range, text-filter or param-filter tests need to match in order for the overall filter to match.                    </t>                </list>            </t>            </section>            <section title="CALDAV:text-match XML Element">            <t>                <list style='hanging'>                    <t hangText="XML Element:">CALDAV:text-match</t>                    <t hangText="Updated Definition:">           <figure><artwork type="application/xml-dtd"><![CDATA[<!ELEMENT text-match (#PCDATA)><!-- PCDATA value: string --><!ATTLIST text-match    collation        CDATA "i;ascii-casemap"    negate-condition (yes | no) "no"    match-type (equals|contains|starts-with|ends-with) "contains">]]></artwork></figure>                    </t>                    <t hangText="Additional Description:">                        The "match-type" attribute is used to indicate the type of match operation to use. Possible choices are:                        <list>                            <t>"equals" - an exact match to the target string</t>                            <t>"contains" - a substring match, matching anywhere within the target string</t>                            <t>"starts-with" - a substring match, matching only at the start of the target string</t>                            <t>"ends-with" - a substring match, matching only at the end of the target string</t>                        </list>                    </t>                </list>            </t>            </section>            <section title="Examples">                <figure><preamble>                    In this request, the client is querying for VEVENTs that start on or after a specific date, or VTODOs that are not completed and not cancelled.                </preamble>                <artwork><![CDATA[REPORT /bernard/work/ HTTP/1.1Host: cal.example.comDepth: 1Content-Type: application/xml; charset="utf-8"Content-Length: xxxx<?xml version="1.0" encoding="utf-8" ?><C:calendar-query xmlns:D="DAV:"              xmlns:C="urn:ietf:params:xml:ns:caldav">  <D:prop>    <D:getetag/>  </D:prop>  <C:filter>    <C:comp-filter name="VCALENDAR" test="anyof">      <C:comp-filter name="VEVENT">        <C:time-range start="20110101T000000Z"/>      </C:comp-filter>      <C:comp-filter name="VTODO" test="allof">        <C:prop-filter name="COMPLETED">          <C:is-not-defined/>        </C:prop-filter>        <C:prop-filter name="STATUS">          <C:text-match             negate-condition="yes"             match-type="equals">CANCELLED</C:text-match>        </C:prop-filter>      </C:comp-filter>    </C:comp-filter>  </C:filter></C:calendar-query>]]></artwork></figure>                <figure><preamble>                    In this request, the client is querying for any component that contains a VALARM sub-component.                </preamble>                <artwork><![CDATA[REPORT /bernard/work/ HTTP/1.1Host: cal.example.comDepth: 1Content-Type: application/xml; charset="utf-8"Content-Length: xxxx<?xml version="1.0" encoding="utf-8" ?><C:calendar-query xmlns:D="DAV:"              xmlns:C="urn:ietf:params:xml:ns:caldav">  <D:prop>    <D:getetag/>  </D:prop>  <C:filter>    <C:comp-filter name="VCALENDAR">      <C:comp-filter name="*">        <C:comp-filter name="VALARM" />      </C:comp-filter>    </C:comp-filter>  </C:filter></C:calendar-query>]]></artwork></figure>            </section>        </section>        <section title="Advertising Supported Calendar Component Sets">          <t><xref target="RFC4791">CalDAV</xref> supports the notion of calendar collections that are restricted to only containing components of a certain type, or set of types. The protocol allows clients to specify the restricted component sets by supplying a CALDAV:supported-calendar-component-set WebDAV property in an MKCALENDAR or <xref target="RFC5689">extended MKCOL</xref> request that creates a calendar collection. However, servers themselves might need to restrict the allowed sets of components that can be used in any one calendar (e.g., some servers might only support calendar collections containing components of one type). Currently there is no way for a client to determine what the allowed combination of component types is for use with MKCALENDAR or extended MKCOL.</t>          <t>This specification adds a new CALDAV:supported-calendar-component-sets WebDAV property for use on calendar home collections. This property enumerates the allowed sets of calendar components that the server will support for use with MKCALENDAR or extended MKCOL requests. Clients SHOULD check for the presence of this property before issuing an MKCALENDAR or extended MKCOL request that includes a CALDAV:supported-calendar-component-set WebDAV property. When the new property is found on a calendar home, clients MUST only use a CALDAV:supported-calendar-component-set is one advertised as being supported.</t>      <section title="CALDAV:supported-calendar-component-sets Property">        <t>          <list style="hanging">            <t hangText="Name:">supported-calendar-component-sets</t>            <t hangText="Namespace:">urn:ietf:params:xml:ns:caldav</t>            <t hangText="Purpose:">Enumerates the sets of component restrictions the server is willing to allow the client to specify in MKCALENDAR or extended MKCOL requests.</t>            <t hangText="Protected:">This property MUST be protected and SHOULD NOT be returned by a PROPFIND allprop request (as defined in Section 14.2 of <xref target="RFC4918"/>).</t>            <t hangText="COPY/MOVE behavior:">This property value MUST be preserved in COPY and MOVE operations.</t>            <t hangText="Description:">If servers apply restrictions on the allowed calendar component sets used when creating a calendar, then those servers SHOULD advertise this property on each calendar home collection within which the restrictions apply. In the absence of this property, clients cannot assume anything about whether the server will enforce a set of restrictions or not - in that case clients need to handle the server rejecting certain combinations of restricted component sets. If this property is present, but contains no child XML elements, then clients can assume that the server imposes no restrictions on the combinations of component types it is willing to accept. If present, each CALDAV:supported-calendar-component-set element represents a valid restriction the client can use in an MKCALENDAR or extended MKCOL request when creating a calendar.</t>            <t hangText="Definition:">              <figure>                <artwork><![CDATA[   <!ELEMENT supported-calendar-component-sets             (supported-calendar-component-set*) >   <!-- supported-calendar-component-set defined in RFC4791 -->]]></artwork>              </figure>            </t>            <t hangText="Example:">              <figure>                <artwork><![CDATA[<C:supported-calendar-component-sets     xmlns:C="urn:ietf:params:xml:ns:caldav">  <!-- Calendars with any standard iCalendar component -->  <C:supported-calendar-component-set>    <C:comp name="VEVENT" />    <C:comp name="VFREEBUSY" />    <C:comp name="VJOURNAL" />    <C:comp name="VTODO" />  </C:supported-calendar-component-set>    <!-- Calendars with just VEVENT or VFREEBUSY -->  <C:supported-calendar-component-set>    <C:comp name="VEVENT" />    <C:comp name="VFREEBUSY" />  </C:supported-calendar-component-set>    <!-- Calendars with just VEVENT -->  <C:supported-calendar-component-set>    <C:comp name="VEVENT" />  </C:supported-calendar-component-set>    <!-- Calendars with just VTODO -->  <C:supported-calendar-component-set>    <C:comp name="VTODO" />  </C:supported-calendar-component-set></C:supported-calendar-component-sets>]]></artwork>              </figure>            </t>          </list>        </t>      </section>        </section>        <section title="Filtering by Calendar Component Type">          <t>Calendar clients are sometimes "scoped" to only utilize one type of main calendar component type (e.g., a scheduling client that only handles "VEVENT" components, or a task manager that only handles "VTODO" components). CalDAV provides a calendar query report that allows clients to find only calendar object resources that contain a specified main component type, which is useful when initially loading the contents of a calendar into a local cache. However, clients also need to keep that cache updated as changes occur on the server. One way to do that is to use the <xref target="I-D.daboo-webdav-sync">WebDAV sync report</xref>, but that report will return changes for all calendar object resources within a calendar collection. Thus "scoped" clients will be forced to load calendar object resources containing component types they do not care about to discover what type they are, or issue additional queries to see whether the changes reported by the sync report are for component types it handles. A better approach would be to have a way for the WebDAV sync report response to include details of the calendar component type for each calendar object resource that it reports as changed.</t>          <t>To better "scope" a WebDAV sync report, this specification recommends that servers SHOULD always include a "component=" parameter (as defined in Section 8.1 of <xref target="RFC5545"/>) in the DAV:getcontenttype WebDAV property media-type value reported for calendar object resources. Clients can then request that property be returned in the WebDAV sync report response for each resource, and thus quickly determine which changes are relevant to them based on component type.</t>                <figure><preamble>                    Example partial WebDAV sync report response with a component type included.                </preamble>                <artwork><![CDATA[<D:response>  <D:href>http://calendar.example.com/cyrusdaboo/calendar.ics</D:href>  <D:propstat>    <D:prop>      <D:getetag>"00003-abcd1"</D:getetag>      <D:getcontenttype      >text/calendar;charset=utf-8;component=vevent<      /D:getcontenttype>    </D:prop>    <D:status>HTTP/1.1 200 OK</D:status>  </D:propstat> </D:response>]]></artwork></figure>        </section>        <section title='Security Considerations'>            <t>This specification does not introduce any new security concerns beyond those addressed in <xref target="RFC4791">CalDAV</xref> and <xref target="RFC5545">iCalendar</xref>.</t>        </section>        <section title='IANA Considerations'>            <t>No IANA actions are needed.</t>        </section>        <section title='Acknowledgments'>            <t>                Thanks to Bernard Desruisseaux, Mike Douglass, Jeffrey Harris, Arnaud Quillaud, and Nick Zitzmann. This specification came about via discussions at the Calendaring and Scheduling Consortium.            </t>        </section>    </middle>    <back>        <references title='Normative References'>            &rfc2119; &rfc4791; &rfc4918; &rfc5545; &rfc5689; &idWebDAVSync;        </references>        <references title='Informative References'>            &rfc6352;        </references>        <section title="Change History (To be removed by RFC Editor before publication)">            <t>                Changes in -01:                <list style='numbers'>                    <t>Changed description of COPY/MOVE for supported-calendar-component-sets property</t>                    <t>Removed bogus text in property description.</t>                    <t>Changed supported-calendar-component-sets to use supported-calendar-component-set as a child element.</t>                    <t>Added recommendation to use "component=" parameter in DAV:getcontenttype WebDAV properties on calendar object resources.</t>                </list>            </t>        </section>    </back></rfc>
