[CalendarServer-users] Monolithic Collections and KOrganizer / kontakt / download

Markus Stürmer markus.stuermer at informatik.uni-erlangen.de
Fri Sep 4 08:01:41 PDT 2009


In principle, KOrganizer (kontact?) should be able to _subscribe_ to  
calendars hosted by DCS, if EnableMonolithicCalendars is enabled  
(default).

The problem is an "exception" hacked into CalendarServer/twistedcaldav/ 
resource.py: Whenever a normal browser connects to an …/ 
<calendarname>/-URL, it does NOT get the collection as ics file, but a  
nicely rendered HTML page.

KOrganizer's problem is that it cannot be destinguished from konqueror  
(in my case, it identifies itself as "Mozilla/5.0 (compatible;  
Konqueror/3.5; Linux) KHTML/3.5.7 (like Gecko) SUSE") and therefore  
gets an HTML page instead of an ics file. The check is

  119         if config.EnableMonolithicCalendars:
[ comments, explanation, telling it's a hack ... ]
  132             agent = request.headers.getHeader("user-agent")
  133             if agent is not None and (
  134                 agent.startswith("Mozilla/") and  
agent.find("Gecko") != -1
  135             ):
  136                 renderAsHTML = True
  137             else:
  138                 renderAsHTML = False

I added a (dirty) check to evaluate a certain get request, and then  
disables that special handling for browsers:
  134                 agent.startswith("Mozilla/") and  
agent.find("Gecko") != -1 and not request.uri.endswith("/?ics")

This way all browsers and kontact can get ics-files whenever they add  
"?ics" to the calendar path, e.g. https://www.example.com/calendars/doe/calendar/?ics

Of course, this is not a real solution, but I think it's an acceptable  
workaround because it affects only a single line and does not change  
the behavior of the server otherwise at all.

Regards,
Markus


More information about the calendarserver-users mailing list