How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

22
How to use the IBM Social Business Toolkit in Java Applications Bhavesh Shah, Lead Developer Social Business Toolkit SDK IBM SBT Webinar 06/26/13

description

How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13 Video: http://youtu.be/MsHxrccnO28 IBM Social Business Toolkit: http://developer.ibm.com/social Abstract: In this webinar you will learn about the Java APIs provided in the IBM Social Business Toolkit SDK. We will demonstrate a samples framework which lets developers see these APIs in action. The webinar will also include demonstrations of some mini applications developed using the IBM Social Business Toolkit. To get started we will show you what options exist to quickly get the SDK running in your local Eclipse IDE. Finally the session will cover how to start using the Java API from within a simple dynamic web application. Speaker: Bhavesh Shah, @bhavesh_23 IBM, Social Business Toolkit Lead Developer

Transcript of How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

Page 1: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

How to use the IBM Social Business Toolkitin Java Applications

Bhavesh Shah, Lead Developer Social Business Toolkit SDK

IBM SBT Webinar 06/26/13

Page 2: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation2

Future Webinars

Page 3: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation3

About Me

Based in India Software Lab

Working on Social Business Toolkit SDK with team of developers in India and Ireland Labs

Email: [email protected]: bhavesh_23LinkedIn: http://www.linkedin.com/pub/bhavesh-shah/7/692/637

Previous work:● IBM Connections Integration Plugins for Websphere Portal● IBM Connections Integration Plugins for IBM Lotus Notes

Bhavesh Shah@ bhavesh_23IBM, Social Business Toolkit, Lead Developer

Page 4: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation4

Agenda

● IBM Social Business Toolkit Java API● What is it?● Why would I want to use it?

● Java API - Key Concepts

● Getting started with Java API● Demo steps for setup IDE workspace and write a simple JSP

● Demo mini apps based on Java APIs which connect to● IBM Connections ● IBM SmartCloud● Other social platforms like Twitter, DropBox.

Page 5: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation5

Disclaimers

IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion.

Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision.

The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract. The development, release, and timing of any future features or functionality described for our products remains at our sole discretion.

Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user’s job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.

Page 6: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation6

IBM Social Business Toolkit SDK – Java API

Java API – What is it?

Page 7: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation7

Java API - What is it?

● Set of Java wrappers on top of ● IBM Connections REST API● IBM SmartCloud REST API

Java API

REST Services exposed by Social Platform

Platform Support

● Standalone Java Applications

● J2EE Applications

● IBM Domino

Page 8: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation8

Java API - Key Concepts

● Endpoints● Provide an abstraction around the connection to a service● Isolates application code from details of the deployment

● Services + Entities● Isolates application code from details of the Social Platform REST API● Common pattern across the SDK JavaScript and Java API

Endpoint : connect to a different server using different authentication mechanism

Uses default endpoint

Service

Entity

Page 9: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation9

Java API – Developers Playground

2. Samples Viewer

3. Samples Preview

1. Samples Navigator

Page 10: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation10

Java API – Social Playground

1. Samples Navigator

2. Samples Viewer

3. Samples Preview

Page 11: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation11

IBM Social Business Toolkit SDK – Java API

Java API – Why would I want to use it ?

Page 12: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation12

Java API – Why would I want to use it ?

● Makes development of Social Applications easy and rapid

● Abstracts common development chores like● Authentication● Parsing response feeds● Low level networking

● Goal is to make SBT one stop shop for all Social Application Development needs

● Consolidate Social application development efforts within and across enterprises

Page 13: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation13

IBM Social Business Toolkit SDK – Java API

Java API – How do I get started ?

Page 14: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation14

Java – Getting started

● IBM Collaboration Quick Start for Social Business

● Installing the SDK● On your development machine or an internal server● On IBM Collaboration Quick Start for Social Business

● Setting up a development environment● Using stable build downloaded from OpenNTF● Using latest code from GitHub

● Creating your first SDK application● Browse existing samples and reuse in your application

● Documentation● Samples● API Documentation

Page 15: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation15

IBM Collaboration Quick Start for Social Business

● IBM Collaboration Quickstart for Social Business is an IBM SmartCloud™ Enterprise image

● Quickly get an instance without any installation, hardware, or maintenance● All you need is Internet Access (SSH, SCP, VNC)

For more information go here: http://heidloff.net/home.nsf/dx/29.04.2013080743NHE97V.htm

For more information go here: http://heidloff.net/home.nsf/dx/29.04.2013080743NHE97V.htm

Page 16: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation16

Installing the SDK

● Stable builds are available on OpenNTFhttp://ibmsbt.openntf.org/

● Includes Tomcat server● Requires Java JRE v6● Sample applications pre-deployed● Configuration for Quick Start● Configuration for Smart Cloud

● Setting up a development environment1. Download build and unzip to your sdk folder2. Unzip Tomcat (located in <your sdk folder>\sbtsdk\tomcat) to your tomcat folder3. Set JRE_HOME=<location of your JRE>4. Edit <your tomcat folder>\conf\sbt.properties

Change 'qs.renovations.com' to your quick start host e.g. 'vhostNNNN.dc1.on.ca.compute.ihost.com'Set OAuth 2.0 for your Quick Start

