GithubHelp home page GithubHelp logo

caldav4j's Introduction

CalDAV4j Overview

Build Status Build Status
Maven Maven Status
License Apache 2.0 License

CalDAV4j is a java library implementing the CalDAV protocol for the client side implementation.

CalDAV4j makes it easy to issue complex queries to a caldav server, supporting free-busy and calendar-collections. Moreover, it supports the standard adding and removal of events.

CalDAV4j

Goals

  • High-Level CalDAV API's: This API works at the level of iCal4j objects, and allows for high level operations. All the "hard" protocol work that you need to do to make this happen is hidden from the end user.

  • Low Level API Access: Let's you work at the Http/WebDAV/CalDAV protocol level by creating instances of HttpMethods (like GetMethod, MkCalendar, ReportMethod, etc.) and executing them.

  • Flexible query language support: An easy and flexible query language (eg. for events in a given date range); and Recurring event management (eg. updating master events and recurrence instances).

  • Performance: When possible, caches (such as caches of etags and icalendar resources) are maintained so that network chatter and parsing of icalender files is minimized.

  • Compliance: We aim to be compliant with the following specs:

    • CalDAV spec and updates. (RFC 4791, RFC 7809)
    • CalDAV Scheduling specs. (Work in Progress, RFC 6638)
    • Reliability: Many functional tests and the "rails" for checking your caldav implementation support.

Using CalDAV4j in your code

CalDav4j is available currently on Maven Central, thus to add it, you can add a dependancy by adding the following to the pom.xml:

<dependency>
    <groupId>com.github.caldav4j</groupId>
    <artifactId>caldav4j</artifactId>
    <version>0.9.2</version>
</dependency>

Gradle:

compile 'com.github.caldav4j:caldav4j:0.9.2'

For more information on how to add CalDAV4j into your code, please refer to: https://search.maven.org/artifact/com.github.caldav4j/caldav4j/

There are two versions currently 0.9.2 (Stable based on HttpClient 3.x) and 1.0.0-rc.1 (Dev branch based on HttpClient 4.x) depending on which version of HttpClient you want to use will determine the version to use.

Documentation

The unit tests are currently best place right now to see how to use CalDAV4j. Documentation can be found on the wiki

Building

CalDAV4j uses Maven as its build system. To build this project, one must simply install through maven, while skipping all the tests:

mvn install -DskipTests

Testing

During package creation, you can test your caldav server replacing the caldav4jUri with your own custom one.

mvn package -Dcaldav4jUri='https://user:[email protected]/base/user/collections/'

A Docker image of a caldav server, Bedework (~900MB) is distributed via Docker Hub:

docker run -d -p 8080:8080 ioggstream/bedework
mvn clean package -Dcaldav4jUri='http://vbede:bedework@localhost:8080/ucaldav/user/vbede/'

Before committing, always reformat your code

mvn -e spotless:apply

License

CalDAV4j is licensed under the Apache 2.0 License

  • Copyright © 2005-2011 Open Source Application Foundation
  • Copyright © 2011 - Present Individual Contributors

Contributing Organizations and Individuals

Current Status

CalDAV4j 0.9.2 is the current (tagged) release and 1.0.0-rc.1 is the current development branch.

For the complete changelog, refer to this page.

caldav4j's People

Contributors

alexander233 avatar artheus avatar dependabot[bot] avatar enummela avatar ioggstream avatar markhobson avatar naramski avatar pietro-ventura avatar ssams avatar teymourlouie avatar theantimist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

caldav4j's Issues

Upgrade use of Slide to Jackrabbit

The Slide project has been retired:
http://jakarta.apache.org/slide/

We should upgrade to Jackrabbit WebDAV Library 1.4:
http://jackrabbit.apache.org/jackrabbit-webdav-library.html
http://repo1.maven.org/maven2/org/apache/jackrabbit/jackrabbit-webdav/1.4/

Original issue reported on code.google.com by [email protected] on 3 Sep 2008 at 4:07

complete GenerateQueryTest

Problem

* junit GenerateQueryTest never fails, it simply print to log resulting
GenerateQuery output.
* we should check that resulting output matches the CalendarQueries listed
in RFC4791 creating files matching the queries.
* main issue is about comparing XML 




Original issue reported on code.google.com by [email protected] on 19 Dec 2008 at 3:41

Forced 'Content-type' header.

Hello, 
The method addRequestHeaders in class CalDAVReportMethod always includes a 
'Content-type' header, even if it is already present. In that scenario,  the 
resulting request will have two 'Content-Type' headers. Some servers will 
return a '400 Bad request' response.

Original issue reported on code.google.com by [email protected] on 13 Oct 2009 at 10:59

Unit test references missing resourse

What steps will reproduce the problem?
1. Run SchedulePostMethodTest against Apple CalendarServer

What is the expected output? What do you see instead?

