Tutorials > Portal > Portal > Call the TutorialStore service in a portlet

< Previous | Next >


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.


Procedure

  1. Create a new standard portlet, TutorialStore, in the MVCPortlet project:

    1. Expand the MVCPortlet project to MVCPortlet\WebContent\WEB-INF.

    2. Right-click portlet.xml and select Open. The Portlet Deployment Descriptor editor opens.

    3. Click the Portlets tab and select New… to create a new portlet. The New Portlet wizard opens.

    4. Select the MVCPortlet Project, TutorialStore Portlet name, and Empty Portlet Portlet type.

    5. Clear the Generate a custom portlet class check box.

    6. Click Browse… and select the MVCPortlet class.

    7. Click Finish.

  2. Update the initialization settings for the TutorialStore portlet:

    1. From the same Portlet Deployment Descriptor editor, on the portlet page, highlight the TutorialStore portlet on the left-side.

    2. On the right-side, scroll down to the Initialization section.

    3. Click Add… and enter the following information:

      wc.config.class

      com.ibm.commerce.foundation.internal.client.portal.configurations.MVCPortletConfiguration

      wc.config.files

      com.ibm.commerce.foundation/portlet-config.xml

    4. Save the file (Ctrl+S).

  3. Update the Persistent Preference Store setting for the TutorialStore portlet:

    1. From the same Portlet Deployment Descriptor editor, on the portlet page, highlight the TutorialStore portlet on the left-side.

    2. On the right-side, scroll down to the Persistent Preference Store section.

    3. Click Add... and enter the following information:

      Name

      .ContextDefault-storeId

      Values

      The WebSphere Commerce storeId that the portlet will be using.

    4. Click OK.

    5. Save the file (Ctrl+S).

In this step you have created a new standard portlet, called TutorialStore, using the MVCPortlet implementation class. There is currently no logic defined in this empty portlet. In the next sections of the tutorial, you are going to add custom configurations to call out to the TutorialStore service.

< Previous | Next >


+

Search Tips   |   Advanced Search