[Vobject] VAVAILABILITY usage / documentation ?

Jeffrey Harris jeffrey at skyhouseconsulting.com
Wed Mar 17 12:31:27 CDT 2010


Hi Erik,

>     Thanks for taking the time to read my question & respond.  I
> believe, based on your response, that what I'm looking for doesn't
> exist yet.  But I'll try and clarify what I'm doing with an example
> just in case.

Hmm. I definitely agree there's no nicely-encapsulated logic for what you're looking for, but I'll repeat that I'm fairly certain the CalendarServer folks are doing a superset of this, it's just may not be easy to pull out their logic.

I think you're likely to produce a more complete and general (but still nicely encapsulated) solution if you can team up with those folks. So in my ideal world, you'd ask them to point you to where in their code the basics of this logic lives, and see if you can pull that out in a way that's still useful to them.

>     What I'd like is to be able to do is create a calendar, add the
> first two v-events into the calendar, and then query the calendar to
> see if a particular datetime or datetime + timedelta or relative is
> busy or available.  I think this is about the same thing you suggested
> you would be open to here:

Things get messy in a hurry if you want this to work for indefinitely recurring events. What should the return value be if I'd like to reserver every Wednesday at 1PM, and there's a single day that's busy, but all the rest are free?

>     This is really expensive (cycle wise), but I can't think of a
> smarter way to do it.

I'm not 100% following how you've done this. What you describe as X-AVAILABILITY sounds like you could standard transparancy see for ( http://tools.ietf.org/html/rfc5545#section-3.8.2.7). Layering sounds interesting, but I'm not sure how it would work. I'm not clear on why you restrict/bin things by half hour.

Here's how I've imagined doing this. If you have mostly adds, and few removes, write functions to convert an individual vevent (or whatever else) into a busy-blocks object (which encapsulates a list of datetime+timedelta tuples), then define an addition operator for those busy-blocks. You can cache the aggregate daily or weekly busy blocks, and any time you add a new event, as a side effect update the cached busy-blocks with the new event's busy block (this is cheap). You'll have to rebuild many of your busy blocks any time you subtract/change an event, of course.

Hope that helps,
Jeffrey


More information about the VObject mailing list