OpenSocial und Apache Shindig

52
International PHP Conference 17. Nov. 2009 | Karlsruhe Frank Ruske

description

Einführung in OpenSocial und Apache Shindig

Transcript of OpenSocial und Apache Shindig

Page 1: OpenSocial und Apache Shindig

International PHP Conference17. Nov. 2009 | KarlsruheFrank Ruske

Page 2: OpenSocial und Apache Shindig

© MAYFLOWER GmbH 2009

2

OpenSocial

Frank Ruske

❙ >10 Jahre Erfahrung in der Softwareentwicklung

❙ Seit März 2009 Mitarbeiter bei Mayflower

❙ Autor für das PHP-Magazin

Page 3: OpenSocial und Apache Shindig

Was ist das Objekt?

Page 4: OpenSocial und Apache Shindig

Was ist das Ziel?

Page 5: OpenSocial und Apache Shindig

Wie kann das Objekt geshared werden?

Page 6: OpenSocial und Apache Shindig

4.294.967.296

340.282.366.920.938.463.463.374.607.431.768.211.456

665.570.793.348.866.943.898.599 pro Quadratkilometer665.570.793.348.866.943.898.599 pro Quadratkilometer

ca. 667.000.000.000.000.000 pro Quadratmillimeterca. 667.000.000.000.000.000 pro Quadratmillimeter

Page 7: OpenSocial und Apache Shindig

Was ist die Belohnung für eine Anmeldung?

Page 8: OpenSocial und Apache Shindig

Business Model?

Page 9: OpenSocial und Apache Shindig

Wie können wir Objekte sozialisieren ohne ein

weiteres Social Network zu erstellen?

Page 10: OpenSocial und Apache Shindig
Page 11: OpenSocial und Apache Shindig
Page 12: OpenSocial und Apache Shindig
Page 13: OpenSocial und Apache Shindig
Page 14: OpenSocial und Apache Shindig

a common open set of API's for building

social applications across multiple sites

Page 15: OpenSocial und Apache Shindig
Page 16: OpenSocial und Apache Shindig
Page 17: OpenSocial und Apache Shindig
Page 18: OpenSocial und Apache Shindig

Gadget (XML)Clientseitig: JavaScript, HTML

und CSS

ContainerServerseitig: RESTfull API, JSON

RPC (optional)

Page 19: OpenSocial und Apache Shindig

GrundfunktionenPeople,Friends,

Activities,Persistence

Page 20: OpenSocial und Apache Shindig

BenutzergruppenViewerOwnerFriend

Page 21: OpenSocial und Apache Shindig
Page 22: OpenSocial und Apache Shindig

http://www.frank-ruske.com/ipc/hello_world.xml

OpenSocial application „Hello world“

Page 23: OpenSocial und Apache Shindig
Page 24: OpenSocial und Apache Shindig
Page 25: OpenSocial und Apache Shindig
Page 26: OpenSocial und Apache Shindig

http://www.frank-ruske.com/ipc/show_friends_final.xml

Page 27: OpenSocial und Apache Shindig
Page 28: OpenSocial und Apache Shindig
Page 29: OpenSocial und Apache Shindig

http://www.frank-ruske.com/ipc/activity.xml

Page 30: OpenSocial und Apache Shindig
Page 31: OpenSocial und Apache Shindig

http://www.frank-ruske.com/ipc/save_data.xml

Page 32: OpenSocial und Apache Shindig

gadgets.io.makeRequest()

Page 33: OpenSocial und Apache Shindig

Apache Shindig

Incubator seit November 2007

Page 34: OpenSocial und Apache Shindig
Page 35: OpenSocial und Apache Shindig

http://shindig.local/gadgets/files/samplecontainer/samplecontainer.html

http://shindig.local/gadgets/files/samplecontainer/examples/SocialHelloWorld.xml

Page 36: OpenSocial und Apache Shindig

http://www.frank-ruske.com/ipc/activity.xml

Page 37: OpenSocial und Apache Shindig
Page 38: OpenSocial und Apache Shindig

REST / PEOPLE/people/{guid}/@all

Alle Leute mit Verbindungen zum User {guid}

/people/{guid}/@friendsAlle Freunde vom Benutzer {guid}

/people/{guid}/@selfProfil vom Benutzer {guid}

/people/@me/@selfProfil des Viewers

Page 39: OpenSocial und Apache Shindig

Freunde von „Jane Doe“

http://shindig.local/social/rest/people/jane.doe/@friends

Page 40: OpenSocial und Apache Shindig

REST / ACTIVITIES/activities/{guid}/@self

Liste mit Aktivitäten des User {guid}

/activities/{guid}/@friendsListe mit Aktivitäten der Freunde des User {guid}

Page 41: OpenSocial und Apache Shindig

Aktivität von „John.doe“

http://shindig.local/social/rest/activities/john.doe/@self

Page 42: OpenSocial und Apache Shindig

REST / PERSISTENCE/appdata/{guid}/@self/{appid}

Alle App spezifischen Daten für den User {guid}

/appdata/{guid}/@friends/{appid}Alle App spezifischen Daten für die Freunde des Users

Page 43: OpenSocial und Apache Shindig

REST / Additional Parameters/format={format}

Format der Rückgabe (ATOM, JSON, XML)

/fields={field+}Die Felder die zurück gegeben werden sollen

/startPage={startPage}Paginator

/count={count}Paginator – Anzahl von Items

Page 44: OpenSocial und Apache Shindig

Additional Parameters

http://shindig.local/social/rest/activities/john.doe/@self?format=XML

Page 45: OpenSocial und Apache Shindig

Container implementieren:

1.) PHP Interfaces implementieren:ActivityService, PersonService, AppDataService,

MessagesService, AlbumService, MediaItemService

2.) Apache Shindig konfigurieren

Page 46: OpenSocial und Apache Shindig

1.) PHP Interfaces implementieren:class JsonDbOpensocialService implements ActivityService, PersonService, AppDataService, MessagesService, AlbumService, MediaItemService {...}

http://svn.apache.org/repos/asf/incubator/shindig/trunk/php/src/social/sample/JsonDbOpensocialService.php

Page 47: OpenSocial und Apache Shindig

2.) Shindig konfigurieren

http://svn.apache.org/repos/asf/incubator/shindig/trunk/php/config/container.php

Page 48: OpenSocial und Apache Shindig

PartuzaOpenSocial / Social Network Beispielseite

Kommuniziert mit Apache Shindig

Implementiert in PHP

Page 49: OpenSocial und Apache Shindig

1.) PHP Interfaces implementieren:class PartuzaService implements ActivityService, PersonService,

AppDataService, MessagesService, AlbumService, MediaItemService {...}

http://code.google.com/p/partuza/source/browse/trunk/Shindig/PartuzaService.php

Page 50: OpenSocial und Apache Shindig

2.) Shindig konfigurieren

http://svn.apache.org/repos/asf/incubator/shindig/trunk/php/config/container.php

Page 51: OpenSocial und Apache Shindig

Links und Referenzenunter

www.frank-ruske.com/ipc09

Page 52: OpenSocial und Apache Shindig

Vielen Dank für Ihre Aufmerksamkeit!

ReferentFrank RuskeMayflower GmbHPleichertorstr. 297070 Würzburg+49 (931) 35 9 65 - [email protected]