50
www.exoplatform.com Copyright 2011 eXo Platform SHINDIG IN 2 HOURS [email protected] Social team

Shindig in 2 hours

  • Upload
    hanhvi

  • View
    5.836

  • Download
    3

Embed Size (px)

DESCRIPTION

In 2 hours, we discuss about apache shindig and how to integrate shindig in eXo Platform production. The presentation lay-out in a simple way to understand about shindig, why and how using shindig as a part of developing product. Since shindig is a best implementation of OpenSocial then know about it and find the way to apply it is needed. In eXo Platform now, shindig is being used as Gadget Container/Server and the based Container to enable eXo Social fully support OpenSocial standard. Short but clear about shindig, hope it helps.

Citation preview

Page 1: Shindig in 2 hours

www.exoplatform.com

Copyright 2011 eXo Platform

SHINDIG IN 2 HOURS

[email protected] team

Page 2: Shindig in 2 hours

2www.exoplatform.com

Copyright 2011 eXo Platform

Page 3: Shindig in 2 hours

3www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig: - Introduction - Architecture

Shindig integration (eXo)

Objective: 3W

In 2 hours ...

Page 4: Shindig in 2 hours

www.exoplatform.com

Copyright 2011 eXo Platform

Shindig Introduction

Page 5: Shindig in 2 hours

5www.exoplatform.com

Copyright 2011 eXo Platform

Page 6: Shindig in 2 hours

6www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig (Introduction)

Page 7: Shindig in 2 hours

7www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig (Introduction)

Page 8: Shindig in 2 hours

8www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig (Introduction)

Page 9: Shindig in 2 hours

9www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig (Introduction)

Page 10: Shindig in 2 hours

10www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig (Introduction)

Page 11: Shindig in 2 hours

11www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig (Introduction)

Page 12: Shindig in 2 hours

12www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig (Introduction)

Page 13: Shindig in 2 hours

13www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig

What is shindig?- OpenSocial container→start hosting OpenSocial apps quickly by: + Providing the code to render gadgets + Open Social API, RESTful, RPC protocol services

- Java and PHP

GoalLauch a new container in under an hour's worth of work.

Page 14: Shindig in 2 hours

14www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig (History)

Version Release OpenSocial

3.0.02.0.3 01/Dec/10 2.0.2 30/Oct/10 2.0.0 07/Sep/10 2.0.0-RC2 10/Aug/10 1.1-BETA5 23/Nov/09 0.9 1.0.1 10/May/10 0.8 1.0 19/Jun/09

Nov 2007

Page 15: Shindig in 2 hours

15www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig (In Production)

Page 16: Shindig in 2 hours

16www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig. Why Use?

• Strong Open Source community

• High quality production-ready code

• Used by: hi5, orkut, iGoogle, Netlog, Hyves …

• Synchronized with specification

• Language neutral (Java, PHP, ...)

Page 17: Shindig in 2 hours

17www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig (Getting Started-Java)

http://shindig.apache.org/getting-started.html

- Check out code svn co http://svn.apache.org/repos/asf/incubator/shindig/trunk

- Build & Run (Jetty Server) mvn clean install mvn -Prun

- Run (tomcat server) http://localhost:8080/container/sample1.html http://localhost:8080/social/rest/people/canonical/@self?format=xml

Page 18: Shindig in 2 hours

www.exoplatform.com

Copyright 2011 eXo Platform

Shindig Architecture

Page 19: Shindig in 2 hours

19www.exoplatform.com

Copyright 2011 eXo Platform

• Gadget Server Parses gadget XML, renders as HTML/JS/CSS• OpenSocial Data Server - Plugs into social graph data - RESTful, RPC protocol services• Downloaded JavaScript libraries Core gadgets, OpenSocial client JavaScript environment

Shindig Architecture (Components)

Page 20: Shindig in 2 hours

20www.exoplatform.com

Copyright 2011 eXo Platform

Apache Shindig (APIs – Entry Points)

- OS API renderGadget() req.send() req..requestCreateActivity()

- REST API ..social/rest/people/...

..social/rest/activities/...

Page 21: Shindig in 2 hours

21www.exoplatform.com

Copyright 2011 eXo Platform

• Shindig Client and Server Components

• Gadget Server

• Social Data Server

