empowering the social web with apache shindig

44
Empowering the Social Web with Apache Shindig Paul Lindner Wed Nov 4th, 2009 Saturday, November 14, 2009

Upload: plindner

Post on 27-Jan-2015

109 views

Category:

Technology


3 download

DESCRIPTION

The social web is already reality! It makes applications available to more users, by providing common APIs that can be used in many different contexts. OpenSocial is an API that can be used by developers to create applications using standard JavaScript and HTML. These applications run on social websites that have implemented the OpenSocial APIs. Known as OpenSocial containers, these websites allow developers to access their social information. In return, they receive a large suite of applications for their users. Apache Shindig is a brand new incubator podling implementing the OpenSocial APIs. This talk describes Shindig in depth, and shows how it can be embedded into a larger web application to enable the web-app to host OpenSocial apps.

TRANSCRIPT

Page 1: Empowering the Social Web with Apache Shindig

Empowering the Social Web with Apache

ShindigPaul Lindner

Wed Nov 4th, 2009

Saturday, November 14, 2009

Page 2: Empowering the Social Web with Apache Shindig

The Social WebSaturday, November 14, 2009

Page 3: Empowering the Social Web with Apache Shindig

The Social WebPeople and Connections

Activity Streams / News FeedsMessaging / Notifications

APIs?

Saturday, November 14, 2009

Page 4: Empowering the Social Web with Apache Shindig

Saturday, November 14, 2009

Page 5: Empowering the Social Web with Apache Shindig

Saturday, November 14, 2009

Page 6: Empowering the Social Web with Apache Shindig

Saturday, November 14, 2009

Page 7: Empowering the Social Web with Apache Shindig

The SolutionGadgets from iGoogle

Add People, Activities, and Viral Javascript APIs

Open to all

Iterate..

Saturday, November 14, 2009

Page 8: Empowering the Social Web with Apache Shindig

And Then...OpenSocial Foundation

HackathonsAtom/XML/Json REST APIs

OpenSocial TemplatesData Pipelining

Portable ContactsOAuth

Activity Streams?

Saturday, November 14, 2009

Page 9: Empowering the Social Web with Apache Shindig

End ResultSaturday, November 14, 2009

Page 10: Empowering the Social Web with Apache Shindig

Shindig

Saturday, November 14, 2009

Page 11: Empowering the Social Web with Apache Shindig

ShindigSaturday, November 14, 2009

Page 12: Empowering the Social Web with Apache Shindig

ShindigSaturday, November 14, 2009

Page 13: Empowering the Social Web with Apache Shindig

ShindigSaturday, November 14, 2009

Page 14: Empowering the Social Web with Apache Shindig

Apache Shindig is...

• Gadgets and OpenSocial and Reference Implementation

• OAuth Client/Server

• Java/PHP Implementation

• Almost 2 years old!

• Production-Quality code.

Saturday, November 14, 2009

Page 15: Empowering the Social Web with Apache Shindig

Mostly ShindigSaturday, November 14, 2009

Page 16: Empowering the Social Web with Apache Shindig

Shindig is not...

• A Full Featured Social Network

• A system to manage applications and developers

• All that developer friendly (yet!)

Saturday, November 14, 2009

Page 17: Empowering the Social Web with Apache Shindig

Project Status• 21 Committers

• 231 Jira Contributors

• 287k LoC

• 1.0 Released, 1.1 on the way

• Almost Graduated from Incubation

• Good Practices - Code Review, TDD

Saturday, November 14, 2009

Page 18: Empowering the Social Web with Apache Shindig

1.1 Release• OpenSocial 0.9 Features

• Server Side Templates

• Server Side Preloads

• Data Pipelining

• Proxied Content

• lightweight JavaScript apis / JSON-RPC

• Major Upgrade

• 2212 files changed, 138129 insertions(+), 40672 deletions(-)

Saturday, November 14, 2009

Page 19: Empowering the Social Web with Apache Shindig

OpenSocial VersionsSaturday, November 14, 2009

Page 20: Empowering the Social Web with Apache Shindig

Shindig Offspring• Partuza

• SocialSite

• Sakai

• Lockheed Martin Eureka Framework

• Atlassian (Jira, Confluence, etc)

• Drupal Integration

• FriendConnect

• Others?

Saturday, November 14, 2009

Page 21: Empowering the Social Web with Apache Shindig

Getting Started - Java

• Install Maven, Subversion

• Check out Code

• Build, Install and run

svn co http://svn.apache.org/repos/asf/incubator/shindig/trunkcd trunkmvnmvn -Prun

Saturday, November 14, 2009

Page 22: Empowering the Social Web with Apache Shindig

Getting Started - PHP

• Install Subversion, Apache httpd, PHP > 5.2, and PHP with modules json, simplexml, mcrypt and curl

• Check out Shindig Code

• Configure Apache

Saturday, November 14, 2009

Page 23: Empowering the Social Web with Apache Shindig

DEMOSaturday, November 14, 2009

Page 24: Empowering the Social Web with Apache Shindig

Shindig Foundations• Java

• Maven and plugins

• Guice 2.0

• Apache Commons

• OAuth

• Ehcache

• Juel

• httpclient

• google-collections

• PHP

• PHPUnit

• Zend

• mod_rewrite

• OAuth

Saturday, November 14, 2009

Page 25: Empowering the Social Web with Apache Shindig

Shindig Architecture

• Gadget Server/Renderer

• OpenSocial data server (REST, Atom, JSON-RPC)

• People/Activities/Messages/Persistence Interfaces.

