Integrating IBM Lotus Quickr with IBM WebSphere Portal using IBM WebSphere Portlet Factory

Learn how to integrate IBM® Lotus® Quickr™ Web 2.0 services with IBM WebSphere® Portal applications, creating list and detail portlets that allow you not only to browse all the contents of a Lotus Quickr Library but also to allow access to the contents of a document.

Robert E. Loredo, Software Engineer, IBM Software Group, IBM

Robert Loredo is a Software Engineer with the WPLC Technical Enablement division of IBM Software Group. He creates proof-of-concepts and enables IBM Business Partners and Independent Service Vendors who use Lotus and WebSphere Portal family products. You can reach him at loredo@us.ibm.com.



Shiva Nistala, Advisory Software Engineer, IBM

Shiva Nistala is an Advisory Software Engineer with IBM Developer Relations. Shiva is actively involved with technical enablement of IBM Business Partners who use IBM WebSphere Portal, IBM Lotus Connections, and related technologies and tools. Shiva has written and spoken on several topics related to WebSphere Portal and Lotus Collaborative technologies. You can reach him at shivan@us.ibm.com.



29 June 2009 (First published 07 April 2009)

Editor's note: Know a lot about this topic? Want to share your expertise? Participate in the IBM Lotus software wiki program today.

Introduction

With the recent developments in Web 2.0, businesses are quickly realizing the potential benefits of using collaboration software such as wikis, team collaboration programs, and forums. It has become imperative to provide a mechanism for users to collaborate at different levels.

Existing WebSphere Portal users can quickly take advantage of these new modes of collaboration by using custom integration portlets. This article explains a method for integrating WebSphere Portal applications by using Lotus Quickr Web 2.0 services. We include a working example that can give immediate benefits to your customers.


Product overviews

First, let’s go over some key features of the products we’re discussing.

Lotus Quickr

Lotus Quickr is team collaboration software that contains features such as content libraries, team places, connectors, templates, and personal file sharing, all of which facilitate faster and more effective collaboration, among small and large teams alike.

Lotus Quickr adopts Web 2.0 infrastructure and is well suited to deal with flexible, virtual teams. Among the services that Lotus Quickr offers are these:

  • Collaborative authoring using a wiki
  • Information sharing using blogs
  • Content sharing using content libraries
  • Instant communications using instant messaging

These services make Lotus Quickr useful in a global economy in which teams are geographically separated but frequently work together.

As of this article’s writing, the latest release of Java™ 2 Platform, Enterprise Edition for Lotus Quickr is version 8.1, and it’s actually built on top of WebSphere Portal V6.0. Although there is an IBM Lotus Domino® version of Lotus Quickr that is available, we refer to the Java 2 Platform, Enterprise Edition version here.

WebSphere Portal

WebSphere Portal is an integration platform capable of bringing several services together as a single, unified, consistent user interface (UI) that delivers role-based, process-driven, in-context, and personalized information to users, contributing to their overall productivity.

WebSphere Portal offers several services and capabilities such as Web content management, in-context situational applications, consumer gadget applications, team collaboration software, and single sign-on (SSO) capabilities.

As of this article’s writing, the latest release of WebSphere Portal is version 6.1, which includes an enhanced user experience supported by various underlying Web 2.0 technologies such as Asynchronous JavaScript and XML (AJAX), Representational State Transfer (REST), palettes, drag and drop, smart markup, and dynamic menus using semantic tags.


Integrating the two products

WebSphere Portal and Lotus Quickr do not compete in the same space; in fact, they are complementary. WebSphere Portal V6.1 does not include the collaboration and content management features that Lotus Quickr provides. This difference means that the only way existing WebSphere Portal installations can take advantage of the new Web 2.0 capabilities provided by Lotus Quickr is through custom portlets.

Obviously, such integration allows existing WebSphere Portal users to create Web 2.0 content within exactly the same interface to which they are accustomed in Lotus Quickr.

WebSphere Portal document manager, a feature in earlier releases of WebSphere Portal, is no longer included in WebSphere Portal V6.1. Therefore, existing users can benefit merely by being able to use the content library feature of Lotus Quickr. Unfortunately, though, there is no portlet that is ready to use without modification that can help WebSphere Portal users view Lotus Quickr content libraries.

