Content 1. Introduction 2. IBM Social Business Toolkit - Social SDK 3. Social Builder 4. Sample WEF Portlet application 5. Future 6. Important Resources 7. Authors
Introduction Developing social applications on Portal specially using IBM WEF ( or other platforms like PTK ) requires developers to have two primary skills, those being, web development ( Portal ) and social platform knowledge (Application Programming Interface, REST, XML, JSON, Networking, parsing of responses etc. ). A pre-requisite of developing such a software would be to educate the developer in both these domains extensively. In addition to this, developer would also need to invest time in familiarizing and learning API's of the specific target social software like IBM Connections, Domino, Sametime, Smartcloud etc. Clearly developing skills in all the disparate technologies and developing a glitch free code is a challenge for a new developer. Even for experienced developers it means they end up investing more time on code related to broader infrastructure of software ( like service layer, network layer, parsers etc. ) than on the core business application. Most of the social platforms like IBM Connections are built on top of open standards. Given this do we have established standards, development patterns, tooling support for leveraging and consuming these social platforms in business applications? This white paper will take a look at how Social SDK not only expedites the development of such social software based applications but also minimizes the skills, a developer must acquire to start developing this kind of application. It also demonstrates how a redistributable WEF builder could be developed which uses Social SDK and connects to Connections File service. Further it also demonstrates how this WEF Builder could be used in WEF based applications for interacting with Files service of IBM Connections. Although the white paper has details of developing a WEF builder for Files service similar builders could be - developed for all the services from Connections or other social platforms SDK currently supports. IBM Social Business Toolkit IBM Social SDK (Social Business Toolkit) tries to resolve exactly the above problem we discussed. It tries to hide almost entire boiler-plate code related to developing software for social applications like Connections from end developers and allow them to invest more time on the core business application. Take for example integration with Connections. It would easily take a developer weeks if not months to familiarize himself all the API's of different services it exposes. For instance, if a user wants to develop a portlet application using Files service from the connections, he would need to understand all the apis, analyze all the requests and response requirement, develop the network layer ( handle all the complications like different types of authentication, session time outs etc. ) and finally develop the robust parsers, which can convert the xml ( or json ) back into business objects. When using SDK all this can be achieved in matter of minutes. A example is provided below FIlesService fileservice = new FilesService(); fileservice.getmyfiles();
As you can see from the above two lines of code, which returns the list of user files - the job of the end developers becomes very easy w.r.t. integration with the social platforms, when using SDK. Specially developers working on portal applications no longer have to invest in either developing skills which are required to fetch and post data to connections nor develop and maintain code which does so. Compare this to more traditional approach of developing such application Traditional mechanism 1. Figure out the correct REST url from published documentation. Developer has to invest time in identifying out correct atom url required to perform a specific operation. 2. Construct right url depending on request, by appending the server url to rest url. 3. Construct correct atom/json payload and headers. Skill : Extensive skills in generating well formed payloads in required format like ATOM/XML, JSON etc. SDK approach 1. Instantiate the class which belongs to service you intend to use, eg : FilesService for interacting with Files. FilesService fileservice = new FilesService(); 2. Make the appropriate api call from service object. fileservice.getmyfiles(); Skill : Java or JS depending on api you use. 4. Develop authentication code ( this changes if you need to use any other supported authentication standard like Basic, Oauth1.0a, Oauth2.0 etc. Skill : This requires developer to pick extensive skills in implementations of various standards mentioned above. 5. Network : Code which makes the actual network call once user has been authenticated. Several complications need to be take care of in this layer like slow network, unresponsive server, session timeout etc. Skill : Developer needs to understand libraries like HttpClient or HttpUrlConnection in detail. 6. Parser : Code to parse the response back, since response could be in various formats and standards like XML, JSON developer would need to be aware of all these standards. Skill : XML/JSON parsing in language of implementation.
To look into usage of SDK in detail and get a first hand experience, you can visit the playground on the GreenHouse. Playground serves as an excellent starting point, to the Social SDK usage, understand both JS and JAVA apis, scenarios, authentication protocols supported by the Social SDK and see the working snippets etc. Some concepts of the SDK are explained below : Application : 'Application' abstracts the SDK runtime, i.e it manages the application level objects like managed beans factories and properties factories whether the SDK is being consumed by a J2EE application of by a standalone Java Application In a web application SBTFilter (HTTP servlet filter) is responsible for initializing the application using servlet context. In case of a standalone application, the consuming application needs to initialize it. Application can optionally have Listeners associated with it to capture the application related events. Context : Represents the context of the Social SDK. It can be reused by all helpers/modules in the SDK application. In the Social SDK, application Context is stored on per thread level in a ThreadLocal variable. In a web application SBTFilter (HTTP servlet filter) is responsible for initializing the context by passing the application, Servlet Request and Servlet Response Objects. In a standalone Java application, consuming application initializes the context by passing the application object. Once initialized, context is used to retrieve various system objects at different scopes like session, application, request scopes. Managed Beans : In the context of SDK, Managed Beans are simply Java Beans representing system objects and resources. Managed beans are dynamically loaded and instantiated. For example endpoint, credential store etc. are represented as Managed Beans in the Social SDK framework. Endpoint : An endpoint encapsulates connectivity specific characteristics to let an application connect with a social platform. Characteristics like server Url, implementation class, credential store, authentication url etc are a part of endpoint definition. An endpoint is represented as a managed bean. Java Wrappers : Social SDK provides different service classes which developers can use to interact in a more convenient way with social software ( both Connections and SmartCloud ). Currently SDK supports ActivityStreams, Profiles, Communities, Forums, Search and Files service from Connections (on-premise) and SmartCloud. Not a new set of APIs, but helpers on top of the existing APIs of IBM social platform
Social Builder The white paper demonstrates how a distributable WEF based Social builder can be developed using the Social SDK Files service apis (or other supported services). Paper further demonstrates how this builder can be consumed by a Portal application. Below are the detailed instructions on how you can consume this social builder ( currently supporting Files Service ) in your own application. Before we deep dive into architecture of social builder, below are some useful and frequently used concepts in developing Portal applications using WEF. WEF/Builder Concepts : The Builder, Model and profiles are the basic nuts and bolts of any WEF based application. A builder is the core building block that automates design and development tasks performed by developers. Builders free the developer from having to deal with the low-level complexities of feature implementation. The developer simply specifies inputs for the builders and clicks OK. IBM WEF software constructs the code required to achieve that functionality. Typical Layers of Portlet Application : A typical SOA based implementation works on provider and consumer layer. Provider layer is used to connect with any backend repository and the consumer layer is meant to consume data provided by the provider layer. So provider layer has the responsibility of performing data operations while consumer is responsible to create required presentation on that and enable user to interact with it, through the required UI. The Service operation and service consumer are to provide a bridge between consumer and provider. Service operations are to wrap all the input parameters in it and construct the result in desired format while service consumer to wrap all the operation in it and expose these operations to consumer. Now let s look at the prerequisites and instructions of consuming the Social builder. Prerequisites 1. WEF Installation ( WEF 8.0.0.2, although builder would work on older WEF installations, sample portlet is build upon multi channel framework which needs WEF 8.0.0.2 + Multi channel feature pack ) 2. WAS CE if you wish to run test application or compatible IBM WebSphere Portal server incase you decide to create a portlet using this. 3. IBM Connections 4.x
Setting up Environment 1. Including Feature Sets Two distinct feature sets are provided for bringing SBT capabilities into WEF environment. a. SocialBusinessToolkit : Contains all SBT dependencies and core modules. b. IBMConnectionsBuilder : Contains Files builder classes. To include these in WEF Environment with these we just need to place two packages under packages directory (<WEF_Root>/ Designer\FeatureSets\Web-App_8.0.0\Packages). You would need to restart WEF after placing these packages.
2. Importing feature sets in your project To import these feature sets in your project follow the below steps a. Right click on the project, then select properties
b. Expand Web Experience Factory Project Properties then select feature Info. c. Click on Apply and Okay.
Sample WEF Portlet Application IBM Connections Builder feature set enables ICFiles builder in your project. ICFiles Builder exposes a set of predefined service operations into your model, which allows you to interact with IBM Connections files without knowing underlying details of REST implementation and entry structure. To use ICFiles Builder we need to follow steps below a. Click on builder picker, then search and choose ICFiles Builder b. Click on ok, it will add ICFIles Builder into your model. c. Provide required inputs into ICFiles Builder as below Provide builder name, username and password, rather than hard coding the username and password you may choose to map reference variables which holds corresponding values. Currently ICFiles builder support a single service which File, so choose that from drop down. Builder inputs must look like similar to screen below.
d. Now Click on apply/ok, it will expose all the wrapped service operations into your model along with required result and input schema. Service operations exposed are as below : e. These service operations allow you to fetch files data and work with connections files. f. To implement web UI, you are free to choose any standard WEF approach like using view and form. For example to list all files of logged in user from connections you may add a view and form
builder, which can be mapped to getmyfiles service operation exposed by this builder. g. Providing Connections server details. The easiest way to do so is to place properties file (named sbt.properties) in user's home directory (C:\Users\Admin\). Following commands could be used in identifying the home directory on different operating system : Windows: Unix: echo %HOMEPATH% $ echo $HOME Sbt.properties is a convenient property file which SDK refers to load dynamic properties for various endpoints, like Connections server url and other authentication details. For this sample purpose we just specify the url for connections server. This property file should have below entry connections.url=https://yourconnectionsurl:port h. After performing above required steps, your model (along with View and form) is ready to list all my files from connections file service. By default it will list down all the data column available for files. Which you may adjust these column by using Data column modifier. By default it will look like below.
i. ICFiles Builder has a complete set of operation to provide all CRUD operation to build fully functional Files portlet. It s flexible to work with as it just provides the backend capability of communicating with Connections server using underlying SDK, So you are free to choose UI implementation as per requirements. j. A complete CRUD enabled fully function ICFiles based Files portlet may look like below.
k. Snapshot below depicting various operations the page supports. Some of the major operations this application supports are Operations like My Files, Public Files from the view dropdown. User can drill to detailed view for a file by clicking on its name. User can also Lock/Unlock or delete a file by clicking suitable options. Lastly it provides link for user to download the file. Select view type Select a file and upload Page Navigation Links to file details Select page Size Delete File Download File This sample application can be downloaded from OpenNTF project page. To use this application you need to import "SampleConsumerApp.zip" as Web Experience Factory Archive. Another sample which can be downloaded from OpenNTF project page is SampleMultichannelFilesPortlet.zip", leverages Multichannel and responsive UI features of WEF. To try this application you would need to import Multichannel feature pack along with zip file provided. We would like to thank Jonathan Booth (jbooth1@us.ibm.com) for guiding us on Multichannel and responsive UI standards and developing this sample application. **Note:- In Normal WEF Programming developers may choose to use standard SOA approach (provider consumer architecture). Although ICFiles builder itself exposes predefined service operation, you may create a provider model and then add a service definition and wrapped service operations over service operations exposed by ICFiles Builder..
Future Aim of this white paper was to expose the powerful capabilities and ease of development SDK provides. It discusses the shift of development paradigm in development practices and various benefits of it. It demonstrated how the process of developing social portlets could be expedited and simplified by delegating all the communication with social server to SDK. Developer's then can just focus increasing their skills and expertise in platforms like WEF. Additionally we also explored possibility of injecting social capabilities in WEF platform through commonly accepted patterns like Feature packages and builders. This could be the first step is infusing advanced social capabilities in form of inbuilt tooling in web development platforms like WEF. Currently we have limited the scope of this article to show integration of Files service, but this could be extended to support all service supported by SDK ( Profiles, Communities, ActivityStreams etc. ) in future. Based on wider adoption from the community apart from covering other service in Connections, this could be extended to even cover other social software's like Domino and Sametime.
Important Resources 1. Creating a custom builder 2. Multichannel and Responsive User Interface (UI) Support 3. WEF Concepts for new users 4. Developing Portlets using WEF 5. Best Practices WEF Development 6. SBT Playground on Greenhouse 7. Open NTF SBT homepage 8. OpenNTF SBT download page 9. OpenNTF project page ( All the sources in this white paper can be downloaded from here ).
Authors Manish Kataria has been working with IBM for over 6 years in Social Collaboration domain. He has worked on integrating IBM Connections with IBM Notes, WebSphere Portal, Sametime, and Symphony TM, as well as Microsoft Office, Outlook and Windows. Currently he is working with IBM Social SDK team in IBM India Software Labs. Manish has multiple patents in social software development and has contributed various white papers for Connections. He holds an engineering degree in Computer Science from University of Delhi. You can reach him at mkataria@in.ibm.com or in.linkedin.com/in/mkataria. Nagendra Shukla has been working IBM for over 6 years in Social Portal domain. He has worked on integrating IBM Connections with IBM WebSphere Portal. Nagendra has contributed on RED books for Connections Portal Integration approaches. He holds Masters degree in Computer Applications from Jiwaji University Gwalior. You can reach him at nagshukl@in.ibm.com