expected: a succeeding unittest

seen: a message that iCal-20081127-092400.ics cannot be found

What version of the product are you using? On what operating system?

svn trunk on ubuntu linux


Original issue reported on code.google.com by arnout.engelen on 26 Mar 2009 at 2:11

GCalDAVCalendarCollectionTest.java fails because of wrong exception type

When i execute GCalDAVCalendarCollectionTest, testAddRemove fails with 
the exception given below. testAddRemove expects a
ResourceNotFoundException exception, and this exception is correctly 
thrown in getETag. However, the "catch (Exception e)" in getETags 
catches this exception and rethrows it as a CalDAV4JException exception.

The attached patch fixes this problem, and
GCalDAVCalendarCollectionTest.testAddRemove successfully
passes.



org.osaf.caldav4j.CalDAV4JException: Problem executing get method
    at
org.osaf.caldav4j.CalDAVCalendarCollection.getETag(CalDAVCalendarCollection.java
:786)
    at
org.osaf.caldav4j.CalDAVCalendarCollection.getCalDAVResource(CalDAVCalendarColle
ction.java:665)
    at
org.osaf.caldav4j.CalDAVCalendarCollection.getCalendarByPath(CalDAVCalendarColle
ction.java:135)
    at
org.osaf.caldav4j.google.GCalDAVCalendarCollectionTest.testAddNewRemove(GCalDAVC
alendarCollectionTest.java:257)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
    at
com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:108)
    at
com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunne
r.java:42)
    at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter
.java:165)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:105)
Caused by: org.osaf.caldav4j.ResourceNotFoundException: Could not find
resource for the PATH
'/calendar/dav/[email protected]/events/NEW_UID.ics'
    at
org.osaf.caldav4j.CalDAVCalendarCollection.getETag(CalDAVCalendarCollection.java
:776)
    ... 26 more


Original issue reported on code.google.com by [email protected] on 19 Nov 2009 at 2:37

Attachments:

Create source jars in maven repository

Please add source jars in the maven repository so that it becomes trivial to 
see the caldav4j code in capable IDEs.

Providing source jars may also lead to more users that are willing to 
contribute patches.

Original issue reported on code.google.com by [email protected] on 10 Aug 2010 at 11:35

BUG: CalDAVCollection.add(HttpClient, Calendar) adds 3 calendars instead of 1!

What steps will reproduce the problem?
1. Initialize a CalDAVCollection object.
2. Call the function add(HttpClient, Calendar).

What is the expected output? What do you see instead?
One calendar is supposed to be added to the collection, however, three 
calendars are being added.

What version of the product are you using? On what operating system?
I downloaded the source and built it using maven as in the instructions. The 
jar file's name is: "caldav4j-0.7-SNAPSHOT.jar." I am using Windows XP 
Professional (5.1, Build 2600).

Please provide any additional information below.
The bug is caused because the boolean didIt is never being changed from false 
to true.

Here is how I think the fix would look like. Simply change the current switch 
block in the function with:

switch (statusCode){
  case CaldavStatus.SC_CREATED:
  case CaldavStatus.SC_NO_CONTENT:
    didIt = true;
    break;
  case CaldavStatus.SC_PRECONDITION_FAILED:
    break;              
  default:
    MethodUtil.StatusToExceptions(putMethod);
}

Original issue reported on code.google.com by [email protected] on 8 Jun 2010 at 6:04

jakarta-slide-webdavlib Java 1.6

jakarta-slide-webdavlib has been built using JDK 1.6 (and -target 1.6).
Could you please recompile it using Java JDK 1.5 (or -target 1.5)?

Best regards,
M. Linsmayer

Original issue reported on code.google.com by [email protected] on 28 Apr 2008 at 8:00

Non-latin characters garbaged with PUT method

What steps will reproduce the problem?
1. Modify or create new event with non-latin characters in summry

What is the expected output? What do you see instead?

you will receive ???? symbols instead text

What version of the product are you using? On what operating system?

0.5-SNAPSHOT

Please provide any additional information below.
problem in PutMethod.generateRequestBody method: you need to use 
setRequestEntity instead 
of  setRequestBody

Index: src/main/java/org/osaf/caldav4j/methods/PutMethod.java
===========================================================
========
--- src/main/java/org/osaf/caldav4j/methods/PutMethod.java  (revision 131)
+++ src/main/java/org/osaf/caldav4j/methods/PutMethod.java  (working copy)
@@ -18,6 +18,8 @@

 import java.io.IOException;
 import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.Charset;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
@@ -33,6 +35,7 @@
 import org.apache.commons.httpclient.HttpConnection;
 import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpState;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.osaf.caldav4j.CalDAVConstants;
@@ -171,7 +174,11 @@
                 log.error("Problem generating calendar: ", e);
                 throw new RuntimeException("Problem generating calendar. ", e);
             }
