empowering the social web with apache shindig
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
Empowering the Social Web with Apache
ShindigPaul Lindner
Wed Nov 4th, 2009
Saturday, November 14, 2009
The Social WebSaturday, November 14, 2009
The Social WebPeople and Connections
Activity Streams / News FeedsMessaging / Notifications
APIs?
Saturday, November 14, 2009
Saturday, November 14, 2009
Saturday, November 14, 2009
Saturday, November 14, 2009
The SolutionGadgets from iGoogle
Add People, Activities, and Viral Javascript APIs
Open to all
Iterate..
Saturday, November 14, 2009
And Then...OpenSocial Foundation
HackathonsAtom/XML/Json REST APIs
OpenSocial TemplatesData Pipelining
Portable ContactsOAuth
Activity Streams?
Saturday, November 14, 2009
End ResultSaturday, November 14, 2009
Shindig
Saturday, November 14, 2009
ShindigSaturday, November 14, 2009
ShindigSaturday, November 14, 2009
ShindigSaturday, November 14, 2009
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
Mostly ShindigSaturday, November 14, 2009
Shindig is not...
• A Full Featured Social Network
• A system to manage applications and developers
• All that developer friendly (yet!)
Saturday, November 14, 2009
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
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
OpenSocial VersionsSaturday, November 14, 2009
Shindig Offspring• Partuza
• SocialSite
• Sakai
• Lockheed Martin Eureka Framework
• Atlassian (Jira, Confluence, etc)
• Drupal Integration
• FriendConnect
• Others?
Saturday, November 14, 2009
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
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
DEMOSaturday, November 14, 2009
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
Shindig Architecture
• Gadget Server/Renderer
• OpenSocial data server (REST, Atom, JSON-RPC)
• People/Activities/Messages/Persistence Interfaces.
Saturday, November 14, 2009
Extra Features
• Proxy Server
• Image Resizer
• Content Rewriter/Compressor
• Gadget Blacklist
• more!
Saturday, November 14, 2009
Saturday, November 14, 2009
Saturday, November 14, 2009
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
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
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
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
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
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
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
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
container.js
• Support for multiple containers
• Defines supported fields, url paths
• Should match web.xml config
Saturday, November 14, 2009
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
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
Container to Platform
• Add Schemas for Data
• Apps, Developers, Permissions, Notifications, App Invites
• Add UI Elements
• Gallery, Canvas, Invites, Notifications
Saturday, November 14, 2009
DEMOSaturday, November 14, 2009
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
Learn More
• http://incubator.apache.org/shindig/
• http://www.opensocial.org
• Social and Widgets Meetup
• Thursday, 8pm
Saturday, November 14, 2009
Q & A
Saturday, November 14, 2009