SlideShare a Scribd company logo
There’s an API for that! Why and 
how to build on the IBM 
Connections PLATFORM 
Mikkel Flindt Heisterberg 
Senior Solution Architect and Partner 
OnTime® by IntraVision
There’s an API for that! Why and how to build on the IBM Connections PLATFORM
Agenda 
• Brief intro to 
–IBM Connections as a PLATFORM 
–iWidgets for IBM Connections 
–Developing for the Activity Stream 
–SPI’s and Event handlers 
Mikkel Flindt Heisterberg 
Twitter: @lekkim 
E-mail: mfh@intravision.dk 
http://lekkimworld.com 
http://slideshare.net/lekkim
The IBM Connections platform
Widgets
Widgets – descriptor 
<iw:iwidget id="com.example.ExampleWidget" supportedModes="view fullpage” 
mode="view” lang="en" xmlns:iw="http://www.ibm.com/xmlns/prod/iWidget" 
iScope="com.example.ExampleWidget"> 
<iw:resource uri="http://www.example.com/ExampleWidget.js" /> 
<iw:resource uri="http://www.example.com/ExampleWidget.css" /> 
<iw:content mode="view"> 
<![CDATA[ 
<div id="_IWID_widgetContent">Loading...</div> 
]]> 
</iw:content> 
<iw:content mode="fullpage"> 
<![CDATA[ 
<div id="_IWID_widgetContent">Loading...</div> 
]]> 
</iw:content> 
</iw:iwidget>
Widgets – iScope 
dojo.provide("com.example.ExampleWidget"); 
dojo.declare("com.example.ExampleWidget", null, { 
constructor: function() {}, 
onLoad: function() {}, 
onView: function() {}, 
onEdit: function() {}, 
onFullpage: function() {}, 
onSearch: function() {} 
});
Widgets – declaration 
Declaratively configured using widgets-config.xml 
<widgetDef defId="com.example.ExampleWidget” 
url="/ExampleWidget.xml" loginRequired="true” 
showInPallette=”true” primaryWidget=”false”> 
<itemSet> 
<item name="resourceId" value="{resourceId}" /> 
<item name="profilesCtx" value="{profilesSvcRef}" /> 
<item name="myProp" value="Abc123" /> 
</itemSet> 
</widgetDef>
Widgets – iContext 
• An iContext instance is set into the iScope instance 
• The iContext provides access to the widget markup (e.g. root 
element), I/O related functions (i.e. URL rewriting), widget 
attributes etc. 
• The iContext is easily accessed from the iScope class using 
this.iContext 
• Important functions include: 
– iContext.getRootElement() : DOM Element 
– iContext.getElementById(id:string) : DOM Element 
– iContext.getiWidgetAttributes() : ItemSet 
– iContext.getUserProfile() : ItemSet 
– iContext.io.rewriteURI(uri:string) : string 
– iContext.iEvents.fireEvent(name:string, type:string, payload:object)
Loading prior to IBM Connections 
5
Loading from IBM Connections 5
Loading from IBM Connections 5 
http://www.youtube.com/ 
watch?v=1GLpA604Iic
Activity Stream 
• The following is based on my highly acclaimed 
(cough, cough) presentation on the Activity 
Stream 
• Much more detail and many examples there 
• See http://slideshare.net/lekkim 
Mikkel Flindt Heisterberg 
Twitter: @lekkim 
E-mail: mfh@intravision.dk 
http://lekkimworld.com 
http://slideshare.net/lekkim
Activity Stream 
• IS 
– River of news – it’s like water flowing by you 
– Notifications about ”stuff” happening in (other) 
systems – we refer to these notifications as 
entries 
• ISN’T 
– A new inbox – doesn’t replace email 
– A perpeptual data store – entries are deleted 
based on a server defined purge interval (default 
is 30 days) unless saved or actionable
Activity Stream 
• In my opinion it makes most sense to not consider 
the activity stream as one single stream 
• Instead think that 
– Each user has his/her own (@me) 
– There is a public stream (@public) 
– A community may have a stream if the widget has 
been added by a community owner – if there’s no 
stream for a community posting to it will return a 
”403 Forbidden”
Activity Stream 
• You will mainly use the POST and PUT methods to send JSON data (Content-Type: 
application/json) to the API 
• JSON is super simple key/value data format. It has simple datatypes (strings, 
numbers, booleans), objects and arrays 
{ 
”email”: ”mh@intravision.dk”, 
”niceGuy”: true, 
”age”: 37, 
”name”: { 
”first”: ”Mikkel Flindt”, ”last”: ” Heisterberg” 
}, 
”Connectospheres”: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15] 
}
Activity Stream 
{ 
"actor": {"id": "@me"}, 
"verb": "post", 
"title": "Some entry title", 
"updated": "2013-05-17T12:00:00.000Z", 
"object": { 
"title": "Some object title", 
"objectType": "note", 
"id": "1234567890-1234567890-1234567890" 
} 
}
Activity Stream 
https://<host>/connections/opensocial/<auth>/rest/activitystreams 
/<user ID>/<group ID>/<application ID>/<activity ID> 
Component Meaning 
<auth> (optional) If using form based authentication leave this component out. Otherwise options 
are anonymos, basic, oauth. 
<user ID> The user whose stream you’re addressing – use @me for current users stream, @public for 
public stream or a community ID for the stream in a community. 
<group ID> The group of entries you’re addressing – use @all for all posts or options for special 
meaning such as @saved, @actions, @mentions. Refer for InfoCenter and resources slide 
for more. 
<application ID> When retrieving entries this refers to the application (or ”generator”) that created the entry. 
All the IBM Connections app names can be used (profiles, blogs, wikis etc.) plus custom 
ones (e.g. ontimegc). @all used for all applications. 
<activity ID> Used to reference a specific event e.g. for updating saved status.
Activity Stream 
1. /activitystreams/@me/@all 
List my (current users) entries 
2. /activitystreams/@public/@all 
List public stream entries 
3. /activitystreams/@me/@actions 
List my actionable events 
4. /activitystreams/@me/@saved/blogs 
List my saved events from blogs 
5. /@me/@all/@all/urn:lsid:lconn.ibm.com:activitystreams.story:bdb562f… 
Work with entry from my stream based on ID 
* All URLs above start with 
https://<host>/connections/opensocial/<auth>/rest 
Also used 
when creating 
new entries 
(e.g. POSTing)
Other Programming Interfaces 
• SPIs are lower-level programming interfaces which may be subject to 
modification from release to release. 
• Event SPI 
– The IBM Connections Event SPI allows third parties to consume event data generated by 
IBM Connections. 
• Seedlist SPI 
– Use the Seedlist service provider interface (SPI) provided with IBM Connections to 
integrate your search engine with IBM Connections content. 
• Service SPI 
– You can use the IBM Connections Service SPI to learn about the applications running in 
your IBM Connections deployment. 
• User SPI 
– You can use the IBM Connections User SPIs to access information about the users in 
your IBM Connections deployment.
Event Handlers – declaration 
Declaratively configured using events-config.xml 
<postHandler enabled=”true" invoke="ASYNC" 
name=”MyEventHandler” class="com.example.MyEventHandler"> 
<subscriptions> 
<subscription source="*" type="*" eventName="*"/> 
<!-- 
<subscription source=”PROFILES" type="*" 
eventName=”profiles.updated"/> 
<subscription source=”PROFILES" type="*" 
eventName=”profiles.person.photo.updated"/> 
--> 
</subscriptions> 
</postHandler>
Event Handlers – implementation 
import com.ibm.connections.spi.events.EventHandler 
public class MyEventHandler implements EventHandler { 
public void init() throws EventHandlerInitException {} 
public void destroy() {} 
public void handleEvent(Event event) throws EventHandlerException { 
String eventName = event.getName(); // event name 
Person actor = event.getActor(); // person that triggered event 
// look at the event name 
if (event.getName().equals("profiles.person.photo.updated")) { 
// a profile photo was updated 
this.doEventProfilesPhotoUpdated(event); 
} else if (event.getName().equals("profiles.updated")) { 
// a profile was updated 
this.doEventProfilesUpdated(event); 
} 
} 
}
Event Handlers – summary 
• Make event handlers asynchroneous 
• What happens if your event handler fail? 
• What happens if the recipient of the event 
(3rd party API) fail? 
• Be defensive – consider what happens if 
events are lost
Thank you 
• Presentations on slideshare.net – this one is 
coming 
• Contact me – often times more than willing to 
help – I’ll let you know when it’s a project  
Mikkel Flindt Heisterberg 
Twitter: @lekkim 
E-mail: mfh@intravision.dk 
http://lekkimworld.com 
http://slideshare.net/lekkim

