WebSphere Commerce Portal integration and WebSphere Commerce stores

In WebSphere Commerce an online store is the place where all transactions for your online business occur.

All online stores created with WebSphere Commerce include at least one of the following types of assets:

  1. Storefront
  2. Business logic
  3. Store data

If a store contains all three of these types of assets, it is a fully operational store. If a store contains only a subset of the assets, for example, it contains storefront assets and business logic, or store data and business logic, or just store data, it is known in WebSphere Commerce as an asset store. Asset stores are collections of sharable resources (business artifacts, business processes and storefront assets) that can be leveraged in other stores. An asset store is usually composed of the assets that can be used by multiple stores. Typically, an asset store does not have a storefront.

Configuring asset-store.properties file for the MVCPortletStoreService plug-in

This asset sharing concept can also be used in the WebSphere Portal environment, with the aid of the Store Plug-in Extension. It leverages the MVC Portlet plug-in framework so that a customized version can be specified. The store plug-in must implement the PortletStorePlugIn interface which can be initialized and destroyed along with the MVC portlet. A default implementation has been provided:


com.ibm.commerce.foundation.client.portal.services.MVCPortletStoreService

This store service will read the asset store property file, MVCPortlet_installdir/WEB-INF/config/asset-store.properties, of the following format:


WebSphere Commerce storeId = WebSphere Commerce asset storeId

For example:


10151 = 10051

This file defines the asset store relationship between the WebSphere Commerce store and the corresponding WebSphere Commerce asset store that provides the store assets for presentation. The model defines a many-to-one relationship, where multiple stores can be mapped to a single asset store, but multiple asset stores cannot be mapped to a single store.

When adding a new store, the Portal Administrator must update the two store property files and then define the portlet to serve it up using the proper preference settings. If this new store does not require any customization, it can be put online by issuing a refresh() action on the MVCPortletStoreService.

WebSphere Commerce store and its associated static contents

All static content asset files, such as images and static HTML, should be included into the portlet application for ease of installation and deployment. However, the MVCPortlet also allows external references to these static contents using a URL defined in the URL provider. There are three possible locations where store related static content can be deployed to and served up at runtime:

  1. On the WebSphere Portal web server
  2. Within the MVCPortlet WAR
  3. Remotely on the WebSphere Commerce web server

Refer to the Static content in a portlet topic for more information about how to define references to static content on an MVCPortlet JSP.

Configuring store-directory.properties file for MVCPortletStoreService plug-in

Because each store can have its own specific static asset files, it is required to have a separate directory, called a store directory, or storedir, to act as a container for these store specific files. The store plug-in extension can determine the store directory for any given store based on a store directory property file, MVCPortlet_installdir/WEB-INF/config/store-directory.properties, of the following format:


WebSphere Commerce store ID = Relative path from the context root of the server or application which contains the static content

For example:


10001 = /ConsumerDirect

Note that not every store is required to define its own store directory. There is a default mechanism employed in the lookup logic. When a specified store is not found during store path lookup, then the default store directory will be used instead. Therefore a mandatory property name must be defined in this file:


default = /