[Kde-pim] Recurrence Exception handling
Christian Mollekopf
chrigi_1 at fastmail.fm
Fri Jan 18 01:50:40 GMT 2013
Hey,
Since Dan Vratil and me have hit the same Problem more or less simultaneously
for the Google-Resource respectively the Kolab-Resource, I'd like to share our
plans with this specific feature of iCal.
The problematic feature, which isn't fully supported by KCalCore so far, is an
exception to an event.
This feature allows to override a specific occurrence of a recurring event
with a new event, allowing to change any/all of it's properties on that
specific date.
In iCal this exception is represented by an additional event, with an
identical UID and an additional RecurrenceID, which contains the DTSTART of
the occurrence to override.
As this breaks the basic assumption that UID's are unique, kcalcore doesn't
like it and can't deal with it properly. KOrganizer simply creates a new event
and excludes the date from the original event, effectively loosing the
connection of the exception to the main recurring event.
My suggestion to fix this shortcoming would be to an exception-property to the
KCalCore::Incidence class, which holds a list of KCalCore::Incidence's. This
doesn't reflect how iCalendar models it (in iCal the exception is next to the
event and not contained), but I think a containment makes much more sense for
the in-memory representation. This way deleting an event automatically also
removes the corresponding exceptions. Further this way we don't have to care
about the UID's, we can simply generate special UID's for the exceptions which
are unique as well.
As this requires new API in kdepimlibs and we have to use that API from
kdepim-runtime, I suppose this fix has to wait for 4.12 (4.11 for the
kdepimlibs fix).
As temporary workaround we came up with the following solution, which can also
be backported to 4.10 (e.g. for 4.10.1).
* We create a new event for each exception, and assign it a new UID with the
pattern: UID_RECURRENCEID
* We exclude that specific date (RecurrenceID) on the original event.
* The original UID is stored in an attribute (Dan created a patch where it's
stored in an akonadi attribute, but we could also use a KCalCore custom value)
* We additionally store the original exception-dates of the main event, so we
can remove the additional date-exclusion again when writing the values back to
the server.
This way we can implement the feature transparently to korganizer, which
should work mostly fine, as exception and event can be modified from
korganizer, although korganizer has no comprehension of the link between
exception and original event. There are some glitches, such as the resource
automatically deleting the exception after the main event has been deleted,
but that's still better than just breaking or dismissing the feature
alltogether.
Dan already prepared a patch for the google resource, I will then do the same
for the kolab-resource, and possibly the ical serialization.
If you have any input or concerns, let us know.
Cheers,
Christian
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list