Develop > Presentation layer > Management Center framework > Customize the Management Center user interface
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, duplicate all object definitions that are inherited from the 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.
When modeling object definitions in a tool, ensure that you:
- 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, move the object definition for the product description into the base definition.
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, 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. For example:
<class name="catCatalogGroupPrimaryObjectDefinition" extends="wcfPrimaryObjectDefinition" objectType="CatalogGroup" objectGroups="CatalogGroupAlias" compatibleObjectTypes="SalesCatalogGroup" ...
- Add a wcfFalseEnablementCondition element as a child of the inherited primary business objects. For example:
<!--- Condition to disable the object creation in certain store types. --> <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 the 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, 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.
<!--- 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>
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 about baseType and isBaseDefinition, see wcfObjectDefinition.
- 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.
<wcfRegisterObjectDefinition objectType="BaseCatalogGroup" objectDefinitionClass="catBaseCatalogGroupPrimaryObjectDefinition"/> <!--- This class defines the base object from which CatalogGroup and Inherited CatalogGroup are derived. --> <class name="catBaseCatalogGroupPrimaryObjectDefinition" extends="wcfPrimaryObjectDefinition" isBaseDefinition="true" objectType="BaseCatalogGroup" displayNameProperty="identifier" idProperty="catgroupId" displayName="${catalogResources.masterCategory_DisplayName.string}" newDisplayName="${catalogResources.masterCategory_NewDisplayName.string}" objectGroups="CatalogGroupAlias" compatibleObjectTypes="SalesCatalogGroup" propertiesClass="catCategoryProperties" searchType="FindCategories" helpLink="tasks/tpnadcat.htm" detailsViewHeaderText="${catalogResources.UtilityPaneHeaderText.string}"> <!--- Property Definition for the identifier property of the category --> <wcfPropertyDefinition displayName="${catalogResources.categoryCode_DisplayName.string}" propertyName="identifier" type="string" required="true" maximumSize="254"/> <!--- Property Definition for the field1 property of the category --> <wcfPropertyDefinition displayName="${catalogResources.categoryField1_DisplayName.string}" propertyName="field1" type="string" maximumSize="254"/> <!--- Property definition for the available objects which reference this category. The list includes sales catalogs, merchandising associations and promotions. --> <wcfPropertyDefinition propertyName="referenceType"> <wcfPropertyValue displayName="${catalogResources.salesCatalogReference.string}" value="SalesCatalogs"/> <wcfPropertyValue displayName="${catalogResources.merchandisingAssociationReference.string}" value="MerchandisingAssociations"/> <wcfPropertyValue displayName="${catalogResources.promotionReference.string}" value="Promotions"/> </wcfPropertyDefinition> <!--- Refresh Service to refresh this category. Calling this will fetch the category's details again from the server. --> <wcfRefreshService url="/cmc/GetCatalogGroup"> <wcfServiceParam name="storeId" /> <wcfServiceParam name="masterCatalogStoreId"/> <wcfServiceParam name="catalogId" propertyName="catalogId" parentProperty="true" parentType="Catalog" /> <wcfServiceParam name="catgroupId" propertyName="catgroupId"/> </wcfRefreshService> <!--- Retrieves the {@link catCatalogGroupDescription} child objects. --> <wcfGetChildrenService url="/cmc/GetCatalogGroupChildren-LanguageDescriptions" objectTypes="CatalogGroupDescription"> <wcfServiceParam name="storeId"/> <wcfServiceParam name="catalogId" propertyName="catalogId" parentProperty="true" parentType="Catalog"/> </wcfGetChildrenService> <!--- Retrieves the {@link catChildCatalogGroup} child objects. --> <wcfGetChildrenService url="/cmc/GetCatalogGroupChildren-CatalogGroup" objectTypes="ChildCatalogGroup"> <wcfServiceParam name="storeId"/> <wcfServiceParam name="defaultLanguageId"/> <wcfServiceParam name="catalogId" propertyName="catalogId" parentProperty="true" parentType="Catalog" /> </wcfGetChildrenService> <!--- Retrieves the {@link catChildProduct}, {@link catChildCatalogGroupSKU}, {@link catChildBundle} and {@link catChildKit} child objects. --> <wcfGetChildrenService url="/cmc/GetCatalogGroupChildren-CatalogEntry" objectTypes="ChildProduct,ChildInheritedProduct, ChildCatalogGroupSKU,ChildInheritedCatalogGroupSKU, ChildBundle,ChildInheritedBundle, ChildKit,ChildInheritedKit"> <wcfServiceParam name="storeId"/> <wcfServiceParam name="defaultLanguageId"/> <wcfServiceParam name="catalogId" propertyName="catalogId" parentProperty="true" parentType="Catalog" /> </wcfGetChildrenService> <!--- Retrieves the {@link catChildCatalogGroup} object that see this object. --> <wcfGetReferencesService url="/cmc/GetMasterCatalogGroupParent-ReferenceCatalogGroup"> <wcfServiceParam name="storeId"/> <wcfServiceParam name="masterCatalogId"/> <wcfServiceParam name="masterCatalogStoreId"/> <wcfServiceParam name="catgroupId" propertyName="catgroupId"/> <wcfServiceParam name="defaultLanguageId"/> </wcfGetReferencesService> <!--- Retrieves the {@link catAttachmentReference} objects that see this object. --> <wcfGetChildrenService url="/cmc/GetAttachmentReferencesForCatalogGroup" objectTypes="AttachmentReference,BusinessObjectToInheritedAttachment,InheritedBusinessObjectToInheritedAttachment"> <wcfServiceParam name="storeId"/> <wcfServiceParam name="catgroupId" propertyName="catgroupId"/> </wcfGetChildrenService> <!--- Update service to update a category. --> <wcfUpdateService sendDefaultLanguageProperties="true" url="/cmc/UpdateCatalogGroup"> <wcfServiceParam name="storeId"/> <wcfServiceParam name="defaultLanguageId" parameterName="languageId"/> <wcfServiceParam name="catalogId" propertyName="catalogId" parentProperty="true" parentType="Catalog" /> <wcfServiceParam name="catgroupId" propertyName="catgroupId"/> <wcfServiceParam name="owningStoreId" propertyName="objectStoreId" optional="false"/> <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> </wcfUpdateService> <!--- Delete service to delete a category. --> <wcfDeleteService url="/cmc/DeleteCatalogGroup"> <wcfServiceParam name="storeId"/> <wcfServiceParam name="catalogId" propertyName="catalogId" parentProperty="true" parentType="Catalog" /> <wcfServiceParam name="catgroupId" propertyName="catgroupId"/> <wcfServiceParam name="owningStoreId" propertyName="objectStoreId" optional="false"/> </wcfDeleteService> <!--- Validator to check and pass the warning message when there is no parent specified for the product This class is defined in restricted/objectDefinitions/CatalogValidator.lzx --> <wcfRequiredParentValidator validatorId="parentExistsCheck" validatorType="requiredParentCatalogValidator" errorMessage="${catalogResources.missingRequiredCategoryParent.string}"/> <!--- Child object definition for the description related fields of a category. This is object is language sensitive. This class is defined in CatalogCommonObjectDefinitions.lzx --> <catCatalogGroupDescription/> <!--- This navigation list definition is used to display {@link catChildProduct}, {@link catChildCatalogGroupSKU}, {@link catChildKit} and {@link catChildBundle}. --> <wcfNavigationListDefinition name="childCatEntriesNavList" listClass="catCatalogEntryChildList" listTitle="${catalogResources.catalogEntriesList.string}" displayName="${catalogResources.catalogEntriesListDisplayName.string}" isDefault="true" toolbarIcon="catalogEntriesListToolbarIcon" /> <!--- This navigation list definition is used to display {@link catChildCatalogGroup}. --> <wcfNavigationListDefinition name="CategoryChildList" listClass="catCategoryChildList" listTitle="${catalogResources.categoriesList.string}" displayName="${catalogResources.subCategoriesListDisplayName.string}" toolbarIcon="categoryListToolbarIcon" /> <!--- Parent Reference object definition between the category and another child category. This indicates that a category can be a parent of another category. --> <catChildCatalogGroup/> <!--- Parent Reference object definition between the category and a child product. This indicates that a category can be a parent of a product. --> <catChildProduct/> <!--- Parent Reference object definition between the catalog group and its child SKUs. This indicates that a category can be a parent of a SKU. This class is defined in CatalogCommonObjectDefinitions.lzx --> <catChildCatalogGroupSKU/> <!--- Parent Reference object definition between the category and a child bundle. This indicates that a category can be a parent of a bundle. --> <catChildBundle/> <!--- Parent Reference object definition between the category and a child kit. This indicates that a category can be a parent of a kit. --> <catChildKit/> </class> <wcfRegisterObjectDefinition objectType="CatalogGroup" objectDefinitionClass="catCatalogGroupPrimaryObjectDefinition"/> <class name="catCatalogGroupPrimaryObjectDefinition" extends="wcfPrimaryObjectDefinition" objectType="CatalogGroup" baseType="BaseCatalogGroup" icon="catalogGroupIcon" headerIcon="catalogGroupHeaderIcon"> <!--- Condition to disable the object creation in certain store types. --> <catStoreTypeCatalogObjectCreationRestriction/> <!--- 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> <!--- Reference object definition for the attachment of the catalog group This class is defined in CatalogCommonObjectDefinitions.lzx --> <catCatalogGroupAttachmentReference/> <!--- Reference object definition for the asset store attachment of the catalog group This class is defined in CatalogCommonObjectDefinitions.lzx --> <catCatalogGroupInheritedAttachmentReference/> </class> <wcfRegisterObjectDefinition objectType="InheritedCatalogGroup" objectDefinitionClass="catInheritedCatalogGroupPrimaryObjectDefinition"/> <!--- --> <class name="catInheritedCatalogGroupPrimaryObjectDefinition" extends="wcfPrimaryObjectDefinition" objectType="InheritedCatalogGroup" baseType="BaseCatalogGroup" icon="inheritedCatalogGroupIcon" headerIcon="inheritedCatalogGroupHeaderIcon" compatibleObjectTypes="CatalogGroup,SalesCatalogGroup"> <!--- Parent Reference object definition between the catalog group and its inherited child SKUs. This indicates that a category can be a parent of a SKU. This class is defined in CatalogCommonObjectDefinitions.lzx --> <catChildInheritedCatalogGroupSKU/> <!--- Parent Reference object definition between an inherited category and another inherited child category. This indicates that an inherited category can be a parent of another inherited category. --> <catChildInheritedCatalogGroup/> <!--- Parent Reference object definition between the category and a child inherited product. This indicates that a category can be a parent of a product. --> <catChildInheritedProduct/> <!--- Parent Reference object definition between the category and a child bundle. This indicates that a category can be a parent of a bundle. --> <catChildInheritedBundle/> <!--- Parent Reference object definition between the category and an inherited child kit. This indicates that a category can be a parent of a kit. --> <catChildInheritedKit/> <!--- Reference object definition for the asset store attachment of the catalog group This class is defined in CatalogCommonObjectDefinitions.lzx --> <catInheritedCatalogGroupInheritedAttachmentReference/> </class>
Related information
Tutorial: Supporting extended sites in the Recipes tool