Getting Started as Java Developer


The SDK comes with Java and JavaScript APIs to easily access IBM Connections and IBM SmartCloud for Social Business. Watch this video for a short overview of the SDK or watch this longer video to learn about the IBM Collaboration Solutions app dev strategy.

Watch a Video with Sample Snippets

Watch the video (at 2m30s) to see some simple JSP samples.

Prepare your Environment

In order to use the SDK within your applications, you need to download and install the SDK.

Download the latest SDK

There are simple Java snippets that can be run from an Eclipse IDE. The complete Eclipse workspace with the samples and a local Tomcat server comes with the SDK which can easily be used in Eclipse IDEs. Read the documentation (tbd: add link) how to set up the samples and how to run (tbd: add link) them.

Code your first app

Build a Hello World web application using Eclipse and Tomcat 7.0

  1. Click File -> New -> Dynamic Web Project.

    Specify the project name as social.helloworld-web.

    Click Finish.

    New Dynamic Web Project dialog 1

    New Dynamic Web Project dialog 2
  2. Right-click social.helloworld-web and create a new folder named lib.
    Add the following SDK dependency jar files to the lib folder (available from one of the existing sample WAR files).


    They appear as follows in the file system.


  3. Update the build path and deployment assembly properties of social.helloworld-web as follows.
    Right-click social.helloworld-web and select properties.

    Select Java Build Path -> Add Jars and add all SDK jar files from the lib folder.

    Select Deployment Assembly -> Add -> Java Build Path Enteries and select all SDK jar files.

    Click Apply and OK.

    Java Build Path dialog

    Web Deployment Assembly dialog
  4. Click File -> New -> Servlet to create a new servlet for toolkit services. Provide the following information:
    • Use the existing servlet class:
    • Name: ServiceServlet
    • Description: The service servlet handles requests from the toolkit to access external resources.
    • URL mappings: /service/*
    Create Servlet dialog
  5. Click File -> New -> Servlet to create a new servlet for initializing the toolkit JavaScript library.
    • Use the existing servlet class:
    • Name: LibraryServlet
    • Description: This servlet initializes the specified JavaScript library for use by the Social Business Toolkit.
    • URL Patterns: /library/*
  6. Click File -> New -> Filter to create a new filter for creating the toolkit application and context objects. . Provide the following information:
    • Use the existing filter class:
    • Description: This filter is responsible for creating the toolkit application and context objects for every servlet within this web application.
    • URL Patterns: /*

  7. Add the following lines to web.xml.
    <description>Reference to a URL resource which points to the configuration properties for the Social Business Toolkit.</description>
  8. Create the file managed-beans.xml in the WebContent\WEB-INF folder.
  9. Copy from sbtsdk\config and place it in tomcat-config. This file needs to be customized, e.g. the URL to IBM Connections.

  10. Create a new jsp file named ViewMyConnectionsFiles.jsp.
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
    <%@page import=""%>
    <%@page import="java.util.HashMap"%>
    <%@page import=""%>
    <%@page import=""%>
    <%@page import="java.util.List"%>
    <%@page import="java.util.Map"%>
    <%@page import=""%>
    <%@page import=""%>  
      <head><title>My Files</title></head>
        <div id="content">
          try {
            FileService fileService = new FileService();
            List<FileEntry> files = fileService.getPublicFiles(null);
            if(files != null && ! files.isEmpty()) {
              for (Iterator iterator = files.iterator(); iterator.hasNext();) {
                FileEntry file = (FileEntry);
                out.println("<a href=\"" + file.getDownloadLink() + "\"> " + file.getLabel() + "</a><br/>" );
            } else {
              out.println("No Results");
          } catch (Throwable e) {} 
  11. Right-click the jsp file and select Run as -> Run on Server for the configured server.
  12. Click Finish.
    Run on Server menu

Learn More

To find out what functionality the SDK provides read the Java API documentation. There are articles how to install and configure the SDK. Additionally there is a tutorial and the following webinar to learn how to create a J2EE application from scratch.