ad104 - ibm connections activitystream integration - ibm connect 2013

Download AD104 - IBM Connections ActivityStream Integration - IBM Connect 2013

If you can't read please download the document

Upload: brian-ogorman

Post on 14-Jun-2015

7.119 views

Category:

Documents


4 download

DESCRIPTION

AD104 session from IBM Connect 2013. IBM Connections ActivityStream Ingetration with Bill Looby and Brian O'Gorman

TRANSCRIPT

  • 1. AD104 IBM Connections ActivityStream Integration Bill Looby Brian OGorman 2013 IBM Corporation

2. AgendaWhat is the Activity Stream ? What do you expect to see and where, and what do you expect not to see ?Decide on your user model How do you want to interact with the Activity Stream ?Tooling up Use the right tools to get you startedAuthentication and Authorization Who are you and how can we be sure ?Putting it all together A simple extension . . .Administration and configuration What does an administrator need to know ?Posting an event How to POST and how the event is renderedRetrieving lists of events How to find the events of interest2 2013 IBM Corporation 3. Agenda What is the Activity Stream ? What do you expect to see and where, and what do you expect not to see ? Decide on your user model How do you want to interact with the Activity Stream ? Tooling up Use the right tools to get you started Authentication and Authorization Who are you and how can we be sure ? Putting it all together A simple extension . . . Administration and configuration What does an administrator need to know ? Posting an event How to POST and how the event is rendered Retrieving lists of events How to find the events of interest3 2013 IBM Corporation 4. What does the Activity Stream look like ?4 2013 IBM Corporation 5. Why is the Activity Stream important ? To the Business . . . To make Social Business work, all systems can participate by providing appropriatesimply-structurd events Once you have these events they can be stored and used in a manner consistentacross all contributing systems Gathering this informataion via an appropriate aggregation engine is a key part ofSocial Business technology From this aggregation analytics can be performed including lens and filters on events To the User its a bit simpler . . . Everything I need to know and act on in one place !5 2013 IBM Corporation 6. Agenda What is the Activity Stream ? What do you expect to see and where, and what do you expect not to see ? Decide on your user model How do you want to interact with the Activity Stream ? Tooling up Use the right tools to get you started Authentication and Authorization Who are you and how can we be sure ? Putting it all together A simple extension . . . Administration and configuration What does an administrator need to know ? Posting an event How to POST and how the event is rendered Retrieving lists of events How to find the events of interest6 2013 IBM Corporation 7. Do you want to inform ?Heres somethingyoull be interestedin Inform a user Send a specific notification to a specific user Only that user will see it Heres something thathappened. You can Be discoverablefind it if you look ! Show the event on the public feed Automatically forward to any followers of the ActorHeres somethingthat happened in Inform a Community this community Show the event on the community feed Automatically forward to any followers of the Community7 2013 IBM Corporation 8. Do you want to interact ? A link may be just fine The application sending the event is complex and any user should follow the provided link tointeract with it effectively Or you may want to allow simple interactions There are simple interactions that are suitable for inclusion with the event For example : approval, rejection, simple selection, simple commenting, upload, share etc. In each case, this is a simple enough interaction, so you would prefer not to lose your currentbrowser context, but return quickly to your stream once complete8 2013 IBM Corporation 9. Do you want to consume ? A general list The activity stream can be consumed easily and presented within another application in order toensure that any user using that application still sees their current stream. This may be useful where there is a specific application in which users tent to live so that theyare unlikely to be paying attention to their stream otherwise. An application specific list A separate application may use Connections simply as a storage mechanism for its own events. It can retrieve events specific to the application for display within the application All of these events are then also available aggregated within Connections Any combination Basic filtering is provided to show information specific to an object/actor/community etc. Search-based filtering allows for more specific combinations of criteria9 2013 IBM Corporation 10. Agenda What is the Activity Stream ? What do you expect to see and where, and what do you expect not to see ? Decide on your user model How do you want to interact with the Activity Stream ? Tooling up Use the right tools to get you started Authentication and Authorization Who are you and how can we be sure ? Putting it all together A simple extension . . . Administration and configuration What does an administrator need to know ? Posting an event How to POST and how the event is rendered Retrieving lists of events How to find the events of interest10 2013 IBM Corporation 11. Some Tools REST Client11 2013 IBM Corporation 12. Some Tools . . . continued When using a REST Client Form based authentication can be used. But FBA should never be used other than this as it is considerably more difficult to manage. Your browser is also a useful tool for all GET operations you may want to install a JSON Feed Reader plugin. cURL can be used to do simple command line based requests (you can for example set up a script to do some autopopulation this way)12 2013 IBM Corporation 13. Some Tools - Java HttpClient A simple http request mechanism from Apache Sends and receives raw requests Highly flexible and configurable Abdera (as an aside used for Atom generation and parsing) An Atom manipulation library Built on top of HttpClient Creates and Parses atom feeds making the main properties available easily Things to watch out for . . . . Redirects they autofollow by default, normally you wont need this Authentication you can set credentials to use on all requests SSL wont automatically accept, you need to add by default13 2013 IBM Corporation 14. Some Tools - JavaDefaultHttpClient httpclient = new DefaultHttpClient();// register the passed credentialsUsernamePasswordCredentials credentials = new UsernamePasswordCredentials(userName, password);CredentialsProvider credentialsProvider = new BasicCredentialsProvider();credentialsProvider.setCredentials( new AuthScope(host, AuthScope.ANY_PORT), credentials);httpclient.setCredentialsProvider(credentialsProvider);// register to auto accept SSL certificates and not to check hostsSSLContext sslcontext = SSLContext.getInstance("TLS");sslcontext.init(null, null, null);SSLSocketFactory socketFactory = new SSLSocketFactory(new AnyTrustStrategy(), SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);// allow any SSLSchemeRegistry sr = httpclient.getConnectionManager().getSchemeRegistry();sr.register(new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));sr.register(new Scheme("https", 443, socketFactory));return httpclient;14 2013 IBM Corporation 15. Agenda What is the Activity Stream ? What do you expect to see and where, and what do you expect not to see ? Decide on your user model How do you want to interact with the Activity Stream ? Tooling up Use the right tools to get you started Authentication and Authorization Who are you and how can we be sure ? Putting it all together A simple extension . . . Administration and configuration What does an administrator need to know ? Posting an event How to POST and how the event is rendered Retrieving lists of events How to find the events of interest15 2013 IBM Corporation 16. Authenticating requests APIs that access public data dont require authentication Connections to date has generally used Basic Authentication to access non- public data As of IC4, OAuth access is available, and is the recommended authorization mechanism for Open Social APIs OAuth is however designed primarily for for service to service rather than client applications. 16 2013 IBM Corporation 17. Summary of authentication options Anonymous access For public data, some APIs are available at an anonymous URL, where no authentication challenge is performed or credentials expected. Form Based Authentication Authentication used by browser URLs (where the user is redirected to the login page) Ajax applications also use this when accessing APIs in order to take advantage of the available session information Complex login redirect handing is however required Not recommended or supported for third party applications Basic Authentication Involves sending a Base-64 encoded header including the username and password This should always be done over https (to avoid passwords being sent in cleartext) Most HTTP libraries support settings for adding basic authentication headers (as do REST Client plugins) OAuth Authorisation Is an authorisation (rather than authentication) mechanism You can authorise a service to act on your behalf without giving them your credentials 17 2013 IBM Corporation 18. How do I invoke the appropriate authorization mechanism Answer . . . use the appropriate URL format ! /connections/opensocial/rest/activitystreams/@me/@all This is the default fomat It uses form based authentication (so you will get a redirect response if the appropriate session cookies are not provided for example) /connections/opensocial/anonymous/rest/activitystreams/@public/@all This is available when querying public data and performs no authentication check /connections/opensocial/basic/rest/activitystreams/@public/@all This performs the appropriate basic authentication challenge /connections/opensocial/oauth/rest/activitystreams/@public/@all This performs the appropriate OAuth dance18 2013 IBM Corporation 19. Agenda What is the Activity Stream ? What do you expect to see and where, and what do you expect not to see ? Decide on your user model How do you want to interact with the Activity Stream ? Tooling up Use the right tools to get you started Authentication and Authorization Who are you and how can we be sure ? Putting it all together A simple extension . . . Administration and configuration What does an administrator need to know ? Posting an event How to POST and how the event is rendered Retrieving lists of events How to find the events of interest19 2013 IBM Corporation 20. Take a simple website. . . .20 2013 IBM Corporation 21. . . . and add some simple code . . .21 2013 IBM Corporation 22. . . . giving you . . . . . . but this is just the start You can enhance the content as it appears in the stream You can provide an embedded experience for the event You can associate the event with a community You can make the event public You can begin to support followers22 2013 IBM Corporation 23. Agenda What is the Activity Stream ? What do you expect to see and where, and what do you expect not to see ? Decide on your user model How do you want to interact with the Activity Stream ? Tooling up Use the right tools to get you started Authentication and Authorization Who are you and how can we be sure ? Putting it all together A simple extension . . . Administration and configuration What does an administrator need to know ? Posting an event How to POST and how the event is rendered Retrieving lists of events How to find the events of interest23 2013 IBM Corporation 24. A development only server You can to edit the opensocial-config.xml file in the LotusConnections-config directory. Simply set the whiteListEnable attribute of gadget-settings to "false". Any Gadget can now be placed into the stream, so this is not secure enough for a production environment. It is however suitable for a development server. With this setting in place, you can now post any event into the Activity Stream referencing any Gadget, and the Gadget will be rendered. Note : You should be checking the file out to do this, but if you are on a single node you can edit the file directly and restart the server.24 2013 IBM Corporation 25. Enabling developers on a production server Where a server is required for both production and development the server admin can enable a development page and a number of hosts who have the authority to deliver Gadgets. You will need to edit the opensocial-config.xml file in the LotusConnections- config directory You should set the enabled attribute of developer to "true". You can then use the developer page to test Gadgets. http:///connections/resources/web/com.ibm.lconn.gadget/test/bootstrap.html. . .25 2013 IBM Corporation 26. Agenda What is the Activity Stream ? What do you expect to see and where, and what do you expect not to see ? Decide on your user model How do you want to interact with the Activity Stream ? Tooling up Use the right tools to get you started Authentication and Authorization Who are you and how can we be sure ? Putting it all together A simple extension . . . Administration and configuration What does an administrator need to know ? Posting an event How to POST and how the event is rendered Retrieving lists of events How to find the events of interest26 2013 IBM Corporation 27. Posting an event { You can POST any event to the stream "actor": { of the current user "id": "@me" /connections/opensocial/rest/activitystreams/ }, @me/@all "verb": "post", "title": "${share}", The main details are - "content":"This event is my first entry", actor : Connections or External Id "updated": "2012-01-01T12:00:00.000Z", verb : from a set list "object": { title : Connections will generate if needed "summary": "First Entry details", content : for display of event details "objectType": "note", updated : event time "id": "objectid", "displayName": "First entry", object : details on the object including title, id etc. "url": "http://myurl.com/myid" } connections : a grab bag of connections specific properties that add more information connections: { ... } }27 2013 IBM Corporation 28. Basic Entry Title, Content, Object Summary{ "actor": { Main items displayed in ActivityStream:"id": "@me" entry.title }, entry.content "verb": "post", "title": "[entry.title]", entry.object.summary "content":"[entry.content]", "object": {"summary": "[entry.object.summary]","objectType": "note","id": "00011","displayName": "[entry.object.displayName]","url": "http://myurl.com/myid" }}28 2013 IBM Corporation 29. Basic Entry Title, Content, Object Summary If title omitted, will be generated based on verb { "actor": {"id": "@me" }, "verb": "post", "content":"[entry.content]", "object": {... } } If content or object.summary omitted, nothing displayed { "actor": {"id": "@me" }, "verb": "post", "title": "[entry.title]", "object": {"summary": "[entry.object.summary]",... } }29 2013 IBM Corporation 30. HTML Formatting for Title, Content, Object Summary No Active Content ACF run on all fields title Allows anchor tags only content, object.summary Allows following tags

