Running the SBT Sample with IBM Portal

Hopefully, this quick tip helps others.  I recently worked with a colleague who installed the Social Business Toolkit Ear and could not get the app to load the configuration properly.  I changed the class loader to PARENT_LAST and the application loaded the configuration properly.

 

IBM SmartCloud Connections using Ruby

Recently, I was asked by a partner integrating with IBM SmartCloud for Social Business‘ IBM Connections Files service how to do so in Ruby.   I thought this brief demonstration code would help Ruby developers build a compelling integration.

Note, I have already gone through the OAuth Dance and generated an OAuth Bearer Token. I have expired this particular token so as to make the code safe for republishing.

API Explorer

For those developers who are looking for the right API…. The IBM SmartCloud for Social Business has it’s own view on the API Explorer.

Navigate to https://greenhouse.lotus.com/sbt/SBTPlayground.nsf/Explorer.xsp

From the Environments Menu, select SmartCloud. You’ll see the view changes, and BSS and Social appear.

View

BSS is the Business Support Services, and Social is for the Social APIs which you can access and use in the Cloud.

Expand BSS

Click on Authentication

In the main pane, Click on Change Password

Click Login (gets you logged into SmartCloud)

Click Execute (You’ll see how the API works)

API

 

 

cURL, oAuth and IBM SmartCloud for Social Business

For folks that are just getting started with IBM SmartCloud for Social Business, such that they are curious about scripting cURL and oAuth 2.0 flows so you can generate a Bearer token, please follow these steps.

Login to IBM SmartCloud for Social Business – https://apps.na.collabserv.com
Navigate over to Internal Apps – https://apps.na.collabserv.com/manage/account/isv/input
Click Register App
On the popup window, enter the application details:

Name Value
App Name paultest
App Description An application to demonstrate oAuth2.0
oAuth Type Check Enable API Access via OAuth2.0 Web Server Flow
Access Grant Duration 90 Days
Callback URL https://localhost/callback

 

Click Register

You should see a message that states app registered successfully.

InternalApps

Find your App Name (paultest), Click on the Down Caret > Show Credentials

Click Show Client Secret

Copy down the ClientID, Client Secret, Web App CallbackURL

Name Value
ClientID app_20085940_1399482973905
Client Secret a133ed0de271c2253e5cfe146c1765e012dcc1241de29ed7d4e56f0fce2b923678afd5e5
Callback URL https://localhost/callback

 

Navigate to https://apps.na.collabserv.com/manage/oauth2/authorize?response_type=code&client_id=YOUR_CLIENT_ID&callback_uri=YOUR_CALLBACK
Replace YOUR_CLIENT_ID with the ClientID above
Replace YOUR_CALLBACK with the Callback URL above

You should be redirected to the Grant page.

Click Grant Access and Leave Site

Grant

Copy the Generated URL from the Browser Bar

URL
https://localhost/callback?code=edc5fc9fb77d7df86663d16cd0b56c44444de03d88266b4148752900863fc65604bbbe9c277d235f7c60d860321b548e3ab4131511ad5803442e790c35a120aad4493779bc1a71c8885caec4860ce92d748880a8740c8d349e2b6fa96d285ad17a8537648dd5101fb451fc30bde8d7976ba381367b4379e2d0d509aab27b607

Save the Value of Code

Name Value
Code    edc5fc9fb77d7df86663d16cd0b56c44444de03d88266b4148752900863fc65604bbbe9cb4379e2d0d509aab27b607

 

Now you should check to see if cURL is installed, else, you can download it from http://curl.haxx.se/ or use yum install curl.

In addition to the client id, client secret and callback url, we are going to use the authorize and token endpoints which are needed to generate a Bearer token.

Name Value
Authorization Endpoint https://apps.na.collabserv.com/manage/oauth2/authorize
Token Endpoint https://apps.na.collabserv.com/manage/oauth2/token

 

Open a Terminal Window

Launch the command to get the Bearer Token

curl -X POST https://apps.na.collabserv.com/manage/oauth2/token \
-d client_id=YOUR_CLIENT_ID \
-d client_secret=YOUR_CLIENT_SECRET \
-d callback_uri=YOUR_CALLBACK \
-d code=YOUR_AUTHORIZATION_CODE \
-d grant_type=authorization_code

You see

access_token=16c7f772427f367be615ffaefd8293cff73646e246e1d094a63dd914c43b9e3efd84809378199815886d83a740&refresh_token=5b1e334d4de0b8e39c3dff8fd1c88dc8d9169fdbe7a0759b155dcd2b3a0479c47f5b&issued_on=1399488937103&expires_in=7200000&token_type=Bearer

*note the tokens have been trimmed in size. *

Now, you can make a request to SmartCloud for Social Business using the Bearer Token (access token)

curl –header “Authorization: Bearer 16c7f772427f367be615ffaefd8293cff73646e246e1d094a63dd914c43b9e3efd84809378199815886d83a740ea6ef1713c6dc310b4cac9730bad0426bfe1abd0eaefadef38411243d21546e2645dad16c35fb299da8d642de665582b559cef50d9742f12313f7b90a5977f7cc08c34a8bafe7” https://apps.na.collabserv.com/lotuslive-shindig-server/social/rest/people/@me

You see response data:

