Management Center modeling guidelines for extended sites
Each of the Management Center tools is modeled with support for extended sites. These guidelines describe how to model object definitions within an extended sites-enabled tool.
Objects within an extended sites-enabled tool can be local or inherited. A local object is an object that is owned by the currently selected store and an inherited object is an object that is owned by a referenced asset store. To distinguish between local and inherited objects, the Management Center requires two object definitions - one for the local object and one for the inherited object. Since local primary business objects and inherited primary business objects are modeled as two separate object definitions in the extended sites store, you must duplicate all object definitions that are inherited from your asset store.
There are three types of related object definitions: a base object definition, local object definition, and inherited object definition. The base object definition is used to create a common ancestor for all object types. Set both the base and inherited object definitions to createable="false" so that the user interface prevents you from creating objects of that type.
- Move all store-dependent object definitions to a base definition
and name the objectType
baseABC
. To determine if a property is store-dependent, consider whether it would need to be overridden at the extended site level. For example, the product descriptions in WebSphere Commerce are currently store-independent, which means that every store that has access to a product sees the same product description. If you customize WebSphere Commerce to make the product description store-dependent, you need to move the object definition for the product description into the base definition.Note: The underlying schema must also support store-dependent properties. For example, since the current database table that stores merchandising associations (MASSOCCECE) in WebSphere Commerce has a column for the store ID, products can have different merchandising associations in different stores. You can also track a store-specific merchandising association for a product. - Duplicate all reference business object definitions for the references
that are store-dependent and clearly mark them as inherited objects.
Name the
objectType
of the inherited reference object definitions to indicate that they are inherited. When creating this type of object, determine if the reference itself will be store-dependent.For example, a merchandising association is a reference business object that creates a reference between a source product and a target product. If both the source product and the target product are from an asset store, you need to determine if the user will create a merchandising association on the asset store or on an extended site that inherits from that asset store. In the first case, all extended sites that inherit from that asset store will see the merchandising association. In the second case, only the extended site on which the merchandising association was created will see the merchandising association. To support both of these scenarios, the merchandising association reference business object must be store-dependent.
- Set compatibleObjectTypes to the objectType of the extended site
store business object. When the object is copied, the newly created
object is marked as an extended site store business object as opposed
to an inherited business object.
Syntax examples Syntax type Code sample OpenLaszlo <class name="catCatalogGroupPrimaryObjectDefinition" extends="wcfPrimaryObjectDefinition" objectType="CatalogGroup" objectGroups="CatalogGroupAlias" compatibleObjectTypes="SalesCatalogGroup" ...
Definition <PrimaryObjectDefinition definitionName="CatalogGroup" objectType="CatalogGroup" objectGroups="CatalogGroupAlias" compatibleObjectTypes="SalesCatalogGroup" ...
- Add a wcfFalseEnablementCondition element as a child
of your inherited primary business objects.
Syntax examples Syntax type Code sample OpenLaszlo <!--- Condition to disable the object creation in certain store types. --> <catStoreTypeCatalogObjectCreationRestriction/>
Definition <!--- Condition to disable the object creation in certain store types. --> <EnablementOrCondition baseDefinitionName="catStoreTypeCatalogObjectCreationRestriction"/>
Typically, inherited objects cannot be created by the framework. However, there are two exceptions to this rule in WebSphere Commerce. Although you can create inherited merchandising associations and prices in the extended site, these are both reference objects, not primary objects. Inherited primary objects are never created in the extended site. In addition, inherited objects cannot have enablement conditions, while local objects can have enablement conditions. Define a wcfEnablementCondition with the list of storeTypes where the creation of these objects is allowed. Use this attribute for extended sites primary business objects that need to prevent create and copy operations by store type.
- Update the response JSP page to return the objectStoreId if you
created your own inherited object (such as a merchandising association
object) and want users who are logged into the Management Center to
be able to create the object at the asset store level while logged
into an extended sites store. This is supported for both merchandising
associations and prices.
When you invoke the Create service, the Management Center user interface invokes a create request and the appropriate response JSP page creates the response for the request. This response contains the information related to the result of the request, including any changed information that the Management Center requires as a result of the request. When the object is inherited from the asset store, you must add the following line to the response JSP to return the objectStoreId:
<objectStoreId>.{param.storeID}</objectStoreId>
- Declare the Create service only in the local object definition
to prevent the inherited object from being created.
Syntax examples Syntax type Code sample OpenLaszlo <!--- Create service to create a new category. --> <wcfCreateService sendDefaultLanguageProperties="true" url="/cmc/CreateCatalogGroup"> <wcfServiceParam name="storeId"/> <wcfServiceParam name="defaultLanguageId" parameterName="languageId"/> <wcfServiceParam name="isTopCategoryTrue" parameterName="isTopCategory" value="true" optional="false"> <wcfEnablementCondition conditionId="objectTypeCondition" checkObjectDefinition="true" propertyName="objectType" parentProperty="true" enablementValue="Catalog"/> </wcfServiceParam> <wcfServiceParam name="isTopCategoryFalse" parameterName="isTopCategory" value="false" optional="false"> <wcfEnablementCondition conditionId="objectTypeCondition" negate="true" checkObjectDefinition="true" propertyName="objectType" parentProperty="true" enablementValue="Catalog"/> </wcfServiceParam> <wcfServiceParam name="catalogId" propertyName="catalogId" parentProperty="true" parentType="Catalog" optional="false"/> <wcfServiceParam name="catalogIdentifier" propertyName="identifier" parentProperty="true" parentType="Catalog" optional="true"/> </wcfCreateService>
Definition <!--- Create service to create a new category. --> <CreateService sendDefaultLanguageProperties="true" url="/cmc/CreateCatalogGroup"> <ServiceParam name="storeId"/> <ServiceParam name="defaultLanguageId" parameterName="languageId"/> <ServiceParam name="isTopCategoryTrue" parameterName="isTopCategory" value="true" optional="false"> <EnablementCondition conditionId="objectTypeCondition" checkObjectDefinition="true" propertyName="objectType" parentProperty="true" enablementValue="Catalog"/> </ServiceParam> <ServiceParam name="isTopCategoryFalse" parameterName="isTopCategory" value="false" optional="false"> <EnablementCondition conditionId="objectTypeCondition" negate="true" checkObjectDefinition="true" propertyName="objectType" parentProperty="true" enablementValue="Catalog"/> </ServiceParam> <ServiceParam name="catalogId" propertyName="catalogId" parentProperty="true" parentType="Catalog" optional="false"/> <ServiceParam name="catalogIdentifier" propertyName="identifier" parentProperty="true" parentType="Catalog" optional="true"/> </CreateService>
Example
The following sample code illustrates how to model extended sites business objects. The catalog group object definitions in this example demonstrate the typical method for modeling local and inherited object definitions. For example:- A base object definition is used to define all of the common property definitions, child object definitions, and service definitions.
- The local and inherited object definitions are declared using the base definition as their base type.
- The naming convention used to declare base object types is BaseABC, the naming convention for inherited object types is InheritedABC, and the naming convention for local objects is ABC.
- Base definitions are identified by specifying
isBaseDefinition="true"
in the object definition. For more information aboutbaseType
andisBaseDefinition
, see wcfObjectDefinition. - You must register base definitions using wcfRegisterObjectDefinition.
- An object group alias (
CatalogGroupAlias
) is declared in the base definition. - The object group is used in the common properties view and the common list view declarations to see both local and inherited catalog groups.
Syntax type | Code sample |
---|---|
OpenLaszlo |
|
Definition |
|