Exercise 1.1: Importing the resources

In this exercise, you will import the two bookmark sample portlets.

Before you can begin this tutorial, you must first import the required resources:

Importing the sample project files

Import the two bookmark samples by following these steps:

  1. From the Help menu, select Samples Gallery > Technology samples > Portlet > Basic.
  2. Double-click the Bookmarks (using IBMR portlet API) sample. The sample introductory page opens in the right pane.
  3. Click Import the sample. Importing the sample creates an EAR project named bookmarkIBMEAR and a Portlet project named bookmarkIBM.
  4. Import the sample code for the Bookmarks (using JSR 168 API). Importing this sample also creates two projects, bookmarkJSREAR and bookmarkJSR.

About the files used in this tutorial

The samples include the following files:

Other portlet samples

The workbench provides several types of portlet coding samples, which are available in the Samples Gallery. From the Help menu, select Samples Gallery > Technology samples > Portlet.

The samples provided under the Basic Portlet category are listed below. All of these samples illustrate differences between the two portlet APIs. To import any of the samples, open it and click on Import the sample on the main page of the sample.

The two bookmarks portlet samples illustrate a portlet that stores Web addresses as bookmarks.

The Content Access portlet samples demonstrate use of the ContentAccessService interface provided by WebSphereR Portal.

The cooperative portlet samples show how to exchange information between portlets on the same page, using Click-To-Action (IBM portlet API) and the Property Broker Service (JSR 168 API) .

This tutorial discusses the bookmark portlet samples, explaining the differences between implementing the bookmark code using the IBM portlet API and the JSR 168 portlet API. Some differences that are not illustrated in the bookmark sample are also discussed.

Using JSR 168 portlets with WebSphere Portal

The WebSphere Portal v5.0 test environment within the workbench automatically supports the JSR 168 API. If you are using a remote WebSphere Portal v5.0.2 server, you must configure WebSphere Portal to allow JSR 168 portlets by editing the properties file ConfigService.properties in the <WebSphere_Portal_install_root>/shared/app/config/services directory, and setting portal.enable.jsr168 = true.

Workbench support for the APIs

The workbench provides support for the two APIs in the new Portlet project wizards:

When you create new portlets in these projects, they will be JSR 168 portlets or IBM portlets, depending on the project they are created in.

Now you are ready to begin Exercise 1.2: Conceptual differences between the APIs.

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.