Connecting jCaldav Joomla Component to DAViCal Server

This tutorial shows how to connect my Joomla! jCaldav component to a DAViCal server. The DAViCal server was already running on my local machine; a tutorial to achieve this is at openSUSE-11-2-DAViCal-Installation. It is therefore assumed you have access to working DAViCal and Joomla! setups and, if you want to perform my test in the middle of this tutorial with the Chandler client, you will need that too. However, the Chandler steps are not required - they were included to check everything had been created satisfactorily in DAViCal.

The goal is to upload a previously created .ics file into DAViCal, and then check that jCaldav on Joomla is correctly showing the events. For the sake of this exercise, I have chosen a calendar file containing football fixture events, although this is of course arbitrary. If you would like to create your own calendar files programmatically, check out my Perl tutorial iCalendar-ics-Perl-FIFA-2010-World-Cup-Coding-Tutorial. The calendar file is shown below for completeness.

BEGIN:VCALENDAR
CALSCALE:GREGORIAN
METHOD:PUBLISH
PRODID:Data::ICal 0.15
VERSION:2.0
X-WR-CALNAME:Barrow
BEGIN:VEVENT
CATEGORIES:http://calsync.homelinux.com\;SPORT\;FOOTBALL\;Barrow
DESCRIPTION:Downloaded from http://calsync.homelinux.com\n\nBarrow v Crawle
y Town
DTEND;TZID=Europe/London:20100415T214500
DTSTAMP:20100409T083325Z
DTSTART;TZID=Europe/London:20100415T194500
SUMMARY:Blue Square Premier: Barrow v Crawley Town
UID:201004050900051270454405.93849@calsync.co.uk
END:VEVENT
BEGIN:VEVENT
CATEGORIES:http://calsync.homelinux.com\;SPORT\;FOOTBALL\;Barrow
DESCRIPTION:Downloaded from http://calsync.homelinux.com\n\nKidderminster v
  Barrow
DTEND;TZID=Europe/London:20100420T214500
DTSTAMP:20100409T083325Z
DTSTART;TZID=Europe/London:20100420T194500
SUMMARY:Blue Square Premier: Kidderminster v Barrow
UID:201002120842051265964125.1292@calsync.co.uk
END:VEVENT
BEGIN:VEVENT
CATEGORIES:http://calsync.homelinux.com\;SPORT\;FOOTBALL\;Barrow
DESCRIPTION:Downloaded from http://calsync.homelinux.com\n\nHiston v Barrow
DTEND;TZID=Europe/London:20100424T170000
DTSTAMP:20100409T083325Z
DTSTART;TZID=Europe/London:20100424T150000
SUMMARY:Blue Square Premier: Histon v Barrow
UID:200907031206091246619169.75522@calsync.co.uk
END:VEVENT
BEGIN:VEVENT
CATEGORIES:http://calsync.homelinux.com\;SPORT\;FOOTBALL\;Barrow
DESCRIPTION:Downloaded from http://calsync.homelinux.com\n\nBarrow v Steven
age
DTEND;TZID=Europe/London:20100508T170000
DTSTAMP:20100409T083325Z
DTSTART;TZID=Europe/London:20100508T150000
SUMMARY:F: Barrow v Stevenage
UID:201003260835091269592509.05241@calsync.co.uk
END:VEVENT
BEGIN:VEVENT
CATEGORIES:http://calsync.homelinux.com\;SPORT\;FOOTBALL\;Barrow
DESCRIPTION:Downloaded from http://calsync.homelinux.com\n\nYork v Barrow
DTEND;TZID=Europe/London:20100413T214500
DTSTAMP:20100409T083325Z
DTSTART;TZID=Europe/London:20100413T194500
SUMMARY:Blue Square Premier: York v Barrow
UID:201002120842051265964125.51707@calsync.co.uk
END:VEVENT
BEGIN:VEVENT
CATEGORIES:http://calsync.homelinux.com\;SPORT\;FOOTBALL\;Barrow
DESCRIPTION:Downloaded from http://calsync.homelinux.com\n\nBarrow v Salisb
ury
DTEND;TZID=Europe/London:20100417T170000
DTSTAMP:20100409T083325Z
DTSTART;TZID=Europe/London:20100417T150000
SUMMARY:Blue Square Premier: Barrow v Salisbury
UID:200907031206101246619170.63978@calsync.co.uk
END:VEVENT
BEGIN:VEVENT
CATEGORIES:http://calsync.homelinux.com\;SPORT\;FOOTBALL\;Barrow
DESCRIPTION:Downloaded from http://calsync.homelinux.com\n\nHayes &amp\; Ye
ading v Barrow
DTEND;TZID=Europe/London:20100410T170000
DTSTAMP:20100409T083325Z
DTSTART;TZID=Europe/London:20100410T150000
SUMMARY:Blue Square Premier: Hayes &amp\; Yeading v Barrow
UID:200907031206111246619171.62007@calsync.co.uk
END:VEVENT
BEGIN:VTIMEZONE
TZID:Europe/London
BEGIN:STANDARD
DTSTART:20001029T020000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
TZNAME:Europe/London
TZOFFSETFROM:+0100
TZOFFSETTO:+0000
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20000326T010000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
TZNAME:Europe/London
TZOFFSETFROM:+0000
TZOFFSETTO:+0100
END:DAYLIGHT
END:VTIMEZONE
END:VCALENDAR

