Sorry to drop into this discussion this late, but I completely failed to notice it and started to implement a CalendarGenerator by myself. You can find it in CVS head [1].

I took the opposite road form the one advocated by Geoff. My CalendarGenerator is designed to output a "blank" calendar for any month, that is without any event attached to dates.

It allows for extensibility through subclassing. Just override the:

void addContent(Calendar date, Locale locale)

method in your subclass. It will be called once for every calendar day in the month.

If you want to attach events to dates, my suggestion is that you parse your events source (say, an iCal file) in the "setup" method and store events in a suitable data structure, indexed by date. Then, in the overridden "addContent" method, find the events for the "date" arguments and output the desidered XML elements.

Comments?

Ugo


[1]: http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/java/org/apache/cocoon/generation/CalendarGenerator.java


Reply via email to