-            setRequestBody(writer.toString());
+            try {
+               setRequestEntity(new 
StringRequestEntity(writer.toString(),CalDAVConstants.CALENDAR_CONTENT_TYPE,Char
set.defaul
tCharset().toString()));
+           } catch (UnsupportedEncodingException e) {
+               //just ignore
+           }
         }
         return super.generateRequestBody();
     }





Original issue reported on code.google.com by [email protected] on 8 Sep 2008 at 3:30

Invalid Parameters With ICAL

With ical client, i add an event and invite some people to the event .
When I get the events via CalDav4j, i've got an exception for an event in
particular :

Caused by: java.lang.IllegalArgumentException: Invalid parameter name:
SCHEDULE-STATUS
    at
net.fortuna.ical4j.model.ParameterFactoryImpl.createParameter(ParameterFactoryIm
pl.java:642)
    at net.fortuna.ical4j.data.CalendarBuilder.parameter(CalendarBuilder.java:241)
    at
net.fortuna.ical4j.data.CalendarParserImpl.parseParameter(CalendarParserImpl.jav
a:290)


If i delete the event i get the others events without problems.

To reproduce the problem
1. create an event via ical-client (use ICAL Server from Mac)
2. invite somebody to this event
3. call the caldav server and get events

Is it a problem or write i bad query ?
I'm using the generate query : 
GenerateQuery generator = new GenerateQuery();
            generator.setFilter(Component.VEVENT);
            generator.setTimeRange(startDate,endDate);
            List<Calendar> result = cdm.getComponentByQuery(cdm.getClient(),
Component.VEVENT, generator.generateQuery());

Original issue reported on code.google.com by [email protected] on 7 May 2010 at 10:32

Set svn:ignore on trunk

Please add the following to svn:ignore for the project's trunk:

target
.classpath
.project
.settings

Helps me to easily see if I've modified anything locally.  Thanks!

Original issue reported on code.google.com by [email protected] on 9 Sep 2008 at 9:07

Connection and credentials check

Couldn't find any. Tried to 
 use a workaround by trying to delete a non existing query, but wrong url