1. Create New Principle

Create New PrincipalPoint a web browser at your DAViCal server and login in. Click on User Functions->Create Principal and populate the form. I have said this principal is a Person, but a Resource would probably have been a smarter selection. Click on 'Read' to auto-populate the access control settings, then click on Create when you are ready

2. Created New Principal

Created New PrincipalThis screen shows the details of the principal we just created. Now click on Create Collection at the bottom of the screen.

3. Create New Collection

Created New CollectionPopulate the fields here as appropriate. You will need to find the calendar file on your local filestore. Click on Create once all the fields are filled and options are selected.

4. Creating New Collection

Creating New CollectionOnce the collection is created, make a note of the DAV path - ringed in the image to the left. We will need this later. The collection is in the DAViCal server and in the next steps we'll check everything is OK by connecting Chandler client to the server. These steps can be missed out.

5. Chandler Test: Subscribe

Chandler SubscribeSo the non-mandated Chandler tests start here. Run Chandler up and click on Share->Subscribe. You will see the subscription dialog box. Insert in here the URL we saved from the previous step. Don't forget to add the domain name - in this case it's localhost. Click Subscribe

6. Chandler Test: Subscribe (2)

Chandler Subscribe (2)The dialog box will expand to allow the insertion of the account and password. These are the values you used to create the new principal. Click subscribe.

7. Chandler Test: Collection

Chandler CollectionChandler will now merrily connect to DAViCal and fetch the collection, displaying the screen shown left. Everything looks ok so we are confident the setup is correct.

8. Joomla Administration jCaldav

Joomla jCaldavNow login to your Joomla site as an Administrator and click Components->jCaldav. You will see a list of the current collections known to the system. Click on New.

9. jCaldav Create Collection

jCaldav CollectionThe Create Collection screen should be populated similarly to that depicted on the left. A few points worthy of note - the URL is the same URL we created during the Chandler test, which is the DAV link plus the domain name. The userid and password are the values from the creation of the new principal in DAViCal, and don't forget to click on the Published radio button to ensure that the results are shown to the end user. Click on Save.

10. jCaldav Collections

jCaldav CollectionsYou will now see a screen listing the collections known to the system, including the one we just created.

11. Menu Item Manager

Menu Item ManagerWe now need to add the collection to a menu item which will enable Joomla to create a link to the dynamic page. Click on Menus->Demos. Note - Demos is a menu item I had already created, so you will need to create your own. Click on New

12. New Menu

New MenuNow click on jCaldav collection and the screen will reformat to the image to the left. Add a title and select the collection under Parameters (Basic). Click Save.

13. Menu Item Manager

Menu CollectionThe menu list will now show the latest entry and we are now ready to check it out!

14. Joomla Site Welcome Screen

Joomla Front ScreenNow point a web browser to its front screen. You will see on my system there is a list of jCaldav collections. Yours may be different depending upon how you have set up the menus. Click on Barrow AFC.

15. jCaldav Collection

jCaldav CollectionYou will now see the DAViCal collection shown on your Joomla! website. Job done! Smile