Re: 10.000 events in a Resource Calendar
Christian Mollekopf <[email protected]>
| Newsgroups | gmane.comp.kde.devel.kolab |
|---|---|
| Organization | Kolab Systems AG |
| Message-ID | <4155399.Oh8APWNbE5__2972.88307124308$1337530668$gmane$org@myhost2> |
On Sunday 20 May 2012 10.35:58 Jeroen van Meeuwen wrote: > On 2012-05-19 23:29, Christian Mollekopf wrote: > > On Saturday 19 May 2012 12.10:29 Jeroen van Meeuwen wrote: > >> Hi there, > >> > >> I'm attempting to develop the code that is going to do resource > >> management > >> as defined in [1], as far as the server-side components are involved > >> that > >> is. > >> > >> For testing purposes, I'm inserting 10.000 events into a resource > >> calendar, > >> all Kolab format version 3 of course. 10.000 is a lot to start with, > >> > >> Given an iTip message (to which a resource is "invited"), I want to > >> see if > >> there's a conflict with any of the existing events in the Calendar. > >> > >> To that end, I was wondering if there's a way to do this more > >> efficiently > >> than; > >> > >> 1) Obtain *all* event objects, > >> 2) Parsing *all* of them one by one, > >> 3) Until I find a conflict or run out of events. > >> > >> Any thoughts would be appreciated. > > > > If you can tell me what exactly you need in terms of conflict > > detection API, I can implement the required functionality in > > libkolab. > > What I need for this exercise is which events (if any) in $imap_folder > overlap with the [start]-[end] slice of time I'm getting. Recurrence > rules will need to be included, of course. > For that one we could create a wrapper for the KCalCore calendar which would be used like this: calendar = kolab.Calendar() for event in imap_folder calendar.addEvent(event) DateTime start DateTime end eventlist = calendar.getEvents(start, end); So the kolab.Calendar serves as in-memory cache, and can be kept around, for as long as required. First we can rebuild it everytime, later on we can improve it to be updateable etc. > A little further on, I may, from a set of folders (resources in a > collection) within which I may want to re-schedule reservations. See > http://wiki.kolab.org/Kolab_3.0_Resource_Management#Non-unique_resources > * get the conflicting Events (Resources) for the calendar cache * apply algorithm to update events * update cache if you still need it Or do you think you need any special facilities? Cheers, Christian > Kind regards, > > Jeroen van Meeuwen _______________________________________________ Kolab-devel mailing list [email protected] https://www.intevation.de/mailman/listinfo/kolab-devel
signature.asc
(application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEABECAAYFAk+5GRMACgkQF4TVOOpldADrHwCgtS5pycp6IqC7NKTFYUHthoDv VvYAoJNajeHvkz7whGtDo3NRIOf3YaKH =yxE8 -----END PGP SIGNATURE-----