How В to В Develop В a В Simple В Java В Integration В with В the В IBM В Social В Business В Toolkit В SDK В Paul В Bastide В В The В IBM В Social В Business В Toolkit В SDK В is В a В set В of В libraries В and В code В samples В that В you В use В for В connecting В to В the В IBM В Social В Platform. В It В covers В many В products В like В IBM В Connections, В IBM В Notes/Domino, В and В IBM В Sametime. В The В libraries В include В support В for В many В authentication В mechanisms, В as В well В as В comprehensive В wrappers В for В the В REST В APIs, В and В reusable В boilerplate В code. В В В The В SDK В has В Java, В JavaScript, В PHP В and В Apple В iOSВ® В ready В helper В libraries В and В code В samples. В В The В Java В code В includes В support В for В Java В 2 В Enterprise В Edition В (J2EE) В Java В Server В page В (JSP) В and В Java В Servlets, В and В Java В Standalone В code. В В В The В Java В standalone В code В is В great В for В those В who В are В programming В an В Eclipse В plugin, В an В AWT В widget, В a В Java В Applet, В IBM В DominoВ® В Agent, В and В cannot В depend В on В a В J2EE В Web В Container В to В provide В the В Servlet В Filters В and В reusable В login. В В В In В this В blog, В I В show В you В how В to В develop В a В very В simple В Java В standalone В application, В which В can В be В developed В in В any В Java В supporting В environment. В В I В prefer В to В use В Eclipse. В В Steps В Open В a В Browser В В В Navigate В to В http://ibmsbt.openntf.org В В В Click В on В Downloads/Releases В В Click В Link В under В Downloads В В 2 В How В to В Develop В a В Simple В Java В Integration В with В the В IBM В Social В Business В H Toolkit В SDK В В В В Extract В / В Expand В sbtsdk-В‐1.0.0.20140125-В‐1133.zip В to В your В preferred В Folder. В 7-В‐Zip В is В a В great В tool В to В use. В В В Open В Eclipse В В Enter В a В Workspace В Location В (e.g. В /Users/paulbastide/Desktop/Dev/workspace01) В Click В OK В В Click В Workbench В (or В Click В the В ESC В Key) В В В How В to В Develop В a В Simple В Java В Integration В with В the В IBM В Social В Business В Toolkit В SDK В Paul В Bastide В В В Click В File В > В New В > В Other В Select В Java В Project В Click В Next В В В Enter В Project В Name В (e.g. В sbt.sample.standalone.java) В Click В Next В В В 4 В How В to В Develop В a В Simple В Java В Integration В with В the В IBM В Social В Business В H Toolkit В SDK В В В В Click В Libraries В Click В External В Jars В Navigate В to В sbtsdk/source/com.ibm.sbt.libs.java/lib В Add В these В Jars В apache-В‐mime4j-В‐0.6.jar В commons-В‐codec-В‐1.6.jar В commons-В‐fileupload-В‐1.2.2.jar В В How В to В Develop В a В Simple В Java В Integration В with В the В IBM В Social В Business В Toolkit В SDK В Paul В Bastide В В commons-В‐io-В‐2.4.jar В httpclient-В‐4.3.1.jar В httpcore-В‐4.3.jar В httpmime-В‐4.3.1.jar В Click В Open В В В Click В Add В External В JARs В again В Open В sbtsdk/redist/jar В Select В the В JAR В files В com.ibm.commons-В‐1.0.0.20131218-В‐0549.jar В com.ibm.commons-В‐9.0.0.jar В com.ibm.commons.runtime-В‐1.0.0.20131218-В‐0549.jar В com.ibm.commons.xml-В‐1.0.0.20131218-В‐0549.jar В В 6 В How В to В Develop В a В Simple В Java В Integration В with В the В IBM В Social В Business В H Toolkit В SDK В В В com.ibm.commons.xml-В‐9.0.0.jar В com.ibm.sbt.core-В‐1.0.0.20131218-В‐0549.jar В Click В Open В В Click В Finish В В В If В prompted В to В Switch В Perspectives, В Click В Yes В В How В to В Develop В a В Simple В Java В Integration В with В the В IBM В Social В Business В Toolkit В SDK В Paul В Bastide В В В Expand В the В Project В -В‐ В sbt.sample.standalone.java/src В Right В Click В src В Expand В New В > В Class В В Enter В a В Name В (e.g. В StandaloneDemo) В В Select В method В stub В public В void В static В В Click В Finish В В В 8 В How В to В Develop В a В Simple В Java В Integration В with В the В IBM В Social В Business В H Toolkit В SDK В В В В Now, В I В am В going В to В show В you В how В to В code В the В boilerplate. В В В Let’s В add В a В simple В function В to В this В App. В В Navigate В to В the В end В of В the В Class В } В and В paste В at В the В end В This В code В is В accessing В the В boilerplate В code, В which В the В code В is В using В to В access В the В backend В service В using В the В Authorization В Header В in В the В HTTP В request. В В How В to В Develop В a В Simple В Java В Integration В with В the В IBM В Social В Business В Toolkit В SDK В Paul В Bastide В В /**
* creates a new Basic Endpoint to connect to Connections
* @param url
* @param user
* @param password
* @return
*/
private BasicEndpoint createEndpoint(String url, String
user, String password) {
BasicEndpoint endpoint = new ConnectionsBasicEndpoint();
endpoint.setUrl(url);
endpoint.setUser(user);
endpoint.setPassword(password);
endpoint.setForceTrustSSLCertificate(true);
return endpoint;
}
Next, В you В want В to В use В the В endpoint В as В part В of В the В Class. В В Enter В В BasicEndpoint endpoint;
/**
* creates the basicendpoint wrapped in the demo class
* @param url
* @param user
* @param password
*/
StandaloneDemo(String url, String user,
String password){
endpoint = createEndpoint(url,user,password);
}
В I В added В a В getter В for В the В endpoint, В so В it В can В be В reused В in В other В classes. В В /**
* returns the endpoint
* @return
*/
public BasicEndpoint getEndpoint(){
return endpoint;
} В В You В can В now В add В the В code В to В access В the В Forums В you В have В access В to. В В String url = args[0];
String user = args[1];
1 How В to В Develop В a В Simple В Java В Integration В with В the В IBM В Social В Business В 0 В Toolkit В SDK В В В String password = args[2];
StandaloneDemo demo = new StandaloneDemo(url, user,
password);
ForumService svc = new ForumService(demo.endpoint);
try {
ForumList forumList = svc.getAllForums();
for(BaseForumEntity forumEntity : forumList){
Forum forum = (Forum) forumEntity;
System.out.println("+F: " +
forum.getTitle());
TopicList topics = forum.getTopics();
for(BaseForumEntity topicEntity : topics){
ForumTopic topic = (ForumTopic)
topicEntity;
System.out.println("-- " +
topic.getTitle());
}
}
} catch (ForumServiceException e) {
e.printStackTrace();
}   Click  File  >  Save   Click  Run   Click  Run  Configuration   Click  on  Arguments   Enter  the  URL  for  your  connections  server  as  the  first  argument   e.g.  https://greenhouse.lotus.com:443   Enter  your  login  id  and  login  password  Click  Run  How  to  Develop  a  Simple  Java  Integration  with  the  IBM  Social  Business  Toolkit  SDK  Paul  Bastide    If  you  look  in  the  Console,  you’ll  see  the  Results.      The  Java  File  is  attached.    You  can  use  this  approach  with  your  development  and  application  to  access  the  Social  Business  platform,  and  you  can  use  this  to  access  any  web  resource  from  your  application.    Some  other  samples  are  https://github.com/OpenNTF/SocialSDK/blob/master/samples/java/sbt.sample.ap
p/src/com/ibm/sbt/sample/app/BlogServiceApp.java В В 1 How В to В Develop В a В Simple В Java В Integration В with В the В IBM В Social В Business В 2 В Toolkit В SDK В В В Summary В В For В those В who В wish В to В get В help В with В their В Java В integration В with В the В SDK, В you В may В feel В free В to В leave В a В comment В on В the В blog, В or В use В the В StackOverflow В Tag В #ibmsbt В . В В В Referenced В links В are: В В StackOverflow В Channel В http://stackoverflow.com/questions/tagged/ibmsbt В #ibmsbt В IBM В Social В Business В http://ibmsbt.openntf.org В Toolkit В Homepage В IBM В developerWorks В http://www.ibmdw.net/social В Social В IBM В Social В Business В https://github.com/OpenNTF/SocialSDK В Toolkit В on В GitHub В В
© Copyright 2025 Paperzz