Style limitations Images given max-width of 100% (of the item container) Tables given simple 1px border Vertical whitespace (newlines, paragraphs) collapsed30 2013 IBM Corporation 31. HTML Formatting for Title, Content, Object Summary Only 6 lines of content and/or object.summary displayed initially Show More / Show Less links provided31 2013 IBM Corporation 32. Generator Identifies the source of the entry Can be used to request filtered feeds Can specify details in entry being posted "generator": { "id": "briansApp", "image": { "url": "http://http://briansApp.com/briansApp.png" }, "displayName": "Brians App", "url": "http://briansApp.com" } The image, if provided, is displayed in stream. Should be 16x1632 2013 IBM Corporation 33. Generator registering your application Applications can be registered (NewsActivityStreamService.registerApplication()) Provide following details: appId, displayName, url, secureUrl, imageUrl, secureImageUrl, summary Benefits: Post events with just appId for generator"generator": {"id": "briansApp" } ImageUrl or SecureImageUrl choosen appropriately for feed Filter displayed in ActivityStreams in Connections 33 2013 IBM Corporation 34. File Item Use objectType: file for entry that denotes a file{"actor": { "id": "@me"},"verb": "post","title": "${Actor} has uploaded ${Object} to SlideView","object": { "summary": "", "objectType": "file", "id": "slide001", "fileUrl": "http://slideview.briansApp.com/AD104.odp", "displayName": "AD104.odp", "url": "http://slideview.briansApp.com/viewSlide?deck=AD104.odp"}} Can also add preview image "object": { ... "image": { "url": "http://slideview.briansApp.com/getThumb?deck=AD104.odp" } }34 2013 IBM Corporation 35. Embedded Experience Provide extra detail and embedded functionality for your ActivityStream entry Displayed in popup when entry is clicked in the stream Defined in entry.opensocial.embed Two types supported: OpenSocial gadget URL** Require 4.0 CR2 for URL EE35 2013 IBM Corporation 36. Embedded Experience OpenSocial Gadget Need to provide gadget and context when posting entry "opensocial": { "embed": { "gadget": "http://briansApp.com/gadgets/slideview.xml", "context": { "deck": "AD104.odp" } } } gadget URI to the gadget definition context Anything you want Gadget must be registered via Homepage Administration UI or wsadmin commands Gadgets that are not registered will be ignored, and a generic EE from Connections is used Typically, gadgets will use OAuth authentication to load data from application36 2013 IBM Corporation 37. Embedded Experience URL Provide url when posting entry"opensocial": {"embed": {"url": "http://slideview.briansApp.com/ee/viewSlide?deck=AS104.odp"}} There is no context supported, but contextual data can be passed in URL URL must be whitelisted (via opensocial-config.xml) URLs that are not whitelisted will be ignored, and generic EE from Connections is used37 2013 IBM Corporation 38. Additonal details . . . Rollup In order to address the scenario where a user posts a file and 200 people like it, filling up their Activity Stream, rollup needs to be performed. This means - Only the latest event on any given object is shown The 2 most recent comments are returned.We support the ?rollup=true flag on retrieval for specifying that a rolled up feed is required.In order to provide for rollup, simply add the following (by default, the object id will be used) - "connections": {"rollupid": "3d7638dd-b5e1-4d52-a03d-83591996da20" },38 2013 IBM Corporation 39. Additonal details . . . Templated titles Connections allows for the introduction of two kinds of title template Object substitutions - where a referenced object within the event is substituted into the title. Title template substitutions - using object substitutions, providing a complete titleObject Substitution - A number of substitution values are supported within a submitted event.title. These are specified using the ${} marker. ${Actor} - this is converted into appropriately marked up HTML which displays the Actors name and links to a Business Card corresponding to the Actor ${Object} - for person objects as per Actor above, otherwise the displayName with a link to the url ${Target} - for person objects as per Actor above, otherwise the displayName with a link to the urlTitle Template Substitution ${add}=${Actor} added ${Object}. ${create}=${Actor} created ${Object}. ....39 2013 IBM Corporation 40. Additonal details . . . Distributing events { "to":[{"objectType":"person", "id":"acct:[email protected]"} Note : This reflects an outstanding ],proposal to update the existing "cc":[{"objectType":"person",deliverTo model from Activity Streams. "id":"http://example.com/profiles/bob"} ], An event can be distributed to multiple "verb":"post",users "actor":{"objectType":"person", "id":"acct:[email protected]"}, "object":{... } } }40 2013 IBM Corporation 41. Additonal details . . . Distribution . . . Restrictions By default most users do not have the authority to distribute events to another users stream. If they did then this would mean that any user would have the ability to spam indiscriminately.Although the ability to distribute can be opened up via configuration to any user, there is some basic distribution allowed for any user. 1)To [UserID] where the user in question is the current user 2)To @me which resolves to the same thing 3) To @public which means the event will appear on everyones discovery tab - but this is onlypermitted if the submitting user is also the actor in the event 4) To [CommunityId] where the current user is a member of that community or the community ispublic - again this is only permitted if the submitting user is also the actor in the event.In order do distribute any event to any user, the distributing user needs to be in the appropriate J2EE Role.41 2013 IBM Corporation 42. Agenda What is the Activity Stream ? What do you expect to see and where, and what do you expect not to see ? Decide on your user model How do you want to interact with the Activity Stream ? Tooling up Use the right tools to get you started Authentication and Authorization Who are you and how can we be sure ? Putting it all together A simple extension . . . Administration and configuration What does an administrator need to know ? Posting an event How to POST and how the event is rendered Retrieving lists of events How to find the events of interest42 2013 IBM Corporation 43. Details . . . Querying feeds My Activity Stream /activitystreams/@me/@all Filtered by Blogs /activitystreams/@me/@all/blogs Filtered by Activities /activitystreams/@me/@all/activities Filtered by Files /activitystreams/@me/@all/files Filtered by [AnyApp] /activitystreams/@me/@all/AnyApp Single event details /activitystreams/@me/@all/@all/[eventid]Object History /activitystreams/@me/@all/@all?filterBy=object &filterOp=equals &filterValue=[blogid]43 2013 IBM Corporation 44. Additional details . . . Some special applications . . . @communities - this covers any events you receive as a result of communities you are following and so the generator id you will see can be from the submitting component application and not always communities@tags - this covers any events you receive as a result of tags you are following and so the generator id you will see will be from the submitting component application and never tags @people - this covers any events you receive as a result of people you are following and so the generator id you will see can be from the submitting component application and not always profiles@status - this covers status updates that may be received from either the profiles application or the communities application44 2013 IBM Corporation 45. Additonal details . . . Working with Communities Filtering of a users stream based on events they receive as a result of following a community simply involves using the /@communities application filterWhen retrieving a community feed we treat communities as a pseudo-person /connections/opensocial/rest/activitystreams//@all This provides a list of all events relating to a community independent of who is following This feed also verifies that the community is either public, or that the viewer is a member of the community (otherwise they would not have rights to view the feed)To POST an event to a community, you distribute the event to the community as if it were a person, by either POSTing to /connections/opensocial/rest/activitystreams//@all Including the community in the distribution list45 2013 IBM Corporation 46. Additonal details . . . Saved and actionable events Actionable Events These are events that are marked as requiring attention either by the user or by the application that submitted the event (note : the connections UX doesnt expose the ability for a user to mark an event actionable, but the API does) All actionable events can be retrieved using the URL : /activitystreams/@me/@actionsSaved Events These are events that are marked by the user as being of sufficient interest to review later All actionable events can be retrieved using the URL : /activitystreams/@me/@saved Note : Actionable and saved events are not removed during normal event cleanup.46 2013 IBM Corporation 47. OpenNTF Appathon (Starts Feburary 2013) IBM Connections App Dev - Prizes: $5000 IBM XPages App Dev - Prizes: $5000 Anything leveraging Connections (social SDK, OpenSocial, iWidgets, REST APIs, customization, WebSphere, PHP, XPages, etc.) will be accepted.http://appathon.openntf.org 2013 IBM Corporation 48. Legal disclaimer IBM Corporation 2013. All Rights Reserved. The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBMs current product plans and strategy, which are subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in this presentation may change at any time at IBMs sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. All references to BriansApp refer to a fictitious company and are used for illustration purposes only.48 2013 IBM Corporation 49. Related SessionsAD105 - Customizing and Extending IBM Connections - Tue 11:15amINV305 - The Power of Social Software in the Enterprise - Tue 1:30pmAD206 - IBM Domino XPages: Embrace, Extend, Integrate - Tue 1:30pmID105 - You Have My Mail in Your Connections - Tue 3:00pmBOF406 - Connections at IBM and at Your Company - Wed 7:00amID308 - Social Content Managemner Solutions for IBM Connections - Wed 10:00amAD401 - Developing Integrated Applications with the Social Business Toolkit - Wed 11:15amID307 - Make your Microsoft Stack Social with IBM Connections - Wed 11:15amID302 - Whats new in IBM Connections Mobile - Wed 1:30pmID306 - IBM Connections Mobile Server Administration and Security - Wed 3:00pmID309 - Leveraging the Power of IBM Connections and IBM Websphere Portal Wed 3:00pmID304 - IBM Connections 4.0 Deployment and Performance Planning - Wed 4:15pmINV211 - The New Social Business Paradigm with OpenSocial - Wed 4:15pmSHOW300 - IBM Connections 4 101: Installing & Deploying IBM Connectons Cognos - Wed 4:30pmID305 - Getting the Most Value Out of Metrics in IBM Connections 4 - Thur 10:00am49 2013 IBM Corporation