More Related Content

What's hot (15)

PPTX
7 Deadly Sins in Azure AD App Development
Joonas Westlin
 
PDF
How to add your own OpenSocial Gadgets to IBM Connections
IBM Connections Developers
 
PPTX
Social Login
Michele Leroux Bustamante
 
PPTX
DEV-1467 - Darwino
Jesse Gallagher
 
ODP
IBM Connect 2014 - AD204: What's new in the IBM Domino Objects: By Example
IBM Connections Developers
 
PDF
O365con14 - a developer jam with yammer
NCCOMMS
 
PDF
Introduction to OAuth 2.0 - Part 2
Nabeel Yoosuf
 
PDF
Nishimura finding vulnerabilities-in-firefox-for-i-os-(nishimunea)
PacSecJP
 
PDF
- Webexpo 2010
Petr Dvorak
 
PPTX
Introduction to OAuth 2.0 - Part 1
Nabeel Yoosuf
 
PPTX
End to End Security with MVC and Web API
Michele Leroux Bustamante
 
PDF
Introduction to OAuth 2.0 - Part 1
Nabeel Yoosuf
 
PPTX
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Aaron Parecki
 
PPTX
Domino/Notes 9.0 upgrade to take advantage of NFL, WFL and CORS technologies
Andrew Luder
 
