Shareable type components can be registered or unregistered. Registering components identifies how the component will be shared across all sites:
Components that are not registered will be shared across all sites by default.
Components that are registered will be shared only when made part of a site group.
Components that are registered but are not member of a site group are unavailable to any site until added to a site group or are unregistered.
For example, to share a shopping cart across all sites, do not register the component.
To share a shopping cart across the sites within a site group, you must register the component and then add it to a site group. Once the registered component is added to the site group, it is available only to sites within site groups. If a site is not a member of a site group, the registered component will be unavailable.
If you register a component, for example a shopping cart, but do not add it to a site group, the component will not be available to any sites until it is added to a site group.
Shareable type components should be registered with the system only when it is necessary to manage or limit the scope of the shareable type component. For example, if all sites share a shopper’s login status, there is no need to define login status as a shareable type component. However, if the login is shared between only a few sites, then it you would register the login status as a shareable type component to apply the limitation.
If a shareable type component is currently registered but needs to be shared across all sites, the shareable type component must be unregistered by the site developer. This excludes the shareable type component from data sharing validation and ensures that it will not be limited within Site Administration.
Registering a Shareable Type
Components are registered with the /atg/multisite/SiteGroupManager
using the shareableTypes
property.
For example:
shareableTypes+=/atg/multisite/NewShareableType
Once you have registered your ShareableType
, all sites have their own instance of the shareableType
. However, if the ShareableType
remains unregistered, the ShareableType
is shared between all sites.
Once you have registered a ShareableType
, you can configure site groups that will share the ShareableType
you have created.