An initial version of the EventCalendar macro and parser in this proposal is added to MacroMarket. You can see the detail and discuss it in MacroMarket/EventCalendar
This is a new MoinMoin macro for event calendar (similar to MonthCalendar macro). The development is based on the MoinMoin MonthCalendar macro but it is a litte bit different from MonthCalendar. It is targeted to the one of PIM.
Feature (done)
- Monthly view of events
- Handles daily and timely events
Uses text files for storing event data doesn't sound like the wiki way!?
- Uses wiki subpages for storing event data
- In the wiki subpages, shows the events parsed. Sample below:
{ { {#!eventcal == My Birthday Party == My birthday is 2005/10/20. The party will be held from 14:00 to 20:00. Welcome everybody! } } }
My Birthday Party 2005/10/20 14:00 ~ 2005/10/20 20:00
- Add/edit/remove/list events
- Fields included: Title, Start/End Date/Time, Description, Reference Page in wiki
- macro/EventCalendar.py, parser/eventcal.py
To do list
Timezone information for date/time field (IMHO useless in PIM-like) ? be more concrete
- Daily view of events
- Weekly view of events (is it useful?)
Date/time Format customization (e.g., 2005/10, Oct. 2005, 18:00, 06:00pm) use userprefs for that
User-friendly interfaces with javascript (e.g., floating box for description, changing color over the event box) keep in mind some browser don't have js, so it should be usable without, too
- User- or Category- merged view of events (aggregates events from multiple data files)
More fields: Moderator, PostDate/time, PostIP, Category, User this doesn't sound like generic calendar data
- Custom background color per event
- Custom icon per event
- Upcoming event list
Reference page-included event view (using Include macro?) sounds nice and wiki
- Reserved fields in data file for a future use
Platform Support
- Tested on/with:
MoinMoin 1.3.5
- Windows XP
- Python 2.4
- IE 6.0, Firefox 1.5b2, Mozilla 1.7a, Opera 8.5
at least add some tests with firefox and maybe opera
Sample & Screenshot
my wiki: http://silee.icu.ac.kr/mywiki/moin.cgi/CalendarTest
- Monthly view
- List view
- Event parser
Discussion
After debugging on the features done as above, I'll put this macro on the MacroMarket.
For better result, please suggest your idea or enhancement on this. Thanks.
-- SeungikLee 2005-10-27 01:29:04
- Please suggest how to handle the plain-text file. The data text file contains:
<EventID> \t <Title> \t ... \n ...
- Appending a new event does not matter but updating or removing a line from the file is somewhat problematic in terms of performance. My ideas are 1) to read all, update/remove, and overwrite all, 2) to read until the item, update/remove, overwrite remains, and truncate it. If the size of event data file grows up - I think that it's not much but - it may cause some performance issues. One alternative is to use separate files according to the range of event id, e.g., data1.txt for 1-1000, data2.txt for 1001-2000, etc. Any suggestion?
-- SeungikLee 2005-10-27 01:51:46
- Its hard to edit tab separated file, maybe use some other separator, or use some markup.
- At inserting the data, it replaces tab to other characters. I've tried to use xml for this but its file size grows much.
Of course XML suck for data entry. But you may use wiki markup, for example:
== Event Name == Event description... start:: 2005-10-25 14:00 end:: 2005-10-28 20:00 foo:: bar
This markup is automatically rendered in a meaningful way:
Event Name
Event description...
- start
- 2005-10-25 14:00
- end
- 2005-10-28 20:00
- foo
- bar
You can parse this data using a special event formatter, that ignore everything but heading level 1, paragraph, text and definition list. When you format you page with such formatter, it can produce a list of events objects, each with name, start, end, foo and description. Check how MoinMoin/formatter/pagelinks.py works. I think this will be the easiest way to parse your data into format you can use. Then pickle your event data in the page cache directory. Next time you need to read the page data, use the cache. Check how Page use this system to create a pagelinks cache - Page.getPageLinks, Page.parsePageLinks.
It's a good suggestion, I think. But I'm trying to avoid to use dedicated wiki pages for event data only, because it generates orphan pages. My target is: we just create and maintain normal wiki pages, and insert a marker for an event record when we need event calendar for neat scheduling. I use the parsing block with eventcal as the marker. For example, http://silee.icu.ac.kr/mywiki/moin.cgi/CalendarTest2 shows how the MoinMoin 1.5 release schedules in http://moinmoin.wikiwikiweb.de/MoinMoinTodo/Release_1.5 can use this method.
-- SeungikLee 2005-10-29 18:26:31
- What is wrong with orphaned pages?
not wrong but it is fully dependent to the calendar so that the wiki pages for storing event data need to be removed when the calendar for these is not needed any more. My suggestion is that the event information is our normal wikis and you could insert a marker per event record - without or with small changes in its text - when you've got to aggretate all the related events in user-friendly format, e.g., monthly view of the events.
- If you can put events in any page, how do you collect events in the event viewer? Lets say you have a good solution to collect events from all the wiki - how do you find the event source when you want to remove or edit events?
- Not all the wiki but child pages of some page where macro inserted or specified. Of course that it may be very tough job to search the events from all the pages if we specify the root page as the target. In the event calendar, each event entry has the reference page which the event information is collected from. To make it easier to find the event entry in the reference page, a bookmark to this could be generated automatically.
- Could you give me a hint for that? I'll take it into my consideration.
-- SeungikLee 2005-10-27 03:47:38
Seems that you don't need that hint any more
Use page content, not a file.
I've inserted the functionalities you mentioned. It uses wiki page content as well as text data files, and a parser shows the event item in the page content. Please visit the sample site (http://silee.icu.ac.kr/mywiki/moin.cgi/CalendarTest). It's very buggy but give your comment please. Thanks. -- SeungikLee 2005-10-28 16:26:48
Why use both data file and a wiki page?
I tried your event test page. It is not clear how you should work with it. I learned by trial and error that each #!eventcal is an event, and I guess you use the date~date as start and end date.
I suggest you write a specification that describe what kind of activities you want to support, and how people should do common tasks. For example, how one should add an event, change event data like start date, end date etc. It is hard to test the implementation when you don't know what the system should do
Oops. Sorry for inconvenience. Please refer to http://silee.icu.ac.kr/mywiki/moin.cgi/CalendarTest/EventTest. Thanks.