(calendar's colection UID), wrong credentials and the non existing query -
all produce the same exception.

Original issue reported on code.google.com by [email protected] on 6 Aug 2008 at 7:53

Can't execute the REPORT request to an iCal Server

I'm trying to use the REPORT request to an iCal Server from a WebObjects
application.  I can get a calendar with the GET request just fine, but I
can't use the REPORT request to find events.

I'm using part of the examples in CalDAV4j :

public static final String CALDAV_SERVER_WEBDAV_ROOT =
"/calendars/users/diradmin/calendar/";

...
CalDAVCalendarCollection calendarCollection = createCalDAVCalendarCollection();

Date beginDate = ICalendarUtils.createDateTime(2007, 0, 1, null, true);

Date endDate = ICalendarUtils.createDateTime(2007, 11, 30, null, true);

List<Calendar> l =
calendarCollection.getEventResources(httpClient,beginDate, endDate);

System.out.println(l);
...

I should get two events, but instead I'm getting exceptions :

org.osaf.caldav4j.CalDAV4JException: Problem executing method: Problem
executing method
[2007-11-02 09:18:07 EDT] <WorkerThread0>
org.osaf.caldav4j.CalDAV4JException: Problem executing method
    at
org.osaf.caldav4j.CalDAVCalendarCollection.getEventResources(CalDAVCalendarColle
ction.java:214)
    at Session.<init>(Session.java:78)
...

Caused by: java.lang.NullPointerException
    at
org.osaf.caldav4j.xml.OutputsDOMBase.createNewDocument(OutputsDOMBase.java:67)
    at
org.osaf.caldav4j.methods.CalDAVReportMethod.generateRequestBody(CalDAVReportMet
hod.java:114)
...
at
org.osaf.caldav4j.CalDAVCalendarCollection.getEventResources(CalDAVCalendarColle
ction.java:212)


Original issue reported on code.google.com by [email protected] on 2 Nov 2007 at 1:34

Attachments:

Testdata contains forbidden (for caldav) METHOD property

What steps will reproduce the problem?
1. Running FunTest against the Apple CalendarServer on Ubuntu Linux

What is the expected output? What do you see instead?

Expected: a succeeding test

Instead, in the unittest output:

DEBUG - BaseTestCase.put(190) | 
PUT /calendars/users/raboof/caldav4j/Floating_Jan_2_7pm.ics
<?xml version='1.0' encoding='UTF-8'?>
<error xmlns='DAV:'>
  <valid-calendar-object-resource xmlns='urn:ietf:params:xml:ns:caldav'/>
</error>

In the server logging:

2009-03-26 01:31:49+0100 [-] [caldav-8009]  [-]
[twistedcaldav.method.put_common#error] Calendar data does not conform to
CalDAV requirements: METHOD property is not allowed in CalDAV iCalendar data

in Floating_Jan_2_7pm.ics:

METHOD:PUBLISH

I think that line should be removed. After removing it the tests succeeds.


What version of the product are you using? On what operating system?
svn trunk on ubuntu linux

Original issue reported on code.google.com by arnout.engelen on 26 Mar 2009 at 12:36

CalendarComparator patch

from Roberto Polli:

wrote a small CalendarComparator class. here a simple usage:
 /** sort a Calendar list by date
    *
    * @param calendars
    * @return
    */
   public List<Calendar> sortByStartDate(List<Calendar> calendars) {
       Collections.sort(calendars, new CalendarComparator());
       return calendars;

   }

attached  the class code
http://caldav4j.googlegroups.com/web/CalendarComparator.java

Peace, R.

Original issue reported on code.google.com by [email protected] on 28 Nov 2007 at 7:06

Use a trailing '/' when referencing collection resources

What steps will reproduce the problem?
1. run CalDAVCalendarCollectionsTest against an Apple CalendarServer

What is the expected output? What do you see instead?

Expected: a succeeding test

Seen: calendar = calendarCollection.getCalendarForEventUID(httpClient,
ICS_GOOGLE_DAILY_NY_5PM_UID); throws an exception because it can't find the
resource.

CalendarServer logging: REPORT /calendars/users/raboof/caldav4j HTTP/1.1

This request, afaics, is requesting a list of children of the collection
that match certain criteria. CalendarServer, however, returns a HTTP 301
Moved Permanently to '/calendars/users/raboof/caldav4j/', adding a trailing
'/'.

The fact that caldav4j is not following the 301 is actually the desirable
behaviour: http://www.ietf.org/rfc/rfc2616.txt 10.3.2 (HTTP) says about
this: "If the 301 status code is received in response to a request other
than GET or HEAD, the user agent MUST NOT automatically redirect the
request unless it can be confirmed by the user, since this might change the
conditions under which the request was issued.".

caldav4j should have sent the request with a trailing '/' in the first
place, according to http://www.ietf.org/rfc/rfc2518.txt: "There is a
standing convention that when a collection is referred to by its name
without a trailing slash, the trailing slash is automatically appended. 
Due to this, a resource may accept a URI without a trailing "/" to point to
a collection. In this case it SHOULD return a content-location header in
the response pointing to the URI ending with the "/".  For example, if a
client invokes a method on http://foo.bar/blah (no trailing slash), the
resource http://foo.bar/blah/ (trailing slash) may respond as if the
operation were invoked on it, and should return a content-location header
with http://foo.bar/blah/ in it.  In general clients SHOULD use the "/"
form of collection names."

The fact that calendarserver doesn't follow this 'standing convention', and
caldav4j SHOULD use '/' anyway.

The calendarCollectionRoot property of CalDAVCalendarCollectionBase holds
the root without trailing '/', and in several places a '/' is append to it
when used. Either the other places not yet appending a '/' should be
reviewed, or calendarCollectionRoot should be documented to contain the
trailing '/' and any extra appended slashes should be removed.

What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by arnout.engelen on 26 Mar 2009 at 1:53

BaseTestCase produces invalid (?) iCalendar data

What steps will reproduce the problem?
1. run FunTest against Apple CalendarServer

What is the expected output?
  a succeeding test :)

What do you see instead?

In the unittest output:

DEBUG - BaseTestCase.put(190) | 
PUT /calendars/users/raboof/caldav4j/Floating_Jan_2_7pm.ics
<?xml version='1.0' encoding='UTF-8'?>
<error xmlns='DAV:'>
  <valid-calendar-object-resource xmlns='urn:ietf:params:xml:ns:caldav'/>
</error>

In the server logging:

2009-03-26 01:20:25+0100 [-] [caldav-8009]  [-]
[twistedcaldav.method.put_common#error] At line 26: ' 20090326T002025Z' is
not a valid DATE-TIME

In the code (BaseTestCase.java:184):

        event = event.replaceAll("DTSTAMP:.*", "DTSTAMP: " + new
DateTime(true).toString());

Is that space directly after 'DTSTAMP:' allowed?


What version of the product are you using? On what operating system?
svn trunk on ubuntu linux



Original issue reported on code.google.com by arnout.engelen on 26 Mar 2009 at 12:30

Move Maven repository out of trunk

The caldav4j Maven repository currently resides in trunk, which means that it 
is unnecessarily lugged around in every branch and tag.

Consider moving the repository to become a sibling of trunk instead.

Alternatively, an even better solution is to use Sonatype's OSS repository so 
that caldav4j is automatically synced with Maven's central repository:

https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage
+Guide

Original issue reported on code.google.com by [email protected] on 17 Feb 2011 at 1:04

Create JavaDoc .jar

What?
 * create javadoc
Why?
 * to document
 * to be sonatype-ready
How?
 * add target in pom
 * add documentations in classes

Where?
 * modify pom.xml

Original issue reported on code.google.com by [email protected] on 17 Feb 2011 at 2:03

Upgrade httpclient to 3.1

There are a number of bug fixes:

https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310360&versio
n=12312326

Original issue reported on code.google.com by [email protected] on 15 Mar 2011 at 2:25

Fix tests

There's a whole number of problems with the current tests.  They need to be 
stabilised before anyone can confidently contribute to the codebase.

Initial problems:

1) Some tests fail under Java5 as they assume a DOM Level 3 implementation is 
available

2) Mixed JUnit3 & 4 syntax in tests causing some tests to fail or be ignored