PDF
HTML5 and the dawn of rich mobile web applications
James Pearce
 
7 Deadly Sins in Azure AD App Development
Joonas Westlin
 
How to add your own OpenSocial Gadgets to IBM Connections
IBM Connections Developers
 
DEV-1467 - Darwino
Jesse Gallagher
 
IBM Connect 2014 - AD204: What's new in the IBM Domino Objects: By Example
IBM Connections Developers
 
O365con14 - a developer jam with yammer
NCCOMMS
 
Introduction to OAuth 2.0 - Part 2
Nabeel Yoosuf
 
Nishimura finding vulnerabilities-in-firefox-for-i-os-(nishimunea)
PacSecJP
 
- Webexpo 2010
Petr Dvorak
 
Introduction to OAuth 2.0 - Part 1
Nabeel Yoosuf
 
End to End Security with MVC and Web API
Michele Leroux Bustamante
 
Introduction to OAuth 2.0 - Part 1
Nabeel Yoosuf
 
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Aaron Parecki
 
Domino/Notes 9.0 upgrade to take advantage of NFL, WFL and CORS technologies
Andrew Luder
 
HTML5 and the dawn of rich mobile web applications
James Pearce
 

Similar to There’s an API for that! Why and how to build on the IBM Connections PLATFORM (20)

ODP
AD104 - IBM Connections ActivityStream Integration - IBM Connect 2013
Brian O'Gorman
 
PPTX
An Introduction to Working With the Activity Stream
Mikkel Flindt Heisterberg
 
PDF
Mikkel Heisterberg - An introduction to developing for the Activity Stream
LetsConnect
 
PDF
IBM Connections Activity Stream APIs - Lab Dec 2012
Vincent Burckhardt
 
PDF
How to access the Activity Stream in IBM Connections
IBM Connections Developers
 
PDF
How to increase social adoption - meetIT 2016, Milano
Henning Schmidt
 
PDF
IBM Connections How to use existing data to increase adoption success with IB...
Dominopoint - Italian Lotus User Group
 
PPT
1309 leveraging social business data visualizing the connections org structure
Matthew Milza
 
ODP
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
James Gallagher
 
PDF
Rock the activity stream api
Wannes Rams
 
PDF
AD306 - Turbocharge Your Enterprise Social Network With Analytics
Vincent Burckhardt
 
PDF
2013-03 - CeBIT - DNUG - Activity Streams
Arnd Layer
 
ODP
JMP102 Extending Your App Arsenal With OpenSocial
Ryan Baxter
 
PDF
Should we manage events like APIs? | Alan Chatt and Kim Clark, IBM
HostedbyConfluent
 