Shindig Architecture

Page 22: Shindig in 2 hours

22www.exoplatform.com

Copyright 2011 eXo Platform

• Shindig Client and Server Components

• Gadget Server

• Social Data Server

Shindig Architecture

Page 23: Shindig in 2 hours

23www.exoplatform.com

Copyright 2011 eXo Platform

Shindig Architecture (Components)

Page 24: Shindig in 2 hours

24www.exoplatform.com

Copyright 2011 eXo Platform

Shindig Architecture (Server Comps)

- _Servlets are entry points to take calls from client side.

Page 25: Shindig in 2 hours

25www.exoplatform.com

Copyright 2011 eXo Platform

Shindig Architecture (How It Works?)

Req TYPE

FETCH_PEOPLE : Get Person data

FETCH_PERSON_APP_DATA : Get the data attributes for a person

UPDATE_PERSON_APP_DATA : update attributes of a person

FETCH_ACTIVITIES : Get List of activities for a Particular Person

CREATE_ACTIVITY : create Activity associated with a Person

Page 26: Shindig in 2 hours

26www.exoplatform.com

Copyright 2011 eXo Platform

• Shindig Client and Server Components

• Gadget Server

• Social Data Server

Shindig Architecture

Page 27: Shindig in 2 hours

27www.exoplatform.com

Copyright 2011 eXo Platform

Gadget Server

- Gadget Container JavaScript: JavaScript for general gadget functionality.

- Gadget Rendering Server: to render the gadget XML into HTML.

Gadget

GadgetServer

SocialData Server

HTML

Page 28: Shindig in 2 hours

28www.exoplatform.com

Copyright 2011 eXo Platform

Gadget Rendering in Flow

Page 29: Shindig in 2 hours

29www.exoplatform.com

Copyright 2011 eXo Platform

• Shindig Client and Server Components

• Gadget Server

• Social Data Server

Shindig Architecture

Page 30: Shindig in 2 hours

30www.exoplatform.com

Copyright 2011 eXo Platform

Social Data Server

People

Relationships

Activities

Page 31: Shindig in 2 hours

31www.exoplatform.com

Copyright 2011 eXo Platform

Social Data Server

- OpenSocial Container JavaScript: JavaScript environment that provides

OpenSocial specific functionality (Profiles, Relationships, Activities).

- OpenSocial Data Server: with extension points so others can connect it to their own backends.

Gadget

GadgetServer

SocialData Server

JSON

Page 32: Shindig in 2 hours

32www.exoplatform.com

Copyright 2011 eXo Platform

Social Data Server

http://rollerweblogger.org/roller/entry/shindig_java_internals_diagram_updated

Page 33: Shindig in 2 hours

33www.exoplatform.com

Copyright 2011 eXo Platform

Social Data Server

Page 34: Shindig in 2 hours

www.exoplatform.com

Copyright 2011 eXo Platform

Shindig Integration

Page 35: Shindig in 2 hours

35www.exoplatform.com

Copyright 2011 eXo Platform

Utilize existing Open Source container code.

Wants Gadgets Wants Social features: Profiles, Relationships, Activities

Integration. Why?

Page 36: Shindig in 2 hours

36www.exoplatform.com

Copyright 2011 eXo Platform

Integration. How?

- Shindig Implementation: Java, PHP …

- Gadget Server, Social Data Server

Page 37: Shindig in 2 hours

37www.exoplatform.com

Copyright 2011 eXo Platform

Integration

Render gadget

OpenSocial Container (Social Data Server)

Page 38: Shindig in 2 hours

38www.exoplatform.com

Copyright 2011 eXo Platform

• Customize sample comtainer (Gadget Container)

• Implement Interfaces – People, Friends, Activities (Social Server)

• Write Guice Modules (binding)

• Add mapping information to web.xml (servlets, filters, guices- modules … )

• Add more SecurityTokenDecoder, etc. (Enabling OAuth support)

Integration (SUMMARIZE)

Page 39: Shindig in 2 hours

39www.exoplatform.com

Copyright 2011 eXo Platform

• Customize sample comtainer (Gadget Container)

• Implement Interfaces – People, Friends, Activities (Social Server)

• Write Guice Modules (binding)

• Add mapping information to web.xml (servlets, filters, guices- modules … )