3) Some tests are missing a default constructor

4) Misnamed tests that are ignored by Maven

5) Confusing test resource configuration

6) Too much noise in the test console output; mainly debug log messages, some 
System.outs

Original issue reported on code.google.com by [email protected] on 16 Feb 2011 at 4:39

MkCalendar sends empty HTTP content

Hello,

we are currently using the org.osaf.caldav4j.CalDAVCalendarCollection class
to perform operations on a DAVICAL calendar server
(http://rscds.sourceforge.net/).

The createCalendar() method does not work and the server returns a HTTP
code 500 "Internal Server Error". After monitoring the HTTP traffic, we
found out that the MKCALENDAR method was not sending any HTTP content.
However, there was a "Content-Type" header defined to "text/xml".

If we remove the "Content-Type" header, everything works fine. It may
suggest that DAVICAL is just too restrictive about incoming requests, but
we also found it strange because the MkCalendarMethod indeed defines a
generateRequestBody() method that looks to return not-null XML content.
After further investigation, it seems that this method is never called.

Is this normal ?

Note: we are using the latest trunk version (158).


Original issue reported on code.google.com by [email protected] on 26 Mar 2009 at 11:11

Unit Tests with missing GCaldavCredential.java - No build possible

What steps will reproduce the problem?
Build the project

What is the expected output? What do you see instead?

Expected: A finished build.

But the current build output:

[ERROR]Mojo: 
[ERROR]    org.apache.maven.plugins:maven-compiler-plugin:2.0.2:testCompile
[ERROR]FAILED for project: 
[ERROR]    org.osaf:caldav4j:jar:0.6-SNAPSHOT
[ERROR]Reason:
[ERROR]org/osaf/caldav4j/google/GCalDAVCalendarCollectionTest.java:[24,24]
cannot find symbol
[ERROR]symbol  : class GCaldavCredential
[ERROR]location: package org.osaf.caldav4j
[ERROR]org/osaf/caldav4j/methods/PutGetTestGoogle.java:[15,24] cannot find
symbol
[ERROR]symbol  : class GCaldavCredential
[ERROR]location: package org.osaf.caldav4j
[ERROR]org/osaf/caldav4j/google/GCalDAVCalendarCollectionTest.java:[52,31]
cannot find symbol
[ERROR]symbol  : class GCaldavCredential
[ERROR]location: class org.osaf.caldav4j.google.GCalDAVCalendarCollectionTest
[ERROR]org/osaf/caldav4j/methods/PutGetTestGoogle.java:[28,54] cannot find
symbol
[ERROR]symbol  : class GCaldavCredential
[ERROR]location: class org.osaf.caldav4j.methods.PutGetTestGoogle

What version of the product are you using? On what operating system?

Current svn checkout from 2010-02-23 (up to commit ID SVN#184)


Original issue reported on code.google.com by [email protected] on 24 Feb 2010 at 8:20

Problem (or help) connecting with bedework


1. I have modified CaldavCollectionManager (at org/osaf/caldav4j/example) 

addEvent works fine but when trying to modify it i get an error trying to
get calendar of event (getCalendarForEventUID) with null pointer exception

The code 


public static void main(String[] args) throws CalDAV4JException,
                                               SocketException, 
                                               URISyntaxException 
{

 final String CALDAV_SERVER = CaldavCredential.CALDAV_SERVER_HOST;
 final String CALDAV_PORT =
String.valueOf(CaldavCredential.CALDAV_SERVER_PORT); 
 final String CALDAV_USER = CaldavCredential.CALDAV_SERVER_USERNAME; 
 final String CALDAV_PASS = CaldavCredential.CALDAV_SERVER_PASSWORD;


 System.out.println("Creando Cliente Caldav ..");
 BaseCaldavClient cli = new BaseCaldavClient(CALDAV_SERVER, CALDAV_PORT,
                                   CaldavCredential.CALDAV_SERVER_PROTOCOL,
                                CaldavCredential.CALDAV_SERVER_WEBDAV_ROOT,
CALDAV_USER, CALDAV_PASS);

 System.out.println("Abriendo una collection..");
 CalDavCollectionManager cdm = new CalDavCollectionManager(cli);
 cdm.setRelativePath("calPrue");

 System.out.println("Creando un evento sencillo ...");
 // create date for event
 // anyo, mes (1 menos), dia, hora (2 horas menos), minutos
 Date beginDate = ICalendarUtils.createDateTime(2009, 3, 16, 16 ,0, null,
true);
  Date endDate = ICalendarUtils.createDateTime(2009, 4, 6, null, true);
  Dur duration = new Dur("3H");
  String MyUid ="2009_00010_01_444_caldav4j";

  // create new event
  VEvent nve = new VEvent(beginDate, duration, "Evento Nuevo CalDav4j");
  cdm.addEvent(nve, null, MyUid);

  /* Fine so far, I can see the event on bedework web interface (and
through lightning too)

  /////////////////////////////////////////////////////////

  System.out.println("Voy a modicar el evento..");
  // modify event
  System.out.println("--Voy a por el calendar..");

  Calendar pippo =  cdm.getCalendarForEventUID(nve.getUid().getValue());


  /* Not get here yet. Null pointer exception above */

  System.out.println("Master event..");
  VEvent ve = ICalendarUtils.getMasterEvent(pippo,MyUid);

  System.out.println("Cambio el sumario");
  ICalendarUtils.addOrReplaceProperty(ve, new Summary("I changed the
summary!"));
  System.out.println("Voy a actualizar..");
  cdm.updateMasterEvent(((HttpClient) cdm.client),ve,null);


 }


The error is

Exception in thread "main" org.osaf.caldav4j.CalDAV4JException: Problem
executing method
        at
org.osaf.caldav4j.CalDAVCalendarCollection.getCalDAVResourceForEventUID(CalDAVCa
lendarCollection.java:643)
        at
org.osaf.caldav4j.CalDAVCalendarCollection.getCalendarForEventUID(CalDAVCalendar
Collection.java:123)
        at
org.osaf.caldav4j.example.CalDavCollectionManager.getCalendarForEventUID(CalDavC
ollectionManager.java:283)
        at
org.osaf.caldav4j.example.CalDavCollectionManager.main(CalDavCollectionManager.j
ava:404)
Caused by: java.lang.NullPointerException
        at
org.osaf.caldav4j.xml.OutputsDOMBase.createNewDocument(OutputsDOMBase.java:67)
        at
org.osaf.caldav4j.methods.CalDAVReportMethod.generateRequestBody(CalDAVReportMet
hod.java:127)
        at
org.apache.webdav.lib.methods.XMLResponseMethodBase.getRequestContentLength(XMLR
esponseMethodBase.java:237)
        at
org.apache.webdav.lib.methods.HttpRequestBodyMethodBase.addRequestHeaders(HttpRe
questBodyMethodBase.java:248)
        at
org.osaf.caldav4j.methods.CalDAVReportMethod.addRequestHeaders(CalDAVReportMetho
d.java:103)
        at
org.apache.commons.httpclient.HttpMethodBase.writeRequestHeaders(HttpMethodBase.
java:2036)
        at
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:19
19)
        at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
        at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDire
ctor.java:397)
        at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirecto
r.java:170)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
        at
org.osaf.caldav4j.methods.HttpClient.executeMethod(HttpClient.java:103)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
        at
org.osaf.caldav4j.CalDAVCalendarCollection.getCalDAVResourceForEventUID(CalDAVCa
lendarCollection.java:641)


Original issue reported on code.google.com by [email protected] on 17 Apr 2009 at 11:28

Mkcalendar is making folder rather than calendar

What steps will reproduce the problem?
1. Initialize MkCalendarMethod
2. Using setPath, set the Path of caldav server and user in which calendar 
needs to be added 
3. run HttpClient.executeMethod to make the calendar at desired location. 
But instead of calendar, a folder is being created in which no calendar 
events are getting added.

What is the expected output? What do you see instead?
Expected ouput is that a calendar should be made in which I can add 
calendar events or upload .ics file but instead a folder is being created 
in which calendar events are not getting added. 403 Forbidden error is 
coming.

What version of the product are you using? On what operating system?
Im using the latest caldav4j library. Im using Eclipse IDe for development 
on windows XP.

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 29 Aug 2008 at 6:18

Fields in GCalDAVCalendarCollectionTest hide Fields in BaseTestCase => NPE

When i execute GCalDAVCalendarCollectionTest, i get a NullPointerException,
as shown below. 
The problem is that COLLECTION_PATH in GCalDAVCalendarCollectionTest hides 
the field COLLECTION_PATH defined in BaseTestCase. Same problem for 
httpClient and methodFactory. The attached patch fixes the problem, 
so that running GCalDAVCalendarCollectionTest does not end in an NPE.

java.lang.NullPointerException
    at
org.osaf.caldav4j.CalDAVCalendarCollectionBase.setCalendarCollectionRoot(CalDAVC
alendarCollectionBase.java:64)
    at
org.osaf.caldav4j.CalDAVCalendarCollection.<init>(CalDAVCalendarCollection.java:
102)
    at
org.osaf.caldav4j.google.GCalDAVCalendarCollectionTest.createCalDAVCalendarColle
ction(GCalDAVCalendarCollectionTest.java:393)
    at
org.osaf.caldav4j.google.GCalDAVCalendarCollectionTest.testAddNewRemove(GCalDAVC
alendarCollectionTest.java:254)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
    at
com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:108)
    at
