[Owncloud] CalDAV interoperability

Nicolas progweb at free.fr
Sat Mar 10 09:35:24 UTC 2012


Hi,

I try to synchronize my PlayBook with OwnCloud addressbook & calendar
services.

For the playbook, and I think others embedded devices, it's easier to
use short URL. So I have patched my owncloud to do :

diff --git a/.htaccess b/.htaccess
index ebb28b0..f314e9f 100644
--- a/.htaccess
+++ b/.htaccess
@@ -9,6 +9,17 @@ php_value memory_limit 512M
 </IfModule>
 <IfModule mod_rewrite.c>
 RewriteEngine on
-RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
+RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
+
+#RewriteCond %{REQUEST_METHOD} ^PROPFIND$
+
+RewriteCond %{HTTP_HOST} ^carddav
+RewriteCond %{REQUEST_URI} !^/apps
+RewriteRule .* /apps/contacts/carddav.php/$1 [L]
+
+RewriteCond %{HTTP_HOST} ^caldav
+RewriteCond %{REQUEST_URI} !^/apps
+RewriteRule .* /apps/calendar/caldav.php/$1 [L]
 </IfModule>
 Options -Indexes
+#MultiviewsMatch Any


and


diff --git a/apps/calendar/caldav.php b/apps/calendar/caldav.php
index b710b99..c389188 100644
--- a/apps/calendar/caldav.php
+++ b/apps/calendar/caldav.php
@@ -25,7 +25,8 @@ $nodes = array(
 
 // Fire up server
 $server = new Sabre_DAV_Server($nodes);
-$server->setBaseUri(OC::$APPSWEBROOT.'/apps/calendar/caldav.php');
+//$server->setBaseUri(OC::$APPSWEBROOT.'/apps/calendar/caldav.php');
+$server->setBaseUri(OC::$APPSWEBROOT.'/');
 // Add plugins
 $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
 $server->addPlugin(new Sabre_CalDAV_Plugin());


and


diff --git a/apps/contacts/carddav.php b/apps/contacts/carddav.php
index 654aeb6..0792d62 100644
--- a/apps/contacts/carddav.php
+++ b/apps/contacts/carddav.php
@@ -39,7 +49,8 @@ $nodes = array(
 
 // Fire up server
 $server = new Sabre_DAV_Server($nodes);
-$server->setBaseUri(OC::$APPSWEBROOT.'/apps/contacts/carddav.php');
+//$server->setBaseUri(OC::$APPSWEBROOT.'/apps/contacts/carddav.php');
+$server->setBaseUri(OC::$APPSWEBROOT.'/');
 // Add plugins
 $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
 $server->addPlugin(new Sabre_CardDAV_Plugin());


So now, I can use the url :
carddav.domain.tld
or
caldav.domain.tld


I do better later...


For CardDAV, it works well with PlayBook device (and Gnome Evolution
3.2.2)


For CalDAV, it works well with Evolution ; but not at all with PlayBook.


I don't really how to debug and dump stream. I have patched owncloud to
dump the stream between the client & the server into a file. But maybe,
there is a better way ?


For PlayBook, it missing info in DAV communication :

Indeed, in the ressourceType into the XML answer, there is no the
"calendar" information. If I add "dirty"... :
case '{DAV:}resourcetype' :
$newProperties[200]['{DAV:}resourcetype']->add('{urn:ietf:params:xml:ns:caldav}calendar');
in the getPropertiesForPath (3rdparty/Sabre/DAV/Server.php)
the information.
it works better.


I seek to add this field, I don't think that we have to modify SabreDAV
itself, but the owncloud sabre connector.


Regards,

Nicolas





More information about the Owncloud mailing list