In addition to the ShoppingCartShareableType component that comes configured out of the box, Commerce Reference Store implements a second ShareableType component, /atg/store/RelatedRegionalStoresShareableType. RelatedRegionalStoresShareableType is a non-Nucleus shareable type component that represents the concept of regional peers of the same store. Commerce Reference Store has a sharing group, Related Regional Stores, that includes the CRS Store US and CRS Store Germany sites, along with the RelatedRegionalStoresShareableType component. This configuration indicates that CRS Store US and CRS Store Germany are regional peers.

Commerce Reference Store JSP code uses the /atg/dynamo/droplet/multisite/SharingSitesDroplet to determine which other sites are in a Related Regional Stores sharing group with the current site; for example, when CRS Store US is the current site, the SharingSitesDroplet returns CRS Store Germany, and vice versa. This approach allows Commerce Reference Store to implement one generic piece of JSP code that renders a widget that allows shoppers to switch among regional peer sites (see Rendering the Store and Country Pickers for more details and a code example). This approach also eliminates the need for site-specific JSP code that says “if site A is the current site, render widgets for sites B and C; if site B is the current site, render widgets for sites A and C, and so on.” Adding a new site to a group of regional peers only requires adding the site to the Related Regional Stores sharing group in Site Administration. No JSP code needs to change in order to retrieve and render the additional regional peer (although presentation code may need to change if there is not enough room for the additional site to appear in the UI).

The RelatedRegionalStoresShareableType component is defined in the /atg/store/RelatedRegionalStoresShareableType.properties file found in Commerce Reference Store’s Store.Estore.International module. Its definition looks like this:

$class=atg.multisite.ShareableType

# The shareable type ID used by application code
id=crs.RelatedRegionalStores

# Information used to find strings appropriate for localized UIs
displayNameResource=relatedRegionsShareableTypeName
resourceBundleName=
atg.projects.store.multisite.InternationalStoreSiteRepositoryTemplateResources

For more details on rendering the country picker in Commerce Reference Store, see Changing Site Context. For an overview of non-Nucleus shareable type components, see the Multisite Administration Guide. For details on creating non-Nucleus shareable type components, see the Multisite Request Processing chapter of the Platform Programming Guide.


Copyright © 1997, 2014 Oracle and/or its affiliates. All rights reserved. Legal Notices