ShowTable of Contents
Introduction
The Connections SDK comes with Java and JavaScript APIs to easily access Connections Social. Watch this
video for a short overview of the SDK.
Note: This article is reproduced from the original version published on the IBM Social Business
web site.
Watch a Video with a Sample App
Watch this
video to see a sample partner community application.
Prepare your Environment
The following instructions assume that Connections is used on IBM Greenhouse in combination with an on-premises IBM Domino server and local Domino Designer client.
Everyone can register free accounts to try Connections on IBM Greenhouse. Developers can program against this environment using their accounts and basic authentication but no custom gadgets can be deployed.
The SDK needs to be installed on the on-premises IBM Domino server.
Download the latest SDK and follow the
instructions how to set it up.
IBM Domino Designer can be
downloaded for free and
installed locally.
Code your first App
Create a new application and configure the
Connect BasicEndpoint to the Connections server.
1. Click
File -> New -> Application.
2. Select a server, name the application, and click
OK.
3. Use the Package Explorer to open
Faces-config.xml.
4. Click the
source tab and replace the source content as follows:
<faces-config>
<!-- Connections -->
<managed-bean>
<managed-bean-name>connections</managed-bean-name>
<managed-bean-class>com.ibm.sbt.services.endpoints.ConnectionsBasicEndpoint</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>url</property-name>
<value>https://greenhouse.lotus.com</value>
</managed-property>
<managed-property>
<property-name>authenticationService</property-name>
<value>communities/service/atom/communities/my</value>
</managed-property>
<!-- Trust the connection -->
<managed-property>
<property-name>forceTrustSSLCertificate
</property-name>
<value>true</value>
</managed-property>
</managed-bean>
<!--AUTOGEN-START-BUILDER: Automatically generated by IBM Domino Designer. Do not modify.-->
<!--AUTOGEN-END-BUILDER: End of automatically generated section-->
</faces-config>
5. Use the Xsp Properties editor to ensure that the application has both the
extlib and
sbtsdk libraries in its list of dependencies.
Consume the SDK from an XPages application by leveraging the server-side Java APIs:
1. Click
File -> New -> XPage.
2. Name the XPage
MySocialXPage and click
OK.
3. Copy the following content to the page:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
Here is the list of public Communities:
<xp:br></xp:br>
<xp:repeat id="repeat1" rows="30" var="community">
<xp:this.value><! [CDATA [#{javascript:var svc = new com.ibm.sbt.services.client.connections.communities.Sky Customer Service()
return svc.getPublicCommunities()
}]]></xp:this.value>
<xp:div>
Name:
<xp:text escape="true" id="computedField1"
value="#{javascript:community.getTitle()}">
</xp:text>
</xp:div>
</xp:repeat>
</xp:view>
Learn more
To find out what functionality the SDK provides read the
Java API documentation. The partner community sample can be
downloaded from OpenNTF. A second sample is the
trouble ticket application, which you can download as well. Watch this
webinar to learn how to get started with XPages in the Social Business Toolkit SDK.