PPT
Open Standards For Social Business Apps
IBM Connections Developers
 
ODP
Bp209
Ryan Baxter
 
ODP
IBM Connect 2014 - KEY108: IBM Collaboration Solutions Application Developmen...
IBM Connections Developers
 
ODP
Connect 2014 - Key108 - Application Development Strategy
Philippe Riand
 
PPTX
Do Try This at Home! Extend IBM Connections using IBM Worklight
Prolifics
 
PPTX
Should we manage events like APIs? | Kim Clark, IBM
HostedbyConfluent
 
AD104 - IBM Connections ActivityStream Integration - IBM Connect 2013
Brian O'Gorman
 
An Introduction to Working With the Activity Stream
Mikkel Flindt Heisterberg
 
Mikkel Heisterberg - An introduction to developing for the Activity Stream
LetsConnect
 
IBM Connections Activity Stream APIs - Lab Dec 2012
Vincent Burckhardt
 
How to access the Activity Stream in IBM Connections
IBM Connections Developers
 
How to increase social adoption - meetIT 2016, Milano
Henning Schmidt
 
IBM Connections How to use existing data to increase adoption success with IB...
Dominopoint - Italian Lotus User Group
 
1309 leveraging social business data visualizing the connections org structure
Matthew Milza
 
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
James Gallagher
 
Rock the activity stream api
Wannes Rams
 
AD306 - Turbocharge Your Enterprise Social Network With Analytics
Vincent Burckhardt
 
2013-03 - CeBIT - DNUG - Activity Streams
Arnd Layer
 
JMP102 Extending Your App Arsenal With OpenSocial
Ryan Baxter
 
Should we manage events like APIs? | Alan Chatt and Kim Clark, IBM
HostedbyConfluent
 
Open Standards For Social Business Apps
IBM Connections Developers
 
IBM Connect 2014 - KEY108: IBM Collaboration Solutions Application Developmen...
IBM Connections Developers
 
Connect 2014 - Key108 - Application Development Strategy
Philippe Riand
 
Do Try This at Home! Extend IBM Connections using IBM Worklight
Prolifics
 
Should we manage events like APIs? | Kim Clark, IBM
HostedbyConfluent
 
Ad

More from Mikkel Flindt Heisterberg (12)

PPTX
An Introduction to Lightning Web Components
Mikkel Flindt Heisterberg
 
PPTX
IBM Connections 5 Gæstemodel
Mikkel Flindt Heisterberg
 
ODP
BP309 Project Management Inside and Outside the Box
Mikkel Flindt Heisterberg
 
PPT
Creating a keystore for plugin signing the easy way
Mikkel Flindt Heisterberg
 
PDF
BP207 - Easy as pie creating widgets for ibm connections
Mikkel Flindt Heisterberg
 
PPTX
OnTime Partner Webinar September 2011
Mikkel Flindt Heisterberg
 
ODP
Plug yourself in and your app will never be the same (2 hr editon)
Mikkel Flindt Heisterberg
 
ODP
Plug yourself in and your app will never be the same (2 hour edition)
Mikkel Flindt Heisterberg
 
PPT
Lotusphere Comes To You 2011
Mikkel Flindt Heisterberg
 
PPTX
Lotus Community Call - 22 March 2011
Mikkel Flindt Heisterberg
 
ODP
Plug yourself in and your app will never be the same (1 hr edition)
Mikkel Flindt Heisterberg
 
PPTX
Lotus Notes Plugin Installation For Dummies
Mikkel Flindt Heisterberg
 
An Introduction to Lightning Web Components
Mikkel Flindt Heisterberg
 
IBM Connections 5 Gæstemodel
Mikkel Flindt Heisterberg
 
BP309 Project Management Inside and Outside the Box
Mikkel Flindt Heisterberg
 
Creating a keystore for plugin signing the easy way
Mikkel Flindt Heisterberg
 
BP207 - Easy as pie creating widgets for ibm connections
Mikkel Flindt Heisterberg
 
OnTime Partner Webinar September 2011
Mikkel Flindt Heisterberg
 
Plug yourself in and your app will never be the same (2 hr editon)
Mikkel Flindt Heisterberg
 
Plug yourself in and your app will never be the same (2 hour edition)
Mikkel Flindt Heisterberg
 
