CardDav

Help
2011-08-03
2013-06-05
  • Stefan Lüer

    Stefan Lüer - 2011-08-03

    Hello community,
    i wanna connect to a CardDav Server and share Contacts with the server.
    On the mainpage it is written, that this is possible. I read the documentation a whole day, but i dont get an idea how to connect to CardDav? Is it the same way like CalDav? I checked the iCal, iCal Connector, but i didnt find anything.
    I will be happy to read your ideas / tips / solutions.. :-)
    Sincerely

     
  • Anonymous - 2011-08-03

    Hi Stefan,

    The documentation for the ical4j-connector isn't so great right now, I would suggest the best place to look is in the unit tests for the ical4j-connector project (checkout the latest from CVS).

    Note that I have tried the CalDAV functionality and it seems to work ok, however I have never actually tested with a CardDAV server, so I can't guarantee it will actually work (in theory it should work the same way as CalDAV I think).

    If you manage to get it working I would be happy to hear about it, or if you need more help post back in these forums.

    regards,
    ben

     
  • Pascal Robert

    Pascal Robert - 2011-08-04

    CardDAV works 90% like CalDAV, only some REPORT queries are different, and of course you manage vCard objects instead  of iCalendar objects.

    As for CalDAV, look like the store.getCollections() method have a problem, when I connect to a Kerio Connect 7.2 server, I don't get the list of collections. I will debug this, I need it for a migration I'm doing from TeamAgenda to Kerio Connect.

     
  • Pascal Robert

    Pascal Robert - 2011-08-04

    As for my Kerio Connect, my problem was here:

      URL url = new URL("http", "192.168.200.144", -1, "/");
      CalDavCalendarStore store = new CalDavCalendarStore("-//MacTI//WOCal//EN", url, PathResolver.KMS);

    So when I get the list of collections, the URL was:

      PROPFIND //full-calendars/oaciq-staging.com/probert/ HTTP/1.1

    Notice the two slashes. I removed the slash in the URL constructor and the problem went away.

     
  • Anonymous - 2011-11-09

    I want to connect via Ical with Google my calendar. and I have a problem with the following code .. Can anyone tell me what I did wrong?
    private static final String _ssl_username = "xxxxxxxx";
    private static final char _ssl_password = "yyyyyyyy".toCharArray();
    public void parse() throws MalformedURLException, ObjectStoreException,
    ObjectNotFoundException {

    URL url = new URL("https://www.google.com:443/calendar/dav/usename@gmail.com/user");

    CalDavCalendarStore store = new CalDavCalendarStore(PRODID, url,
    PathResolver.GCAL);

    store.connect(_ssl_username, _ssl_password);

    }

    CalDavCalendarCollection collection = store
    .getCollection("/users/admin/calendar/");

    // * @return and array of calendar objects

    Calendar calendars = collection.getEvents();

    if (calendars != null) {

    for (int i = 0; i < calendars.length; i++) {

    System.out.print(calendars_.getComponent("VEVENT")
    .getProperty(Property.SUMMARY));
    System.out.print(calendars.getComponent("VEVENT")
    .getProperty(Property.DTSTART));
    System.out.print(" - ");
    System.out.println(calendars.getComponent("VEVENT")
    .getProperty(Property.DTEND));

    }

    }
    }_

     
  • Pascal Robert

    Pascal Robert - 2011-11-10

    https://www.google.com/accounts (you should have a better username…), do it like this:

        URL url = new URL("https", "www.google.com", -1, "/");
        CalDavCalendarStore store = new CalDavCalendarStore("-//MacTI//WOCal//EN", url, PathResolver.GCAL);
        store.connect(user, password.toCharArray());
        CalDavCalendarCollection  collection = store.getCollection("calendar/dav/usename@gmail.com/user");

    Please be aware that Google Calendar CalDAV implementation is lame. You can't store VTODO objects in it, and all extra calendars, even the ones you create, are seen as delegated collections (use store.getDelegatedCollections to get them).

     
  • stive

    stive - 2011-11-11

    I got this error: net.fortuna.ical4j.connector.ObjectStoreException: HTTP/1.1 302 Found , it will place a temporary forwarding … You know how I can fix this error?

     
  • Pascal Robert

    Pascal Robert - 2011-11-11

    Make sure you have a slash at the end of the collection path (e.g., user/, not user).

     
  • stive

    stive - 2011-11-17

    Hi elvis,you mean something like :CalDavCalendarCollection collection = store.getCollection("calendar/dav/stivehogmeni@googlemail.com/user/");.The problem is: with or without the slash I have the same error.
    Should we not be handed over to the path of the. Ics file as a parameter to GetCollection? I mean something like :
    ("https://www.google.com/calendar/ical/username%40googlemail.com/public/basic.ics");

     
  • stive

    stive - 2011-11-17

    now it worked. I've checked with my CollectionID collection.getId () and then I have the copy in GetCollection (). Now I want to see the event. I try in my view, the for loop, but it does not quite work. He says illegaly Property .
    what should I do now
    Thanks

     
  • stive

    stive - 2011-11-22

    can someone tell me how can I fix this error? Google Calendar tells me that the property location is not valid.This is what I get when debugging my code:
    IN:VCALENDAR
    PRODID:-//Google Inc//Google Calendar 70.9054//EN
    VERSION:2.0
    CALSCALE:GREGORIAN
    X-WR-CALNAME:essaie
    X-WR-TIMEZONE:Europe/Berlin
    BEGIN:VTIMEZONE
    TZID:Europe/Berlin
    X-LIC-LOCATION:Europe/Berlin
    BEGIN:DAYLIGHT
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    TZNAME:CEST
    DTSTART:19700329T020000
    RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
    END:DAYLIGHT
    BEGIN:STANDARD
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    TZNAME:CET
    DTSTART:19701025T030000
    RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
    END:STANDARD
    END:VTIMEZONE
    BEGIN:VEVENT
    DTSTART;TZID=Europe/Berlin:20111025T143000
    DTEND;TZID=Europe/Berlin:20111025T153000
    DTSTAMP:20111110T112035Z
    UID:42cuv6iegplhqptmoldnqu8vmk@google.com
    CREATED:20111025T122521Z
    DESCRIPTION:
    LAST-MODIFIED:20111110T112035Z
    LOCATION:                                                                  --> error no Value for Location property
    SEQUENCE:0
    STATUS:CONFIRMED
    SUMMARY:Test
    TRANSP:OPAQUE
    X-MOZ-LASTACK:20111110T112033Z
    X-LIC-ERROR;X-LIC-ERRORTYPE=VALUE-PARSE-ERROR:No value for LOCATION propert  --> error
    y. Removing entire property:                                                --> error
    X-MOZ-GENERATION:1
    BEGIN:VALARM
    ACTION:EMAIL
    DESCRIPTION:This is an event reminder
    SUMMARY:Alarm notification
    ATTENDEE:mailto:username@googlemail.com
    TRIGGER:-P0DT0H10M0S
    END:VALARM
    BEGIN:VALARM
    ACTION:DISPLAY
    DESCRIPTION:This is an event reminder
    TRIGGER:-P0DT0H10M0S
    END:VALARM
    END:VEVENT
    END:VCALENDAR

    someone has a solution ?
    thanks!

     
  • Anonymous - 2011-12-12

    Hello all !

    I must say that I'm a little lost also with how to implement a CardDav client with iCal4j-connector :-/

    Does someone had managed to retrieve from a CardDav server a collection of .vcf files or put some .vcf files on a server ?

    Thank you in advance !

    Kind regards,

     
  • Pascal Robert

    Pascal Robert - 2011-12-13

    Hi Whistle Master ,

    I haven't try to work with CardDAV yet, but from what I know, you can start with CalDavCalendarCollection and CalDavCalendarStore as examples, because CardDAV is almost the same as CalDAV, the differences are in the properties that you send in your request and that it's VCard objects that you get back and forth.

    It's on my todo to work on this, but right now I'm working on optimization of some CalDAV requests.

     
  • Anonymous - 2012-01-30

    Hi Elvis,

    Did you make any progress regarding the CardDav implementation ?

    Thank you very much,
    Kind regards,

     
  • Anonymous - 2012-02-24

    Hi Elvis,

    I am working on a client,  which should copy/delete vCards into Apples Snow Leopard address book server. I am pretty new to Java (just started learning it about a week ago) so I didn't really know what to do with your connector library. Looked into the source code but further explanation is required I guess. Could you give me a simple instruction how to tell the client to connect with the ABS?
    Modifying the database afterwards shouldn't be the problem.

    Kind regards,
    Ed

     
  • Anonymous - 2012-12-27

    Hi all,
    "iCal4j Connector is an extension library that provides support for connecting to back-end calendar/vCard servers. Initial support includes connecting to CalDAV- and CardDAV-compliant servers, as well as Java Content Repository (JCR) implementations"
    Doesn't seem to be true for CardDAV - I see no methods for obtaining CardStore object using the connector (apart from connecting to JCR - which is not exactly CardDAV). But the doc says "We support CardDAV in Connector". I'm puzzled.

    I have tried to get vCards via CalDavCalendarStore somehow, but I don't see any way to do that (and it just seems to be wrong to use instance of CalDavCalendarStore for obtaining vCards instead of some instance of  CardStore - so I'm guessing it's not supposed to work this way).

    Please, help!

     
  • Pascal Robert

    Pascal Robert - 2012-12-27

    You have to use the CardDavStore. Example:

              CardDavStore kerioStore = new CardDavStore("//MacTI/MKS2Exchange", new URL("https://yourserver"), PathResolver.KMS);
             kerioStore.connect("myuser", "mypassword".toCharArray());

              for (CardDavCollection collection: kerioStore.getCollections()) {
                  for (VCard card: collection.getComponents()) {
                    contactsOut.append(card.toString());
                  }
              }

     
  • max

    max - 2013-01-14

    Hi all,

    I could find the last version the latest release of  ical4j-connector  is version 0.9.3. The latest snapshot version of it is 0.9.2. Well I can't see CardDavStore and CardDavCollection classes. Which package/jar file is correct for these classes?

    Thank you!
    Best regards.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks