Download - IBM Connections Activity Streams Integration
© 2014 IBM Corporation
Activity Streams IntegrationIBM Connections 5.0 Workshop
Author: Paul GodbyIBM Ecosystem DevelopmentDuration: 45 minutes
Agenda
● Overview● Components of an Event● Components of OpenSocial Gadgets● Deployment / Configuration● APIs
Social Application Container
● Social networking sites attempt to increase participation by allowing 3rd parties to build new applications
● A site that hosts a 3rd party application is a container● The app can leverage the social data of the user base● The app drives new users back to root site to build user base for it's service● Container builds more value for users by providing more content
● A container typically consists of at least 3 categories of user-based social information
1) User profile – Information a developer can use to provide a personalized user experience
2) Network – friends and relevant social contacts
3) Activity Stream – user's news feed that provides aggregated view of network updates● Contains events and the means to act upon them
● Updating the Activity Stream allows developers to reach a new audience (from a user's network) and drive traffic to their applications
Embedded Experiences
● Social application built on top of the infrastructure defined by the container● 3rd party application developers build on top of existing container
● Container development ensures features are up to date, adds/removes supported features (ie: OAuth)
● Application developers can spend more time on their own application
● In IBM Connections:● OpenSocial Gadgets that display a preview of a Connections application object
(File, Status Update, Blog Entry, etc). ● Allow simple social actions on the object such as commenting and liking.● Display from activity stream UI in a popup
Open Social gadgets
● Gadget URL included in activity stream event posted from an application● Event can point to IBM Connections gadgets or external gadgets that will be
displayed in the EE popup
iWidgets vs OpenSocial Gadgets
iWidget OpenSocial Gadget
Activity Streams * X
Share Dialog X
Home Page X X
Profiles X
Communities X
Rendering inline iFrame
Specification iWidget 1.0 OpenSocial 2.0
● Recommendation: Use an OpenSocial Gadget when possible● Provides better integration and code reuse opportunities with other products
– Example: IBM Notes / Domino 9
* Available in the following applications: Home Page, Profiles, Communities
Agenda
● Overview● Components of an Event● Components of OpenSocial Gadgets● Deployment / Configuration● APIs
Data Model
● Serialized using the JSON data format using the ActivityStrea.ms specification● Event tells the story of a person performing an action on or with an object
● Primarily consists of: – Actor = describes the entity that performed the activity
– Verb = identifies the action the activity describes
– Object = describes the primary object of the activity
– Target = target of the activity, dependent on the verb
● Goal is to provide enough metadata that the consumer (social application container) can present it in a rich human-friendly format
● Consider the following sentence:
Martin posted a blog entry to his blog.
Actor
Verb
Object
Target
Activity Stream sample event
● Minimum data for posting an event in IBM Connections● Actor = user performing the action● To = target user's stream (if left out, event will post to actor's stream)
Include additional data from 3rd party system
● Add a “context” section to the “openSocial → embed” JSON object
● You can retrieve this data later using OpenSocial APIs in your gadget
IBM Connections Extensions
● Saved● Store an event to easily revisit at a future time
● Actionable● Flag an event as important and requires the user's attention
● Rollup● Add to existing event (ie: a comment) and “roll it up” to the top of the stream
@mentions
● Requires IBM Connections 4.5 CR4+● Must set the event verb to “mention”● Requires the IBM Connections uUid and a display name
URL Preview
● Requires IBM Connections 5.0+● Must use an API to first retrieve the meta data, then add as attachment to the event
● Oembed / meta-data API:● Returns meta-data associated with a given url passed in input● API shaped on oEmbed standard - http://oembed.com/● Format for allowing an embedded representation of a URL on third party sites● /opengraph/basic/{anonymous}/api/embed?url=<url to HTML page to extract data>
● Image proxy resizer API:● /connections/thumbnail/api/imageProxy?url=<original image
url>&maxHeight=<maxHeight>&maxWidth=<maxWidth>● Return the image resized, with ration maintained● Return png format● Accept most common image formats (jpg, png, bmp) as input
Activity Stream Events: Important things to know!
● Gotchas:● Data will be deleted after predefined interval (default is 30 days)
– Unless marked “Saved” or “Actionable”
● Events only contain references to items in other systems● The Activity Stream is NOT a data repository
● When designing your application:● Do not assume a user will see the event...● Users should continute to be able to perform workflow actions in external systems
Agenda
● Overview● Components of an Event● Components of OpenSocial Gadgets● Deployment / Configuration● APIs
OpenSocial Gadget
● Application built using XML, JavaScript, CSS, and HTML● Allows developers to easily write useful web applications that work anywhere on
the web without modification● XML file allows the container to load the application content and information
<?xml version=”1.0” encoding=”utf-8”?>
<Module>
<ModulePrefs … /> title, author, description, thumbnail, height, width, OAuth config, etc.
<UserPref … /> provide key/value storage of data using JavaScript
<Content ...> defines content loaded for different views
<![CDATA[
Gadget Content
]]>
</Content>
</Module>
OpenSocial Gadget sample
Alternatively, you can reference content on an external server...
HTML markup embedded in “Content” section of XML
Agenda
● Overview● Components of an Event● Components of OpenSocial Gadgets● Deployment / Configuration● APIs
OpenSocial Gadget deployment
1) Declare Home Page administrator(s)
2) Home Page administrators can:● add/remove gadgets● enable/disable gadgets
Add/Remove gadgets
● OpenSocial gadgets must be registered, or added to the existing “whitelist”● Prevents unknown and untrusted gadgets from being introduced into the system
● Use the Home Page administration UI to add/remove gadgets
Agenda
● Overview● Components of an Event● Components of OpenSocial Gadgets● Deployment / Configuration● APIs
SBT SDK – Retrieve Activity Stream entries
● Retrieve the list of entries using the ActivityStream service
Delete Activity Stream entries
● Deletion available only for select users● User must be mapped to the Admin role in the WidgetContainer application
● Issue an HTTP DELETE request to the specified URL and include event Ids
● Delete a single event● /connections/opensocial/rest/activitystreams/@me/@all/@all/<event id>
● Delete multiple events● /connections/opensocial/rest/activitystreams/@me/@all/@all/<eventId1>,<eventId2>
Thanks!
● Access FREE education on the IBM Collaboration Solutions portfolio of products today!
1. Visit the IBM Greenhouse and create a free account.
Link → http://greenhouse.lotus.com/
2. Visit the IBM Collaboration Solutions Ecosystem Development Community
Link → https://greenhouse.lotus.com/communities/community/icsecod
3. Learn new skills and share these links with your friends and colleagues!