Skip to main content

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

Martin Forest (mforest@ca.ibm.com), Software Developer, IBM
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.
Chris Galloway (crg@ca.ibm.com), Information Developer, IBM
Photo: Chris Galloway
Chris Galloway is an Information Developer for WebSphere Commerce at the IBM Toronto Lab, Canada.
Jenny Chan (jenchan@ca.ibm.com), Software Quality Engineer, IBM
Photo: Jenny Chan
Jenny Chan is a Software Quality Engineer for WebSphere Commerce at the IBM Toronto Lab, Canada.

Summary:  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.

Date:  19 Nov 2008
Level:  Intermediate PDF:  A4 and Letter (29KB | 6 pages)Get Adobe® Reader®
Activity:  421 views

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.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=352601
ArticleTitle=Tip: Enabling the sales catalog in the catalog asset store for extended sites in WebSphere Commerce
publish-date=11192008
author1-email=mforest@ca.ibm.com
author1-email-cc=Author2 cc address
author2-email=crg@ca.ibm.com
author2-email-cc=dwu@us.ibm.com
author3-email=jenchan@ca.ibm.com
author3-email-cc=dwu@us.ibm.com

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Rate a product. Write a review.

Special offers