{"entry":{"photos":[{"value":"PROFILES","type":"Source"},{"value":"20089096__1386184300.jpg","type":"Photo"}],"telephone":"111-111-1111","aboutMe":"test software engineer","profileUrl":"https://apps.na.collabserv.com/contacts/profiles/view/20089096","mobilephone":"111-111-1112","orgs":[{"value":"PROFILES","type":"Source"},{"value":"Mentorship Expressway","type":"Org"}],"country":"US","website":"www.mycompany.com","id":"na.collabservtest.lotus.com:user:20089096","fax":"111-111-1114","orgId":20085940,"addresses":[{"value":"PROFILES","type":"Source"},{"address":""},{"address":""},{"address":""}],"photo":"20089096__1386184300.jpg","emailAddress":"pbastide@us.ibm.com","websites":[{"value":"PROFILES","type":"Source"},{"website":""},{"website":""},{"title":"Test","website":"http://T22"},{"website":"www.mycompany.com"}],"fullName":"Paul Bastide","objectId":20089096,"jobtitle":"Director","ims":[],"emails":[{"title":"Primary Email","email":"pbastide@us.ibm.com"}],"org":{"name":"Mentorship Expressway"},"displayName":"Paul Bastide","phoneNumbers":[{"value":"PROFILES","type":"Source"},{"title":"Contact","phone":"978-000-0000"},{"title":"ID","phone":"GGGG"},{"phone":""},{"title":"Primary Telephone","phone":"111-111-1111"},{"title":"MobilePhone","phone":"111-111-1112"},{"title":"Fax","phone":"111-111-1114"}]}}

That’s it, you now know how to use the Bearer Token with oAuth and SmartCloud.

Reference

https://labs.hybris.com/2012/06/18/trying-out-oauth2-via-curl/

Seamless User Experience with IBM SmartCloud for Social Business

I work with many partners to integrate with IBM Collaboration Solutions products and projects – IBM Domino, IBM Sametime, IBM Connections, IBM Social Business Toolkit, IBM Collaboration QuickStart for Social Business.

Recently, I have been focusing on integrating with the IBM SmartCloud for Social Business. Many partners ask how they can make a seamless experience between IBM SmartCloud for Social Business and their custom application. This article introduces the IBM SmartCloud for Social Business, the Trials you can use to prototype your integrations, and how to make the seamless experience.

Overview

IBM SmartCloud for Social Business is a suite of business networking and collaboration cloud-based services hosted by the IBM Collaboration Solutions division of IBM. The integrated services include social networking for businesses, online meetings, file sharing, instant message, data visualization and e-mail.

Trials

You can use various trials. Customer Trials are:

No charge, 60 day trial, 25 accounts
Anyone can sign up
Once Per Domain
Available at http://ibm.co/1coI7gP

Partner Trials are:

No charge, 1 year trial, 30 accounts
Use the account to demonstrate and develop solutions for your clients
Must be a PartnerWorld Member
Available at http://ibm.co/1kbh7eL

Starting Point and Extensions

When you first log in with your trial, you see a great starting point, your dashboard.

Dashboard

Click the Apps Menu

Apps Menu

You can add your own application here.

Let’s add our own extension.

Click the Admin Menu

Click Manage Organization

Manage Organization

Click Organization Extensions

Click Add Extension

Add Extension

Select Top Navigation Bar

Type Name : Demo

Enter Icon Url: http://www-03.ibm.com/ibm/history/ibm100/images/icp/D562347I16459C79/us__en_us__ibm100__sustainable_cocoa__icon__540x324.png

This is for the image that you want displayed to the left of the entry on the Apps Menu. You can use any icon that is web accessible by the User’s browser.

Enter Url:  http://bastide.org/wp-content/uploads/2014/03/demo-seamless1.html

You can point to any webpage that your user can access via their web browser (internal or external to a corporate network).

Click Save

Extension-Save

Click The Apps Menu

Notice the Demo is added.

New Apps Menu

You have completed the first step of the seamless experience.

Making your App Seamless

Making an application seamless is a multiple step process,
add the linked styles, so you can take full advantage of the styles.

<link rel="stylesheet" href="https://apps.na.collabserv.com/theming/theme/css/3" type="text/css" />

Next, you want to add a class and div to add the menu bar.

<div class=”lotusui30 lotusui30_body lotusui30_fonts scloud3“> <div id=”smartcloudExt” class=”scloud3” > <script src=”https://apps.na.collabserv.com/navbar/banner/notes9/smartcloudExt?displayName&orgName=Demo Org&oneui=3” language=”javascript“></script> </div>

Notice, smartcloudExt exists as the div id and is the last component in the URL, they must exist, the javascript loads the banner in the div in a specific div based on that component.  It can be anything as long as they agree.   Notice also, that the div is surrounded by the div with class – that’s the theme/User Interface specific definitions necessary to render the menu bar.

Next, if you want to take advantage of the styles from IBM, called OneUI, you can navigate and find the elements of the style and use the sample as a starting point http://infolib.lotus.com/resources/oneui/3.0/docPublic/components

Copy and paste it in place.

Save

Launch in Firefox .

Result

You can inspect each element, and find the CSS you want to override. Look to the right…

CSS_Inspector_Firebug

Copy the CSS and inline the CSS with your own definition.

For instance, I wanted to increase the size of the cloud table.

<style type="text/css">
.scloud3 table, .scloud3_gecko input, .scloud3_gecko select, .scloud3_webkit input, .scloud3_webkit select {
    font-size: 1.5em;
}
</style>

This results in expanded font sizes.

Result with Expanded Font

Note, you might see an issue with no banner, such as this image. This means you have not previously logged into the SmartCloud, login to activate the banner.

Screen Shot 2014-03-09 at 8.01.34 AM

The source for the demo is available here

You now know how to take advantage of the IBM SmartCloud for Social Business to build a seamless experience for your users.

References

Copied Detailed Table Information http://infolib.lotus.com/resources/oneui/3.0/docPublic/components/tableSummaryDetails.htm
OneUI 3.0 Documentation http://infolib.lotus.com/resources/oneui/3.0/docPublic/index.htm
Linked CSS https://apps.collabservnext.com/theming/theme/css/3
CSS Formatter  http://www.codebeautifier.com/