Developing > Persistence layer > WebSphere Commerce integration with WebSphere Portal > Customizing WebSphere Commerce Portal integration > Use the provided WebSphere Commerce MVCPortlet class (MVC style)



Adding or customizing a portlet using the MVCPortlet class

To add a portlet to the WebSphere Commerce integration with WebSphere Portal Server.

  1. Add a portlet using the Rational Application Developer version 7 instructions. Make sure you select "Empty portlet" as portlet class to avoid having configuration information generated.

  2. Modify the portlet deployment descriptor, using the Rational Application Developer instructions.

    The following parameters must be specialized when you configure the portlet deployment descriptor:

    Mandatory initialization parameters

    Name Sample Values Description
    wc.config.class com.ibm.commerce.foundation.client.portal.configurations.

    MVCPortletConfiguration

    Configurator class for MVC portlet
    wc.config.files com.ibm.commerce.foundation/

    portlet-config.xml

    List of MVC configuration files; order of files is important, and using LIFO method for overriding existing definitions; these configuration files must be placed under the WEB-INF/config directory of this portlet WAR.
    wps.markup html Markup format to be used for this portlet. HTML is the only format that has been tested and supported on the sample. WML can be used, but it is not currently supported.
    wps.markup.root.html jsp/html Root directory of HTML markup JSP templates.
    wps.markup.root.wml jsp/wml Root directory of WML markup JSP templates.

    Supported optional preference settings

    Name Default Values Description
    .ExternalContentURLReference url/com/ibm/commerce/foundation/client/portal/ExternalContent JNDI name for use to lookup the location (URL) prefix to static asset files such as images.
    .AuthenticationType basic Authentication type to be used for single sign-on to WebSphere Commerce.
    .SimulatedSSOUserName   Simulated single sign-on user name (only needed when authentication type set to simulated).
    .SimulatedSSOPassword   Simulated single sign-on password (only needed when authentication type set to simulated).
    .ContextDefault-storeId 0 If storeId is not given in the context, this is the default storeId to be used.
    .ContextDefault-langId -1 If langId is not given in the context, this is the default langId to be used.

  3. If your WebSphere Portal Server is running, restart it.

    Portlet preferences can be used to initialize a business context object at runtime to build the basic set of WebSphere Commerce business context for use with the client library. When building up the initial business context object, the context plug-in will search for any portlet preference name that starts with ".ContextDefault-" and use the string after that prefix as the name of the context name. The value of this context will be the actual value set for this preference name. For example, if .ContextDefault-storeId is the name of the context default and its value is 10001, then the context name will be storeId and the context value will be 10001.

Related concepts

Define references to static content in an MVCPortlet JSP file

WebSphere Commerce integration with WebSphere Portal

Use WebSphere Commerce services in portlets

Populating data on a portlet JSP file using the WebSphere Commerce foundation tag library

Customizing WebSphere Commerce Portal integration

Last updated: 25 November 2009