Roadmap to calendar mapping any acs_object
I was doing some thinking about the OpenACS calendar last night, trying to wrap my head around what I consider to be the holy grail for OpenACS' calendar: the ability to map any sort of acs_object onto the calendar package's calendar.
I thought about it for a while, and came up with a design and roadmap to get there that would work, provide an upgrade path, and would be quite efficient as well.
Design
The basic idea is that we make a level higher than the current calendar items, and implement some type of service contract (not necessarily acs_service_contracts, but possibly so).
We add to calendar a table which lists other packages which are registered as calendar sources. The calendar package itself, with its current calendar items, would be one such calendar source, but other packages, once they are updated to conform to the new calendar API, would register themselves as calendar sources as well.
The table in the calendar package is the service contract. It keeps track of all the packages that are registered as calendar sources, the the associated Tcl proc to call in order to get the information from those calendar sources (with different views of the data too, if we want to go that far (brief, normal, verbose), and Tcl procs to show filters, create pages, and the like.
The calendar package itself, when hit with a request, goes through these steps:
- Calls a memoized proc which finds a list of all the packages that are registered (room reservations, calendar items, project task deadlines) and the Tcl procs associated with them (basically, uses the service contract). Show these as options to the user on some part of the screen, with checkboxes next to the ones that are currently selected.
- Go down the list of currently selected packages, calling each Tcl proc to get the actual data to show on the calendar. The Tcl procs return a list of lists, with the Julian dates and the actual presentation information. We use CSS (and choose some sort of classes that standardize things, so we can change the UI of all the elements at once).
- We then go down the list and call procs (hopefully memoized) which show filter options as well. For example, you can filter down whose task deadlines you see, what rooms' room reservations you see, etc..
Some more details are available in the IRC log.
Roadmap
- Update calendar, adding the service contract (tables?). Make calendar work well with the new format.
- Add in another package, such as project-manager, to test how filters, etc.. work with more than one package. Write upgrade scripts.
- Create documentation for how to add your data to the calendar package.
- Update other packages.
Comments?