Something missing in smartcloud SBT ? – “Cannot find Endpoint connections”

I started down the path of adding “My Communities” to my little test database and following the same process as I had found the profile information I went to the playground and looked at the Java snippets for SmartCloud – get Communities



and from that I created the following Java code in my Utils class. When looking at the eclipse errors and adding the correct imports, there is no services.client.smartcloud.communities.Community option.


Running that I got the following error in my XPage


I knew that the only Endpoint I had created was the managed-bean “smartcloud”

So I copied and pasted the entire smartcloud bean in my faces-config.xml, renamed it “connections” and voila it solved the problem. Called connections, connecting to the SmartCloudOAuthEndpoint. Weird!



So I am not sure if this is a bug or defect or what within the SBT. It looks like many of the “connections” classes and objects have been ported over to smartcloud as there and many smartcloud classes with the same name and functions as the connections ones.

Or maybe this is intentional for some reason that I am not aware of.

Either way – noted and recorded so I don’t forget.



Scoping your beans correctly with the IBM Social Business Toolkit

If you are setting up the IBM Social Business Toolkit within your XPages application – the faces-config.xml is where you configure your SBT connection to Smartcloud/Connections. This particular issue arose for us recently but makes perfect sense once we understood what was going on.

Initially we had the following and everyone who accessed the application got the same list of one user’s files. We struggled to figure out why.

In the faces-config.xml one of the required parameters is the scope of the CredStore managed bean.


Turns out it was always the first person who logged in – which makes sense as the bean has application scope. The bean stays in scope and then everyone else starts to use it as well – giving them the wrong files.

The right answer is to use session scope for the CredStore bean (and smartcloud bean) which means that it is only in scope for the requests which are being by the session user – which is for each user exactly what you want.