Saturday, November 14, 2009

Page 26: Empowering the Social Web with Apache Shindig

Extra Features

• Proxy Server

• Image Resizer

• Content Rewriter/Compressor

• Gadget Blacklist

• more!

Saturday, November 14, 2009

Page 27: Empowering the Social Web with Apache Shindig

Saturday, November 14, 2009

Page 28: Empowering the Social Web with Apache Shindig

Saturday, November 14, 2009

Page 29: Empowering the Social Web with Apache Shindig

Java Implementation

• Uses Composition and Dependency Injection via Guice.

• People/Activities/AppData/Messaging Services.

• Authentication and Security

• Hooks for just about everything else.

Saturday, November 14, 2009

Page 30: Empowering the Social Web with Apache Shindig

Integration Basics

• Implement Interfaces - People, Activities, Data, Messaging

• Review shindig.properties, container.js

• Write Guice Module

• Add to web.xml

• Add more - HttpFetcher, HttpCache, SecurityTokenDecoder, etc.

Saturday, November 14, 2009

Page 31: Empowering the Social Web with Apache Shindig

PeopleServicepublic Future<RestfulCollection<Person>> getPeople(Set<UserId> userIds, GroupId groupId, CollectionOptions options, Set<String> fields, SecurityToken token) throws ProtocolException { ...}

public Future<Person> getPerson(UserId id, Set<String> fields, SecurityToken token) throws ProtocolException { ...}

Saturday, November 14, 2009

Page 32: Empowering the Social Web with Apache Shindig

ActivityServicepublic Future<RestfulCollection<Activity>> getActivities(Set<UserId> userIds, GroupId groupId, String appId, Set<String> fields, CollectionOptions options, SecurityToken token);

public Future<Void> createActivity(UserId userId, GroupId groupId, String appId, Set<String> fields, Activity activity, SecurityToken token);(and more....)

Saturday, November 14, 2009

Page 33: Empowering the Social Web with Apache Shindig

AppDataServiceFuture<DataCollection> getPersonData(Set<UserId> userIds, GroupId groupId, String appId, Set<String> fields, SecurityToken token);

Future<Void> deletePersonData(UserId userId, GroupId groupId, String appId, Set<String> fields, SecurityToken token);

Future<Void> updatePersonData(UserId userId, GroupId groupId, String appId, Set<String> fields, Map<String, String> values, SecurityToken token);

Saturday, November 14, 2009

Page 34: Empowering the Social Web with Apache Shindig

MessageServiceFuture<RestfulCollection<MessageCollection>> getMessageCollections(UserId userId, Set<String> fields, CollectionOptions options, SecurityToken token);

* also create/modify/delete

Future<RestfulCollection<Message>> getMessages(UserId userId, String msgCollId, Set<String> fields, List<String> msgIds, CollectionOptions options, SecurityToken token);

* also create/modify/delete

Saturday, November 14, 2009

Page 35: Empowering the Social Web with Apache Shindig

Guice Module

package com.example.MyGuiceModule;

public class MyGuiceModule extends AbstractBaseModule { protected void configure() { bind(PeopleService.class).to(MyPeopleService.class); bind(ActivityService.class).to(MyActivityService.class); bind(AppDataService.class).to(MyAppDataService.class); bind(MessageService.class).to(MyMessageService.class); }}

Saturday, November 14, 2009

Page 36: Empowering the Social Web with Apache Shindig

shindig.properties

• 42 Parameters at last count

• Global Cache Params

• Global RSA key for OAuth signed requests

• Bound via Guice in the code

• @Named(“shindig.param”) String param

Saturday, November 14, 2009

Page 37: Empowering the Social Web with Apache Shindig

container.js

• Support for multiple containers

• Defines supported fields, url paths

• Should match web.xml config

Saturday, November 14, 2009

Page 38: Empowering the Social Web with Apache Shindig

web.xml

<content-param> <param-name>guice-modules</param-name> <param-value>com.example.MyGuiceModule</param-value></context-param>

• Copy web.xml

• java/server/src/main/webapp/WEB-INF/web.xml

• Add Guice Module

Saturday, November 14, 2009

Page 39: Empowering the Social Web with Apache Shindig

More!• Customize HttpFetcher

for security

• OAuthDataStore OAuth API Access.

• SecurityTokenDecoder to link with your existing security infrastructure.

• ExecutionListener for logging and analytics

• GadgetSpecFactory for localized control of GadgetSpecs

• OAuthStore for proxying OAuth requests

Saturday, November 14, 2009

Page 40: Empowering the Social Web with Apache Shindig

Container to Platform

• Add Schemas for Data

• Apps, Developers, Permissions, Notifications, App Invites

• Add UI Elements

• Gallery, Canvas, Invites, Notifications

Saturday, November 14, 2009

Page 41: Empowering the Social Web with Apache Shindig

DEMOSaturday, November 14, 2009

Page 42: Empowering the Social Web with Apache Shindig

Parting Thoughts

• OpenSocial & Shindig - Mature, Open, and Successful

• Social Networks to the Enterprise

• Open Stack is emerging

• OAuth, OpenId, Portable Contacts, Activity Streams

• Shindig is your gateway.

Saturday, November 14, 2009

Page 43: Empowering the Social Web with Apache Shindig

Learn More

• http://incubator.apache.org/shindig/

• http://www.opensocial.org

[email protected]

• Social and Widgets Meetup

• Thursday, 8pm

Saturday, November 14, 2009

Page 44: Empowering the Social Web with Apache Shindig

Q & A

Saturday, November 14, 2009