Step 3: Creating a non WebSphere Commerce portlet application project

In the previous step of this tutorial, Defining the new Commerce Enabled Portal Portlet, you defined the new portlet.

You now need to create a portlet application project for the non WebSphere Commerce portlet that will communicate with the Commerce Enabled Portal portlet.

To create a portlet application project, do the following:

  1. On the machine where Rational Application Developer with portal tooling is installed, create a new portlet application project:
    1. From the File menu, click New > Project. The New Project wizard displays.
    2. Select Portlet Application Project. Click Next. The Select page displays.
    3. In the Select page, select Portlet Project. Click Next. The Create a Portlet Project page displays.
    4. In the Project name field, type the name of the project. For example NonCommerce.
    5. From the Select a portlet type list, select Create empty portlet. Click Finish. The new portlet project displays in the main window.
  2. In the downloaded sample code package, find the ThirdParty folder: Samples\Sample4\ThirdParty_WAR.
  3. Import the sample Third Party folder to the new portlet application project. The sample files contain all the information to create the third party portlet application project.
    1. In the Project Navigator, expand the NonCommerce project.
    2. Expand Java Resources and then right click JavaSource. From the menu, select Import. The Import wizard displays.
    3. In the Select page, select File system. Click Next. The File System page displays.
    4. In the From directory field, click Browse to navigate to the location of the Source folder. Select Source. Click OK. Source displays in the list.
    5. Select the Source check box. Click Finish. If a dialog displays asking you to overwrite the files, select Yes.
    6. In the Project Navigator, expand the NonCommerce project.
    7. Right click WebContent. From the menu, select Import. The Import wizard displays.
    8. In the Select page, select File system. Click Next. The File System page displays.
    9. In the From directory field, click Browse to navigate to the location of the ThirdParty folder. Select ThirdParty. Click OK. ThirdParty displays in the list.
    10. Expand ThirdParty. Select the com check box. Click Finish. If a dialog displays asking you to overwrite the files, select Yes.
  4. A sample.jsp file is provided in the samples download package under Sample4. This sample.jsp file is used by the third party portlet. The sample.jsp file includes a form that allows users to select either the Men's or Women's fashion categories. Copy sample.jsp to the following location:
    • workspace\NonCommerce\WebContent\Web-INF\jsp

      If the JSP directory does not exist, create it.

  5. Open sample.jsp. Change the values for the category IDs to match those in your store.
  6. Save your changes.
  7. Continue the tutorial by completing the steps in Displaying the portlets.

Feedback