Creating CalDAV & CardDAV Server
In this set of articles, we will describe how to create a CalDAV and CardDAV servers.
CalDAV / CardDAV Server is an Extension of WebDAV Class 1 Server
CalDAV and CardDAV standards are extensions of a WebDAV standard. All CalDAV/CardDAV servers represent Class 1 WebDAV server and as though all CalDAV/CardDAV interfaces in IT Hit library are derived from WebDAV interfaces used to build Class 1 servers: IHierarchyItem, IFolder, IFile, IItemCollection and IContent. In a typical CalDAV/CardDAV server, you will find a DavEngineAsync class and GetHierarchyItemAsync implementation that is very close to regular Class 1 WebDAV server but returns additional item types, as well as you will see class derived from ContextAsync. You will also find RequestAsync/ResponseAsync classes and authentication mechanisms identical to regular WebDAV server. The topics describing the above interfaces and classes could be found in the Creating Class 1 WebDAV Server article. If you are new to IT Hit WebDAV Server Engine library you may need to review it to understand the basics of the Engine workflow.
Potentially CalDAV/CardDAV server can also support Class 2 locking and versioning, however, most CalDAV/CardDAV clients do not support this functionality.
You are free to implement any folder structure that you need including the naming of folders and files. Your folders hierarchy data and calendar data can come from database, file system, could be extracted from CRM/ERP/CMS via its API or could come from any other source.
URLs and Display Names
Typically on a regular WebDAV server used for file management, your file names and URL parts must be identical. This requirement comes from the incorrect behavior of some WebDAV clients and is not relevant in the case of a CalDAV / CardDAV server. On a CalDAV / CardDAV server, the display name could be different from URL part. Often your calendar URL will contain a calendar ID while name will be a human readable name of the calendar. You are free to give any names your calendars as well as any folders and files including acl folders, home set folders, calendar and business card files, etc.
Note that typically calendar file names, business card file names and user file names are invisible to the end user. While calendar folder names and address book folder names are displayed in client user interface as calendar names and address book names. Some CalDAV/CardDAV clients may also display folders hierarchy under your home set folder.
This articles describes the content of calendar file, explains the difference between event components and instances and describes how the .ics file structure changes when you update a recurring event.