REST services

Lotus Quickr services for IBM WebSphere Portal provides rich REST-style interfaces to its ATOM syndication and ATOM publishing services. Lotus Quickr's ATOM syndication lets you access read-only ATOM feeds from various Lotus Quickr resources, including document libraries, folders, documents, and drafts.

The ATOM publishing support allows you to manipulate Lotus Quickr resources using HTTP GET, PUT, POST, and DELETE. For example, you can do the following:

  • Manipulate metadata for document libraries, folders, and documents
  • Upload documents
  • Retrieve documents
  • Delete documents

For a comprehensive guide to all of the Lotus Quickr REST services, refer to the Lotus Content Quickr Services wiki.

Using these REST interfaces, you can create a custom portlet to surface Lotus Quickr data in WebSphere Portal and thus integrate Lotus Quickr data with WebSphere Portal services. Programmatically coding the REST interfaces in a portlet, though, is not a trivial task. It involves parsing the feed and coding for various steps in this process.

Here, we take on this challenge by using IBM WebSphere Portlet Factory.

WebSphere Portlet Factory

WebSphere Portlet Factory is a powerful application development tool designed to build applications rapidly. More importantly, it lets you create user interfaces based on several back-end data sources such as IBM Lotus Domino, relational databases, and SAP, without manual programming.

Among its features is the patented profiling feature that lets you have a single code base and apply variability parameters to create several multiple portlets without additional coding.

Using WebSphere Portlet Factory's REST Service Call builder, you can quickly create a portlet that integrates Lotus Quickr services with WebSphere Portal. Currently, there is a sample of this portlet on the WebSphere Portlet Factory wiki; however, the sample does not allow you to view a document within a portlet.

In this article, we demonstrate how you can make some simple modifications to the existing sample, enabling you to view the document within the portlet and at the same time include interportlet communication. This modification lets you see the document hierarchy, and the document itself, rendered on the same page in two different portlets.

Such integration gives you a stronger unified interface within your applications. You can use a similar technique to integrate Lotus Quickr content into your custom applications. Wiring allows you to place portlets on different pages, if needed by a particular user interface design.


Understanding the two portlets

There are two portlets on which we focus:

  • The first, Quickr Explorer, as mentioned above, is a modified version of the sample on the WebSphere Portlet Factory wiki.
  • The second portlet, Quickr Content Display, is new and is the central theme of this article.

The Quickr Content Display portlet acts as the receiver portlet, while the Quickr Explorer portlet acts as the sender portlet.

Let’s start with a brief description of what is contained in the Quickr Explorer portlet.

The Quickr Explorer portlet (see the Downloads section of this article) contains two models, the QuickrFeedProvider and the QuickrFeedConsumer:

  • QuickrFeedProvider is a data provider model containing all the necessary builders to give any consumer model the ability to make certain REST service calls. In this sample, there are three REST service calls: one that retrieves a list of feeds available, another that can post a document onto the Lotus Quickr server, and one that can request a document from the Lotus Quickr server.
  • QuickrFeedConsumer is a consumer model that consumes all the REST services available from the QuickrFeedProvider model. This model is used to create the UI that enables anyone who uses the portlet to enter credentials and a link to a Lotus Quickr library, which could contain a list of folders and documents. After the credentials are submitted to the Lotus Quickr server, a list of available folders, documents, or both is visible within the portlet.

The QuickrExplorer sample also contains a Java utility class that’s used to identify whether a selected link is a folder or a document. Further details on the models themselves can be found on the WebSphere Portlet Factory wiki’s Samples and techniques page.

Modifying the QuickrExplorer sample

We revised the QuickrUtil class and the QuickrFeedConsumer model in the WebSphere Portlet Factory project to enable the resulting portlet as a source portlet for this sample.

