jeff's picture

Most of the KKoncepts staff are already using the Mozilla Calendar - Lightning or Sunbird. But recently we decided that we wanted to share our calendars, so we can all see what each other is doing (or not doing, as the case may be.) :-)

Being lazy, rather than set up our own calendar server, we simply created a webdav share where we all can store our calendar files. We already use a custom Apache authentication module we wrote which authenticates against our email database of username and passwords, so we can easily use Apache to control who can access which calendars.

If you already have a local calendar in Lightning/Sunbird, you can easily publish it to a webdav share by right-clicking on your calendar's name in the Calendar pane and choosing "Publish". Mozilla will ask you where to publish it, and you enter in the full URL to your webdav share including a name for this file.

So I could publish my calendar to "https://www.kkoncepts.net/calendars/jeff.jansen". Assuming Apache is set up to allow me read-write access to that directory or at least that file, all is well. Now a colleague can come along and use the "New Calendar" wizard to add a new calendar. They choose that the calendar is "On the Network" (rather than local) and put in the same URL that I used to publish it. Assuming they have read access to that file, they will see all my appointments. If they have read-write access, they can edit it as well.

As far as people viewing that calendar are concerned, this works great. Under the "Preferences/Options" for Lightning, you can tell it how often to refresh remote calendars. By default it's every 30 minutes. So every 30 minutes, they see any changes that have been made to my calendar. In addition, they can always refresh it immediately by right-clicking in the calendar pane and choosing "Reload Remote Calendars".

But for the calendar owner, there's a problem. Every time they edit their calendar, they have choose "Publish Calendar" again. Changes made are not automatically uploaded to the server. This is annoying, to say the least.

We can, in fact, make Lightning upload our changes automatically, but it's a bit of a hack and it has some disadvantages, as I'll note afterwards. Basically, having uploaded your calendar with all its entries, you then delete it from your local calendar. (Make really sure it's been uploaded to the server first!) Then you use the New Calendar wizard to connect to your own calendar on the webdav share. Now Lightning will treat it like a remote calendar, and changes made to remote calendars are uploaded immediately. As soon as you make a change to your calendar, that change will be copied to your calendar file on the webdav share.

If you don't have a local calendar, then you can skip deleting the local one and just use the New Calendar wizard to connect to a "not yet existing" calendar file on the network. An empty calendar file will be created (of course, you need to have write permissions in the webdav share to do this) and used as you add events.

The disadvantage of all this is that if you frequently work off-line, you can't edit your calendar. Lightning won't allow you to make changes to a remote calendar when you are off-line. Worse, if you are not connected to the network/internet but still "on-line" as far as Thunderbird is concerned, you'll see your changes locally, but of course, they won't be uploaded. So none of the folks viewing it will see these changes. And when your internet connection does come back up and Lightning reloads that calendar, your changes will be lost.

Lightning does have an experimental Cache option, but I haven't gotten it to work. In fact, with Cache enabled, sometimes Lightning has "forgotten" my calendar completely. It's there, but when no calls are ever made to the webdav server to access it (as I watch the apache logs).

Another disadvantages with this method is that when you edit your calendar, the WHOLE file is uploaded to the webdav server. Same thing when you reload. The whole file comes down. So if you have 1000s entries, this method probably isn't for you. You'll need an actual calendar server.

Also, since the whole file is uploaded and download, if two people both add/edit entries at the same time without having "reloaded" just before, the second will overwrite the first. Again, if you need to allow multiple people to edit the same calendar, you really need a calendar server.

But if only one person will ever be editing the calendar (and everyone else is just viewing it) and you don't have too many entries. This is an easy way to have calendar sharing.

Comments

An alternative...

Hi Jeff,
I really like Mulberry (http://www.mulberrymail.com/) as a calendar client that can connect to a WebDAV server. I just couldn't get Lightning / Sunbird to do what I wanted it to do, but Mulberry (after a little fiddling to get it setup) just works...
Sincerely,
Ben.