Download - Java API for Social Media

Transcript
Page 1: Java API for Social Media

Java API for Social Media From Agorava to ΩrkutJustJava

Werner Keil

Antoine Sabot-Durand

Sao Paulo, Brazil

18 / 05 / 12

Page 2: Java API for Social Media

A JAVA API FOR ACCESS TOSOCIAL NETWORKS

Our Goal

2 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Page 3: Java API for Social Media

3 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Who am I?

Werner Keil

Consultant – Coach

Creative Cosmopolitan

Open Source Evangelist

Software Architect

…Twitter @wernerkeil

Page 4: Java API for Social Media

Proliferation

4 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Page 5: Java API for Social Media

Proliferation of Social Media

5 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Page 6: Java API for Social Media

Social Gaga

6 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Page 7: Java API for Social Media

• Open source implementation of OpenSocial & Gadgets specification

• An Apache Software project• Available in Java & PHP• http://shindig.apache.org

   It’s Goal: “Shindig's goal was to allow new sites to start hosting social apps in under an hour's worth of work"

Apache Shindig

8 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Page 8: Java API for Social Media

• Become an OpenSocial Containero Get Shindig (PHP or Java) or the Google implementation

http://shindig.apache.org o Look at examples & documentation

http://code.google.com/p/opensocial-resources/wiki/SampleApps

• The “official” OpenSocialimplementation has shifted – from Shindig to Google Code

9 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

OpenSocial Container

Page 9: Java API for Social Media

What Is a Gadget?

Simple gadgets for getting a Grid proxy credential and running remote commands. Both run on my ownWeb server.

10 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Page 10: Java API for Social Media

• MySpace• Orkut• Friendster• Hi5

11 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Who uses OpenSocial

Page 11: Java API for Social Media

• Facebook• Twitter• LinkedIn• XING*• Yammer• Foursquare• Google+• ...

* Abandoned it for Security and other reasons

12 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Who does not use OpenSocial

Page 12: Java API for Social Media

• OpenSocial is what Google created for MySpace(Yammer CTO and co-founder Adam Pisoni)

• Out of the box, most gadgets are publicly available content that do not require authentication and authorization.(ThoughtWorks Studios about OpemSocial gadgets)

• OpenSocial is a specification that provides a standard way to share content between semi-trusted applications.

• While initially proposed for public facing social networking sites, it has possibly more potential within the corporate firewall(ThoughtWorks Radar, March 2012)

13 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

What’s said about OpenSocial

Page 13: Java API for Social Media

• REST API for Person and Contacts• Open source implementation

• Compatible with OpenSocial• http://portablecontacts.net

 

Portable Contacts

14 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Page 14: Java API for Social Media

Sun Microsystems• Socialsite: Shindig + gadget based UI written in Java• Open Source https://socialsite.dev.java.net/ 

       

15 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

SocialSite – Sun’s approach to Social

Page 15: Java API for Social Media

Facebooks’ Query Language•All of the Facebook API is basically a set of wrappers around their SQL like FQL query language. So you can, if you prefer, make custom methods out of FQL query strings.

var myQuery='SELECT name FROM user WHERE uid='+api.get_session().uid;

api.fql_query(myQuery, getFQLResponse);

getFQLResponse() is a developer-written callback function

16 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

If it’s SQL like, could we use something like JPA around it?

Page 16: Java API for Social Media

DaliCore – History

DaliCMS (2006): “Web 2.0 ready CMS” Open-source “CMS” with community features 2008: integration with Shindig, provides

OpenSocial Implementation (JavaScript code from Shindig, Java code in DaliCMS)

Developed as Glassfish incubator project

17 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Page 17: Java API for Social Media

DaliCore – CMS

More than a CMS → DaliCore Adds functionality common to users, content

and permissions on top of Java EE 6. Focus on Users and Permissions. In about every project that uses DaliCore,

users should be able to login with existing credentials (Facebook, Twitter, Google Connect,...)

Dali modules extend DaliCore

Page 18: Java API for Social Media

DaliCore – Connect

ExternalNetwork class is extended by FacebookExternalNetwork TwitterExternalNetwork GoogleExternalNetwork

public abstract class ExternalNetwork

public abstract Response connect(String callback);

public abstract ExternalToken callback(String requestToken, String verifier);

public abstract OnlineAccount createOnlineAccount(ExternalToken accessToken) throws DaliCoreException;

Page 19: Java API for Social Media

DaliCore – Integrate

The User concept in DaliCore can have 0 or more instances of “OnlineAccount”

In projects created with DaliCore, the administrator/configurator decides what social networks are supported.

Users can access all functionality using their social network credentials.

Page 20: Java API for Social Media

Seam Social – a bootstrap for the API• A full CDI API to interact with Social Networks• Developed by Antoine Sabot-Durand (one of the proposed co-

Spec Leads)• Independent of CDI implementation• A helper for:

o Consuming REST serviceso Consuming OAuth 1 and 2 serviceso Identification via OAutho JSON binding of Social Services API

• Ready to adopt JSR 351, 353 and JSR 339 and maybe others• Will move to Apache Delta Spike initiative during 2012

21 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Page 21: Java API for Social Media

Twitter4J – History

Twitter4J is an unofficial Java library for the Twitter API.With Twitter4J, you can easily integrate your Java application with Twitter.

Its author, Yusuke Yamamoto now officially working at Twitter. Designated to represent Twitter in Social JSR EG.

22 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Agorava

Page 22: Java API for Social Media

Social Gagorava

23 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Page 23: Java API for Social Media

Agoravian

24 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

SOCI

LIKE

Page 24: Java API for Social Media

Agorava – a kind of JCA for Social Media

25 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Page 25: Java API for Social Media

Agorava Socializer

26 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Page 26: Java API for Social Media

Agorava Socializer – Architecture

27 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Agorava Socializer

JSF Web App „RI“

Agorava ConnectorsFacebook Twitter,…

Agorava Core

API („Spec“) CDI

Page 27: Java API for Social Media

Mr. Agorava

28 © 2010-2012 Werner Keil, Antoine Sabot-Durand and Others

Birthday 18th May!FB: https://www.facebook.com/antoine.sabotdurand or @antoine_sd

Page 28: Java API for Social Media

DEMOLet’s Socialize

Page 29: Java API for Social Media

AGORAVA AGORA!Q&A

Page 30: Java API for Social Media

Contact

Website: http://agorava.org

GitHub: https://github.com/agorava

Google Group: https://groups.google.com/forum/?hl=de&fromgroups#!forum/java-social

Email: [email protected]

Twitter: @Java_Social or @AgoravaProj