View Full Version : Email contacts via Spring Social?
Jul 19th, 2011, 12:16 PM
I'm working on a quick proof of concept of the (quite common) practice of gathering contacts from a user's email account (gmail, yahoo, etc).
Would adding this kind of functionality make sense in the Spring Social framework (iow, a generic Google (OpenID?) connector)? Has anyone started down this path already?
Jul 19th, 2011, 12:31 PM
I'd welcome such a contribution. We have some basic email invite functionality in Greenhouse, but are missing a contact import capability. I always expected we would get there eventually, and if folks in the community need this and can get it started we can help integrate it and smooth out the edges.
Jul 19th, 2011, 12:40 PM
I am also looking at this kind of feature from Spring Social .So please let me know if you come across, meanwhile am also trying to find out.
Jul 19th, 2011, 03:01 PM
Would it make sense to leverage Scribe as a dependency for the auth piece as a way of kickstarting this?
Jul 19th, 2011, 08:08 PM
Why do you think Scribe makes sense? Spring Social includes a standalone OAuth client with a clean API, and that's all Scribe is, right? Let me know if I'm missing something - I don't know a lot about how the Google contacts API works, but if it's OAuth we should have all the tools we need already.
Jul 20th, 2011, 08:53 AM
The Google Contacts API (like most/all other Google APIs) uses OAuth. They support OAuth 1 as well as some non-OAuth options, but they recommend that you use OAuth 2. Spring Social should have what you need--if you run into any trouble let me know and I'll help you work it out.
I'd think that the first step would be to create a provider module for Google's contacts API. You *could* work on it at a lower-level, I suppose...but I tend to think of this effort in 2 parts: (1) the provider module with a connection factory, service provider, and a Java binding to the contacts API and (2) the work to import contacts into an app via that API binding. Ultimately you're going to want to have your users authorize your app to gather contacts...and ConnectController along with a service provider/connection factory can do that. The API binding would offer things like fetching, updating, and deleting contacts (and whatever else their API supports). If you want to also support Yahoo or other contacts APIs, then you could create a provider module for each of those contacts service providers.
With that foundation in place, then build the more specific "import contacts" use-case on top of that.
In case you're not already thinking along these lines, may I suggest you create a project in GitHub to house the Google Contacts provider module. GitHub makes collaboration so much easier. You can look to https://github.com/SpringSource/spring-social-facebook and https://github.com/SpringSource/spring-social-twitter as examples of provider-module projects...and the reference documentation has some guidelines on how to create a provider module (http://static.springsource.org/spring-social/docs/1.0.x/reference/html/implementing.html).
Again, let me know if you have questions or need any help.
Jul 20th, 2011, 06:15 PM
Thanks for the detailed response -- it definitely helps to get the perspective of those who have already gone down this road.
I'll try to make sure I (or one of my colleagues as it might be) contribute back what we figure out. I was looking at: http://code.google.com/apis/contacts/docs/3.0/developers_guide_java.html and it looks much of it would be writing bridges and wrappers between the existing Google libraries and Spring Social. I'll let you know if and when we get anywhere...
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.