.. include:: ========================================= CosmoCardDav - CardDav support in Cosmo ========================================= :Author: Vinubalaji Gopal (Vinu) .. image:: ui/chandler/OSAFLogo.png :alt: Open Source Applications Foundation logo .. This document has been placed in the public domain. .. |bullet| unicode:: U+02022 .. |mode| unicode:: U+00D8 .. capital o with stroke .. footer:: OSAF, SF |bullet| August 10, 2006 Introduction ============ CardDav in Cosmo .. class:: incremental * Mentor: Brian Moseley and the Cosmo team * Cosmo - Is a calendar, file server and will also become an address book server * CardDav is a protocol to store, retreive, query and sync vcard information with a server * CardDav - vCard Extensions to WebDav is based on CalDav Problem ======= CardDav Protocol details .. class:: incremental * MKADBK support * Creating vCard Object Resources * Address Book Reports - adbk-query - adbk-multi-get Solution ======== The implementation strategy was to: .. class:: incremental * Use VCard4j for parsing and storing the vcard * Implement CardDav features based on the CalDav implementation * Understand and implement storage in Jackrabbit - the Java Content Repository * Use Cadaver, curl and the httptest to test the implementation VCARD Example ======================= .. class:: normal :: BEGIN:VCARD VERSION:3.0 FN:Brian Moseley N:Moseley;Brian;;; X-EVOLUTION-FILE-AS:Moseley\, Brian EMAIL;TYPE=OTHER:bcm@nospam-osafoundation.org UID:pas-id-44931D9800000000 REV:2006-06-16T21:07:36Z END:VCARD MKADBK Request in Cosmo ======================= :: prompt> curl -X MKADBK -u test1:test1 -v -H 'Content-Type: text/xml; charset="utf-8"' -d @mkadbk.xml http://localhost:8080/cosmo/home/test1/testadbk * About to connect() to localhost port 8080 * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 8080 * Server auth using Basic with user 'test1' > MKADBK /cosmo/home/test1/testadbk HTTP/1.1 ... < HTTP/1.1 201 Created < Server: Apache-Coyote/1.1 < X-Cosmo-Version: 0.5-SNAPSHOT < Content-Length: 0 < Date: Fri, 04 Aug 2006 19:44:58 GMT * Connection #0 to host localhost left intact * Closing connection #0 Repository view =============== :: /t/te/test1 /t/te/test1/cosmo:email = vinu@nospam-osafoundation.org /t/te/test1/cosmo:dateCreated = 2006-08-04T12:44:00.994-07:00 . . /t/te/test1/testadbk/adbk:language = en /t/te/test1/testadbk/dav:created = 2006-08-04T12:44:58.447-07:00 /t/te/test1/testadbk/dav:displayName = testadbk /t/te/test1/testadbk/dav:lastModified = 2006-08-04T12:44:58.447-07:00 /t/te/test1/testadbk/jcr:primaryType = dav:collection /t/te/test1/testadbk/jcr:mixinTypes = adbk:collection /t/te/test1/testadbk/jcr:mixinTypes = ticket:ticketable /t/te/test1/testadbk/dav:displayname = Lisa's Address Book /t/te/test1/testadbk/adbk:description = My primary address book. How to PUT a vCard Resource =========================== * Once an address book collection is created, we can start storing vcard's using the PUT command. * It looks like a ordinary PUT command, but in Cosmo the vcard is parsed at this stage * The parsed values are stored as key value pairs in the content repository and are used for reports * Each vCard resource must have a UID type and its value should be unique. Demo ==== What's left to be done ====================== Here's a short plan of what I intend to complete before leaving * Query Report support * Multiget Report support * Conform to the latest spec once it is released What I learned ============== Interesting lessons I'll take away from this experience: * Happy to contribute quality code to a open source software and to be part of the community * Got the oppurtunity to implement the CardDav draft * Understood JackRabbit and JCR 170 - a different approach to store data * Learnt to use wiki * and more.. More Info ========= * More Info here: CosmoCardDav_ * Questions? .. _CosmoCardDav: http://wiki.osafoundation.org/bin/view/Projects/CosmoCardDav