Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currently not possible to download group of contacts. #39

Closed
brjhaverkamp opened this issue Nov 24, 2016 · 28 comments · Fixed by #43
Closed

Currently not possible to download group of contacts. #39

brjhaverkamp opened this issue Nov 24, 2016 · 28 comments · Fixed by #43
Labels
1. to develop Accepted and waiting to be taken care of
Milestone

Comments

@brjhaverkamp
Copy link

brjhaverkamp commented Nov 24, 2016

At the moment it is not possible to select a single group of contacts and export/download it as a vcard file.
This used to be possible with the older contact app (last year)
Can this feature be re-added again?

Regards,

Bert

@irgendwie irgendwie added 1. to develop Accepted and waiting to be taken care of feature parity Feature on other projects that needs to be implemented labels Nov 24, 2016
@irgendwie
Copy link
Member

#43 only restores the export functionality - downloading specific groups separately is still not supported

@irgendwie irgendwie reopened this Dec 7, 2016
@skjnldsv
Copy link
Member

skjnldsv commented Dec 7, 2016

Oooh, sorry, you meant groups, I was thinking of addressbooks :(

@brjhaverkamp
Copy link
Author

:-) Indeed. Selecting a contact group to download. (And multiple addresses or groups, I guess for completeness). I'm really missing it now I have to do my Christmas cards again..

But I see where you are coming from, didn't know that functionality had disappeared too.
Thanks for that addition!

@brjhaverkamp
Copy link
Author

Hello, can you comment why this issue is closed?

Today I started my christmas card address list. I have a group for that in Nextcloud and it seems it is still not possible to download that group seperately. I now have to download my whole addressbook and script a filter.

@skjnldsv
Copy link
Member

@brjhaverkamp this issue is not closed! :)

@skjnldsv
Copy link
Member

skjnldsv commented Oct 2, 2018

This will require a php script from the server to filter out vcards or generate a single file from multiple vcards, should be straightforward though.

@brjhaverkamp
Copy link
Author

Sounds good. 3.0? :-)

@skjnldsv
Copy link
Member

skjnldsv commented Oct 2, 2018

@brjhaverkamp Not enough time available!
If someone want to take over and implement such function on server, then perfect. Otherwise too sort for 3.0! :(

@brjhaverkamp
Copy link
Author

If you can point me at where I could integrate this, I could have a stab at it. Not in the coming weeks.(just started a new job) But christmas-card-season is slowly approaching, so around that time I have my yearly focus on the contacts app.

@skjnldsv
Copy link
Member

skjnldsv commented Oct 2, 2018

Sure! :)

The vcf addressbook export is an official plugin, so you cannot edit it on nextcloud, but the source is available as inspiration: https://github.com/nextcloud/3rdparty/blob/master/sabre/dav/lib/CardDAV/VCFExportPlugin.php
Example of a nextcloud plugin for dav: https://github.com/nextcloud/server/blob/2e36069e24406455ad3f3998aa25e2a949d1402a/apps/dav/lib/CardDAV/ImageExportPlugin.php

The idea would be to allow to pass data to the ?export request on an addressbook to request a set of vcard? But this will only allow download by addressbook (which is fine, 99% of our users uses 1 addressbook, and we can trigger multiple requests depending on the addressbooks od the contacts I guess)

@charismatic-claire
Copy link
Contributor

Hi, I just added a pull request for that. Please review and let me know, if that is acceptable!

charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Oct 19, 2018
@charismatic-claire
Copy link
Contributor

Okay. Here are some architectural thoughts and ideas:

  • From the "contacts" app, we are only calling a function, say a downloadGroup(group) function via the computed property groupsMenu() in the Contacts.vue component.
  • This call basically is a HTTP GET request from an URL like this http://<SERVER_ADDRESS>/remote.php/dav/addressbooks/users/<USER_NAME>/<GROUP_NAME>?export
  • The actual work happens on the server side. For this we need to make a pull request to the "server" project itself.
  • What we need is a GroupExportPlugin.php with namespace OCA\DAV\CardDAV extending the "dav" application of the Nextcloud server.
  • The GroupExportPlugin would extend the ServerPlugin from Sabre\DAV\ServerPlugin.
  • We would use dav/appinfo/v1/carddav.php to register our new plugin.
  • First major question would be: How to implement the magic we want?
  • Second major question would be: How and where to register the routes properly?

Well, is that more or less what we want, or do I absolutely not get it?

@skjnldsv
Copy link
Member

skjnldsv commented Oct 24, 2018

@charismatic-claire I started yesterday implementing the plugin! :)
I'll provide a pull request this morning.
You are mostly right on your points, only those I would make a cmall change:

This call basically is a HTTP GET request from an URL like this http://<SERVER_ADDRESS>/remote.php/dav/addressbooks/users/<USER_NAME>/<GROUP_NAME>?export

I would rather have a POST that takes an array of vcf url to be downloaded.
Like I said to allow groups download but also selections or searches

We would use dav/appinfo/v1/carddav.php to register our new plugin.

Apparently also on apps/dav/lib/Server.php, but yes :)

@charismatic-claire
Copy link
Contributor

Wow, making a PR to the "server" project seem to get the attention of quite some people. I'm impressed by the amount of feedback you already got. I'll review your code as well... Thank's a lot for pushing things forward.

@skjnldsv
Copy link
Member

@charismatic-claire Thanks!!
Yes server is quite active ;)

We're a bit stuck regarding the GET/POST request.
I'll let you read the other post and make your mind on it! :)
Your help is very welcome ;)

@charismatic-claire
Copy link
Contributor

@skjnldsv I will update my PR as soon as possible... Thank you for your work and your encouragement. I learned a lot.
@georgehrke Thank you for your work as well!

@skjnldsv
Copy link
Member

skjnldsv commented Nov 6, 2018

@charismatic-claire awesome!
Ping me if you need anything :)

@charismatic-claire
Copy link
Contributor

charismatic-claire commented Nov 8, 2018

Alright. So let's make a little plan first. What do we wanna do? Shall I just add download links to every group, so we can download it and that's it? Or do we wanna go for more?

In case we wanna go for more, I need a little bit more information. If you want, say download 2 groups at the same time, you would need a way to first select which groups you wanna download and then trigger the download. How would that look like? You could set "download checkmarks" first and trigger the download later on by clicking a button? Where would that button be?

If you wanna make a search or a manual selection of contacts to download, how would you first select and later on trigger the download? I'm not talking about the implementation, I'm talking about the interface design here.

Personally I would prefer to just add a download button to each group, like I did before. Only this time, I'll utilize the recently added capabilities of the backend. But I'm not sure if @skjnldsv would accept such a pull request. My understanding is... he wouldn't. So let's talk about it ;-)

@skjnldsv
Copy link
Member

skjnldsv commented Nov 8, 2018

I would say, let's do it step by step! :)
Maybe create a function that trigger a download following Georg's hack (see nextcloud/cdav-library#39) with an array of urls within an addressbook.
So we can use it for the groups but also later use it for a selection or something :)

One issue is that we can have groups across multiple addressbooks, so we'll have to trigger as many REPORT as there are addressbooks. I'll let you figure out, this is just a matter of sorting the proper data and triggering the proper REPORT and download I guess :)

I'm completely fine with the download button for each group.

If you wanna make a search or a manual selection of contacts to download, how would you first select and later on trigger the download? I'm not talking about the implementation, I'm talking about the interface design here.

Let's see that for the 3.1.0 version ;)

@charismatic-claire
Copy link
Contributor

Great. I like that. So let's do it. I'll let you know if I have something to show...

charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Nov 15, 2018
charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Nov 15, 2018
charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Nov 15, 2018
charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Nov 15, 2018
@charismatic-claire
Copy link
Contributor

Yeah, I implemented a new version of this feature, using the multiget functionality. What do you think??? See pull request.

charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Nov 15, 2018
charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Nov 15, 2018
charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Nov 15, 2018
skjnldsv added a commit that referenced this issue Nov 16, 2018
…ownload-contact-group-#39

Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
skjnldsv added a commit to charismatic-claire/contacts that referenced this issue Nov 16, 2018
…ownload-contact-group-nextcloud#39

Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Nov 19, 2018
charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Nov 19, 2018
charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Nov 19, 2018
charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Nov 19, 2018
charismatic-claire pushed a commit to charismatic-claire/contacts that referenced this issue Nov 19, 2018
@brjhaverkamp
Copy link
Author

Hello Charismatic-clair,

While you are on a roll with the contacts app of Nextcloud and this great improvement in issue 37, could I ask you to take a look at issue #42?
This is my other pet-peave regarding the LABEL field in the Vcard that is used in for instance the glabel program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants