Defining the main Recipes tool definition
In this lesson, you define the main definition for the Recipes tool. The tool definition must extend the Business Object Editor class, which is the base class for all Management Center tools. The business object editor includes support for the menu, toolbar, search widget, explorer view, and utilities view. It is responsible for managing all user interactions that allow the user to edit the business objects that are declared with this business object editor.
About this task
- A single instance of
TopObjectDefinition
must be declared as a child of every business object editor. When the business object editor is initialized, an instance of this top object is instantiated. - At least one instance of
Filter
must be declared as a child of every business object editor. This filter is used to filter the objects that display in the explorer view and utilities view browse tab. - Multiple instances of
OrganizationalObjectDefinition
can be declared as children of a business object editor. Organization objects are instantiated only by declaring them in the template of the top object definition or of another organizational object definition. - At least one instance of
PrimaryObjectDefinition
must be declared as a child of every business object editor. There must be a primary object definition for every type of business object that can be returned through a search request or can be located by browsing for objects through the explorer view or utilities view. - Multiple instances of
SearchDefinition
can be declared as children of a business object editor. The search definitions are used to populate the list of search types available from the search area and utilities view search tab.
Procedure
- In the Enterprise Explorer view, expand .
- Right-click the recipe folder and select . Name your new file RecipeManagementToolDefinition.xml.
-
Copy and paste the following sample code into your new file.
<Definitions> <BusinessObjectEditor browseUtilityFilterTypes="MasterCategories,SalesCategories,Recipes" definitionName="cmc/recipe/RecipeManagement" displayName="${ExtRecipeResources.recipe_DisplayName}" explorerFilterTypes="Recipes" helpLink=""> <dependency localName="ExtRecipeResources" moduleName="cmc/recipe/ExtRecipeResources"/> <!-- Context value for the master catalog id --> <ContextValue parameterName="masterCatalogId"/> <InitService baseDefinition="cmc/catalog/CatalogInitService"/> <!-- Filter definitions --> <ObjectTypeFilter displayName="Recipes" filterType="Recipes" isDefault="true" objectTypes="RecipeCollectionNode,UnassignedRecipeNode,RecipeCollection"/> <ObjectTypeFilter baseDefinition="cmc/catalog/MasterCatalogGroupsFilter"/> <ObjectTypeFilter baseDefinition="cmc/catalog/SalesCatalogGroupsFilter"/> <!-- Recipe Top Objects --> <TopObjectDefinition baseDefinition="cmc/recipe/RecipeTopObjectDefinition"/> <!-- Recipe Organizational Objects --> <OrganizationalObjectDefinition baseDefinition="cmc/recipe/UnassignedRecipeNode"/> <OrganizationalObjectDefinition baseDefinition="cmc/recipe/RecipeCollectionNode"/> <!-- Recipe Primary Objects --> <PrimaryObjectDefinition baseDefinition="cmc/recipe/RecipeCollection"/> <PrimaryObjectDefinition baseDefinition="cmc/recipe/Recipe"/> <!-- search definitions --> <SearchDefinition baseDefinition="cmc/recipe/FindRecipes"/> <SearchDefinition baseDefinition="cmc/recipe/FindRecipeCollections"/> </BusinessObjectEditor> </Definitions>
-
Add the new Recipes tool to the application menu: