imip-agent

docs/wiki/EventRecurrences

1355:6975cdaac4a4
2017-10-20 Paul Boddie Simplify the interface of the rule periods computation function.
     1 = Event Recurrences =     2      3 Events defined by iCalendar objects may recur when     4 [[http://tools.ietf.org/html/rfc5545#section-3.8.5|recurrence component properties]]     5 such as `RDATE` and `RRULE` are employed. Each recurrence of an event may then     6 be referenced using     7 [[http://tools.ietf.org/html/rfc5545#section-3.8.4.4|recurrence identifiers]],     8 and such identifiers indicate the originally-specified start point of a     9 particular recurrence (either implicitly specified by `RRULE` properties or    10 explicitly specified by `RDATE` properties).    11     12 == Recurrence Identifier Stability ==    13     14 A recurrence retains the same identifier throughout its lifetime. Even if a    15 recurrence's start date or time changes, it will still retain the same    16 identifier in its `RECURRENCE-ID` property which will no longer reflect the    17 currently-specified start point of the recurrence. Such identifier stability    18 is intended to provide a means of identifying the original recurrence so that    19 it can be hidden from any calendar or event descriptions and replaced with the    20 modified version.    21     22 == Recurrences and Time Zones ==    23     24 Since recurrence identifiers may be defined using time zone information,    25 imip-agent normalises the specified recurrence identifiers to UTC-based    26 datetimes to minimise ambiguity. For example:    27     28 || '''iCalendar Property'''                         || '''Normalised Value''' || '''UTC Datetime?''' ||    29 || `RECURRENCE-ID:20141114`                         || `20141114`             || No                  ||    30 || `RECURRENCE-ID:20141114T000000`                  || `20141114T000000`      || No                  ||    31 || `RECURRENCE-ID;TZID=Europe/Oslo:20141114`        || `20141113T230000Z`     || Yes                 ||    32 || `RECURRENCE-ID;TZID=Europe/Oslo:20141114T000000` || `20141113T230000Z`     || Yes                 ||    33 || `RECURRENCE-ID:20141114T000000Z`                 || `20141114T000000Z`     || Yes                 ||    34     35 Identifiers without time zone information are not in themselves sufficient to    36 unambiguously define points in time, and thus additional time zone information    37 must be provided to obtain such time periods for such purposes as detecting    38 conflicts with other events. In the above examples, those normalised values    39 not providing a UTC datetime representation need further conversion to be    40 usable for period comparisons. Such further conversion would be done by    41 nominating a disambiguating time zone, such as the user's configured time    42 zone.    43     44 By normalising identifiers using any object-resident time zone information,    45 imip-agent can use the resulting values without needing to consult the object    46 providing any redefined recurrence, knowing that any time zone information has    47 already been taken into consideration. Thus, all UTC-based datetimes used as    48 recurrence identifiers are readily usable for comparison purposes, whereas any    49 floating date or datetime values used as recurrence identifiers must need    50 additional conversion using the user's time zone to be usable.    51     52 It might be thought that there would be correspondence between a recurrence    53 identifier and the time zone details employed by the original object    54 describing the redefined recurrence (such as the `TZID` attribute specified on    55 an object's `DTSTART` property), and so any unqualified recurrence identifier    56 might be converted to a UTC-based datetime using such time zone details.    57 However, an assumption could equally be made that the recurrence identifier    58 should inherit time zone details from the redefined recurrence instead. The    59 only reasonable choice to be made when confronted with such ambiguity is to    60 treat any unqualified identifier as a genuine floating date or datetime, and    61 the normalisation process facilitates this strategy.    62     63 == Recurrences and Free/Busy Information ==    64     65 Events employing recurrences on fixed occasions can be readily recorded in the    66 free/busy information for a calendar user. However, iCalendar also permits    67 recurrences that may potentially continue forever, and yet providing free/busy    68 information for arbitrary periods in the future may either result in    69 substantial computation or substantial demands on storage resources.    70 Consequently, free/busy information may only be generated for a period ending    71 at a certain point in the future defined in terms of days from the present.    72 Within this period scheduling would make sense, and attempts to schedule    73 events outside this period would succeed at the participant's own risk.    74     75 Such a period where participant availability is known must be necessarily    76 expanded as time progresses. One-off events, once recorded in the free/busy    77 records, will not contribute further to expansions of those records. Recurring    78 events, however, may provide additional periods of interest as the    79 availability window moves forward in time.    80     81 To determine which events contribute recurrences, a list of objects (initially    82 all objects known to a user that have not been cancelled) is consulted and    83 their recurrence properties inspected. With such knowledge of recurring    84 events, upon expanding the availability window, only these "known recurring"    85 events need to be inspected for further contributions to the free/busy    86 records, and those no longer contributing after a given point can be discarded    87 from the list for future expansion of the window. Meanwhile, new events would    88 need to be added to the list, at least if they were defined as providing    89 recurrences that may occur in future availability periods.    90     91 === Updating Free/Busy Records ===    92     93 To update and thus expand availability information, it is suggested that a    94 regularly scheduled task be used to consult the events known (or thought) to    95 provide additional free/busy periods and to record such additional periods for    96 each user. This can be done using a system's `cron` daemon and a suitable    97 script in `/etc/cron.daily` or equivalent. Such a script is    98 [[../CronIntegration|provided]] in the imip-agent distribution along with a    99 program that can expand availability information for all known recipients of   100 calendar information.