com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunne
r.java:42)
    at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter
.java:165)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:105)

Original issue reported on code.google.com by [email protected] on 19 Nov 2009 at 1:47

Attachments:

Simplify unit tests

The current unit tests are rather fragile and overly complex.  They should be 
restructured to not use a shared fixture and just create the minimal data 
required for each test method.  There should be more fine-grained test methods 
that test for each piece of functionality.

They should also operate against a fake CalDAV server rather than an actual 
one.  The TCK (issue 43) can then be used to test actual CalDAV server 
implementations.

Original issue reported on code.google.com by [email protected] on 18 Feb 2011 at 1:33

Code refactoring in main package

What?
 * let users access a caldav resource directly without going into subclassess

Why?
 * some classes (eg. ResourceMetadata) shouldn't be public. Instead their
properties should be more easily accessed

How?
 * ex. identify less classes to expose

Where?
 * org.osaf.caldav4j

Original issue reported on code.google.com by [email protected] on 19 Mar 2010 at 6:05

Fix GooglePutGetTest

Google currently returns a 409 on the tearDown DELETE:

"HTTP/1.1 409 Can't delete a recurring event except on its organizer's calendar"

Needs investigation.

Original issue reported on code.google.com by [email protected] on 18 Feb 2011 at 2:02

iCal4J-Version