Detailed steps of our changes are as follows:

  1. First, create a WebSphere Portlet Factory project (or use an existing one, if you like). Download the Lotus Quickr sample from the WebSphere Portlet Factory wiki article, "IBM - Creating a Lotus Quickr Service Using the REST Service Call builder," and import this sample into your project.
  2. In the Java resources - Source section of the Project Explorer, create a package named sample and import the updated QuickrUtil.java class into that package. The QuickrUtil class has now been updated to prevent the target portlet from reading the Lotus Quickr folder URLs (see the QuickrUtil.java file in the Downloads section).
  3. Create an empty model and name it QuickrEventDeclaration, thus creating a model with no predefined builders.
  4. Using the Builder Palette icon, open the list of builders and select the Event Declaration builder:
    • Name the event GetQuickrContent (see figure 1).
    • Expand the Arguments section of the builder, enter ContentUrl in the Name column, and select IXml from the drop-down list in the Data Type column.
    Figure 1. Event Declaration builder
    Event Declaration builder
  5. Click OK and save your project.
  6. Open the QuickrFeedConsumer model by double-clicking the model from the Project Explorer section of WebSphere Portlet Factory.
  7. Using the Builder Palette icon, open the list of builders and select the Imported Model builder.
  8. Name the Imported Model builder EventDeclaration as shown in figure 2.
  9. Using the chooser icon at the far right of the Model input field, expand and select the EventDeclaration model you created in Step 4. Leave the remaining default values as is.

    Figure 2. Imported Model builder
    Imported Model builder
  10. Click OK.
  11. Using the Builder Palette icon, open the list of builders and select the Variable builder.
  12. Name the Variable builder DocURL and, from the pull-down menu in the Type field, give it the type XML. Then enter the XML shown in listing 1 in the Initial Value section of the builder (see figure 3):
    Listing 1. XML code for Initial Value field
    <contentInfo>
    	<docurl/>
    	<username/>
    	<password/>
    </contentInfo>
    Figure 3. Variable builder
    Variable builder
  13. Click OK.
  14. Using the Builder Palette icon, open the list of builders and select the Action List builder.
  15. Name the builder sendContentUrl (see figure 4) and expand the Arguments section.
    Figure 4. Action List builder
    Action List builder
    • In the first row, enter the Name as Category and select IXml from the Data Type pull-down menu.
    • In the second row, enter the Name as Content and for the Data Type select IXml from the pull-down menu.
    • In the Return Type pull-down menu, select void.
    • In the Action List section, enter the details as illustrated in listing 2, using the Chooser icon located at the right of each input field as shown in figure 5.
    Listing 2. Action List details
    Assignment!Variables/DocURL/contentInfo/docurl=${MethodCall/QuickrUtil.
    openItem(${Arguments/Category},${Arguments/Content})}
    
    !IF (${Variables/DocURL/contentInfo/docurl}) THEN
    
       fireGetQuickrContent(${Variables/DocURL})
    
    !ELSE
    
       QuickrUtil.getFolderFeedList(${Arguments/Category},${Arguments/Content})
    
    !ENDIF
    Figure 5. Chooser icon
    Chooser icon
  16. Finally, click OK and save the project.

You have just updated the QuickrExplorer sample to declare an event that is triggered when a selection is made in QuickrExplorer. This update causes the sendContentUrl Action List builder to be invoked. The builder determines whether the selection is a folder or a document; if the selection is a document, then it fires the GetQuickrContent event.

Creating the Quickr Content Viewer portlet

The Quickr Content Viewer portlet has two models:

  • QuickrEventDeclaration model is used to declare an event and to alert any other model when an event is triggered.
  • QuickrContentDisplay model is the target model for this sample. Once an event is triggered, the QuickContentDisplay model captures the value from a shared variable and then requests the document, using embed tags, so that the document (currently this sample supports PDF document files) can be viewed within the portlet.