• Add more SecurityTokenDecoder, etc. (Enabling OAuth support)

Integration

Page 40: Shindig in 2 hours

40www.exoplatform.com

Copyright 2011 eXo Platform

• Customize sample comtainer (Gadget Container)

• Implement Interfaces – People, Friends, Activities (Social Server)

• Write Guice Modules (binding)

• Add mapping information to web.xml (servlets, filters, guices- modules … )

• Add more SecurityTokenDecoder, etc. (Enabling OAuth support)

Integration

Page 41: Shindig in 2 hours

41www.exoplatform.com

Copyright 2011 eXo Platform

- People Service public class ExoPeopleService extends ExoService implements PersonService, AppDataService {

public Future<RestfulCollection<Person>> getPeople(...) {}

public Future<Person> getPerson(...) {}

}

- Activitiy Service public class ExoActivityService extends ExoService implements ActivityService {

public Future<RestfulCollection<Activity>> getActivities(...) {}

public Future<Void> createActivity(...) {}

}

Copyright 2010 eXo Platform SAS

Integration (Implement Interfaces)

Page 42: Shindig in 2 hours

42www.exoplatform.com

Copyright 2011 eXo Platform

• Customize sample comtainer (Gadget Container)

• Implement Interfaces – People, Friends, Activities (Social Server)

• Write Guice Modules (binding)

• Add mapping information to web.xml (servlets, filters, guices- modules … )

• Add more SecurityTokenDecoder, etc. (Enabling OAuth support)

Integration

Page 43: Shindig in 2 hours

43www.exoplatform.com

Copyright 2011 eXo Platform

public class ExoSocialApiGuiceModule extends AbstractModule {

@Override

protected void configure() {

bind(PersonService.class).to(ExoPeopleService.class);

bind(AppDataService.class).to(ExoPeopleService.class);

bind(ActivityService.class).to(ExoActivityService.class);

bind(Person.class).to(ExoPersonImpl.class);

}

}

Copyright 2010 eXo Platform SAS

Integreation (Guice Module)

Page 44: Shindig in 2 hours

44www.exoplatform.com

Copyright 2011 eXo Platform

• Customize sample comtainer (Gadget Container)

• Implement Interfaces – People, Friends, Activities (Social Server)

• Write Guice Modules (binding)

• Add mapping information to web.xml (servlets, filters, guices- modules … )

• Add more SecurityTokenDecoder, etc. (Enabling OAuth support)

Integration

Page 45: Shindig in 2 hours

45www.exoplatform.com

Copyright 2011 eXo Platform

webapp/opensocial/src/main/webapp/WEB-INF/web.xml

<context-param>

<param-name>guice-modules</param-name>

<param-value>

org.exoplatform.social.opensocial.ExoSocialApiGuiceModule

</param-value>

</context-param>

Copyright 2010 eXo Platform SAS

Integration (Config in Web.xml)

Page 46: Shindig in 2 hours

www.exoplatform.com

Copyright 2011 eXo Platform

Re-Cap

Page 47: Shindig in 2 hours

47www.exoplatform.com

Copyright 2011 eXo Platform

- OpenSource implementation of OpenSocial & Gadgets standard (Java, PHP)

- Client and Server side (Container, REST, OpenSocial APIs …)

- Java version: Servlet stack

- Multiple entry points for various kinds of calls (servlets)

- Others: Image Resizer, Content Rewriter/Compressor ...

Copyright 2010 eXo Platform SAS

Re-Cap

Page 48: Shindig in 2 hours

48www.exoplatform.com

Copyright 2011 eXo Platform

Copyright 2010 eXo Platform SAS

Why not?

Page 49: Shindig in 2 hours

49www.exoplatform.com

Copyright 2011 eXo Platform

Home Page: http://shindig.apache.org/

Downloads: http://shindig.apache.org/download/index.html

Mailing Lists: http://shindig.apache.org/mail-lists.html

Source Code: http://svn.apache.org/repos/asf/shindig/

Issue Tracking: https://issues.apache.org/jira/browse/SHINDIG

Wiki: http://cwiki.apache.org/confluence/display/SHINDIG/

Copyright 2010 eXo Platform SAS

Resources

Page 50: Shindig in 2 hours

www.exoplatform.com

Copyright 2011 eXo Platform

Thank you!