12.07.2015 Views

Gregory Engels Entwicklercamp 2013

Gregory Engels Entwicklercamp 2013

Gregory Engels Entwicklercamp 2013

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Going with the Flow -Activity Streams inyour own Apps<strong>Gregory</strong> <strong>Engels</strong><strong>Entwicklercamp</strong> <strong>2013</strong>


Some Rights Reserved• Copyright <strong>2013</strong> by <strong>Gregory</strong> <strong>Engels</strong>,Kompurity. Except where otherwisenoted, this work is licensed underthe Creative Commons AttributionShare Alike 3.0 License


<strong>Gregory</strong> <strong>Engels</strong>• Geek• Entrepreneur• PirateSource: Spiegel


• Syndicate social activity• Stream of Activities• What is happened (Verb)• By whom (Actor)• Against something (Object)• Maybe with a (Target)


Actor Verb Object Target


Person shared a link


Person started following a person


Developer fork Project-Name


• http://activitystrea.ms/


What does the ActivityStream look like ?


Why is the Activity Streamimportant ?• To the Business:• Systems can provide simply-structurdevents• Events can be stored and used across allsystems• Aggregation is a key part of Social Businesstechnology• Analytics can be performed


Why is the Activity Streamimportant ?• To the User:• Everything I need to know and acton in one place !


User Model• Inform a user• Send a specific notification to aspecific user• Only that user will see it


User Model• Be discoverable• Show the event on the public feed• Automatically forward to anyfollowers of the 'Actor'


User Model• Inform a Community• Show the event on the communityfeed• Automatically forward to anyfollowers of the Community


Interaction• may be just a link• The application sending the event iscomplex and any user should followthe provided link to interact with iteffectively


• allow simple interactions• For example : approval, rejection,simple selection, simplecommenting, upload, share etc.• simple enough interaction, so youwould not lose your current browsercontext, and return quickly to yourstream once done


Consume• A general list• The activity stream can be consumedeasily and presented within anotherapplication in order to ensure that anyuser using that application still sees theircurrent stream.• This may be useful where there is aspecific application in which users tent to'live' so that they are unlikely to be payingattention to their stream otherwise.


Consume• An application specific list• A separate application may useConnections simply as a storagemechanism for its own events.• It can retrieve events specific to theapplication for display within theapplication• All of these events are then alsoavailable aggregated within Connections


Consume• Any combination• Basic filtering is provided to showinformation specific to an object/actor/community etc.• Search-based filtering allows formore specific combinations ofcriteria


Tools – REST Client


Tools• Your browser is also a useful tool forall GET operations – you may want toinstall a JSON Feed Reader plugin.• cURL can be used to do simplecommand line based requests (youcan for example set up a script to dosome autopopulation this way)


Tools - Java• Abdera (as an aside – used for Atomgeneration and parsing)• An Atom manipulation library• Built on top of HttpClient• Creates and Parses atom feedsmaking the main propertiesavailable easily


Authentication• APIs that access public data don't requireauthentication• Basic Authentication• OAuth access is available, and is therecommended authorization mechanismfor Open Social APIs• OAuth is designed primarily for for serviceto service rather than client applications.


Authentication options• Anonymous access• For public data


Authentication options• Form Based Authentication• Authentication used by browser URLs (wherethe user is redirected to the login page)• Ajax applications also use this when accessingAPIs in order to take advantage of the availablesession information• Complex login redirect handing is howeverrequired• Not recommended or supported for third partyapplications


Authentication options• Basic Authentication• Involves sending a Base-64 encodedheader including the username andpassword• This should always be done over https (toavoid passwords being sent in cleartext)• Most HTTP libraries support settings foradding basic authentication headers (asdo REST Client plugins)


Authentication options• OAuth Authorisation• Is an authorisation (rather thanauthentication) mechanism• You can authorise a service to acton your behalf without giving themyour credentials


Authorization• /connections/opensocial/rest/activitystreams/@me/@all• This is the 'default' fomat• It uses form based authentication• /connections/opensocial/anonymous/rest/activitystreams/@public/@all• performs no authentication check• /connections/opensocial/basic/rest/activitystreams/@public/@all• basic authentication challenge• /connections/opensocial/oauth/rest/activitystreams/@public/@all• OAuth dance


OAuth


• OAuth is a open Protocol forAuthorization• Token based, does not need apassword


• 1. Obtain request token(get_request_token)• 2. User login and authorizes requesttoken (request_auth)• 3. Exchange request token for anaccess token. (get_token)• 4. Use access token to requestprotected resources. (Renew afterexpiry with get_token)


Social Business Toolkit• SDK https://github.com/OpenNTF/SocialSDK• Built version: http://ibmsbt.openntf.org/• http://bit.ly/ibmsbtcommunity


a simple website. . . .


. . . add some code . . .


. . . giving you . . .• . . . you could do more:• enhance the contentas it appears in thestream• embedded experiencefor the event• associate the eventwith a community• You can make theevent public


Posting an event{"actor": {"id": "@me"},"verb": "post","title": "${share}","content":"This event is my first entry","updated": "2012-01-01T12:00:00.000Z","object": {"summary": "First Entry details","objectType": "note","id": "objectid","displayName": "First entry","url": "http://myurl.com/myid"}“connections”: {...}} You can POST any event to thestream of the current user─ /connections/opensocial/rest/activitystreams/@me/@all The main details are -─ actor : Connections or External Id─ verb : from a set list─ title : Connections will generate ifneeded─ content : for display of event details─ updated : event time─ object : details on the object includingtitle, id etc.─ connections : a grab bag of connectionsspecific properties that add moreinformation


{Basic Entry – Title, Content,Object Summary"actor": {"id": "@me"},"verb": "post","title": "[entry.title]","content":"[entry.content]","object": {"summary": "[entry.object.summary]","objectType": "note","id": "00011","displayName":"[entry.object.displayName]","url": "http://myurl.com/myid"}}─ entry.title─ entry.contentMain items displayed inActivityStream:─ entry.object.summary


Title, Content, Object SummaryIf title omitted, will begenerated based on verb{"actor": {"id": "@me"},"verb": "post","content":"[entry.content]","object": {...}}If content orobject.summary omitted,nothing displayed{"actor": {"id": "@me"},"verb": "post","title": "[entry.title]","object": {"summary": "[entry.object.summary]",...}}


Generator• Identifies the source of the entry• Can be used to request filtered feeds"generator": {"id": "briansApp","image": {"url": "http://http://briansApp.com/briansApp.png"},"displayName": "Brian's App","url": "http://briansApp.com"}


Registering your application• Applications can be registered(NewsActivityStreamService.registerApplication())• Provide following details:• appId, displayName, url, secureUrl,imageUrl, secureImageUrl, summary• ImageUrl choosen appropriately for feed• Filter displayed in ActivityStreams inConnections


Usefull links•OpenNTF Extention Libraryhttp://extlib.openntf.org/•Social Business Toolkit Activity Streamhttps://greenhouse.lotus.com/activitystream/


Thank You!• Contact: <strong>Gregory</strong>.<strong>Engels</strong> ※kompurity.deBlog http://inotes.detwitter: @dichter

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!