2

My application generates a complex calendar at runtime, so any user has tasks for a specific date/time and every task has a description + some properties.

I have been requested to "publish" this calendar as webCal. I have no knowledge about webcal, anyway I wonder if anyone of you has already tried for it and can write his comments or suggestions.

One issue is "how to identify a user"? Since I have a multiuser calendar, how do I publish individual calendars for every user?

I think to a kind of Delphi service application that runs continuously, publishing the calendar.

Flavien Volken
  • 19,196
  • 12
  • 100
  • 133
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249

1 Answers1

5

It depends on whether your users need write access to their calendar.

I once wrote a simple (command-line) utility that exports a single (.ics) calendar file. If changed, it uploads the exported .ics file to a web server, where it can be picked up by calendar clients (e.g. Google Calendar, iCalendar, Sunbird, Outlook). Publishing for different users can easily be done by uploading the .ics file to a different folder for each user.

Next, I scheduled this utility to run regularly. Of course, you could have your Delphi service do this regularly.

Many calendar clients understand http:// URLs as well as webdav:// URLs. Authentication can be arranged by using one of the regular HTTP authentication schemes. Of course, you’ll want to use SSL to secure things.

The only limitation of this is approach is that the resulting calendar is, in effect, read-only.

If you wanted to provide write access, you’ll need a real webcal server. A real webcal implementation would mean supporting the webdav protocol (which itself is an extension of the HTTP protocol) on the server, and picking up the changes from your Delphi service. Either that, or writing a WebDav/CalDav server in Delphi (e.g. using the Indy TIdWebdav component by extending the TIdHTTPServer component, since Indy doesn’t sport a TIdWebdavServer component).

You’d have to process all the webdav-specific commands yourself (using the OnCommandOther event), according to the WebDAV specs. This question about writing a WebDAV server may provide some pointers...

Alternatively, you could use a 3rd-party webdav server, and pick up any changes from your Delphi service.

Community
  • 1
  • 1
Martijn
  • 13,225
  • 3
  • 48
  • 58
  • THanks for the reply, so i must write a webserver that supports the wbdav protocol. Did you use Indy? Can you publish a sample program? I would be interested in a server who publishes and a client that interacts with the server. Google returns lots of questions with no answers, this would be the first example! – UnDiUdin Jul 19 '12 at 07:40
  • @user193655: No, I only exported a (read-only) calendar file, and I uploaded that using FTP; so I didn't need to write a Webdav server. – Martijn Jul 19 '12 at 08:10
  • Thanks, could you please better explain me wheree you updated? And how you publish? are you using an existing server? I have zero knowledge about this, but after your comment i feel my solution is quite near. I have an ical file, but how to publish it "with ftp"? Could you please write a "for dummies" step by step description on how you pass from iCal file to a working webdav server? – UnDiUdin Jul 20 '12 at 09:23