Extended site store plugin
A store plugin is one that helps resolving Commerce
Store related information for the MVCPortlet application. It leverages
the WebSphere Commerce MVCPortlet plug-in framework so that a customized
version can also be specified instead. The extended site store plug-in
must implement the PortletStorePlugIn interface which can be initialized
and destroyed along with the WebSphere Commerce portlet. A default
implementation has been provided, com.ibm.commerce.foundation.client.portal.services.MVCPortletStoreService.
This MVCPortletStoreService plug-in serves multiple store
related purposes:
- It resolves the store directory of the given Store ID.
- It resolves the store relationship of the given Extended Site Store ID.
- It resolves URL prefix for use with Store related static contents.
Once the corresponding asset store is determined, the MVCPortlet can lookup the MVCPortlet configuration to determine if a custom version of the JSP file is used for the given action or render.
This store relationship property file, WEB-INF/classes/asset-store.properties,
is used to define the extended site view relationship between the
given extended site and the corresponding asset store. The model
only supports a many-to-one relationship, where multiple extended
sites can be mapped to a single presentation asset store, but not
vice versa. This property file uses the following format:
WebSphere Commerce extended site store ID = WebSphere Commerce presentation asset store ID
Considering the following simple
example:
- An entry
10652 = 10103
is defined in the store relationship property file, meaning an extended site with store Id 10652 uses another store with Id 10103 as its asset store. - In the MVCPortlet configuration file, there is only one TopCategoryDisplay render definition defined for store 10103 and not for the extended site 10652.
- Whenever the MVCPortlet receives a TopCategoryDisplay render request with storeId 10652, the asset store 10103 portlet template will be used for rendering this TopCategoryDisplay request.
Now considering
another example where a custom extended site template is used instead:
- An entry
10651 = 10103
is defined in the store relationship property file, meaning an extended site with store Id 10651 uses another store with Id 10103 as its asset store. - Now in the MVCPortlet configuration file, there are two TopCategoryDisplay render definitions defined, with one entry for each store, as illustrated in the above diagram.
- Whenever the MVCPortlet receives a TopCategoryDisplay render request with storeId 10651, the extended site 10651 custom template will be rendered instead of the one defined for its asset store 10103.
For ease of maintenance in the production environment, it is recommended not to use the store relationship properties file, leaving it as an empty file, and rely on the service call to retrieve the store relationship information.