Cosmo URLs Proposal
This was the consesus during a meeting on Sep 18, 2006
When a collection is shared to a Cosmo server, various URLs will provide different forms of access to that collection. Each collection will have a "web url", suitable for browser-access, serving up the Cosmo UI HTML. For other access methods such as DAV, Atom, or RSS, there will be a URL which will deliver the appropriate payload. Those other URLs can be "discovered" by fetching the web url and parsing the HTML for link tags within the document head such as:
<head>
<link rel="self" title="Web" href="/web/bcm/mystuff/">
<link rel="alternate" type="text/html" title="DAV" href="/dav/bcm/mystuff/">
<!-- the following link will only appear if the collection is a calendar collection -->
<link rel="alternate" type="text/calendar" title="Webcal" href="/webcal/bcm/mystuff/">
<link rel="alternate" type="application/atom+xml" title="Atom" href="/atom/1.0/bcm/mystuff/">
<link rel="alternate" type="application/atomserv+xml" title="Atom Service" href="/service/bcm/mystuff/">
</head>
Collections will have the following "alternate" relation URLs:
- Web
- the Cosmo Web UI page ("self" relation)
- Webcal
- Returns an monolithic iCalendar representation of the calendar items in the collection; not included if the collection is not a calendar collection
- DAV
- Accessible via WebDAV/CalDAV/CardDAV (responds to PROPFIND and REPORT)
- Atom
- Returns an Atom 1.0 feed document
- Atom Service
- Returns an Atom Publishing Protocol service document
If the web URL was accessed via ticket, then the self and alt links in the HTML will include that same ticket in their URLs. Tickets present in URLs will override other authentication methods (such as form/cookie or basic authn). This is different behavior than in Cosmo 0.4, in which dav requests prefer Basic authn to tickets.
The APP service document provides an XML document in the format defined by the
Atom Publishing Protocol containing the same URLs as the web UI page. The service document enables interoperable autodiscovery of the collection's capabilities.
Since iCal, Google Calendar, and other webcal clients don't currently understand this auto-discovery mechanism, the Cosmo UI HTML will include a link which points to the webcal URL for the collection (including the appropriate ticket, if applicable).
Publishing
Chandler users first create a Cosmo account via the Cosmo sign-up page then fill out the account information (host, port, ssl, username, password, path) in the Chandler accounts dialog. The "path" field will refer to the DAV path, not the web path -- an important (and possibly confusing) distinction. When the Chandler user then publishes a collection to Cosmo, Chandler will construct the DAV URL for the collection based on the account settings and the collection name. When Chandler performs the MKCALENDAR (or MKCOL?) for that DAV URL, Cosmo will return the web URL via a
X-Cosmo-Web-Location header. Chandler then creates the read-only and read-write tickets on the DAV URL, and stores the DAV URL, the web URL, and both tickets. These tickets will provide access to the collection over any protocol or user interface. Chandler's "Copy URLs to Clipboard" feature will provide two URLs: the read-only web URL and the read-write web URL.
Subscribing
When a web URL is entered into...
- ...a web browser, the Cosmo UI HTML is displayed, and access control is determined by the ticket in the URL.
- ...Chandler's "subscribe" dialog, Chandler will GET the web URL, scan for the DAV alternate link, download the collection (via DAV), and save both URLs.
- ...Apple iCal, iCal will complain, since it won't understand HTML
--
MorgenSagen - 18 Sep 2006