This tutorial is for portlet developers who want to develop portlet applications that can integrate data from various data sources. It showcases some of the key features of IBM® Rational® Application Developer Version 8.0.4 that increase developer productivity through tools such as wizards, drag-and-drop capabilities, automation, code generation, built-in integration with IBM® WebSphere® Portal servers, and more.
The tutorial also demonstrates one use case where Rational Application Developer helps to create portlet applications that use data from variety of data sources, including IBM® DB2® database server (hereafter called DB2), Microsoft SharePoint Server (henceforth called SharePoint), and IBM® Connections (hereafter called Connections). The portal will act as composite application builder to host multiple portlets that fetch data from a variety of data sources. This tutorial uses IBM WebSphere Portal server, Version 7.0..
These are some of the key features covered in this five-part series:
- Creation of multichannel portlets
This refers to creation of portlet applications that can be viewed either on a desktop web browser or a smart-phone browser. Rational Application Developer enables design time separation of the content for the request to cater to both types of browsers.
- Creation of Service Data Objects (SDOs)
SDOs allow access to a variety of heterogenous data. The tutorial will create an SDO in Rational Application Developer to fetch data from a database, using a portlet.
- Mobile browser simulator
- Integration with SharePoint
Microsoft SharePoint services provide many capabilities to create websites for sharing information with others. They also help manage and maintain documents in document libraries and images in picture libraries. This tutorial demonstrates use of web services provided by SharePoint. The skeleton code generated can be used to code specific business logic to use data from document libraries, thereby rendering it in a portlet application.
- Integration with IBM Connections
IBM Connections is social software for business that lets you access everyone in your professional network, including your colleagues, customers, and partners. Key capabilities include creation of blogs, files for sharing documents, presentation among various kinds of files, creation of communities, ability to create activities for organizing work, planning next steps, tapping professional networks, and gathering information to meet business objectives. The Connections applications (Activities, Blogs, Bookmarks, Communities, Files, Forums, Profiles, and Wikis) and the Connections home page all provide application programming interfaces (APIs) that enable integration with other applications. Using the interfaces, you can programmatically access and update much of the same information that you can access and update through the Lotus Connections user interface. This tutorial specifically shows how to use the Activity APIs to programmatically get the data stored in the activities.
- Creation of event-enabled portlets
Enabling events for portlets is essential if you want portlets to share data with other portlets. In this tutorial, you create Java Portlet Specification 2.0 (JSR 286) portlets that communication with each other using eventing (handling events).
- Wiring capabilities
Wiring together the portlets creates a communication channel between portlets. When portlets are published to a portal, wiring is necessary for the data to transfer, even though the portlets have been enabled for eventing. The tutorial shows how to use the portal wiring tool to wire together two portlets.
This tutorial shows the WebSphere Portal v7.0 wiring interface for a page with a PageBuilder theme. Users can also use portal admin console for wiring together portlets.
About this tutorial
This tutorial is divided in five parts:
- Part 1, this part, gives you and overview and helps you get set up to proceed.
- Part 2 deals with creation of multichannel portlet applications in Rational Application Developer. These applications will be capable of running on both a desktop browser and a smartphone browser.
- Part 3 covers enabling portlets in Rational Application Developer for SharePoint integration. You will be guided through using Rational Application Developer tooling to write your own custom code to use SharePoint artifacts in a portal environment.
- Part 4 deals with event enabling portlets to share data among themselves for Inter-portlet communication.
- Part 5 would deal with enabling portlets created in Rational Application Developer to consume artifacts present in IBM Connections.
As a prerequisite, you need to set up a few things to take full advantage of this tutorial.
Part 2 of this series uses IBM DB2 software v9.5 and the SAMPLE database that it includes. Follow these steps to set up the DB2 use case:
- Download the tables_for_db2.zip file from the downloads section, and extract it to a folder that you name
Tables. The file contains three tables that you will need to import into DB2:
- Launch the DB2 Control Center.
- Expand All Databases > Sample.
- Right-click Tables and choose the option to Create from Import, as shown in Figure 1, to launch the Import Table dialog window.
Figure 1. Option to import DB2 tables
- Click on the Browse button for Import File and choose the table DEALS from the file system. Click Open as shown in Figure 2.
Figure 2. Import Table dialog window
- Enter any value for the Message file.
- Click the Table Specification tab, and specify the Table Name as
DEALS. (See Figure 3.)
Figure 3. Table Specification tab in the Import Table dialog
- Click OK to import the DEALS table. Similarly, import the tables titled ACCOUNT_DETAILS and CONTACT_PERSON.
Mobile theme setup
To see the mobile view of the portlet, you need to install a mobile theme that is available in the IBM Lotus and WebSphere Portal Business Solutions Catalog. Download and follow the instructions to install the mobile theme from the IBM WebSphere Portal Mobile Experience v7.0 page in the Resources section.
This tutorial uses the 2007 version of Microsoft SharePoint server.
- It also uses Basic authentication enabled on the base Internet Information Server (IIS) on which the SharePoint server is based. See Enabling Basic authentication on IIS in the Resources section for how to do that setup.
- For the SharePoint integration use case, you'll need to create the following document libraries in the SharePoint server:
- Liquid Sugar Corp
- Frozen Beer Corp
- Instant Nirvaana Corp [sic]
- Talking Animals Corp
- Silent Music Corp
- After creating the document libraries, upload a sample document to each library. See Creating Document libraries in SharePoint in the Resources section for more information.
Defining SharePoint server credentials
For this tutorial, you will define SharePoint and Connections server credentials inside the connections.properties file that is inside of the WebContent folder of the attached sample portlet project, which you will create during the course of this tutorial. Figure 4 shows a snapshot of the connection.properties file that is also in the attached sample. Figure 4 shows a snapshot of the same.
Figure 4. Defining credentials
For a real-life application though, it's better not to store this information in a plain text file.
IBM Connections setup
For the IBM Connections integration use case, you will need to create the following sample activities in the Connections server:
- Liquid Sugar Corp
- Frozen Beer Corp
- Instant Nirvaana Corp
- Talking Animals Corp
- Silent Music Corp
You will also need to install IBM WebSphere Application Server Feature Pack for Web 2.0 and Mobile in the Resources section. At the time of publication, portlet projects in Rational Application Developer 8.0.4 support Web2.0 feature pack version 188.8.131.52 only, so download that version, as shown in the Figure 5.
Figure 5. Web2.0 feature pack download options
All of the scenarios and use cases in this series are bundled in the scenarios_use_cases_sample.zip file that you'll find in the Downloads section. This compressed file can be imported into Rational Application Developer to inspect source code and publish the portlets.
Before importing the sample into Rational Application Developer, make sure that the WebSphere Application Server v6.1 and v7.0 Feature Pack for Web 2.0 is installed over the base WebSphere Application Server on which the portal is based.
|Tables to be imported into DB2||tables_for_db2.zip||3KB|
|Scenarios and use cases for the series||scenarios_use_cases_sample.zip||5MB|
- Enabling Basic authentication on IIS.
- Creating Document libraries in SharePoint.
- Find out more about Rational Application Developer:
- Browse the Rational Application Developer for WebSphere Software page on developerWorks for links to technical articles and many related resources.
- Explore the Information Center.
- Visit the Rational software area on developerWorks for technical resources and best practices for Rational Software Delivery Platform products.
- Stay current with developerWorks technical events and webcasts focused on a variety of IBM products and IT industry topics.
- Attend a free developerWorks Live! briefing to get up-to-speed quickly on IBM products and tools, as well as IT industry trends.
- Watch developerWorks on-demand demos, ranging from product installation and setup demos for beginners to advanced functionality for experienced developers.
- Improve your skills. Check the Rational training and certification catalog, which includes many types of courses on a wide range of topics. You can take some of them anywhere, any time, and many of the "Getting Started" ones are free.
Get products and technologies
- IBM WebSphere Application Server Feature Pack for Web 2.0 and Mobile.
- IBM WebSphere Portal Mobile Experience v7.0.
- Try Rational Application Developer for WebSphere Software, free.
- Evaluate IBM software in the way that suits you best: Download it for a trial, try it online, use it in a cloud environment, or spend a few hours in the SOA Sandbox learning how to implement service-oriented architecture efficiently.
- Check Rational Application Developer wiki to keep up with news and to contribute.
- Join the Development Tools forum to ask questions and participate in discussions.
- Rate or review Rational software. It's quick and easy. Really.
- Share your knowledge and help others who use Rational software by writing a developerWorks article. Find out what makes a good developerWorks article and how to proceed.
- Follow Rational software on Facebook, Twitter (@ibmrational), and YouTube, and add your comments and requests.
- Ask and answer questions and increase your expertise when you get involved in the Rational forums, cafés, and wikis.
- Get social about thought leadership. Join the Rational community to share your Rational software expertise and get connected with your peers.