[Cosmo-dev] Meeting Summary: EIM Record Types (Jan 16)

Phillip J. Eby pje at telecommunity.com
Tue Jan 16 17:51:24 PST 2007


At 05:26 PM 1/16/2007 -0800, Morgen Sagen wrote:
>The biggest question is how to represent modifications to a recurring
>event.  The leading contender is to define an EventModificationRecord
>type, and for each event modification, include an instance of
>ItemRecord, NoteRecord, and EventModificationRecord.  The master
>event would be represented by an ItemRecord, a NoteRecord and an
>EventRecord.  The difficulty is ensuring that Chandler imports the
>master event records before the modification records, and Morgen's
>task is to investigate that.

The simplest way to do this, I think, is to have your Translator just hold 
records with dependencies until the dependencies are seen, or until 
finishImport() is called.

beginImport() can set up a dictionary mapping record-keys to lists of 
records that can't be processed until that key is seen.  After you process 
a new record, you check its key against the dictionary, and process any 
depending records that were queued, and replace the queue with None or 
something so you know any future depending records can go ahead and be 
processed without going into queue again.

Then, finishImport() would just go through and process any remaining queued 
records.

It's possible a general facility for this could be added to the Translator 
framework, since in principle the EIM schema knows what all the possible 
dependencies are between record types.  I'm out of the office on Thursday 
and Friday, but I might could have something mid-next-week to do this 
queuing automatically for all interdependent record types.  (Or 
alternately, implement it as a routine to "sort" a recordset by dependency 
order.)



More information about the cosmo-dev mailing list