Interoperability with KOrganizer

Bug #79785 reported by Gintautas Miliauskas
8
Affects Status Importance Assigned to Milestone
SchoolTool
Confirmed
Wishlist
Unassigned

Bug Description

I found out that I have KOrganizer installed and it supports iCal (it can
upload calendars too). However, there are two problems concerning
interoperation with SchoolTool.

1) It appears that KOrganizer does not set the Content-Type header.
As a result, getHeader() returns None and SchoolTool spits out a
traceback here:

...
  File ".../schooltool/src/schooltool/rest/cal.py", line 268, in do_PUT
    if ';' in ctype:
exceptions.TypeError: iterable argument required

(rest/cal.py, lines 266-272)
    def do_PUT(self, request):
        ctype = request.getHeader('Content-Type')
>>>> if ';' in ctype:
            ctype = ctype[:ctype.index(';')]
        if ctype != 'text/calendar':
            return textErrorPage(request,
                                 _("Unsupported content type: %s") % ctype)

I don't know if it is a hard requirement for applications to set this
header. If it is, I will report a bug on KOrganizer. Nonetheless, we
might want to relax our iCal processing machinery for compatibility
reasons.

2) iCal files produced by KOrganizer have empty lines between events.
(An example is attached.)

The empty lines between events make SchoolTool choke, however, they
don't produce a traceback; error code 400 is returned with text which
KOrganizer doesn't show. ICalReader raises an unhelpful
ICalParseError during iterEvents: 'Syntax error in line: \n'.
Again, I don't know the specification so I can't say if the empty
lines are valid, however, I think relaxing this restriction is a good
idea for compatibility reasons.

P.S. I want to *KILL* roundup for providing such a measly textarea
for bug descriptions.

Tags: ical
Revision history for this message
Gintautas Miliauskas (gintas) wrote :
Revision history for this message
Gintautas Miliauskas (gintas) wrote :

(Please ignore the file 'korganizer')

Revision history for this message
Marius Gedminas (mgedmin) wrote :

On Mon, Aug 16, 2004 at 07:41:36AM +0000, Gintautas Miliauskas wrote:
> P.S. I want to *KILL* roundup for providing such a measly textarea
> for bug descriptions.

You do know that you can use email for submitting bugs into roundup,
right?

Marius Gedminas
--
Gates' Law: Every 18 months, the speed of software halves.

Revision history for this message
Gintautas Miliauskas (gintas) wrote :

I think that SchoolTool is wrong in requiring the Content-Type header.

I looked in RFC 2445 (iCalendar), but didn't find it specifically mentioned
that this header is mandatory.

Excerpt from RFC 2616 (HTTP/1.1)

   Any HTTP/1.1 message containing an entity-body SHOULD include a
   Content-Type header field defining the media type of that body. If
   and only if the media type is not given by a Content-Type field, the
   recipient MAY attempt to guess the media type via inspection of its
   content and/or the name extension(s) of the URI used to identify the
   resource. If the media type remains unknown, the recipient SHOULD
   treat it as type "application/octet-stream".

However, I did submit a wishlist bug
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=266382)

Here are the headers provided by KOrganizer:

PUT /persons/manager/calendar.ics HTTP/1.1
Connection: Keep-Alive
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.3; Linux) (KHTML, like Gecko)
Pragma: no-cache
Cache-control: no-cache
Accept: text/html, image/jpeg, image/png, text/*, image/*, */*
Accept-Encoding: x-gzip, x-deflate, gzip, deflate
Accept-Charset: utf-8, utf-8;q=0.5, *;q=0.5
Accept-Language: en
Host: localhost:7080
Cookie: auth=50a7d99dc116b084c6aeb3f4d213521c9ec2fdd1
Content-Length: 969

BEGIN:VCALENDAR
...

Revision history for this message
Gintautas Miliauskas (gintas) wrote :

I looked more into KOrganizer and found several problems apart the ones
mentioned.

The complete list of problems:
1) Content-type header not set (http://bugs.kde.org/show_bug.cgi?id=92257)
   (maybe not a bug)
2) Empty lines in calendar file (maybe not a bug)
3) KOrganizer does not deal with DURATION well, it seems to parse it but
   not save it back (http://bugs.kde.org/show_bug.cgi?id=92255)
4) KOrganizer exports all times in UTC, which we treat as local time, and
   in effect, (in Lithuania) event time moves 3 hours back on every
   load/export cycle.
5) Problems with parsing recurrent events:
  a) when weekly recurrence is specified through the Web interface, KOrganizer
     does not show the event at all.
  b) yearly recurrence is not recognized by KOrganizer (it probably expects
     BYMONTH and BYMONTHDAY to be explicitly specified)
  c) exceptions provided by SchoolTool are ignored by KOrganizer;
     SchoolTool barfs (traceback will be attached) when KOrganizer tries to
     submit an event with exceptions.
  d) a similar traceback as in (c) is thrown when trying to submit a
     recurrent event end-date.

There are probably more problems that I didn't come across...

A small patch that at least allows to do testing with KOrganizer is attached.

Revision history for this message
Gintautas Miliauskas (gintas) wrote :

The invalid date format traceback is attached.

