Fwd: [Cosmo-dev] Interesting idea to avoid EIM conflicts
Morgen Sagen
morgen at osafoundation.org
Thu Feb 15 10:05:21 PST 2007
So after a lengthy discussion over in the chandler-design list, we've
decided this is indeed the way we would like to go with
lastModifiedBy (plus it also gives us a lastModified (time) field).
bcm: I won't be implementing this on the Chandler side until I return
on the 26th, so feel free not to touch this until then, I suppose,
otherwise Cosmo will be incompatible with Chandler.
Again, the idea is that whenever we want EIM fields that will *never*
result in conflict, we define a new record type for where all fields
in the record are keys. Thus a record never actually *changes*, only
created and deleted. We're including lastModified (time) as a field
in this record as well so that we can ignore out-of-date records.
Encoding this behavior into the schema in this manner means that when
some plug-in developer defines their own item types and sharing
schema, and they need the same behavior for one of their fields, we
don't have to modify our EIM-handling code at all -- it will just work.
FYI, the way Chandler handles this is we keep the EIM records around
for the last-agreed upon shared state of an item (plus the EIM
records representing pending conflicts). When it's time to send a
locally-changed item to the server, we generate the EIM records for
the current state of the item and compare those against the
previously synced state. If the item has generated a new
lastModifiedBy record, the diffing machinery will automatically see
that it needs to send a "deletion" record for the old lastModifiedBy
record. For the inbound direction, if we receive a lastModifiedBy
record from the server, we will only apply it to the item if its
lastModified (time) field is more recent than what the item already has.
~morgen
Begin forwarded message:
> From: Morgen Sagen <morgen at osafoundation.org>
> Date: February 13, 2007 6:07:12 PM PST
> To: Cosmo <cosmo-dev at osafoundation.org>
> Subject: Re: [Cosmo-dev] Interesting idea to avoid EIM conflicts
>
>
> On Feb 13, 2007, at 5:01 PM, Brian Moseley wrote:
>> morgen, tell me specifically what changes you want made.
>
> The schema change would be to add this record type:
>
> # -*- rnc -*-
> # RELAX NG Compact Syntax Grammar for the
> # EIMML modified-by record type Version 1
>
> namespace mod = "http://osafoundation.org/eim/modifiedBy/0"
>
> include "eimml-core.rnc"
>
> eimModifiedByRecord =
> element mod:record {
> (modUuid
> & modUserid
> & modTime
> )
> }
>
> modUuid =
> element mod:uuid {
> eimTextFieldContent
> }
>
> modUserid =
> element mod:userid {
> eimTextFieldContent
> }
>
>
> modTime =
> element mod:timestamp {
> eimDecimalFieldContent
> }
>
>
>
> ...or in python...
>
> class ModifiedByRecord(eim.Record):
> URI = "http://osafoundation.org/eim/modifiedBy/0"
>
> uuid = eim.key(schema.UUID)
> userid = eim.key(text256)
> timestamp = eim.key(eim.DecimalType(digits=12, decimal_places=2))
>
>
>
> ...and also to remove lastModifiedBy from the ItemRecord
>
>
>
>
> _______________________________________________
> cosmo-dev mailing list
> cosmo-dev at lists.osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/cosmo-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/cosmo-dev/attachments/20070215/1e1ebb07/attachment.html
More information about the cosmo-dev
mailing list