[Framework-Team] additional index for plone.app.event

Rok Garbas rok at garbas.si
Fri Nov 8 04:36:45 UTC 2013


Quoting David Glick (Plone) (2013-11-08 03:45:05)
> On 11/5/13, 1:07 PM, Johannes Raggam wrote:
> > Hi FWT!
> >
> > As I mentioned in the FWT meeting, cillianderoiste and I'm were adding
> > an "event_uid" index for plone.app.event to allow icalendar
> > import/export synchronization.
> >
> > When importing icalendar resources, each imported event is looked up in
> > the catalog (currently on the path, on which the events are imported) if
> > it already exists. If the event with a event_uid already exists, it's
> > updated - otherwise created.
> >
> > Events, which are created within Plone have a event_uid consisting of a
> > plone.uuid part and the domain name (as recommended by RFC5545), like
> > "a0c0d7b0c86f435f9187af18ab71b693 at plone.org".
> > To not have to query for the UID index and the event_uid index on import
> > time, each Plone-internal event should have it's event_uid field
> > populated and indexed. To avoid lengthy upgrade steps, I want to
> > populate the event_uid field and index it, when doing an icalendar
> > export. Only then the event_uid might become neccessary, namely if it is
> > imported later again.
> >
> > Here is the code:
> > Index creation:
> > https://github.com/plone/plone.app.event/blob/893bbfbe198a7d492fc75b170f9169a86bec45cc/plone/app/event/setuphandlers.py#L45
> > Lookup at import time:
> > https://github.com/plone/plone.app.event/blob/893bbfbe198a7d492fc75b170f9169a86bec45cc/plone/app/event/ical/importer.py#L134
> > Index populating DX:
> > https://github.com/plone/plone.app.event/blob/893bbfbe198a7d492fc75b170f9169a86bec45cc/plone/app/event/dx/behaviors.py#L458
> > DX indexer:
> > https://github.com/plone/plone.app.event/blob/893bbfbe198a7d492fc75b170f9169a86bec45cc/plone/app/event/dx/behaviors.py#L493
> > Index populating AT:
> > https://github.com/plone/plone.app.event/blob/893bbfbe198a7d492fc75b170f9169a86bec45cc/plone/app/event/at/content.py#L646
> >
> > ...
> >
> > Any thoughts or suggestions?
> >
> >
> It seems like when importing you could just strip off the domain and use 
> the existing UID index? We shouldn't add a new index unless we really 
> need it, because it makes writes slower and increases the chance of 
> conflict errors.
> 
> If we do need to add this index for some reason that I'm missing, it 
> should be a UUIDIndex instead of a FieldIndex so that we don't have to 
> store an IITreeSet for each index term (since there should only be one 
> event for each event_uid).

that was my question as well? is there a reason we need new UID or we could
reuse existing one? we would still be RFC5545 compliant, right?


--
Rok Garbas - http://www.garbas.si


More information about the Framework-Team mailing list