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:  

Using the store path model

Prerequisites

For this section, you are required to have an extended site environment up and running. You will execute some simple SQL statements to verify and review data related to an extended site deployment.

The purpose behind extended sites is to enable a system to manage multiple business assets for growing businesses.

As a business grows, more stores are created with mutually exclusive available-to-market strategies, each targeting different kinds of customers and different types of geographies.

Extended sites offer the capability to share common business assets among these mutually exclusive stores. This allows business assets to become common to all stores. Instead of duplicating all necessary assets, each site needs to select only those assets they require. This way, the extended site framework keeps the main mission statement of the business simple. The business assets stay simple to maintain in the world of IT.

It only makes sense that the engine powering the extended sites framework is a common repository of code that can drive this capability. Thus, the code that drives the extended site system is itself a common reusable business asset. This makes a business proud to proclaim that their software is also a valuable business asset. It enables IT deployments to be on the offensive, reusing on success, rather than on the defensive constrained to complications.

The design intentions behind the Store Path Model is to ensure that a common repository of code interacts with a set of rules that are easily changed in the means of store relationships and store relationship types. For this section, you will go through some steps to get a basic understanding of the Store Path model in WebSphere Commerce.

Store path basics

The store paths are used as the mechanism for understanding which stores share assets and which stores do not require to share common assets. As the name suggests, the higher up the path you go from a single hosted store to the asset store, the more stores can participate in the sharing of assets. If your store path makes it all the way up to the asset store, then all stores following that path share that asset.

For a basic understanding of the store path model, take a look at the database that is running on your WebSphere Commerce instance.

  1. Ensure the test environment is started.
  2. From your database, prepare to execute an SQL statement. For example, with the toolkit, open a browser and type the following URL: http://localhost/webapp/wcs/admin/servlet/db.jsp.
  3. From your database, execute the following query:

    Listing 1. Database query: store relationships
    select * from STOREREL where STORE_ID = 
    (select STOREENT_ID from STOREENT where IDENTIFIER = 'Example1')

    Example1 is the name of the hosted store you wish to inspect the data.

The results of running this SQL statement (Listing 1) on your database show a lot about the relationships. These store relationships were populated when you created your extended site hosted stores upon deployment.

What is a store relationship?

The store relationship is the store that your customers shop within and its relationship with other stores of business assets it wants to reuse. It is best practice that the store with the business assets to be shared belongs to the asset store - the asset store being a pseudo store for the purposes of encompassing all shared assets.

In particular, the RELATEDSTORE_ID column is the store to which the hosted store has a relationship to. Of course, this is an open ended table to allow for a number of different cominations of relationships, but what is of most interest is the relationship between the hosted store and the asset or the relationship between the asset store, the asset, and the hosted store. With all of this concerning assets - what then is an asset in terms of an extended site framework? There has been much talk about "sharing business assets". Therefore, more details about those assets are required.

Shared assets

Shared assets in an e-commerce environment that have been heuristically categorized from a handful of the WebSphere Commerce components. Thus, as you look at the Store Relationship Types, they are organized by what may be thought of at first glance, components.

For example, execute the following SQL on the database to which you deployed your extended site instance:

  1. Ensure the test environment is started.
  2. From your database, prepare to execute an SQL statement. For example, with the toolkit, open a browser and type the following URL: http://localhost/webapp/wcs/admin/servlet/db.jsp.
  3. From your database, execute the following query:

    Listing 2. Database query: store relationship types
    select STRELTYP_ID,NAME from STRELTYP

Investigating the results of this SQL statement, it shows that a large number of store relationship types show as representation of different types of assets. The result STRELTYP.NAME that equals com.ibm.commerce.catalog is a representation of the catalog related assets that your business utilizes for organizing, selling, and marketing your company products.

Take a further look at one of your hosted stores with respect to the com.ibm.commerce.catalog grouping assets:

  1. Ensure the test environment is started.
  2. From your database, prepare to execute an SQL statement. For example, with the toolkit, open a browser and type the following URL: http://localhost/webapp/wcs/admin/servlet/db.jsp.
  3. From your database, execute the following query:

    Listing 3. Database query: store relationship types
    SELECT a.IDENTIFIER as hostedStore,b.IDENTIFIER as relatedStore,NAME 
    FROM STOREREL,STRELTYP,STOREENT a, STOREENT b 
    WHERE
    STRELTYP.STRELTYP_ID = STOREREL.STRELTYP_ID
    and STRELTYP.NAME = 'com.ibm.commerce.catalog'
    and a.STOREENT_ID = STOREREL.STORE_ID
    and b.STOREENT_ID = STOREREL.RELATEDSTORE_ID
    and a.identifier = 'Example1'

The store identifier used to search for catalog store relationship types is Example1.

Investigating the results of this SQL statement, it shows that there is a relationship between the hosted store, the catalog assets, and itself being the related store. There is also an additional relationship between the hosted store, the catalog assets, and the Catalog Asset Store. This allows your hosted store to provide products not only established at its own hosted store level, but also at the shared level of the common Catalog Asset Store. Thus, what was previously thought of as a component or data set in the e-commerce world, the catalog, is now regarded as shared assets that you can reuse in different ways by different stores.

Asset sharing rules

Based on the SQL statements run so far on your extended site environment, there are some rules on asset sharing. Since a hosted store can have relationships with itself and/or other stores and/or the Asset Store, the following requirements can be achieved:


Table 1. Requirements enabled by the Store Path model
Requirement enabledRelationship levelData example
Hosted store assets are exclusive.The hosted store has only an entry referencing itself.A single entry in STOREREL, where STORE_ID and RELATEDSTORE_ID is the hosted store.
Hosted store assets are shared with the asset store.The hosted store references itself and the asset store.A single entry in STOREREL, where STORE_ID and RELATEDSTORE_ID are the hosted store. A single entry in STOREREL, where STORE_ID is the hosted store and the RELATEDSTORE_ID is the asset store.
The hosted store inherits assets from the asset store only.The hosted store references the asset store.A single entry in STOREREL, where STORE_ID is the hosted store and the RELATEDSTORE_ID is the asset store.
The hosted store assets are exclusive.The hosted store has no levels defined.There are no entries in the STOREREL table for the asset.

The STOREREL.sequence and STOREREL.state fields also provide granular control in how store relationships are enabled or prioritized. For more information, see Relationships between stores.

Section conclusion

It is important to recap the big picture of what the store relationships and store relationship types are providing for your environment. A great benefit for these requirements achieved from a simple store path structure is that the software enabling this framework remains simple, reusable, scalable, and powerful. This will be displayed in this tutorial as you extend the store path model to enable some real-life e-commerce scenarios.

3 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