Like custom site configuration properties, the ShareableType components that are available in Site Administration depend on which Oracle ATG Web Commerce modules you are running. Commerce is configured with a registered ShareableType component, /atg/commerce/ShoppingCartShareableType, which designates the shopping cart and comparison lists as shareable resources and uses atg.ShoppingCart as its ID:

$class=atg.multisite.NucleusComponentShareableType

# The shareable type ID used by application code
id=atg.ShoppingCart

# The Nucleus components associated with this shareable type
paths=/atg/commerce/ShoppingCart,\
      /atg/commerce/catalog/comparison/ProductList

# Information used to find strings appropriate for localized UIs
displayNameResource=ShoppingCartShareableTypeName
resourceBundleName=atg.commerce.order.UserMessages

You register a ShareableType component by adding its full pathname to the shareableTypes property of the /atg/multisite/SiteGroupManager component. Commerce configures the SiteGroupManager like this:

shareableTypes+=/atg/commerce/ShoppingCartShareableType

After a Nucleus ShareableType component is created and registered, the components it represents become partitioned at run time such that a single instance of each component exists for each site (note that this is only the first step in the data sharing process; configuring sharing groups is the second and they are described below). The ATG platform services track which components are partitioned and make sure the correct component is affected when changes are made on any given site. For components that are not affiliated with a ShareableType, one instance of the component exists that is shared by all sites. Because of the default configuration of ShoppingCartShareableType, each new site you create gets its own shopping cart and product comparisons list.

You further refine how shareable types behave by setting up sharing groups in Site Administration. With a sharing group, you can specify multiple sites that share a single resource. For example, consider Commerce Reference Store, which has three sites: ATG Store US, ATG Store Germany, and ATG Home. Commerce Reference Store configures a sharing group, Site group US, that contains ATG Store US, ATG Home and a reference to the ShoppingCartShareableType component’s ID, meaning ATG Store US and ATG Home share a single shopping cart and a single comparison list. ATG Store Germany is not part of this group, so it has its own shopping cart and comparison list.

If you want all sites you create to share the same shopping cart and comparison list, you must modify either ShoppingCartShareableType or SiteGroupManager. To remove data partitioning for either the shopping cart or the comparison list, remove its component name from the ShoppingCartShareableType.paths property. To remove data partitioning for both the shopping cart and the comparison list, un-register the ShoppingCartShareableType component by removing it from the SiteGroupManager.shareableTypes property.

If you have additional session-scoped Nucleus components whose data you want shared by a subset of your application’s sites, you must create and register additional ShareableType components that point to them. Note that if your Nucleus components are part of a larger system, you may also need to do additional custom development to make sure that the entire system is site-aware. For example, making the shopping cart site-aware in Commerce also required updates to the entities that support the shopping cart in order for the entire system to work. See the ATG Platform Programming Guide for more details.