[WIP] Make Tasks a DAV client, close #280 #291

merged 58 commits into from May 16, 2016


None yet

9 participants

raimund-schluessler commented Feb 13, 2016 edited

We want to get rid of the calendar dependency and use the CalDAV server build-in in oC core 9.x.

In order to hopefully make the development easier the same DAV library as in core and calendar will be used. No more server side CalDAV stuff in the app itself.



  • Get calendars
  • Create calendar
  • Delete calendar
  • Rename calendar


  • Get tasks
  • Create task (subtask)
  • Fix creating tasks in the collection views
  • Toggle subtasks visibility
  • Delete task
  • Toggle task state
  • Rename task
  • Set task priority
  • Set start date
  • Set end date
  • Set progress
  • Edit categories
  • Edit note
  • Change calendar
  • Respect write privileges for drag-n-drop
  • Creating subtasks in "All" view does not work
  • Only load uncomplete tasks, load completed tasks on demand
  • Load completed subtasks when opening parent task
  • Respect timezone setting for start, due and reminder
  • Enable copying tasks
  • Set reminder (with notification support)
  • Implement comments


  • Check compliance ./occ app:check-code tasks
  • Add makefile for appstore packaging
  • Add an issue template


  • Implement search provider
@raimund-schluessler raimund-schluessler Remove server side CalDAV stuff 2868021
@raimund-schluessler raimund-schluessler Use bower, update dependencies
@raimund-schluessler raimund-schluessler changed the title from [WIP] Make Tasks a DAV client, closes #280 to [WIP] Make Tasks a DAV client, close #280 Feb 13, 2016

@georgehrke @raghunayyar I would like to use your implementation of the client side calendar service and maybe other files from the calendar-rework if its ok with you.


I would like to use your implementation of the client side calendar service and maybe other files from the calendar-rework if its ok with you.

Sure, it's free software, go ahead :)

@raimund-schluessler raimund-schluessler Load calendars via DAV

Can someone tell me if it is possible to also get the id of a calendar? If yes, how has the request body to look like?

I tried something like this

<?xml version="1.0"?>
<d:propfind  xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav" xmlns:aapl="http://apple.com/ns/ical/" xmlns:oc="http://owncloud.org/ns" xmlns:cs="http://calendarserver.org/ns/">
    <d:displayname />
    <d:id />
    <c:id />
    <aapl:id />
    <c:calendar-description />
    <c:calendar-timezone />
    <aapl:calendar-order />
    <aapl:calendar-color />
    <c:supported-calendar-component-set />
    <oc:calendar-enabled />
    <d:acl />
    <d:owner />
    <oc:invite />

but this does not return an id. @DeepDiver1975 @georgehrke maybe?


<d:href>/remote.php/dav/calendars/admin/personal/</d:href> is unique. I don't think you can get the database id. It wouldn't be of any use anyway, because you always need the url.


It wouldn't be of any use anyway, because you always need the url.

Yes, that's true. But I need something to show in the address bar when a user opens a calendar, so the page history works correctly. The database ID would have been the easiest solution.


The display name is supposed to be unique. Although I'm not sure this if this is enforced at the moment.


The displayname is currently not enforced to be unique and it won't be for different users.

For the moment I will just count upwards, but this might result in a usability problem when a user bookmarks the link to a certain calendar. I will have to think of a better solution later on.


The displayname is indeed not unique. But the Uri is.


The Uri also seems to only be unique for one user. But when User1 shares a calendar with the (for him) unique Uri 'test' with User2 which also has a calendar with this Uri, User2 has two calendars with the same Uri. Hence, only the principaluri is really unique, or am I wrong?


The shared Uri will be test_shared_by_user1


The shared Uri will be test_shared_by_user1

Ah, alright, thank you.
Can I query the Uri directly, or do I have to extract it from the url?
The request

