Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

developerWorks Community:

  • Close [x]

Creating solutions on the extended sites framework in WebSphere Commerce

Part 1: Using the command layer

Michael DJ Shields (mshields@crossview.com), Solution Architect, CrossView, Inc.
Photo of Michael Shields
Michael Shields works for CrossView®, Inc. He has over a decade consulting and developing strategies to best leverage WebSphere Commerce to match client business requirements. He also has over twelve years of developing interactive web solutions using J2EE, PHP, Zend Framework, Adobe products, HTML, CSS, AJAX, jQuery, DOJO and JavaScript. Michael holds 5 patents, published over 12 tutorials on the WebSphere Commerce Information Center, and 10 tutorials on the developerWorks WebSphere Commerce zone. He holds over 12 technical certifications and a designation as a project manager (PMP).
Quan Nguyen (qnguyen@crossview.com), Solution Architect, CrossView, Inc.
Photo of Quan Nguyen
Quan Nguyen has been working for CrossView, Inc., since 1999, consulting and developing e-business solutions by leveraging WebSphere Commerce. As a Solution Architect, he has over a decade of experience, working with major B2C and B2B companies to implement robust WebSphere Commerce strategies, fulfilling their business requirements.
Raj Sanghvi (rsanghvi@crossview.com), Solution Architect, CrossView, Inc.
Photo of Raj Sanghvi
Raj Sanghvi is a Solution Architect for CrossView, Inc. He has over 6 years of experience consulting in WebSphere Commerce working for different sub systems. He also has over 10 years of experience doing software development using J2EE, Oracle, HTML, XML, and SOAP. He holds over 8 technical certifications and a designation as a project manager (CAMP). He has a Master's degree in Computer Science.
Amar Desai (amar.desai@atech.com), Solution Architect, Ascendant Technology
Photo of Amar Desai
Amar Desai is a Solution Architect at Ascendant® Technology. He has helped many top retail, banking, and dining companies materialize their vision in the e-commerce space using WebSphere Commerce. He has a penchant for applying the latest web application trends such as social commerce, precision marketing, and mobile commerce. He is a certified WebSphere Commerce developer and administrator.

Summary:  The purpose of extended sites in WebSphere® Commerce is to ensure sharable assets among different stores. This tutorial provides insight into different ways to use the store path resource that is an available-to-market framework in WebSphere Commerce. A new concept is introduced in this tutorial that provides provide granular levels of sharing with a sub-set of assets. Also, this tutorial describes how to properly extend an EJB to use the BeanFinderObject for your findBy methods to incorporate sharing queries. You will learn how to better ensure that your store's conglomerate is fully capable to share all of the integral assets to make your business successful, while keeping your software reusable and easy to maintain.

Date:  20 Oct 2010
Level:  Intermediate PDF:  A4 and Letter (143 KB | 53 pages)Get Adobe® Reader®

Activity:  23828 views
Comments:  

Conclusion

Customizing WebSphere Commerce to meet business logic starts with defining what assets your are dealing with. Categorizing your business assets can also mean finding commonalities with those store relationship types already defined in WebSphere Commerce. The following are the store relationship types already defined in an extended site in an available-to-market deployment:

  • com.ibm.commerce.businessPolicy
  • com.ibm.commerce.campaigns
  • com.ibm.commerce.catalog
  • com.ibm.commerce.command
  • com.ibm.commerce.hostedStore
  • com.ibm.commerce.price
  • com.ibm.commerce.referral
  • com.ibm.commerce.segmentation
  • com.ibm.commerce.URL
  • com.ibm.commerce.view
  • com.ibm.commerce.inventory
  • com.ibm.commerce.storeitem
  • com.ibm.commerce.channelStore
  • com.ibm.commerce.propertyFiles
  • com.ibm.commerce.currency.conversion
  • com.ibm.commerce.currency.format
  • com.ibm.commerce.currency.supported
  • com.ibm.commerce.currency.countervalue
  • com.ibm.commerce.measurement.format
  • com.ibm.commerce.contract
  • com.ibm.commerce.promotion
  • com.ibm.commerce.shipping.shipmode
  • com.ibm.commerce.shipping.shipjurisdiction
  • com.ibm.commerce.shipping.calculation

If you feel your business logic is dealing with assets that do not belong to the available-to-market store relationship types, then you can create a custom store relationship type.


Listing 12. Example store relationship type entry

insert into streltyp (name,streltyp_id) 
values ('com.dw.commerce.storepath.affiliate',5);

This new store relationship type may be mutually exlcusive to other store relationship types, or they can be considered a sub-set of assets to another store relationship type. You can create new store relationship types to provide more granular control of existing WebSphere Commerce assets. That way, you do not have to write code specific to a single store, but have a common code base that any store can use based on their participation in the store relationship entries. If you pull assets for one store relationship type in the same call as it belongs to another set of assets, then you may have to filter the returning results by inspecting the returning store identifier value and ignoring the value if that store identifier belongs to another store relationship. For example, if you are determining assets for affiliates on the store level only, but the catalog store relationship type is defined on the asset store level, then you may have to inspect the returning related store identifier value to ensure no conflict.

There is a simple utility class you can use to pull all the related store identifiers for a given store relationship type and store identifier, use com.ibm.commerce.common.helpers.StoreUtil.getStorePath(storeId,storePathType). An array of store identifier values is returned. The index of the array is congruent with the sequence value from the STOREREL table. The way you use that data is up to you, either use all values to find corresponding assets by the foreign key store identifier, or use a specific index from the array based on some conditional rule.

When dealing with entity beans, you can append a sub-query based on the store relationships directly into the EJB UserFinderDescriptor finder type FinderHelper method. This is done by including a BeanFinderObject class that the entity bean picks up to merge the SQL statement.

8 of 11 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=551401
TutorialTitle=Creating solutions on the extended sites framework in WebSphere Commerce
publish-date=10202010
author1-email=mshields@crossview.com
author1-email-cc=dwu@us.ibm.com
author2-email=qnguyen@crossview.com
author2-email-cc=dwu@us.ibm.com
author3-email=rsanghvi@crossview.com
author3-email-cc=dwu@us.ibm.com
author4-email=amar.desai@atech.com
author4-email-cc=dwu@us.ibm.com