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:
- On the machine where Rational Application Developer with portal tooling is installed, create a new portlet application project:
- From the File menu, click New > Project. The New Project wizard displays.
- Select Portlet Application Project. Click Next. The Select page displays.
- In the Select page, select Portlet Project. Click Next. The Create a Portlet Project page displays.
- In the Project name field, type the name of the project. For example NonCommerce.
- From the Select a portlet type list, select Create empty portlet. Click Finish. The new portlet project displays in the main window.
- In the downloaded sample code package, find the ThirdParty folder: Samples\Sample4\ThirdParty_WAR.
- 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.
- In the Project Navigator, expand the NonCommerce project.
- Expand Java Resources and then right click JavaSource. From the menu, select Import. The Import wizard displays.
- In the Select page, select File system. Click Next. The File System page displays.
- 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.
- Select the Source check box. Click Finish. If a dialog displays asking you to overwrite the files, select Yes.
- In the Project Navigator, expand the NonCommerce project.
- Right click WebContent. From the menu, select Import. The Import wizard displays.
- In the Select page, select File system. Click Next. The File System page displays.
- 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.
- Expand ThirdParty. Select the com check box. Click Finish. If a dialog displays asking you to overwrite the files, select Yes.
- 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.
- workspace\NonCommerce\WebContent\Web-INF\jsp
- Open sample.jsp. Change the values for the category IDs to match those in your store.
- Save your changes.
- Continue the tutorial by completing the steps in Displaying the portlets.