Hi,

which version of iCal4J where used in calDAV4J-0.5?
(e.g. in PutMethod.java)




Original issue reported on code.google.com by [email protected] on 12 Aug 2009 at 10:10

Write a TCK for CalDAV4J

We need to write an implementation agnostic TCK that exercises CalDAV4J against 
a server.  The TCK can then be run against the various CalDAV servers available 
to test their compliance.

The TCK would test the functionality specified in the CalDAV RFC.

Original issue reported on code.google.com by [email protected] on 18 Feb 2011 at 12:19

get events by dt stamp

hey!

the following patch
http://caldav4j.googlegroups.com/web/caldav4j-requestNewEvents.patch
enables to search for newly changed events.

Requires the previous patch
http://groups.google.com/group/caldav4j/web/caldav4j-request-rfc.patch
for cleaner requests.

Plenty of comments follows!
Let me know,
R.

Original issue reported on code.google.com by [email protected] on 28 Nov 2007 at 7:05

Fail to compile org.osaf.caldav4j.BaseTestCase

I'm now tring to compile org.osaf.caldav4j.BaseTestCase on my PC with 
Windows XP. But found the method:
** protected void mkcalendar(String path) ** 
have a statement with 'symbol not found' error, reported by jdk 1.6 
compiler, it's the statement: 
mk.addDescription(CALENDAR_DESCRIPTION, "en");
it seems the MkCalendarMethod class do not have a 'addDescription' method.

What I include in the classpath is caldav4j-0.5.jar.

Original issue reported on code.google.com by [email protected] on 17 Aug 2009 at 3:36

[PATCH] createTicked failed when ticked has no timeout

What steps will reproduce the problem?
1. Create ticket with no timeout (null)

What is the expected output? What do you see instead?

createTicket will fail, because of server responds with "Infinite"

Please provide any additional information below.
patch will cure this problem. I do not created test because of awaiting
accepting my previous patch to CalDAVCalendarCollectionTest.java ;)

Original issue reported on code.google.com by [email protected] on 12 Sep 2008 at 2:45

Attachments:

Does caldav4j lib now supports to PROPPATCH method ?

As topic, now I want to modify ACL of a URL, read the webdav spec that i 
need to issue to PROPPATCH method request to caldav server, but I don't 
see such method definition in caldav4j source yet. Will such function be 
implemented in the furture ?

Original issue reported on code.google.com by [email protected] on 20 Aug 2009 at 7:51

Error Building caldav4j

What steps will reproduce the problem?
1.Download the code and the pre - requisites
2.run mvn -Dmaven.test.skip=true package
3.you get this exception

[INFO] Compilation failure

C:\eclipse-jee-europa-win32\aycron-ws\caldav4j-read-
only\src\main\java\org\osaf\caldav4j\CalDAVCollection.java:[82,30] cannot 
find symbol
symbol  : class MethodUtil
location: package org.osaf.caldav4j.util

