Forum OpenACS Development: Syncing OpenACS Calendar to external information sources

Currently it is not possible to use parts of the calendar api for syncing dates with other systems, as it is heavily relying on ad_conn [package_id|url|user_id|...].

It is therefor not easy to synchronise calendar items from external calendar sources when there is no current connection. An example: When creating a dotlrn-class-instance i can use an rpc-call to get all the dates for the class-instance from the central computer system. These dates can then be inserted into the calendar of the class-instance.

I therefor propose the rewrite the calendar api to get the package data (instance name, url, package_id ...) from the database and not the current connection. What do others think about that?

Peter,

This is a good idea, but you do want to use the ad_conn information when it is available. The procedures should check if a connection is active by calling [ad_conn connected_p]

All you need is the package_id, the rest can be gotten from the site_nodes utilities.  This is important because they cache stuff and are fast.

One traditional way to handle this is to have API procs take an optional package_id parameter, which they default to [ad_conn package_id].

Since your code to insert items via an rpc-call "knows" that it is doing this, it could figure out the proper package_id and pass it in, no?

There were only a few lines to change in fact... One small change in calendar::item::get and some more changes in calendar::do_notifications. Passing in the package_id would be an option, but then i had to change calendar::item::new as well and i wanted to make as few changes as possible. As Don pointed out, after querying the database for the package_id, all other info can be retrieved via site_node utils. How could i contribute that change (might be quite useful for others)? Make a patch for a bug-tracker item?
Peter - create a patch for bug-tracker.
Hello Peter,
that's nice, I would like to see that in action also. We plan to have some integration of calendar into the IMS Enterprise that we're working on, in this case the DTD itself do not define specific class schedules, but we'll add that in special tags and the plan is to map it to users / class calendars within .LRN.