Lotusphere Comes To You 2011
Mikkel Flindt Heisterberg
 
Lotus Community Call - 22 March 2011
Mikkel Flindt Heisterberg
 
Plug yourself in and your app will never be the same (1 hr edition)
Mikkel Flindt Heisterberg
 
Lotus Notes Plugin Installation For Dummies
Mikkel Flindt Heisterberg
 
Ad

Recently uploaded (20)

PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
Biography of Daniel Podor.pdf
Daniel Podor
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 

There’s an API for that! Why and how to build on the IBM Connections PLATFORM

  • 1. There’s an API for that! Why and how to build on the IBM Connections PLATFORM Mikkel Flindt Heisterberg Senior Solution Architect and Partner OnTime® by IntraVision
  • 3. Agenda • Brief intro to –IBM Connections as a PLATFORM –iWidgets for IBM Connections –Developing for the Activity Stream –SPI’s and Event handlers Mikkel Flindt Heisterberg Twitter: @lekkim E-mail: [email protected] http://lekkimworld.com http://slideshare.net/lekkim
  • 6. Widgets – descriptor <iw:iwidget id="com.example.ExampleWidget" supportedModes="view fullpage” mode="view” lang="en" xmlns:iw="http://www.ibm.com/xmlns/prod/iWidget" iScope="com.example.ExampleWidget"> <iw:resource uri="http://www.example.com/ExampleWidget.js" /> <iw:resource uri="http://www.example.com/ExampleWidget.css" /> <iw:content mode="view"> <![CDATA[ <div id="_IWID_widgetContent">Loading...</div> ]]> </iw:content> <iw:content mode="fullpage"> <![CDATA[ <div id="_IWID_widgetContent">Loading...</div> ]]> </iw:content> </iw:iwidget>
  • 7. Widgets – iScope dojo.provide("com.example.ExampleWidget"); dojo.declare("com.example.ExampleWidget", null, { constructor: function() {}, onLoad: function() {}, onView: function() {}, onEdit: function() {}, onFullpage: function() {}, onSearch: function() {} });
  • 8. Widgets – declaration Declaratively configured using widgets-config.xml <widgetDef defId="com.example.ExampleWidget” url="/ExampleWidget.xml" loginRequired="true” showInPallette=”true” primaryWidget=”false”> <itemSet> <item name="resourceId" value="{resourceId}" /> <item name="profilesCtx" value="{profilesSvcRef}" /> <item name="myProp" value="Abc123" /> </itemSet> </widgetDef>
  • 9. Widgets – iContext • An iContext instance is set into the iScope instance • The iContext provides access to the widget markup (e.g. root element), I/O related functions (i.e. URL rewriting), widget attributes etc. • The iContext is easily accessed from the iScope class using this.iContext • Important functions include: – iContext.getRootElement() : DOM Element – iContext.getElementById(id:string) : DOM Element – iContext.getiWidgetAttributes() : ItemSet – iContext.getUserProfile() : ItemSet – iContext.io.rewriteURI(uri:string) : string – iContext.iEvents.fireEvent(name:string, type:string, payload:object)
  • 10. Loading prior to IBM Connections 5
  • 11. Loading from IBM Connections 5
  • 12. Loading from IBM Connections 5 http://www.youtube.com/ watch?v=1GLpA604Iic
  • 13. Activity Stream • The following is based on my highly acclaimed (cough, cough) presentation on the Activity Stream • Much more detail and many examples there • See http://slideshare.net/lekkim Mikkel Flindt Heisterberg Twitter: @lekkim E-mail: [email protected] http://lekkimworld.com http://slideshare.net/lekkim
  • 14. Activity Stream • IS – River of news – it’s like water flowing by you – Notifications about ”stuff” happening in (other) systems – we refer to these notifications as entries • ISN’T – A new inbox – doesn’t replace email – A perpeptual data store – entries are deleted based on a server defined purge interval (default is 30 days) unless saved or actionable
  • 15. Activity Stream • In my opinion it makes most sense to not consider the activity stream as one single stream • Instead think that – Each user has his/her own (@me) – There is a public stream (@public) – A community may have a stream if the widget has been added by a community owner – if there’s no stream for a community posting to it will return a ”403 Forbidden”
  • 16. Activity Stream • You will mainly use the POST and PUT methods to send JSON data (Content-Type: application/json) to the API • JSON is super simple key/value data format. It has simple datatypes (strings, numbers, booleans), objects and arrays { ”email”: ”[email protected]”, ”niceGuy”: true, ”age”: 37, ”name”: { ”first”: ”Mikkel Flindt”, ”last”: ” Heisterberg” }, ”Connectospheres”: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15] }
  • 17. Activity Stream { "actor": {"id": "@me"}, "verb": "post", "title": "Some entry title", "updated": "2013-05-17T12:00:00.000Z", "object": { "title": "Some object title", "objectType": "note", "id": "1234567890-1234567890-1234567890" } }
  • 18. Activity Stream https://<host>/connections/opensocial/<auth>/rest/activitystreams /<user ID>/<group ID>/<application ID>/<activity ID> Component Meaning <auth> (optional) If using form based authentication leave this component out. Otherwise options are anonymos, basic, oauth. <user ID> The user whose stream you’re addressing – use @me for current users stream, @public for public stream or a community ID for the stream in a community. <group ID> The group of entries you’re addressing – use @all for all posts or options for special meaning such as @saved, @actions, @mentions. Refer for InfoCenter and resources slide for more. <application ID> When retrieving entries this refers to the application (or ”generator”) that created the entry. All the IBM Connections app names can be used (profiles, blogs, wikis etc.) plus custom ones (e.g. ontimegc). @all used for all applications. <activity ID> Used to reference a specific event e.g. for updating saved status.
  • 19. Activity Stream 1. /activitystreams/@me/@all List my (current users) entries 2. /activitystreams/@public/@all List public stream entries 3. /activitystreams/@me/@actions List my actionable events 4. /activitystreams/@me/@saved/blogs List my saved events from blogs 5. /@me/@all/@all/urn:lsid:lconn.ibm.com:activitystreams.story:bdb562f… Work with entry from my stream based on ID * All URLs above start with https://<host>/connections/opensocial/<auth>/rest Also used when creating new entries (e.g. POSTing)
  • 20. Other Programming Interfaces • SPIs are lower-level programming interfaces which may be subject to modification from release to release. • Event SPI – The IBM Connections Event SPI allows third parties to consume event data generated by IBM Connections. • Seedlist SPI – Use the Seedlist service provider interface (SPI) provided with IBM Connections to integrate your search engine with IBM Connections content. • Service SPI – You can use the IBM Connections Service SPI to learn about the applications running in your IBM Connections deployment. • User SPI – You can use the IBM Connections User SPIs to access information about the users in your IBM Connections deployment.
  • 21. Event Handlers – declaration Declaratively configured using events-config.xml <postHandler enabled=”true" invoke="ASYNC" name=”MyEventHandler” class="com.example.MyEventHandler"> <subscriptions> <subscription source="*" type="*" eventName="*"/> <!-- <subscription source=”PROFILES" type="*" eventName=”profiles.updated"/> <subscription source=”PROFILES" type="*" eventName=”profiles.person.photo.updated"/> --> </subscriptions> </postHandler>
  • 22. Event Handlers – implementation import com.ibm.connections.spi.events.EventHandler public class MyEventHandler implements EventHandler { public void init() throws EventHandlerInitException {} public void destroy() {} public void handleEvent(Event event) throws EventHandlerException { String eventName = event.getName(); // event name Person actor = event.getActor(); // person that triggered event // look at the event name if (event.getName().equals("profiles.person.photo.updated")) { // a profile photo was updated this.doEventProfilesPhotoUpdated(event); } else if (event.getName().equals("profiles.updated")) { // a profile was updated this.doEventProfilesUpdated(event); } } }
  • 23. Event Handlers – summary • Make event handlers asynchroneous • What happens if your event handler fail? • What happens if the recipient of the event (3rd party API) fail? • Be defensive – consider what happens if events are lost
  • 24. Thank you • Presentations on slideshare.net – this one is coming • Contact me – often times more than willing to help – I’ll let you know when it’s a project  Mikkel Flindt Heisterberg Twitter: @lekkim E-mail: [email protected] http://lekkimworld.com http://slideshare.net/lekkim