| Next >
Tutorial: Calling the TutorialStore service in a portlet
Attention: This tutorial is currently under revision. The content might contain errors or inaccuracies. Subscribe to this page to be notified when an updated version is available.
In this tutorial, you modify an existing portlet in the WebSphere Commerce Portal server.
Learning objectives
The portlet you add to the WebSphere Commerce Portal server calls the TutorialStore service that you created in the Tutorial: Creating a WebSphere Commerce Service Module tutorial.
Time required
Expect this tutorial to take approximately 2 hours to complete.
Audience
This tutorial is intended for WebSphere Commerce developers who are responsible for creating and customizing a WebSphere Portal Server integration.
Prerequisites
IBM recommends, but not required, that you complete the Tutorial: Creating a WebSphere Commerce Service Module tutorial before you start this tutorial, in order to understand the integration points between the WebSphere Commerce Server and the WebSphere Portal Server. This tutorial demonstrates how to modify a pre-configured WebSphere Commerce standard portlet in the WebSphere Portal server to communicate with the created TutorialStore service.
Before beginning this tutorial, do these tasks:
- Install WebSphere Commerce Developer.
- Setup the WebSphere Commerce Portal development environment.
- Create a WebSphere Commerce sample portal page on WebSphere Portal.
- Set up the TutorialStore service on WebSphere Commerce, following the steps in Tutorial: Creating a WebSphere Commerce service module.
To skip the tutorial, follow the instructions in Deploying the component facade starting at step 3. The files mentioned in the task are provided in the following ZIP file: tutorialstore_process_projectinterchange.zip.
- Download and unzip the sample tutorial code, PortalTutorial.zip, to a temporary location on the hard drive.
- Copy WCDE_INSTALL/portal/MVCPortlet from the WebSphere Commerce Developer environment to the same temporary location on the hard drive.
- Copy the contents from the TutorialStoreServer/sampleConfig/xml/config directory to the WC_EAR/xml/config directory.
- Run the following SQL statements to prepare the WebSphere Commerce Developer database:
- Run the SQL statements from Step 5 of Implement the component façade of the Creating the Get TutorialStore service tutorial.
- Run the SQL statements from Step 7 of Implement the component façade of the Creating the Process TutorialStore service tutorial.
- Configure the message mapper for the Process action:
- Complete Step 8 of Implement the component façade of the Creating the Process TutorialStore service tutorial.
- Verify the TutorialStore service is functioning properly.
Prerequisite knowledge: To complete this tutorial you should be familiar with the following terms and concepts:
- The Java programming language
- Rational Application Developer
- Relational databases
- JSP files
- WebSphere Commerce integration with WebSphere Portal
- WebSphere Commerce services
Lessons in this tutorial
- Add the TutorialStore client library to the MVCPortlet project
In this step of the tutorial, you add the TutorialStore service client library, which adds Web-friendly Java methods to the project so it can act as a client to the TutorialStore service. A JAX-RPC Web service client is then generated from the TutorialStore service to handle sending and receiving requests to the WebSphere Commerce server.
- Create a new TutorialStore portlet in the MVCPortlet project
In this step of the tutorial, you are going to create a new standard portlet, TutorialStore, in the MVCPortlet portlet application. This new portlet reuses the MVCPortlet implementation class, and you define the configurations for the new TutorialStore portlet.
- Add the GetStore portlet JSP file to the MVCPortlet project
In this step, you add a GetStore portlet JSP file to the project. The JSP file calls the WebSphere Commerce foundation tag library, which in turn calls the client library. The client library uses JAX-RPC to send the service request to the WebSphere Commerce server.
- Register a MVCPortlet render to use GetStore portlet JSP
In this step of the tutorial, you are going to register a new MVCPortlet render definition in the portlet configuration file. This render event uses the GetStore portlet JSP file for displaying the content returned from the TutorialStore service.
- Test the GetStore portlet
This section of the tutorial will show you how to use the WebSphere Commerce standard portlet you have just modified to communicate with the TutorialStore service that you created in the previous tutorial. In this section, you start the WebSphere Portal test server and run the WebSphere Commerce JSR 168 standard portlet project, MVCPortlet.
- Summary: Calling the TutorialStore service in a portlet
In this tutorial, you modified an existing portlet in the WebSphere Commerce Portal server.
- Step 1: Setting up the WebSphere Portal development environment
In this step of the tutorial, you set up the WebSphere Portal development environment to start working with WebSphere Portal Server.
| Next >