<?xml version="1.0"?>
<d:propfind  xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav" xmlns:aapl="http://apple.com/ns/ical/" xmlns:oc="http://owncloud.org/ns" xmlns:cs="http://calendarserver.org/ns/">
    <d:displayname />
    <d:uri />
    <c:uri />
    <aapl:uri />
    <oc:uri />
    <c:calendar-description />
    <c:calendar-timezone />
    <aapl:calendar-order />
    <aapl:calendar-color />
    <c:supported-calendar-component-set />
    <oc:calendar-enabled />
    <d:acl />
    <d:owner />
    <oc:invite />

does not return any uri, but gives

    <x1:uri xmlns:x1="http://apple.com/ns/ical/"/>
   <d:status>HTTP/1.1 404 Not Found</d:status>



Can I query the Uri directly, or do I have to extract it from the url?

you have to extract it

@raimund-schluessler raimund-schluessler Enable creating calendars 8c56ebf
@raimund-schluessler raimund-schluessler Enable deleting calendars
@raimund-schluessler raimund-schluessler Update dependencies 5876ae5
@raimund-schluessler raimund-schluessler Add request tokens
@raimund-schluessler raimund-schluessler Use getter for calendar properties 04030b5
@raimund-schluessler raimund-schluessler Use getter for calendar properties everywhere 07bd2b5
@raimund-schluessler raimund-schluessler Remove coffeescript
@raimund-schluessler raimund-schluessler Enable renaming calendars
@raimund-schluessler raimund-schluessler Enable adding tasks
@raimund-schluessler raimund-schluessler Load all tasks and add them to the model
@raimund-schluessler raimund-schluessler Trigger scope.apply after tasks were loaded
@raimund-schluessler raimund-schluessler Enable setting priority
@raimund-schluessler raimund-schluessler Enable completing tasks
@raimund-schluessler raimund-schluessler Show correct tasks, enable showing details
@raimund-schluessler raimund-schluessler Correctly show subtasks, toggle their visibility
@raimund-schluessler raimund-schluessler Don't show task input if not writable
@raimund-schluessler raimund-schluessler Also toggle state of children and parents
@raimund-schluessler raimund-schluessler Let the vtodo save its properties
@raimund-schluessler raimund-schluessler Fix deleting lists, enable deleting tasks c8acb1b
@raimund-schluessler raimund-schluessler Fix creating tasks 4af6363
@raimund-schluessler raimund-schluessler Remove console.log
@raimund-schluessler raimund-schluessler Fix quick deleting priority and percent complete
@raimund-schluessler raimund-schluessler Add category support
@raimund-schluessler raimund-schluessler Fix IRequest error
Henni commented Mar 8, 2016

I'm somehow missing JS files:

@raimund-schluessler raimund-schluessler Fix undefined variables
@raimund-schluessler raimund-schluessler Fix script error when not in debug mode
No idea why this is necessary
@raimund-schluessler raimund-schluessler Adjust gitignore to commit ical and angular-ui-select
Henni commented Mar 9, 2016

Adding a list with the name hello results in:

Invalid Request (Malformed HTTP request)

Request payload:

<c:mkcalendar xmlns:c="urn:ietf:params:xml:ns:caldav" xmlns:d="DAV:" xmlns:a="http://apple.com/ns/ical/" xmlns:o="http://owncloud.org/ns"><d:set><d:prop><d:displayname>hello</d:displayname><o:calendar-enabled>1</o:calendar-enabled><a:calendar-color>#FF7A66</a:calendar-color><c:supported-calendar-component-set><c:comp name="VTODO"/></c:supported-calendar-component-set></d:prop></d:set></c:mkcalendar>

Response payload:

DevTools console:


@Henni Sorry, I can't reproduce this. Creating a calendar with name "hello" works fine with OC 9.0.0 and the current DAVclient branch.