C:\eclipse-jee-europa-win32\aycron-ws\caldav4j-read-
only\src\main\java\org\osaf\caldav4j\CalDAVCollection.java:[274,32] cannot 
find symbol
symbol  : variable MethodUtil
location: class org.osaf.caldav4j.CalDAVCollection

C:\eclipse-jee-europa-win32\aycron-ws\caldav4j-read-
only\src\main\java\org\osaf\caldav4j\CalDAVCollection.java:[348,32] cannot 
find symbol
symbol  : variable MethodUtil
location: class org.osaf.caldav4j.CalDAVCollection

C:\eclipse-jee-europa-win32\aycron-ws\caldav4j-read-
only\src\main\java\org\osaf\caldav4j\CalDAVCollection.java:[402,32] cannot 
find symbol
symbol  : variable MethodUtil
location: class org.osaf.caldav4j.CalDAVCollection

C:\eclipse-jee-europa-win32\aycron-ws\caldav4j-read-
only\src\main\java\org\osaf\caldav4j\CalDAVCollection.java:[736,24] cannot 
find symbol
symbol  : variable MethodUtil
location: class org.osaf.caldav4j.CalDAVCollection

C:\eclipse-jee-europa-win32\aycron-ws\caldav4j-read-
only\src\main\java\org\osaf\caldav4j\CalDAVCollection.java:[813,24] cannot 
find symbol
symbol  : variable MethodUtil
location: class org.osaf.caldav4j.CalDAVCollection

C:\eclipse-jee-europa-win32\aycron-ws\caldav4j-read-
only\src\main\java\org\osaf\caldav4j\CalDAVCollection.java:[1225,24] cannot 
find symbol
symbol  : variable MethodUtil
location: class org.osaf.caldav4j.CalDAVCollection

What is the expected output? What do you see instead?

A Build Successful 

What version of the product are you using? On what operating system?

Maven version: 2.0.9
Java version: 1.5.0_12
OS name: "windows vista" version: "6.1" arch: "x86" Family: "windows"

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 13 May 2010 at 3:17

Add Scheduling support

Add scheduling support:

http://tools.ietf.org/html/draft-desruisseaux-caldav-sched-03


to start we need:
* a class name;
* a minimal set of supported RFC features
* a test class;
* some volounteers ;)

Interested people can post on list.




Original issue reported on code.google.com by [email protected] on 19 Sep 2008 at 11:29

Ticket discovery fails if timeout is "Infinite"

What steps will reproduce the problem?
1. Create a calendar with Chandler Server 0.8.1
2. Using the Account Browser, issue a ticket for the calendar with no timeout
3. In Java, create a CalDAVCalendarCollection referencing the calendar.
4. Call calendarCollection.getTicketsIDs(httpClient, "")
5. Expect to get the ticket ID, but a WebdavException is thrown instead.

The WebdavException does not include the root cause of the exception, which
 is an ArrayIndexOutOfBounds exception thrown at
org.osaf.caldav4j.util.XMLUtils.createTicketResponseFromDOM line 143.

CalDAV4j is assuming a timeout of the form "units-integer", but Chandler is
returning "Infinite". My naive recommendation is to first check whether the
timeout equals "Infinite" before splitting the string.



Exception in thread "main" org.apache.webdav.lib.WebdavException
    at
org.apache.webdav.lib.properties.PropertyFactory.create(PropertyFactory.java:93)
    at
org.apache.webdav.lib.methods.XMLResponseMethodBase.convertElementToProperty(XML
ResponseMethodBase.java:487)
    at
org.apache.webdav.lib.methods.XMLResponseMethodBase$Response.getProperties(XMLRe
sponseMethodBase.java:529)
    at
org.osaf.caldav4j.methods.PropFindMethod.getResponseProperties(PropFindMethod.ja
va:70)
    at
org.osaf.caldav4j.CalDAVCalendarCollection.getTicketsIDs(CalDAVCalendarCollectio
n.java:507)
    at [elided]


Original issue reported on code.google.com by [email protected] on 13 Nov 2007 at 11:00

Attachments:

Methods for finding calendars

It would be great to have an API in caldav4j to find calendars for specific
users.

I would like to add this functionnality but honestly, I don't know where to
add it.  Should we modify CalendarQuery.java for adding this support ?

Original issue reported on code.google.com by [email protected] on 5 Nov 2007 at 9:09

patch for query custom properties

from roberto polli:

made this patch because CalDAVProp creates
<C:prop novalue="no" start="UID"/>
instead of
<C:prop name="UID"/>
the first one doesn't fit for query of custom properties

http://groups.google.com/group/caldav4j/web/caldav4j-request-rfc.patch

Peace, R.

Original issue reported on code.google.com by [email protected] on 28 Nov 2007 at 7:02

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.