IBMSBT in XPages: Getting set up with a Social Business Toolkit (Part #2)

In this article I will show how to connect to Connections Cloud and in turn how to use the Java API to display “My Files” on an XPage using a simple XPages repeat control.

In the previous article I showed how to create an internal App within your Connections Cloud account. In this article we will look at how to configure your XPages application to connect to the cloud.

You will see references to “– TS” in this article and that would be where Mr Toby Samples has provided me the correct language as opposed to the dribble I originally wrote – #ENaT

Setting up the face-config.xml

In my case I am connecting to Connections Cloud so I will be using the managed bean for that.

Extract the face-config.xml from the sample XPagesSBT.nsf database and copy the contents into a new database. I cleaned mine up and removed all the beans that I will not be using. I am then left with the following: CredStore and smartcloud.



Within the Smart cloud bean we have to insert the appId, consumerKey and the consumerSecret – which of course do not coincide with the names on the smart cloud screen.


“The CredStore is referenced as a value of where to store Credentials on the EndPoint in the other managed bean. – TS”

Authenticating with Connections Cloud

Create a new Java Class Utils

package com.xomino.sbt;

public class Utils {


Within there we are going to need to do a number of things but at a high level we need to authenticate with smartcloud and then get the list of myFiles

So I am not going to lie to you – I didn’t find this Toby did but here is how I understand it. Looking at the Javadocs (*crying*) – we can find the class which is referenced from the bean. This is where my dislike and distrust Java throws up a flag and tells me that Javadocs was only written for people who know what they are doing. Look at the help docs for a Github JavaScript project – easy to read – JavaDocs like these – absolutely not. But I digress and continue…..



And within there you can find “isAuthenticated()”


from that you can see that it is a

  • public class which return a boolean (true/false).
  • It is copied from the Endpoint interface (don’t understand interfaces yet)
  • returns true or false.

The Endpoint

“The endpoint is more of a Provider of data that you have to authenticate.  similar to a Database or a Rest Service – TS”. In this case, the Endpoint is the information provided in the managed bean. The URLs for authentication via OAuth, the keys and so forth. So first thing we need to do is get the Endpoint from the Bean. Within Utils:


  • public static Endpoint getEndpoint()
    • a public method
    • static means that it cannot be instantiated by another method
    • Endpoint means “In this case Endpoint means that the method must return an object that implements the Endpoint Interface. – TS
    • getEndpoint() the name of our actual method
  • Endpoint endpoint = ExtLibUtil.resolveVariable(FacesContext.getCurrentInstance(), “smartcloud”);
    • Endpoint
    • variable name endpoint
    • ExtLibUtil.resolveVariable(FacesContext.getCurrentInstance(), “smartcloud”); is how we get the value of the smartcloud bean. The faces-config.xml is used to expose that to the application and within the context of this database we can get it in this fashion.
  • return endpoint
    • returns the managed-bean smartcloud

At this point I would like to add that there is no way that you can possibly work this out for yourself without help from someone else. This is part of the scary thing for Java, it is hard to know where the heck and what the heck to do. But unless you do it you won’t know. I don’t think the intricacies of the language are that hard – it is just the volume. Part of doing this and blogging it, is so that I haev a code repository building up. I cannot remember all the code I have written, but if I remember where it was I can go get it again later. Anyway back to the code

Looking at the code it is all underlined and there are a bunch of errors all over the place. This is where Eclipse is actually awesomely helpful and you start to get busy fixing the errors.

Mousing over the errors you can see Quick fixes to the problems


Select “Import ‘ExtLibUtil’ ” and magically appears at the top of the page – and no red underline now – wooo


so go through and complete the others……and then a whole new error comes up


“So “ExtLibUtil.resolveVariable” always returns a java.lang.Object, but the first part of the expression expects an object that implements the Endpoint Interface so you have to force it (Cast) to be an Endpoint, if its not really an Endpoint object it will blow up when you run it. with a Class Cast Exception – TS”

Fixed that and now on the Authentication


We can now start to create a “checkAuthentication()” method within our class. This will be called from the beforePageRender within our XPage – and will check to make sure that we are. If it isn’t then the page will be automatically redirected to smartcloud to log in.

We can use the Eclipse type ahead which is very helpful in getting the code right and not typing the wrong values


uuurgh another error


If you remember from the Javadoc, the isAuthenticated() method throws a clientServicesException, which means when it fails that is the error type which is bubbled up to the top. You know when you see the stack trace and you have screwed something up in XPages you get the java screen of death – that comes from here. Needs to be added otherwise the class will not compile.




and then finally we have finished this authentication piece !! yeah wow !
NOTE: In the Javadocs you can see this “Fields inherited from class”

make sure that when you import the option for Endpoint you pick the right one (there are two). The Javadocs do have their uses, assuming you understand them !!


ok so now to put that on an XPage

the XPage

This is pretty simple. In the XPages beforeRenderResponse event we add the following code to force authentication




After that we are going to add a display field to just show whether or not we are authenticated – the displayName() of my Profile. (Wow this is a LONG blog post).

Getting my profile

I went to the Playground and looked at the Java example for Smartcloud get my Profile. Now this is a JSF example but what I was looking for was the Objects and methods for getting the profile. I am really proud that this worked first time – means something is sinking in…..



I added a new method (which I knew was wrong and basic) in my Utils function and obviously got errors…..

Correct the Profile Objecta1

Correct the ProfileService Object


Correct the exception handling


Correct the return to be a String (not void)


and then we have our new class



In the XPage I created a computed field which was bound to the class Method getProfileDisplayName()

<xp:text escape="true" id="computedField1"


And then I loaded up my XPage…………

First thing that happens – Authentication prompt for Connection Cloud


and then *amazingly*



I don’t know about you – but I am staggered !!!


WOW this is a long post (probably one of the longest I have ever done). Hopefully I have clearly shown how to set up the Connections Cloud development environment and how to show your first example within your XPage.

Let’s be clear – I am in no way shape or form a Java developer now – but, and this in significant to me, I now know a lot about how to make things work for me within the development environment.

I am pretty stoked actually about how the Profile thing worked – then though I have not the slightest idea how 🙂 That’s a weird, cool, scary feeling.

*rubs hands* Now time to start making something really useful 🙂


Toby Comment

In your images you chose to import the “” package instead of “”  which does in fact work, but its not really best practice.  If you choose the other one which is an interface the code will easily work with all of the other types of Endpoints, because you chose Smartcloud, it will only work with Smartcloud.  Not necessarily a bad thing, but usually we try to use the most generic class/interface possible.  TS

IBMSBT in XPages: Getting set up with a Social Business Toolkit (Part #1)

In this article I will begin to introduce IBM Social Business Toolkit (SBT), provide links on how to get it set up, talk briefly about how it works and then provide my first demo on how to get “My Files”.

The whole of this series will be based on “Smart cloud (now Connections Cloud)” as opposed to Connections on premises. This should not however really affect too much other than how you make the initial connection. After that the API is pretty much the same (for my purposes anyway).

Thank you Kathy Brown

Setting up SBT is not the easiest thing to do – nothing IBM ever is. But I owe a huge thank you to Kathy who did the bulk of the hard work on this. Setting this up locally for me was pretty simple once she knew how. Part of the reason for me writing it down as I said before is self documentation ‘cos I know I will forget 🙂


Here are some links on how to set it up and configure it – you will have to install it on your server as well as in your Domino Designer.

Setting up on Domino Designer 

Download the latest code from OpenNTF (I used this one). Unzip the file locally and within there you will find the following folder

  • sbtsdk/redist/domino/

Within there you will find the!. That is the file you need to reference when you install the feature into Domino Designer. (If you want to run the playground locally you will also need to install from the playground updatesite)

Setting up the server

Within the zip file references above you will find the features and plugins folders.


Copy them and paste them onto your server in the following directory. The features and folders for the server are listed there.


I am sure there is a better “updatesite” way of doing it, but this worked for me *shrugs*

The XPagesSBT.nsf

The database within the zip file gives you some examples of how to work with the API and provides links and examples for the JavaScript API, Java API, XPages snippets and other examples. I am not going to use those examples. There is some cool out of the box feature but

  • The JavaScript API is far from complete (which is why I am learning Java)
  • The Java examples are not complete (which is why I am doing this from scratch)
  • The XPages examples and snippets are very “XPagey” and I would rather do it myself

The faces-config.xml

Now this is the one useful thing you should get from the XPagesSBT.nsf because it contains all the managed beans used by the SBT to connect to Connections Cloud (and Facebook and Twitter and others). In there you will find examples for connecting to smartcloud and connections. You will need these in your quest to create an SBT application.

You will find this file through the Package Explorer, in the WEB-INF folder


Setting up Connections OAuth app

Setting up a Smart (Connections) Cloud “App” for OAuth

Within Connections Cloud, not much less ew, but at least all browser based. This is how to register your app and get the OAuth tokens.











In the next article we will actually create our first example to Authorize and pull personal data from Connections Cloud.





XPages and Java, starting over, again…..Hello World

OK to set the stage for what may just be about to happen – blogging is a form of self documentation for me. If I write it – it helps me remember it. I have said this before (multiple times) and failed, but I need to learn Java. It will probably fail again, let’s not kid ourselves, we all know Marky’s preferred language of choice (*coughs politely*). But I want to properly wrap my head around IBM Social Business Toolkit, and not just learn the limitations of the JavaScript API. To do this I need to learn Java and execute on it. So no promises, but we may get some blog posts on IBMSBT and my learning the Java way.

So with the help of Toby, the mockery of Brad and Kathy and the adulation of Eric, we will begin.

All of this code will be done in R9.0.1 (something)

Hello World (part 1)

1) Create a new Java Class in your database

There are apparently multiple ways to do this but I just went to the Java elements and clicked on the New Java Class button

from the resulting popup enter a package name – in this case com.xomino.sbt, and the name for the new class, HelloWorld

The normal format for naming convention is

  • Package names are lower case and look like a website URL except backwards
  • Classes are Propercase



Click OK and a new Class is created in Designer


and the crowd went wild……well ok maybe not but I know Paul and Russ are laughing their butts off right now.

2) Create a new XPage (xHelloWorld.xsp)

In there I am going to create a button which when clicked will display hello world on the screen. To do this I am going to need a button and a computed field.

When the button is clicked I will set a viewScope variable and refresh the field.

The field is bound to the viewScope variable which I hope to set in the Java code…..Clicking the button will call the com.xomino.sbt.HelloWorld.setMessage() method, which will set the viewScope variable value.

<xp:button value="Click me" id="button1">
	<xp:eventHandler event="onclick" submit="true"
		refreshMode="partial" refreshId="aWrapper">

<xp:div id="aWrapper">
	<xp:text escape="true" id="computedField1"

Once the viewScope variable has been set the aWrapper will be refreshed and I will see my value.

The class looks like this

package com.xomino.sbt;


public class HelloWorld {

	public static void setMessage(){

		/*This is how you get XPages scopes in Java */
		ExtLibUtil.getViewScope().put("message", "Hello World");


To enable the use of ExtLib code you must make sure the box is Checked in the database XSP properties
j4The output



In the dumbest way, this has made me very happy 🙂

Speaking at GRANITE User Group in Chicago – 16 March 2015

I was very flattered to be asked by my friend Richard Moy to speak at the next GRANITE meeting in Chicago later this month.

I will be doing a repeat of the Angular.js presentation I did with Mark Leusink at ConnectED a this year. Mark unfortunately was not able to make it so it will be only the Marky Blank show this time.

Here is the information on the presentation and if you want to come the sign up link is at the bottom.

Hope to see you there 🙂



The Future of Web Development – Write Once, Run Everywhere with AngularJS and Domino

AngularJS is currently the most popular JavaScript MVC framework. It’s driving more adoption and interest in the MVC/ REST API application architecture model. The ease of use, portability and re-usability of the code makes it an ideal solution for modern web developer needs. We’ll show you how to use AngularJS to modernize your existing Domino apps, while leveraging Domino’s best features. The speakers will also demonstrate how the power of architecting a solution based on AngularJS allows your Domino application to be made available through other platform interfaces. Taking “Write once, run everywhere” in the literal sense, you will see the same Angular/ Domino based app running natively in XPages, IBM Connections, Bluemix, IBM Worklight and more. Client-side JavaScript frameworks such as AngularJS are the future of web development – come and see it in action.


Also at the meeting

8:30 AM – 09:00 AM
Breakfast provided by GRANITE09:00 AM – 10:00 AM
IBM Verse: Deep Dive and Futures
Luis Guirigay, Global Technical Ambassador, IBM Analytics & Enterprise Social Solutions

10:00 AM – 10:15 AM

10:15 AM – 11:15 AM
The Future of Web Development – Write Once, Run Everywhere with AngularJS and Domino
Mark Roden – PSC Group LLC

11:15 AM – 11:30 AM

11:30 AM – 12:30 PM
IBM Hawthorn
Luis Guirigay, Global Technical Ambassador, IBM Analytics & Enterprise Social Solutions

12:30 PM – 01:30 PM
Lunch provide by GRANITE

01:30 PM – 01:45 PM
MWLUG 2015 Update
Richard Moy, Managing Director, Phora Group

01:45 PM – 02:00 PM
Direction of GRANITE
Richard Moy, Managing Director, Phora Group

Group discussion on future sessions and social communication to members.