@raimund-schluessler raimund-schluessler Enable setting start and end date
@raimund-schluessler raimund-schluessler Make app compliant
@raimund-schluessler raimund-schluessler Add drag and drop support
@raimund-schluessler raimund-schluessler Fix creating tasks in collection view
@raimund-schluessler raimund-schluessler Hide what does not work yet
@raimund-schluessler raimund-schluessler Fix a bunch of JSHint errors and warnings
@raimund-schluessler raimund-schluessler Add makefile
@raimund-schluessler raimund-schluessler Fix showing calendarname in week view
@raimund-schluessler raimund-schluessler Reflect write privileges in GUI
@raimund-schluessler raimund-schluessler Prevent dropping in not writable lists b2a87ca
@raimund-schluessler raimund-schluessler Show tasks which are related to themself
@raimund-schluessler raimund-schluessler Always check write privileges
@raimund-schluessler raimund-schluessler Make drag and drop more robust 76c9b8f
@raimund-schluessler raimund-schluessler Only allow copy of not writable tasks
@raimund-schluessler raimund-schluessler Don't hide source element when it is copied
@raimund-schluessler raimund-schluessler Only allow moving tasks for now b0bac86
@raimund-schluessler raimund-schluessler Fix undefined return falue 74fba33
@raimund-schluessler raimund-schluessler Prevent dropping on collection when copying task
onny commented Mar 17, 2016

Thank you Raimund for the hard work! Can't wait to use the new version! πŸ‘



@raimund-schluessler raimund-schluessler Only load not completed tasks

With 8808e77 we only load pending tasks. But this also means completed tasks are not loaded at all at the moment.

@DeepDiver1975 Is there a possibility to load the five newest completed tasks per list? And maybe also a query to get the total number of completed tasks at the server?


CalDAV and carddav queries have no understanding of aggregation functions - we have been looking for this for Contacts already.
But getting the five newest should be possible this the calendar query


Hm, can someone give me a hint on how to limit and order the result set? My naive try to limit the result set to five didn't succeed and I don't seem to be able to figure it out by myself:

<c:calendar-query xmlns:c="urn:ietf:params:xml:ns:caldav" xmlns:d="DAV:" xmlns:a="http://apple.com/ns/ical/" xmlns:o="http://owncloud.org/ns">
      <c:comp-filter name="VCALENDAR">
         <c:comp-filter name="VTODO">
            <c:prop-filter name="COMPLETED">

@Henni @georgehrke @DeepDiver1975


I don't think that CalDAV reports support limit and offset.
One way to do this is in two requests.
First one: send your request without <c:calendar-data/>
Second request: Take the hrefs from request one and send a multiget to the server


I thought this was possible because of this: https://tools.ietf.org/html/rfc5323#section-5.17 Did I misunderstand it?


The webdav search extension has nothing to do with CalDAV and CardDAV reports.


I don't think that CalDAV reports support limit and offset.

indeed - only carddav query supports that ... my bad - sorry

@raimund-schluessler raimund-schluessler Update dependencies
@raimund-schluessler raimund-schluessler Fix adding task in all view
@raimund-schluessler raimund-schluessler Show subtasks after creating a subtask 56c29b9
@raimund-schluessler raimund-schluessler Redirect to all view if not otherwise specified
@raimund-schluessler raimund-schluessler Fix undefined variable when adding root task 59b2fa1
@raimund-schluessler raimund-schluessler Enable loading completed tasks
@raimund-schluessler raimund-schluessler Load completed children when opening parent task
@raimund-schluessler raimund-schluessler Only load completed subtasks once b7a7ed3
@raimund-schluessler raimund-schluessler Add issue template (thanks Calendar app)
@raimund-schluessler raimund-schluessler merged commit ff877e3 into master May 16, 2016

2 checks passed

Scrutinizer 33 new issues, 3 updated code elements
continuous-integration/travis-ci/pr The Travis CI build passed

Merging this. Remaining problems are tracked in separate issues:

Timezone for start, due and reminder: #312
Copying tasks: #313
Setting reminder: #314
Implement comment feature: #315
Search: #311


will you release the app soon and add the features afterwards, or will you just continue to develop in the master branch and release the app when everything is done?


As it was requested by several users, I will release a version to the appstore soon and indicate the yet missing features. So it is possible to install via the appstore again and everybody can decide whether or not he is willing to update.


awesome! πŸ‘


Thanks a lot @raimund-schluessler

Gomez commented May 24, 2016

Great work @raimund-schluessler. 🍻 at ownCloudConf!

@nickvergessen nickvergessen deleted the DAVclient branch May 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment