Skip to main content

skip to main content

developerWorks  >  WebSphere  >

Tip: Enabling the sales catalog in the catalog asset store for extended sites in WebSphere Commerce

developerWorks
Document options
PDF format - Fits A4 and Letter

PDF - Fits A4 and Letter
29KB (6 pages)

Get Adobe® Reader®

Document options requiring JavaScript are not displayed


My developerWorks needs you!

Connect to your technical community


Rate this page

Help us improve this content


Level: Intermediate

Martin Forest (mforest@ca.ibm.com), Software Developer, IBM
Chris Galloway (crg@ca.ibm.com), Information Developer, IBM
Jenny Chan (jenchan@ca.ibm.com), Software Quality Engineer, IBM

19 Nov 2008

This article describes how to enable the sales catalog feature in the catalog asset store when using the extended sites model in WebSphere® Commerce Version 6.0 Feature Pack 4.

Introduction

The IBM Management Center for WebSphere Commerce is a business user tool for managing business tasks and assets for online businesses. Among the wide range of functions that are supported by the Management Center is the ability to create sales catalogs. The sales catalog is used to organize and display assets from the master catalog. For example, you can create a sales catalog to highlight new merchandise, seasonal merchandise such as a summer or winter catalog, or a particular product line.

The extended sites business model allows sellers to create many sites to target audiences in various business contexts, such as different geographical regions or market segments. Extended sites can share the same master catalog while having a completely different store front appearance.

By default, each extended site manages its own sales catalog when using the IBM Management Center. This allows each extended site to display assets differently while sharing the same catalog asset store. In this scenario, each extended site has complete control of its own sales catalog. However, in certain situations, it may be desirable to display assets in the same way among the extended sites. By doing a few customizations to the IBM Management Center code, you share sales catalogs among the extended sites. This way, you can centrally manage the sales catalog from the catalog asset store in the customized Management Center. These customizations reduce redundancy and create an efficient method to manage and reuse the sales catalog.


Figure 1. Moving sales catalogs from the extended site to the catalog asset store
Moving sales catalogs from extended site to the catalog asset store

Enabling the sales catalog in the extended sites model

To enable the sales catalog in the catalog assets store, you must disable the sales catalog in all extended sites. The following instructions explain how to do this task.

Before starting, ensure the following conditions are satisfied:

  • Your sales catalogs belong to the catalog asset store, or you have no sales catalogs associated to the catalog asset store.
  • You have no sales catalogs associated to any of the extended sites.

If the sales catalogs are associated with some of your extended sites, then you need to remove these associations by deleting them from the "STORECAT" table for the appropriate stores and sales catalogs.

You need to create a backup of these two files from the LOBTools project before starting this customization:

  • /LOBTools/WebContent/WEB-INF/src/lzx/commerce/catalog/objectDefinitions/CatalogCommonObjectDefinitions.lzx
  • /LOBTools/WebContent/WEB-INF/struts-extension.xml

Control of the sales catalog for a particular store type is handled by the following classes:

  • catStoreTypeSalesCatalogObjectCreationRestriction
  • catStoreTypeSalesCatalogObjectFilterRestriction

The class catStoreTypeSalesCatalogObjectCreationRestriction is used to control the store types to create a sales catalog or sales category.

The class catStoreTypeSalesCatalogObjectFilterRestriction is used to filter out the store types, which do not have sales catalog categories and prevent them from appearing in the navigation pane.

These classes are stored in the file CatalogCommonObjectDefinitions.lzx in the workspace of your developer environment.

The following instructions explain how to enable the sales catalog tool in the catalog asset store and to disable it from the extended sites.

  1. Remove or comment out the following enablement condition from both classes to enable the sales catalog from the asset store:
    <wcfEnablementCondition conditionId="cpsCondition" contextName="storeType" 
       enablementValue="CPS"/>
    

  2. Add the following enablement condition to both classes to disable the sales catalogs in the extended sites (BMH is the store type for B2B extended sites, MHS is the store type for B2C extended sites):
    <wcfEnablementCondition conditionId="bmhCondition" contextName="storeType" 
       enablementValue="BMH"/> 
    <wcfEnablementCondition conditionId="mhsCondition" contextName="storeType" 
       enablementValue="MHS"/>
    

  3. Review the "STORE" table to confirm that the extended sites store types are BMH or MHS.

If a sales catalog that was previously created in the WebSphere Commerce Accelerator fails to show up in the Management Center, make sure that in the table "STORECAT", the mastercatalog column is set to "0" for the respective catalog_id and store_id.

Follow the remaining steps to ensure that the catalog drop-down list in the advanced search only displays the sales catalogs that belong to the store. To do this, create a new JSP.

  1. Create and save the new file FindCatalogs.jsp under the directory LOBTools/WebContent/jsp/commerce/catalog. The content of the FindCatalogs.jsp file looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@ taglib uri="http://commerce.ibm.com/foundation" prefix="wcf"%>
    
    <%-- Webservice to retrieve the master catalog --%>
    <wcf:getData type="com.ibm.commerce.catalog.facade.datatypes.CatalogType"
    	var="catalog"
    	expressionBuilder="getMasterCatalog">
    	<wcf:contextData name="storeId" data="${param.storeId}"/>
    </wcf:getData>
    
    <%-- Webservice to retrieve the sales catalogs --%>
    <wcf:getData type="com.ibm.commerce.catalog.facade.datatypes.CatalogType[]"
    	var="salesCatalogs"
    	expressionBuilder="getAllCatalogs">
    	<wcf:contextData name="storeId" data="${param.storeId}"/>
    	<wcf:param name="booleanValue" value="false"/>
    	<wcf:param name="dataLanguageIds" value="${param.defaultLanguageId}"/>
    </wcf:getData>
    
    <%-- Create the catalog objects. --%>
    <objects>
    <jsp:directive.include file="restricted/serialize/SerializeCatalog.jspf"/>
    
     <c:forEach var="catalog" items="${salesCatalogs}">
      <c:if test="${catalog.catalogIdentifier.externalIdentifier.storeIdentifier.uniqueID
                                 == param.storeId }">
         <jsp:directive.include file="restricted/serialize/SerializeCatalog.jspf"/>
      </c:if>	
    </c:forEach>
    </objects>
    

  2. Open the file /LOBTools/WebContent/WEB-INF/struts-extension.xml.
  3. Add and save the following action in the <actionMappings /> section of struts-extension.xml:
    <action path="/FindCatalogs" forward="/jsp/commerce/catalog/FindCatalogs.jsp" />
    

The customization is now complete. Redeploy the project LOBTools to your target server environment. You can now see the sales catalog option in the filter of the navigation pane when you are in the catalog asset store. You can also create, update, and delete the sales catalogs in the catalog asset store.

Conclusion

This article described how to enable the sales catalog feature in the catalog asset store and how to disable them in the extended stores. This customization allows your organization to manage your sales catalog efficiently if your organization shares identical sales catalogs across multiple extended sites.



Resources



About the authors

Photo: Martin Forest

Martin Forest is a Software Developer for WebSphere Commerce at the IBM Toronto Lab, Canada. He designs and develops the Catalog Management user interface for the WebSphere Commerce Accelerator and the IBM Management Center.


Photo: Chris Galloway

Chris Galloway is an Information Developer for WebSphere Commerce at the IBM Toronto Lab, Canada.


Photo: Jenny Chan

Jenny Chan is a Software Quality Engineer for WebSphere Commerce at the IBM Toronto Lab, Canada.




Rate this page


Please take a moment to complete this form to help us better serve you.



 


 


Not
useful
Extremely
useful
 


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!