Monolithic Collections and KOrganizer / kontakt / download

View: New views
2 Messages — Rating Filter:   Alert me  

Monolithic Collections and KOrganizer / kontakt / download

by Markus Stürmer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
_______________________________________________
calendarserver-users mailing list
calendarserver-users@...
http://lists.macosforge.org/mailman/listinfo.cgi/calendarserver-users

Re: Monolithic Collections and KOrganizer / kontakt / download

by Helge Heß :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 04.09.2009, at 17:01, Markus Stürmer wrote:
> 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.

The proper thing to do would be to check for the 'Accept' header ...

Accept: text/calendar
=> ICS

Accept: text/html
=> HTML

Obviously Kontact would need to properly set the header, but I think  
its reasonable to require that, it it doesn't already.

Greets,
   Helge

_______________________________________________
calendarserver-users mailing list
calendarserver-users@...
http://lists.macosforge.org/mailman/listinfo.cgi/calendarserver-users