Retrieve addressbook objects

89 views
Skip to first unread message

musonic

unread,
Nov 10, 2012, 2:44:05 PM11/10/12
to sabredav...@googlegroups.com
I expect this is a very simple problem to solve but... What is the best way to retrieve ALL the addressbook objects contained within an addressbook collection? I've been reading rfc 6352 but it doesn't seem to directly address this. It demonstrates how to retrieve objects based on certain conditions, but not how to retrieve everything. I think that an addressbook-query report must contain a filter element, but I'm not sure how to structure the request so that it returns every object.
Could you point me in the right direction? Thanks!

Evert Pot

unread,
Nov 10, 2012, 3:46:35 PM11/10/12
to sabredav...@googlegroups.com
Hi,

First: I would recommend against it. It is better to first get the list of all urls, and then fetch the vcards in batches with multiget.

But, if you're ok with this.. the request would look something like this:

   REPORT /home/bernard/addressbook/ HTTP/1.1
   Host: addressbook.example.com
   Depth: 1
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxxx

   <?xml version="1.0" encoding="utf-8" ?>
   <C:addressbook-query xmlns:D="DAV:"
                     xmlns:C="urn:ietf:params:xml:ns:carddav">
     <D:prop>
       <D:getetag/>
       <C:address-data/>
     </D:prop>
     <C:filter />
   </C:addressbook-query>

Nicholas Le Breuilly

unread,
Nov 10, 2012, 5:04:40 PM11/10/12
to sabredav...@googlegroups.com
Thanks Evert, I was wondering exactly that.
 
However, how do I retrieve all the urls in the first place?! Again, I can't find anything in rfc 6352 that deals with this. Should I be reading another memo in conjunction?!

Also, when you talk about batches, what would you recommend as the maximum size of batch per request? I'm assuming you don't recommend getting all the data using a calendar-query because of the potential size of the response?

Thanks,
N
--
You received this message because you are subscribed to the Google Groups "SabreDAV Discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sabredav-discuss/-/T2gn5Wx3ivwJ.
To post to this group, send email to sabredav...@googlegroups.com.
To unsubscribe from this group, send email to sabredav-discu...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sabredav-discuss?hl=en.

Evert Pot

unread,
Nov 10, 2012, 5:54:41 PM11/10/12
to sabredav...@googlegroups.com
On Nov 10, 2012, at 11:04 PM, Nicholas Le Breuilly <nicleb...@gmail.com> wrote:

> Thanks Evert, I was wondering exactly that.
>
> However, how do I retrieve all the urls in the first place?! Again, I can't find anything in rfc 6352 that deals with this. Should I be reading another memo in conjunction?!

With PROPFIND on the addressbook home.

>
> Also, when you talk about batches, what would you recommend as the maximum size of batch per request? I'm assuming you don't recommend getting all the data using a calendar-query because of the potential size of the response?

I think OS X addressbook does about 100 fetches per request, but I'm not fully sure.

If you want to know more about how to do syncing, the best think I can recommend is to just see what existing clients are doing.

Evert

mbiebl

unread,
Nov 10, 2012, 8:58:54 PM11/10/12
to sabredav...@googlegroups.com
Hi,


Am Samstag, 10. November 2012 21:46:35 UTC+1 schrieb Evert Pot:
First: I would recommend against it. It is better to first get the list of all urls, and then fetch the vcards in batches with multiget.

I'm interested in that. I was wondering if it is possible to read, write and delete addressbook entries in batches to improve performance.
Can you elaborate a bit on how to use multiget?

Cheers,
Michael
 

Evert Pot

unread,
Nov 11, 2012, 11:53:14 AM11/11/12
to sabredav...@googlegroups.com

On Nov 11, 2012, at 2:58 AM, mbiebl <mbi...@gmail.com> wrote:

> Hi,
>
> Am Samstag, 10. November 2012 21:46:35 UTC+1 schrieb Evert Pot:
> First: I would recommend against it. It is better to first get the list of all urls, and then fetch the vcards in batches with multiget.
>
> I'm interested in that. I was wondering if it is possible to read, write and delete addressbook entries in batches to improve performance.

SabreDAV has nothing to support this.

> Can you elaborate a bit on how to use multiget?

http://tools.ietf.org/html/rfc6352#section-8.7

Hope this helps,
Evert
Reply all
Reply to author
Forward
0 new messages