5. Start Tomcat using <your tomcat folder>\bin\startup.bat

Page 17: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation17

Installing the SDK - sbt.properties

● Property file containing configuration settings for Sample Framework● # Connections Basic Endpoint Parameters● connections.url=https://qs.renovations.com:444● connections.authenticationPage=/sbt/loginForm.html?endpoint=connections● connections.authenticationService=communities/service/atom/communities/my● connections.apiVersion=4.0● # Connections OAuth 2.0 Endpoint Parameters● connectionsOA2.url=https://qs.renovations.com:444● connectionsOA2.serviceName=SBTK● connectionsOA2.appId=SBTK● connectionsOA2.consumerKey=SBTK● connectionsOA2.consumerSecret=NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN● connectionsOA2.authorizationURL=https://qs.renovations.com:444/oauth2/endpoint/connectionsProvider/authorize● connectionsOA2.accessTokenURL=https://qs.renovations.com:444/oauth2/endpoint/connectionsProvider/token● connectionsOA2.apiVersion=40● # SmartCloud OAuth 1.0 Endpoint Parameters● smartcloud.url=https://apps.na.collabservtest.lotus.com● smartcloud.consumerKey=NNNNNNNNNNNNNNNNNNNNNNNNNNNNN● smartcloud.consumerSecret=NNNNNNNNNNNNNNNNNNNNNNNNNNNNN● smartcloud.requestTokenURL=https://apps.na.collabservtest.lotus.com/manage/oauth/getRequestToken● smartcloud.authorizationURL=https://apps.na.collabservtest.lotus.com/manage/oauth/authorizeToken● smartcloud.accessTokenURL=https://apps.na.collabservtest.lotus.com/manage/oauth/getAccessToken● smartcloud.appId=Social Business Toolkit● smartcloud.apiVersion=4.0

Page 18: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation18

Demo: Setting up a Development Environment and develop a simple JSP● Using a stable build downloaded from OpenNTF

● Download and install the SDK● You need to install Eclipse IDE for Java EE Developers● Execute the script to initialize the Eclipse workspace provided in the SDK

initWin.cmd or initLinux.sh or initMacOS.sh● Launch Eclipse and point to the workspace

C:\sbtk\workspaceWin or \sbtk\workspaceNix● Clean and build all projects● Launch Tomcat and you can now run the sample framework

https://localhost:8443/sbt.sample.web/javascript.jsp

Page 19: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation19

Setting up a Development Environment

● Using latest code from GitHub● Install required software (JRE, Eclipse, SDK)● Import required projects

● Use File -> Import -> Team -> Team Project Set to import this project set j2ee-projectset.psf● Configure Tomcat server

● Configure your own version of Tomcat or the one from the SDK● Add All projects to Tomcat● In Project Explorer open Servers -> Tomcat v7.0 Server at localhost-config

● Add sbt.properties and keystore from SDK Tomcat to that directory● Edit context.xml and add this line: <Resource name="url/ibmsbt-sbtproperties" auth="Container" type="java.net.URL" factory="com.ibm.commons.runtime.naming.UrlFactory" url="sbt.properties" />

● Edit server.xml and modify the SSL Connection to be this: <Connector SSLEnabled="true" clientAuth="false" keystoreFile="conf/keystore" keystorePass="passw0rd" maxThreads="150" port="8443" protocol="HTTP/1.1" scheme="https" secure="true" sslProtocol="TLS"/>

● Start Tomcat and go Toolkit Sampleshttps://localhost:8443/sbt.sample.web/

Page 20: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation20

Java API - Demonstrations

● Demonstrate mini applications using Java APIs1) 'Enterprise updates' sample app demonstrates how Java APIs can be used to aggregate

updates from diverse platforms like Connections ActivityStreams & Twitter

2) 'DropBox' App : Showcases how to achieve DropBox integration using the SBT Java APIs

Page 21: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation21

Resources and Questions

● Home page: http://ibmdw.net/social● SDK: http://ibmsbt.openntf.org● GitHub: https://github.com/OpenNTF/SocialSDK● StackOverflow: #ibmsbt● Twitter: @ibmsbt● YouTube: http://youtube.com/ibmsbt● Playground: http://bit.ly/sbtplayground● API Doc: SBT Java API Documentation

Page 22: How to use the IBM Social Business Toolkit in Java Applications - SBT Webinar 06/26/13

© 2013 IBM Corporation22

Acknowledgements and Disclaimers

© Copyright IBM Corporation 2013. All rights reserved.– U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with

IBM Corp.

IBM, the IBM logo, ibm.com, Rational, the Rational logo, Telelogic, the Telelogic logo, Green Hat, the Green Hat logo, and other IBM products and services are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol (® or ™), these symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at www.ibm.com/legal/copytrade.shtmlOther company, product, or service names may be trademarks or service marks of others.

Availability: References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates.

The workshops, sessions and materials have been prepared by IBM or the session speakers and reflect their own views. They are provided for informational purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to any participant. While efforts were made to verify the completeness and accuracy of the information contained in this presentation, it is provided AS-IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this presentation or any other materials. Nothing contained in this presentation is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software.

All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics may vary by customer. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results.