<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [
<!ENTITY rfc2119 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
<!ENTITY rfc4791 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4791.xml'>
<!ENTITY rfc5545 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5545.xml'>
<!ENTITY rfc5546 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5546.xml'>
<!ENTITY rfc6638 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6638.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" updates="5545,5546"
     ipr='trust200902' docName='draft-ietf-calext-availability-00'>
  <front>
    <title abbrev="Calendar Availability">Calendar Availability</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>

    <author initials="M." surname="Douglass" fullname="Michael Douglass">
      <organization abbrev="RPI">Rensselaer Polytechnic Institute</organization>
      <address>
        <postal>
          <street>110 8th Street</street>
          <city>Troy</city>
          <region>NY</region>
          <code>12180</code>
          <country>USA</country>
        </postal>
        <email>douglm@rpi.edu</email>
        <uri>http://www.rpi.edu/</uri>
      </address>
    </author>
    <date />
    <area>Applications</area>
    <keyword>availability</keyword>
    <keyword>calendaring</keyword>
    <keyword>free-busy</keyword>
    <keyword>iCalendar</keyword>
    <keyword>CalDAV</keyword>
    <abstract>
      <t>
        This document specifies a new iCalendar calendar component that allows
        the publication of available and unavailable time periods
        associated with a calendar user. This component can be used in
        standard iCalendar free-busy lookups, including iTIP free-busy
        requests, to generate repeating blocks of available or busy time
        with exceptions as needed.
      </t>

      <t>
        This document also defines extensions to CalDAV calendar-access and
        calendar-auto-schedule which specify how this new calendar
        component should be used when doing free-busy time evaluation in
        CalDAV.
      </t>
    </abstract>

    <note
      title='Editorial Note (To be removed by RFC Editor before publication)'
    >
      <t>
        Discussion of this specification is taking place on the mailing
        list
        <eref
          target="http://lists.osafoundation.org/mailman/listinfo/ietf-caldav"
        > http://lists.osafoundation.org/mailman/listinfo/ietf-caldav</eref>
        .
      </t>
    </note>

  </front>
  <middle>
    <section title='Introduction'>
      <t>
        Often calendar users have regular periods of time when they are either
        available to be scheduled or always unavailable. For example, an
        office worker will often wish to only appear free to their work
        colleagues during normal 'office hours' (e.g., Monday through
        Friday, 9 am through 5 pm). Or, a university professor may only
        be available to students during a set period of time (e.g.,
        Thursday afternoons, 2 pm through 5 pm during term time only).
        Ideally users should be able to specify such periods directly
        via their calendar user agent, and have them automatically
        considered as part of the normal free-busy lookup for that user.
        In addition it should be possible to present different periods
        of available time depending on which user is making the request.
      </t>
      <t>
        <xref target='RFC5545'>iCalendar</xref>
        defines a "VFREEBUSY" component that can be used to represent
        fixed busy time periods, but it does does not provide a way to
        specify a repeating period of available or unavailable time.
        Since repeating patterns are often the case, "VFREEBUSY"
        components are not sufficient to solve this problem.
      </t>
      <t>
        This specification defines a new type of iCalendar calendar component
        that can be used to publish user availability.
      </t>
      <t>
        <xref target='RFC4791'>CalDAV</xref>
        provides a way for calendar users to access and manage calendar
        data and exchange this data via scheduling operations. As part
        of this, the
        <xref target='RFC4791'>CalDAV calendar-access</xref>
        feature provides a CALDAV:free-busy-query REPORT that returns
        free-busy information for a calendar collection or hierarchy of
        calendar collections. Also, the
        <xref target='RFC6638'>CalDAV calendar-auto-schedule</xref>
        feature allows free-busy information for a calendar user to be
        determined. Both of these operations involve examining user
        calendars for events that 'block time', with the blocked out
        periods being returned in a "VFREEBUSY" component.
      </t>
      <t>
        This specification extends the CalDAV calendar-access and CalDAV
        calendar-auto-schedule features to allow the new iCalendar
        availability components to be stored and manipulated, and to
        allow free-busy lookups to use the information from any such
        components, if present.
      </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>
        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.
      </t>
    </section>
    <section title="iCalendar Extensions">
      <t>
        This specification adds a new "VAVAILABILITY" calendar component to
        iCalendar. The "VAVAILABILITY" component is itself a container
        for new "AVAILABLE" sub-components.
      </t>
      <t>
        The purpose of the "VAVAILABILITY" calendar component is to provide a
        grouping of available time information over a specific range of
        time. Within that there are specific time ranges that are marked
        as available via a set of "AVAILABLE" calendar sub-components.
        Together these can be used to specify available time that can
        repeat over set periods of time, and which can vary over time.
      </t>
      <section title="Vavailability Component" anchor="vavailability_component">
        <t>
          <list style="hanging">
            <t hangText="Component Name:">
              VAVAILABILITY
            </t>
            <t hangText="Purpose:">
              Provide a grouping of component properties that describe the
              availability associated with a calendar user.
            </t>
            <t hangText="Format Definition:">
              A "VAVAILABILITY" calendar component is defined by the
              following notation:
              <figure>
<artwork name="abnf">
       availabilityc  = "BEGIN" ":" "VAVAILABILITY" CRLF
                        availabilityprop *availablec
                        "END" ":" "VAVAILABILITY" CRLF

       availabilityprop  = *(
                         ;
                         ; the following are REQUIRED,
                         ; but MUST NOT occur more than once
                         ;
                         dtstamp / uid
                         ;
                         ; the following are OPTIONAL,
                         ; but MUST NOT occur more than once
                         ;
                         busytype / class / created / description /
                         dtstart / last-mod / organizer / priority /
                         seq / summary / url /
                         ;
                         ; either 'dtend' or 'duration' MAY appear
                         ; once, but 'dtend' and 'duration' MUST
                         ; NOT occur in the same 'availabilityprop'.
                         ;
                         dtend / duration /
                         ;
                         ; the following are OPTIONAL,
                         ; and MAY occur more than once
                         ;
                         categories / comment / contact /
                         x-prop / iana-prop
                         ;
                         )

       availablec  = "BEGIN" ":" "AVAILABLE" CRLF
                     availableprop
                     "END" ":" "AVAILABLE" CRLF

       availableprop  = *(
                      ;
                      ; the following are REQUIRED,
                      ; but MUST NOT occur more than once
                      ;
                      dtstamp / dtstart / uid /
                      ;
                      ; either 'dtend' or 'duration' MAY appear
                      ; once, but 'dtend' and 'duration' MUST NOT
                      ; occur in the same 'availableprop'.
                      ; 'duration' MUST NOT be present if 'dtstart'
                      ; is not present
                      ;
                      dtend / duration /
                      ;
                      ; the following are OPTIONAL,
                      ; but MUST NOT occur more than once
                      ;
                      created / description / last-mod /
                      recurid / rrule / summary /
                      ;
                      ; the following are OPTIONAL,
                      ; and MAY occur more than once
                      ;
                      categories / comment / contact / exdate /
                      rdate / x-prop / iana-prop

                      )
</artwork>
              </figure>
            </t>
            <t hangText="Description:">
              A "VAVAILABILITY" component indicates a period
              of time within which availability information is provided.
              A "VAVAILABILITY" component can specify a start time and
              an end time or duration. If "DTSTART" is not present, then
              the start time is unbounded. If "DTEND" or "DURATION" are
              not present, then the end time is unbounded. Within the
              specified time period, availability defaults to a
              free-busy type of "BUSY-UNAVAILABLE", except for any time
              periods corresponding to "AVAILABLE" sub-components.
            </t>
            <t>
              "AVAILABLE" sub-components are used to indicate periods
              of free time within the time range of the enclosing
              "VAVAILABILITY" component. "AVAILABLE" sub-components MAY
              include recurrence properties to specify recurring periods
              of time, which may be overridden using normal recurrence
              behavior (i.e., use of the "RECURRENCE-ID" property).
            </t>
            <t>
              If specified, the "DTSTART" and "DTEND" properties in
              "VAVAILABILITY" components and "AVAILABLE" sub-components
              MUST be "DATE-TIME" values specified as either date with
              UTC time or date with local time and a time zone
              reference.
            </t>
            <t>
              If any property with a "DATE-TIME" value is present in a
              "VAVAILABILITY" component or any of its "AVAILABLE"
              sub-components, and that property includes a "TZID"
              parameter, then the iCalendar object containing the
              "VAVAILABILITY" component MUST contain "VTIMEZONE"
              components corresponding to each unique "TZID" parameter
              value.
            </t>
            <t>
              When used to publish available time, the "ORGANIZER"
              property specifies the calendar user associated with the
              published available time.
            </t>
            <t>
              If the "PRIORITY" property is specified in "VAVAILABILITY"
              components it is used to determine how that component is combined
              with other "VAVAILABILITY" components. See
              <xref target='combinations' />

            </t>
            <t>
              Other calendar properties MAY be specified in "VAVAILABILITY" or
              "AVAILABLE" components and are considered attributes of the marked
              block of time. Their usage is application specific. For example,
              the "LOCATION" property may be used to indicate that a person is
              available in one location for part of the week and another location
              for another part.
            </t>
            <t hangText="Example:">
              The following is an example of a "VAVAILABILITY" calendar
              component used to represent the availability of a user
              always available Monday through Friday, 9:00 AM to 5:00 PM
              in the America/Montreal time zone:
              <figure>
<artwork>
     BEGIN:VAVAILABILITY
     ORGANIZER:mailto:bernard@example.com
     UID:vavail-1@example.com
     DTSTAMP:20111005T133225Z
     BEGIN:AVAILABLE
     UID:avail-1-A@example.com
     SUMMARY:Monday to Friday from 9:00 to 17:00
     DTSTART;TZID=America/Montreal:20111002T090000
     DTEND;TZID=America/Montreal:20111002T170000
     RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
     END:AVAILABLE
     END:VAVAILABILITY
</artwork>
              </figure>
              The following is an example of a "VAVAILABILITY" calendar
              component used to represent the availability of a user
              available Monday through Thursday, 9:00 AM to 5:00 PM at
              the main office, and
              Friday 9:00 AM to 12:00 PM in the branch office in the
              America/Montreal time
              zone between October 2nd and December 2nd 2011:
              <figure>
<artwork>
     BEGIN:VAVAILABILITY
     ORGANIZER:mailto:bernard@example.com
     UID:vavail-1@example.com
     DTSTAMP:20111005T133225Z
     DTSTART;TZID=America/Montreal:20111002T000000
     DTEND;TZID=America/Montreal:20111202T000000
     BEGIN:AVAILABLE
     UID:avail-1-A@example.com
     SUMMARY:Monday to Thursday from 9:00 to 17:00
     DTSTART;TZID=America/Montreal:20111002T090000
     DTEND;TZID=America/Montreal:20111002T170000
     RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH
     LOCATION:Main Office
     END:AVAILABLE
     BEGIN:AVAILABLE
     UID:avail-1-B@example.com
     SUMMARY:Friday from 9:00 to 12:00
     DTSTART;TZID=America/Montreal:20111006T090000
     DTEND;TZID=America/Montreal:20111006T120000
     RRULE:FREQ=WEEKLY
     LOCATION:Branch Office
     END:AVAILABLE
     END:VAVAILABILITY
</artwork>
              </figure>
              The following is an example of three "VAVAILABILITY"
              calendar components used to represent the availability of
              a traveling worker: Monday through Friday, 9:00 AM to 5:00
              PM each day. However, for three weeks the calendar user is
              working in Montreal, then one week in Los Angeles, then
              back to Montreal. Note that each overall period is covered
              by separate "VAVAILABILITY" components. The last of these
              has no DTEND so continues on "for ever". This example
              shows one way "blocks" of available time can be represented.
              See <xref target='combinations' /> for another approach using
              priority.
              <figure>
<artwork>
     BEGIN:VAVAILABILITY
     ORGANIZER:mailto:bernard@example.com
     UID:vavail-1@example.com
     DTSTAMP:20111005T133225Z
     DTSTART;TZID=America/Montreal:20111002T000000
     DTEND;TZID=America/Montreal:20111023T030000
     BEGIN:AVAILABLE
     UID:avail-1-A@example.com
     SUMMARY:Monday to Friday from 9:00 to 17:00
     DTSTART;TZID=America/Montreal:20111002T090000
     DTEND;TZID=America/Montreal:20111002T170000
     RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
     LOCATION:Montreal
     END:AVAILABLE
     END:VAVAILABILITY
     BEGIN:VAVAILABILITY
     ORGANIZER:mailto:bernard@example.com
     UID:vavail-2@example.com
     DTSTAMP:20111005T133225Z
     DTSTART;TZID=America/Los_Angeles:20111023T000000
     DTEND;TZID=America/Los_Angeles:20111030T000000
     BEGIN:AVAILABLE
     UID:avail-2-A@example.com
     SUMMARY:Monday to Friday from 9:00 to 17:00
     DTSTART;TZID=America/Los_Angeles:20111023T090000
     DTEND;TZID=America/Los_Angeles:20111023T170000
     RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
     LOCATION:Los Angeles
     END:AVAILABLE
     END:VAVAILABILITY
     BEGIN:VAVAILABILITY
     ORGANIZER:mailto:bernard@example.com
     UID:vavail-3@example.com
     DTSTAMP:20111005T133225Z
     DTSTART;TZID=America/Montreal:20111030T030000
     BEGIN:AVAILABLE
     UID:avail-3-A@example.com
     SUMMARY:Monday to Friday from 9:00 to 17:00
     DTSTART;TZID=America/Montreal:20111030T090000
     DTEND;TZID=America/Montreal:20111030T170000
     RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
     LOCATION:Montreal
     END:AVAILABLE
     END:VAVAILABILITY
</artwork>
              </figure>
            </t>
          </list>
        </t>
      </section>
      <section title="Busy Time Type" anchor="BUSYTYPE">
        <t>
          <list style="hanging">
            <t hangText="Property Name:">
              BUSYTYPE
            </t>
            <t hangText="Purpose:">
              This property specifies the default busy time
              type.
            </t>
            <t hangText="Value Type:">
              TEXT
            </t>
            <t hangText="Property Parameters:">
              IANA and non-standard property parameters can be specified on this
              property.
            </t>
            <t hangText="Conformance:">
              This property can be specified within "VAVAILABILITY" calendar
              components.
            </t>
            <t hangText="Format Definition:">
              This property is defined by the following notation:
              <figure>
<artwork name="abnf">
     busytype      = "BUSYTYPE" busytypeparam ":" busytypevalue CRLF

     busytypeparam = *(";" other-param)

     busytypevalue = "BUSY" / "BUSY-UNAVAILABLE" /
                     "BUSY-TENTATIVE" / iana-token / x-name
                     ; Default is "BUSY-UNAVAILABLE".
</artwork>
              </figure>
            </t>
            <t hangText="Description:">
              This property is used to specify the default
              busy time type. The values correspond to those used by the
              "FBTYPE" parameter used on a "FREEBUSY" property, with the
              exception that the "FREE" value is not used in this
              property. If not specified on a component that allows this
              property, the default is "BUSY-UNAVAILABLE".
            </t>
            <t hangText="Example:">
              The following is an example of this property:
              <figure>
<artwork>
     BUSYTYPE:BUSY
</artwork>
              </figure>
            </t>
          </list>
        </t>
      </section>
    </section>

    <section title="Combining Vavailability components" anchor="combinations">
      <t>
        The Vavailability component allows a calendar user to describe their
        availability over extended periods of time through the use of recurrence
        patterns. This availability may be relatively constant from year to year.
      </t>

      <t>
        However, there is usually some degree of irregularity, as people take
        vacations or perhaps spend a few weeks at a different office. For that
        period of time there can be a need to redefine their availability.
      </t>

      <t>
        Rather than modify their existing vavailability, the "PRIORITY" property
        allows new vavailability components to be provided which override others
        of lower ordinal priority. Note that <xref target='RFC5545'>iCalendar</xref>
        defines the "PRIORITY" property such that a value of 0 is undefined,
        1 is the highest priority and 9 is the lowest.
      </t>

      <t>
        When combining vavailability components, an absence of a "PRIORITY"
        property or a value of 0 implies the lowest level of priority. If two or
        more vavailability components have the same PRIORITY value, then their
        AVAILABILITY components which fall within the date range of interest are
        combined. It is up to the creator of such components to ensure that
        combining them produces a consistent and expected result.
      </t>

      <t>
        To calculate the available time, order the intersecting "VAVAILABILITY"
        components by priority, those with no "PRIORITY" or a priority value of
        0 first, then in decreasing order of priority that is, an
        increasing "PRIORITY" value.
      </t>

      <t>
        Step through the resulting list of "VAVAILABILITY" components. For each, the
        time range covered by the "VAVAILABILITY" component is set to busy and
        then portions of it defined by the "AVAILABLE" components in
        the "VAVAILABILITY" component are set to free.
      </t>

      <t>
        Note that, if any VAVAILABILITY component completely covers the date
        range of interest, then any lower priority VAVAILABILITY components
        may be ignored.
      </t>
    </section>

    <section title="Calculating Free-Busy Time" anchor="Calculating">
      <t>
        This section describes how free-busy time information for a
        calendar user is calculated in the presence of "VAVAILABILITY"
        calendar components.
      </t>
      <t>
        An iCalendar "VFREEBUSY" component is used to convey "rolled-up"
        free-busy time information for a calendar user. This can be
        generated as the result of an
        <xref target="RFC5546">iTIP free-busy</xref>
        request or through some other mechanism (e.g., a CalDAV
        calendar-access CALDAV:free-busy-query REPORT).
      </t>
      <t>
        When one or more "VAVAILABILITY" components are present and intersect the
        time-range for the free-busy request, first available time is calculated,
        as outlined in <xref target='combinations' />. Once that is done,
        regular "VEVENT" and "VFREEBUSY" components can be "overlaid" in the
        usual way to block out additional time.
      </t>
      <t>
        An example procedure for this is as follows:
        <list style="numbers">
          <t>
            Initially mark the entire period of the free-busy request
            as free.
          </t>
          <t>
            For each "VAVAILABILITY" component ordered by PRIORITY:
            <list style="numbers">
              <t>
                Determine if the "VAVAILABILITY" intersects the time-range of the
                free-busy request. If not ignore it.
              </t>
              <t>
                Determine if the "VAVAILABILITY" is completely overridden by
                a higher priority component. If so ignore it.
              </t>
              <t>
                For the time period covered by the "VAVAILABILITY" component, mark
                time in the free-busy request result set as busy, using
                the busy time type derived from the "BUSYTYPE" property
                in the "VAVAILABILITY" component.
              </t>
            </list>
          </t>
          <t>
            For each remaining "VAVAILABILITY" component in the same order:
            <list style="numbers">
              <t>
                For each "AVAILABLE" component in the "VAVAILABILITY"
                component:
                <list style="numbers">
                  <t>
                    Expand all recurring instances, taking into account overridden
                    instances, ignoring instances or parts of instances that fall
                    outside of the free-busy request time-range or the time period
                    specified by the "VAVAILABILITY" component.
                  </t>
                  <t>
                    For each instance, mark the corresponding time in the free-busy
                    request result set as free.
                  </t>
                </list>
              </t>
            </list>
          </t>
          <t>
            For each "VEVENT" or "VFREEBUSY" component apply normal
            free-busy processing within the free-busy request
            time-range.
          </t>
        </list>
      </t>
      <section title="Examples">
        <t>
          In the examples below a table is used to represent time slots
          for the period of a free-busy request. Each time slot is two
          hours long. The column header represents the hours from
          midnight local time. Each row below the column headers
          represents a step in the free-busy result set determination,
          following the procedure outlined above.
        </t>
        <t>
          Each cell in the rows below the column header contains a
          single character that represents the free-busy type for the
          corresponding time period at the end of the process step
          represented by the row. The characters in the row are:
        </t>
        <texttable>
          <ttcol>Character</ttcol>
          <ttcol>Meaning</ttcol>
          <c>F</c>
          <c>Represents "FREE" time in that slot.</c>
          <c>B</c>
          <c>Represents "BUSY" time in that slot.</c>
          <c>U</c>
          <c>Represents "BUSY-UNAVAILABLE" time in that slot.</c>
          <c>T</c>
          <c>Represents "BUSY-TENTATIVE" time in that slot.</c>
        </texttable>
        <section title="Simple Example">
          <t>
            A free-busy request for Monday, 6th November 2011, midnight to
            midnight in the America/Montreal timezone.
          </t>
          <t>
            The user's calendar is as shown in
            <xref target="Example1" />
            . This includes one "VAVAILABILITY" component giving
            available time within the requested time-range of 8:00 AM to
            6:00 PM, together with one "VEVENT" component representing a
            two hour meeting starting at 12:00 PM.
          </t>
          <texttable>
            <ttcol>Step</ttcol>
            <ttcol>&nbsp;0
            </ttcol>
            <ttcol>&nbsp;2
            </ttcol>
            <ttcol>&nbsp;4
            </ttcol>
            <ttcol>&nbsp;6
            </ttcol>
            <ttcol>&nbsp;8
            </ttcol>
            <ttcol>10</ttcol>
            <ttcol>12</ttcol>
            <ttcol>14</ttcol>
            <ttcol>16</ttcol>
            <ttcol>18</ttcol>
            <ttcol>20</ttcol>
            <ttcol>22</ttcol>
            <c>1.</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>2.</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>3.</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>4.</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>F</c>
            <c>F</c>
            <c>B</c>
            <c>F</c>
            <c>F</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
          </texttable>
        </section>
        <section title="Further Example">
          <t>
            The following is another way to represent the availability of
            the traveling worker shown above. Here we represent their
            base availability of Monday through Friday, 9:00 AM to 5:00
            PM each day with a "VAVAILABILITY" with defaulted PRIORITY.
            For the three weeks the calendar user is
            working in Montreal we represent it with an overriding
            "VAVAILABILITY" component with priority 1.
            <figure>
    <artwork>
     BEGIN:VAVAILABILITY
     ORGANIZER:mailto:bernard@example.com
     UID:vavail-1@example.com
     DTSTAMP:20111005T133225Z
     DTSTART;TZID=America/Montreal:20111002T000000
     BEGIN:AVAILABLE
     UID:avail-1-A@example.com
     SUMMARY:Monday to Friday from 9:00 to 17:00
     DTSTART;TZID=America/Montreal:20111002T090000
     DTEND;TZID=America/Montreal:20111002T170000
     RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
     LOCATION:Montreal
     END:AVAILABLE
     END:VAVAILABILITY
     BEGIN:VAVAILABILITY
     ORGANIZER:mailto:bernard@example.com
     UID:vavail-2@example.com
     DTSTAMP:20111005T133225Z
     DTSTART;TZID=America/Los_Angeles:20111023T000000
     DTEND;TZID=America/Los_Angeles:20111030T000000
     BEGIN:AVAILABLE
     UID:avail-2-A@example.com
     SUMMARY:Monday to Friday from 9:00 to 17:00
     DTSTART;TZID=America/Los_Angeles:20111023T090000
     DTEND;TZID=America/Los_Angeles:20111023T170000
     PRIORITY:1
     RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
     LOCATION:Los Angeles
     END:AVAILABLE
     END:VAVAILABILITY
    </artwork>
            </figure>

          </t>
        </section>

      </section>
    </section>

    <section title="CalDAV Extensions">
      <section title="CalDAV Requirements Overview" anchor="requirements">
        <t>
          This section lists what functionality is required of a
          CalDAV
          server which supports this extension. A server:
          <list style="symbols">
            <t>
              MUST support "VAVAILABILITY" components in a calendar collection
              resource if the CALDAV calendar-access feature is
              supported, which includes advertising it in
              CALDAV;supported-calendar-component-set properties on
              calendars;
            </t>
            <t>
              MUST support CALDAV:free-busy-query REPORTs that aggregate the
              information in any "VAVAILABILITY" components in the
              calendar collections targeted by the request;
            </t>
            <t>
              MUST support "VAVAILABILITY" components stored in a
              CALDAV:calendar-availability WebDAV property on a CALDAV
              scheduling inbox collection if the CALDAV
              calendar-auto-schedule feature is supported;
            </t>
            <t>
              MUST support
              <xref target='RFC5546'>iTIP</xref>
              free-busy requests that aggregate the information in any
              "VAVAILABILITY" components in calendar collections that
              contribute to free-busy, or in any "VAVAILABILITY"
              components stored in the CALDAV:calendar-availability in
              the CALDAV scheduling inbox collection of the calendar
              user targeted by the iTIP free-busy request, if the CalDAV
              calendar-auto-schedule feature is available.
            </t>
          </list>
        </t>
      </section>
      <section title='New features in CalDAV' anchor='changes'>
        <section title="Calendar Availability Support">
          <t>
            A server supporting the features described in this document MUST
            include "calendar-availability" 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-availability" in the DAV
            response header MUST indicate that the server supports all
            MUST level requirements specified in this document.
          </t>
          <section
            title="Example: Using OPTIONS for the Discovery of Calendar Availability Support"
          >
            <figure>
              <preamble>&gt;&gt; Request &lt;&lt;</preamble>
<artwork><![CDATA[
   OPTIONS /home/bernard/calendars/ HTTP/1.1
   Host: cal.example.com
]]></artwork>
            </figure>
            <figure>
              <preamble>&gt;&gt; Response &lt;&lt;</preamble>
<artwork><![CDATA[
   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,
    calendar-availability
   Date: Fri, 11 Nov 2005 09:32:12 GMT
   Content-Length: 0
]]></artwork>
            </figure>
            <t>
              In this example, the OPTIONS method returns the value
              "calendar-availability" in the DAV response header to
              indicate that the collection "/home/bernard/calendars/"
              supports the new features defined in this specification.
            </t>
          </section>
        </section>
        <section title='CALDAV:free-busy-query REPORT' anchor='free-busy-query'>
          <t>
            A CALDAV:free-busy-query REPORT can be executed on a
            calendar collection that contains iCalendar "VAVAILABILITY"
            components. When that is done, the server MUST aggregate the
            information in any "VAVAILABILITY" components when
            generating the free-busy response, as described in
            <xref target="Calculating" />
            .
          </t>
        </section>
        <section anchor="PROPERTY_calendar-availability" title="CALDAV:calendar-availability Property">
          <t>
<?rfc compact="no" ?>
            <list style="hanging">
              <t hangText="Name:">
                calendar-availability
              </t>
              <t hangText="Namespace:">
                urn:ietf:params:xml:ns:caldav
              </t>
              <t hangText="Purpose:">
                Defines a "VAVAILABILITY" component that
                will be used in calculating free-busy time when an iTIP
                free-busy request is targeted at the calendar user who
                owns the Inbox.
              </t>
              <t hangText="Conformance:">
                This property MAY be protected and SHOULD
                NOT be returned by a PROPFIND DAV:allprop request.
                Support for this property is REQUIRED. The value of this
                property MUST be a valid iCalendar object containing
                "VAVAILABILITY" components and "VTIMEZONE" components
                (if required) only.
              </t>
              <t hangText="Description:">
                This property allows a user to specify their
                availability by including "VAVAILABILITY" components in
                the value of this property. If present, the server MUST
                use these "VAVAILABILITY" components when determining
                free-busy information as part of an iTIP free-busy
                request being handled by the server.
              </t>
              <t hangText="Definition:">
                <figure>
                  <artwork><![CDATA[
   <!ELEMENT calendar-availability (#PCDATA) >
   ; Data value MUST be iCalendar object containing
   ; "VAVAILABILITY" or "VTIMEZONE" components.
                ]]></artwork>
                </figure>
              </t>
              <t hangText="Example:">
                <figure>
                  <artwork><![CDATA[
    <C:calendar-availability xmlns:D="DAV:"
       xmlns:C="urn:ietf:params:xml:ns:caldav"
    >BEGIN:VCALENDAR
    CALSCALE:GREGORIAN
    PRODID:-//example.com//iCalendar 2.0//EN
    VERSION:2.0
    BEGIN:VTIMEZONE
    LAST-MODIFIED:20040110T032845Z
    TZID:America/Montreal
    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:VAVAILABILITY
    UID:vavail-1@example.com
    DTSTAMP:20111005T133225Z
    DTSTART;TZID=America/Montreal:20111002T000000
    BEGIN:AVAILABLE
    UID:avail-1-A@example.com
    SUMMARY:Monday to Friday from 9:00 to 18:00
    DTSTART;TZID=America/Montreal:20111002T090000
    DTEND;TZID=America/Montreal:20111002T180000
    RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
    END:AVAILABLE
    END:VAVAILABILITY
    END:VCALENDAR
    </C:calendar-availability>
                ]]></artwork>
                </figure>
              </t>
            </list>
<?rfc compact="yes" ?>
          </t>
        </section>
        <section title='iTIP free-busy requests' anchor='itip-request'>
          <t>
            The
            <xref target='RFC6638' />
            processing of an iTIP free-busy request targeted at the
            owner of the CALDAV:schedule-inbox will include free-busy
            information derived from "VAVAILABILITY" components in any
            calendar collection targeted during the request, as
            described in
            <xref target="Calculating" />.
            In addition, any "VAVAILABILITY" components specified in
            the CALDAV:calendar-availability property on the owner's
            Inbox, MUST be included in the free-busy calculation.
          </t>
        </section>
      </section>
    </section>
    <section title='Security Considerations'>
      <t>
        Free-busy information generated from "VAVAILABILITY" components
        MUST NOT include information other than busy or free time
        periods. In particular, user specified property values such as
        "SUMMARY" and "DESCRIPTION" MUST NOT be copied into the
        free-busy result data.
      </t>
      <t>
        Beyond this, this specification does not add any additional
        security issues that are not already present in
        <xref target="RFC5545" />
        and
        <xref target="RFC5546" />
        .
      </t>
    </section>
    <section title='IANA Considerations'>
      <section title='Component Registrations'>
        <t>
          This documents defines the following new iCalendar components
          to be added to the registry defined in Section 8.2.2 of
          <xref target="RFC5545" />
          :
        </t>
        <texttable>
          <ttcol>Component</ttcol>
          <ttcol>Status</ttcol>
          <ttcol>Reference</ttcol>
          <c>VAVAILABILITY</c>
          <c>Current</c>
          <c>
            RFCXXXX,
            <xref target='vavailability_component' />
          </c>
          <c>AVAILABLE</c>
          <c>Current</c>
          <c>
            RFCXXXX,
            <xref target='vavailability_component' />
          </c>
        </texttable>
      </section>
      <section title='Property Registrations'>
        <t>
          This documents defines the following new iCalendar properties
          to be added to the registry defined in Section 8.2.3 of
          <xref target="RFC5545" />
          :
        </t>
        <texttable>
          <ttcol>Property</ttcol>
          <ttcol>Status</ttcol>
          <ttcol>Reference</ttcol>
          <c>BUSYTYPE</c>
          <c>Current</c>
          <c>
            RFCXXXX,
            <xref target='BUSYTYPE' />
          </c>
        </texttable>
      </section>
    </section>
    <section title='Acknowledgments'>
      <t>
        Thanks to the following for providing feedback: Toby Considine
        and
        Dave Thewlis. Particular thanks go to Bernard Desruisseaux.
        This specification came about via discussions at the
        Calendaring and Scheduling Consortium.
      </t>
    </section>

  </middle>
  <back>
    <references title='Normative References'>
    &rfc2119;
    &rfc4791;
    &rfc5545;
    &rfc5546;
    &rfc6638;
    </references>
    <!-- <references title='Informative References'> </references> -->
    <section title='Example Calendar #1' anchor="Example1">
      <t>
        <figure>
          <preamble>iCalendar object</preamble>
          <artwork><![CDATA[
    BEGIN:VCALENDAR
    CALSCALE:GREGORIAN
    PRODID:-//example.com//iCalendar 2.0//EN
    VERSION:2.0
    BEGIN:VTIMEZONE
    LAST-MODIFIED:20040110T032845Z
    TZID:America/Montreal
    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:20111113T044111Z
    DTSTART;TZID=America/Montreal:20111106T120000
    DURATION:PT1H
    SUMMARY:Meeting
    UID:60A48841ECB90F3F215FE3D2@example.com
    END:VEVENT
    BEGIN:VAVAILABILITY
    UID:vavail-1@example.com
    DTSTAMP:20111005T133225Z
    DTSTART;TZID=America/Montreal:20111002T000000
    BEGIN:AVAILABLE
    UID:avail-1-A@example.com
    SUMMARY:Monday to Friday from 9:00 to 18:00
    DTSTART;TZID=America/Montreal:20111002T090000
    DTEND;TZID=America/Montreal:20111002T180000
    RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
    END:AVAILABLE
    END:VAVAILABILITY
    END:VCALENDAR
]]></artwork>
        </figure>
      </t>
    </section>
    <section
      title="Change History (To be removed by RFC Editor before publication)"
    >
      <t>
        Changes in -05:
        <list style='numbers'>
          <t>Small typos.</t>
          <t>Fix explanation of priority.</t>
          <t>Change uid values to make legal and easier to follow.</t>
        </list>
      </t>
      <t>
        Changes in -04:
        <list style='numbers'>
          <t>Small typos.</t>
          <t>Add prioritized example.</t>
        </list>
      </t>
      <t>
        Changes in -03:
        <list style='numbers'>
          <t>Switch authors.</t>
          <t>CalDAV scheduling is now rfc6638.</t>
          <t>List priority as a vavailability property and define its use.</t>
        </list>
      </t>
      <t>
        Changes in -02:
        <list style='numbers'>
          <t>Updated to 5545/5546 references.</t>
          <t>Fixed some examples.</t>
          <t>Added some more properties to the components</t>
          <t>Fixed text that said dtstart was required in VAVAILABILITY</t>
        </list>
      </t>
      <t>
        Changes in -01:
        <list style='numbers'>
          <t>Allow property on Inbox for caldav-schedule.</t>
          <t>Clarify that DURATION can only be present in VAVAILABILITY
            if DTSTART is also present, and DTEND is not.</t>
          <t>Updated references.</t>
          <t>Added templates.</t>
        </list>
      </t>
    </section>
  </back>
</rfc>
