[Cosmo-dev] detaching item occurrences

Brian Moseley bcm at osafoundation.org
Thu Aug 9 18:01:02 PDT 2007


in r537 i added support for detaching item occurrences.

a new "detached" link is added to the full projection for a recurring
item entry. the link points to a "detached item" resource which
follows the POE pattern (POST-once-exactly) for detaching an
occurrence. the detached uri looks like /atom/detached/{master
uuid}/{occurrence date}/{projection}?/{format}?.

PUT an entry containing an eim record set to the detached uri. the
record set describes the THISANDFUTURE changes being made to the
occurrence. the uuid of the record set and of its contained fields
must be freshly generated by the client, as it will be used as the
uuid of the newly detached master (and a 409 will be returned if this
uuid is already in use).

the server detaches the targeted occurrence, making it a master in its
own right. all occurrences and modifications from the original that
occur after the detached occurrence are transferred to the new master.
the new master is added to all collections of which the original
master is a member.

the response to this request is a 201 containing a (non-expanded)
entry for the new master with the requested projection and format. the
entry contains the usual links as per the projection (eg full
projection provides parent, modification, expanded, detached links).

subsequent POST requests to the detached uri return 404 since the
occurrence is no longer part of the original master item.

my end-to-end tests weren't quite successful, but i am pretty sure
that i was not constructing the input record set appropriately. i
observed a few oddities:

* after detaching the first occurrence of a daily-occurring event, the
original contained a single occurrence (the first), and the new event
also contained a single occurrence (the same one), and the subsequent
occurrences seem to have disappeared. not sure what i expect to happen
here: maybe detachment shouldn't actually happen in this case, and the
original item should just be updated?

* although i could GET the atom item entry for the new event via the
uuid i specified in the recordset, i  couldn't browse to it in the
account browser. i did see both the old event and the new event in the
account browser, but both seemed to have the same (original) uuid.

* i'm not sure what the record set is supposed to look like. should
rrule/exrule/rdate/exdate be included? all fields? etc.


More information about the cosmo-dev mailing list