Revision history for this message
Gintautas Miliauskas (gintas) wrote :

Some of the problems listed below have been solved.
Here is the updated list:

1) Empty lines in calendar file (maybe not a bug)
2) KOrganizer does not deal with DURATION well, it seems to parse it but
   not save it back (http://bugs.kde.org/show_bug.cgi?id=92255) (showstopper)
3) Problems with parsing recurrent events:
  a) when weekly recurrence is specified through the Web interface, KOrganizer
     does not show the event at all.
  b) yearly recurrence is not recognized by KOrganizer (it probably expects
     BYMONTH and BYMONTHDAY to be explicitly specified)

All would be fine and dandy if not for 2), which is a KOrganizer bug (possibly
in some iCalendar processing library) and would require substantial effort to
be fixed.

Revision history for this message
Reinhold Kainhofer (reinhold) wrote :

Hi, I'm the maintainer of KOrganizer. A few comments:

1) yes, KOrganizer adds empty lines between VEVENT, VTODO and VJOURNAL. I just
checked the specification (RFC 2445), and it doesn't say anything about blank
lines... (neither explicitly allowed, nor explicitly not allowed)

2) I just fixed the duration problem, so the next release of korganizer should
work fine (although KOrganizer can only edit the end time, but not the
duration).

3) KOrganizer (or rather libkcal, which is the iCalendar library, used by all
KDE applications that use iCalendar files, like KPilot for syncing, karm for
tracking time, knotes to store memos, etc) writes out all times in UTC (the
trailing Z after the time). The times in the ics file are UTC if the Z is
appended, and localtime if there is no such Z.
E.g. 11:00 UTC (12:00 in Vienna):
DTSTART:20041114T110000Z

and 11:00 local time:
DTSTART:20041114T110000

4) Concerning the Content-Type header: How exactly do you upload the calendar?
Do you have a remote resource? Which settings/pathes?

5) Concerning the recurrences: Can you please send us some sample files that
don't work?

6) Are the exception issues solved so far? (in particular, were these bugs in
schooltool, or is korganizer at fault, too?)

Cheers,
Reinhold

Revision history for this message
Gintautas Miliauskas (gintas) wrote :

Hello,

I am very glad to receive your comments.

> 1) yes, KOrganizer adds empty lines between VEVENT, VTODO and VJOURNAL. I just
> checked the specification (RFC 2445), and it doesn't say anything about blank
> lines... (neither explicitly allowed, nor explicitly not allowed)

That's fine, we should relax this restriction.

> 2) I just fixed the duration problem, so the next release of korganizer should
> work fine (although KOrganizer can only edit the end time, but not the
> duration).

Excellent. This is very nice to hear, as the duration problem was
critical for nice interoperation.

> 3) KOrganizer (...) writes out all times in UTC (the

SchoolTool was not aware of UTC/local time differences, but now that has
been fixed.

> 4) Concerning the Content-Type header: How exactly do you upload the calendar?
> Do you have a remote resource? Which settings/paths?

Yes, I do have a remote resource. I didn't see any settings that could
be related to the problem. Do you mean to imply that KOrganizer does
currently set the Content-Type header correctly?

Anyway, we have already relaxed this point, because Apple iCal doesn't
set Content-Type either.

> 5) Concerning the recurrences: Can you please send us some sample files that
> don't work?

These were probably mistakes on our part. I haven't done a more
thorough check recently (after fixing some bugs) though; it's possible
that several of these are non-issues already.

Perhaps the yearly recurrence might still have problems. I think that
KOrganizer expects BYMONTH and BYDAY to be specified, whereas SchoolTool
does not specify them. I think that these fields are optional, but I am
not sure.

> 6) Are the exception issues solved so far? (in particular, were these bugs in
> schooltool, or is korganizer at fault, too?)

It was a bug in SchoolTool.

Pardon for the fuss -- the SchoolTool iCalendar implementation is
relatively young and still has some rough edges.

By the way, thanks for KOrganizer -- it's very useful and usable
(although the interface needs a little work usability-wise). People
were aiming for compatibility with Mozilla Calendar and iCal, but I was
advocating KOrganizer; I think it was worth it, because we fixed a
handful of bugs in the process.

Best luck,
--
Gintautas

Revision history for this message
Marius Gedminas (mgedmin) wrote :

Can somebody check whether SB 1.0rc2 has any issues with recent KOrganizer versions?

Revision history for this message
Gintautas Miliauskas (gintas) wrote :

SchoolBell at present does not interoperate with KOrganizer at all. I had
worked out most of the important kinks in ST 0.9, but it appears that the fixes
did not make it when the timetabling code was ported from ST 0.9 to the current
Zope3 based one. Maybe not the latest available versions of the files were
taken, since there was quite a mess with branches.

Revision history for this message
Gintautas Miliauskas (gintas) wrote :

Partially addressed in revision 4088. Would be nice to have this backported.

I haven't tested many complex things, but recurrent events seem to work.

All day events are broken (1-day events show up as 2-day events in KOrganizer,
even though iCalendar source says DURATION=P1D).

Changed in schooltool:
importance: Medium → Wishlist
Changed in schooltool:
status: In Progress → Confirmed
Changed in schooltool:
assignee: gintas → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.