In this case, we use PDF documents so that the Adobe® Reader opens within the portlet:

  1. Create a main and page model and name it QuickrContentDisplay. This step creates a model that automatically populates with two basic builders, an Action List and a Page builder.
  2. Optional. Change the sentence in the Page Contents section to read "Please select a document to view from the Quickr Feed portlet." See figure 6.
    Figure 6. Page Contents section
    Page Contents section
  3. Click OK and save the project.
  4. Using the Builder Palette icon, open the list of builders and select the Page builder. Name it targetPage, and replace the Page Contents section with the code shown in listing 3.

    Listing 3. XML code for the Page Contents section
    <html>
        <body>
            <form name="myForm" method="post">
                <div align="center">
                <span name="namedTag"></span><br/>
                <Embed name="objectTag"></Embed><br/>
                </div>
            </form>
        </body>
    </html>
  5. Click OK, and save the project.
  6. Using the Builder Palette icon, open the list of builders and select the Variable builder:
    • Name the builder docURLSite.
    • For the Type, expand and select XML from the pull-down menu.
    • For the Initial Value, enter the code shown in listing 4.
    Listing 4. XML code for the Initial Value section
    		<contentInfo>
    	<docurl/>
    	<username/>
    	<password/>
    </contentInfo>
  7. Click OK, and save the project.
  8. Using the Builder Palette icon, open the list of builders and select the Imported Model builder.
  9. Name the Imported Model builder EventDeclaration as shown in figure 7.

    Figure 7. Imported Model builder
    Imported Model builder
  10. Using the chooser icon at the far right of the Model input-field expand, select the EventDeclaration model you created in the previous section’s Step 4. Leave the remaining default values as is.
  11. Click OK on the builder, and save the project.
  12. Using the Builder Palette icon, open the list of builders, select Linked Java Object, and name it QuickrUtil. For the Class Name, expand the chooser icon, and select samples.QuickrUtil as shown in figure 8.

    Figure 8. Linked Java Object
    Linked Java Object
  13. Click OK, and save the project.
  14. Using the Builder Palette icon, open the list of builders, select Event Handler, and enter the following fields as indicated in figure 9:
    • In the Name field, enterGetQuickrContentEvent.
    • In the Event Name field, select GetQuickrContent.
    • In the Handler Type field, select the Specify inline below option.
    • In the Arguments section, in the Name field, enter ContentURL and select IXml as the Data Type option.
    • In the Return Type field, select void.
    • In the Actions field, select Assignment!Variables/DocURLSite=${Arguments/ContentURL} and targetPage.
    Figure 9. Event Handler properties
    Event Handler properties
  15. Click OK, and save the project.
  16. Using the Builder Palette icon, open the list of builders, select Attribute Setter, and enter the following fields as shown in figure 10:
    • In the Name field, enter ObjectAttr.
    • In the Page Locatiion section, do the following:
      • In the Location Technique field, select the On Named Tag option.
      • In the Page field, select the targetPage option.
      • In the Tag field, select objectTag.
    • In the Attribute List field, select the names and values shown in table 1.
    Figure 10. Attribute Setter properties
    Attribute Setter properties
Table 1. Names and values for the Attribute List field
NameValue
src ${Variables/DocURL/contentInfo/docurl}
height400px
width100%
  1. Click OK, and save the project.

You have now created the target for this sample.


Building and deploying the project

You are now ready to build and deploy this project onto your WebSphere Portal server. After it is deployed, you can then add it to any WebSphere Portal page and, following the instructions on the Quickr Explorer portlet, you can connect to your Lotus Quickr Java 2 Platform, Enterprise Edition server and view the list of documents.

If you want to view the contents of the document, select the document (for PDF files, Adobe Reader must be installed on your browser) to display its contents in the target Quickr Content Viewer portlet.

As described previously, the Quickr Content Viewer portlet currently supports PDF files. If the required plug-ins or Active X controls of an application are enabled in a browser, you can also see other types of documents, for example, ODF, ODT, XLS, and DOC files.

NOTE: Be aware that there might be some issues with having too many portlets accessing or opening an application within a single browser window. For example, lack of memory or resources to open multiple instances of an application in one browser window could possibly cause unpredictable behavior.


Conclusion

We have shown how you can quickly access Lotus Quickr services by using the REST builders provided by WebSphere Portlet Factory. Moreover, Portlet Factory provides mechanisms to make such integration more appealing to users; for instance, the mechanism of wiring portlets and using the cooperative actions minimizes the pop-up windows in your applications, thus reducing the number of clicks users must perform and improving their productivity.


Downloads

DescriptionNameSize
Code sampleQuickrPortletSample.zip15.8KB
Code sampleQuickrUtil.java5.5MB

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into IBM collaboration and social software on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Lotus, WebSphere
ArticleID=379969
ArticleTitle=Integrating IBM Lotus Quickr with IBM WebSphere Portal using IBM WebSphere Portlet Factory
publish-date=06292009