mxm Ical Tool
If you want to publish one or more Plone events as an iCalendar file, you can use this tool.
You can publish events via the catalog, from a single folder, from a branch of the site, or even single events using this tool. You can also import events from and iCalender file to a Plone Folder.
Rumor has it that "Mozilla Calendar", "Apple iCal", "Ximian Evolution", "KOrganizer" and more, can read iCalendar files. I have mostly tested it with the Mozilla Calendar, and have published my Plone events to it.
I also use it in an customer tool to syncronize to GroupWise calendars.
It should follow the RFC 2445 (iCalender v.2.0) 100%, but I would love to hear success/failue stories.
Usage (python scripts in the skin)
To export an iCalendar file of all your published events, you should use the "events.ical" python method:
To create a file from published events in a member folder and down:
There is a method called "catalogued_events.ics" which uses only catalogued data, so it should be faster. It has the disadvantage of only publishing the catalogued data, so it's a bit lossy.
To publish the events from a single folder, use the "event_folder.ics" method, which uses the event objects in the folder:
To publish a single event, use the "as_ical" method. It converts a single Plone event to an iCalendar file:
You can import events from an iCalendar with the
form. It is a very simple form and looks like this:
After the import, the events will be in the folder the form is used upon.
API (the tool itself)
iCalendar files are text files with a special format. The tool has a very simple API to convert to and from these "iCalendar string". Just 2 methods.
The first method converts from a list of events to an iCalendar string:
The second method converts an iCalendar string to a list of events, and store them in a Plone folder:
from_ical(ical_string='', folder=None, adapter='Event')
For examples you can check out the python script in the skin.
The real magic happens in the "adapter" parameter.
It can be a named adapter, which is a string naming one of the default adapters that is defined in the tool. so far there is "Event", "Brain" and "VEvent".
It can also be an adapter that is defined in an external method or 3. party product.
An adapter is a class special class that can convert to and from iCalandar values. (More info and examples in the "adapters.py" file.) It's pretty straightforward to create your own adapters. This should make it easy to import/export special objects like ATEvent's etc.
If you make new adapters, please let me know, and I will include them in the tool.
You need the iCalendar package for this to work. You can get the latest version from here
You should install it somewhere in the Python path of your Zope server. If you are in doubt, install it in "INSTANCE_HOME/lib/python/" so the complete path to the package will be "INSTANCE_HOME/lib/python/iCalendar"
Get it from here
Last modified 2005-02-08 04:20 PM