Defining a filter
When you open a tool and select a store, the Management Center framework populates the explorer view with each child of the top object. Filters are used to control the set of child objects that are visible in the explorer view.
Before you begin
About this task
Procedure
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- Complete one of the following steps:
- In the Enterprise Explorer view, expand .
- In the Enterprise Explorer view, expand .
- Create a directory to store your new file.
Option Description OpenLaszlo library file Use a directory structure similar to the following example: LOBTools/WebContent/WEB-INF/src/lzx/your_company_name/Management_Center_component, where Management_Center_component is the name of your new custom tool. Definition file Use a directory structure similar to the following example: LOBTools/WebContent/config/your_company_name/Management_Center_component, where Management_Center_component is the name of your new custom tool. - Create your new filter file:
Option Description OpenLaszlo filter library file Use the following syntax to create this file: Management_Center_componentname in camel caseFilterDefinitions.lzx
. For example, CatalogManagementFilterDefinitions.lzx. Within this file, the class name must follow this syntax:three-character Management Center component code in lower caseManagement_Center_componentFilter
. For example, catMasterCatalogGroupsFilter.Filter definition file Use the following syntax to create this file: Management_Center_componentname in camel caseFilterDefinitions.def
. For example, CatalogManagementFilterDefinitions.def. Within this file, the definition name must follow this syntax:three-character Management Center component code in lower caseManagement_Center_componentFilter
. For example, catMasterCatalogGroupsFilter. - Within the new filter file:
Option Description OpenLaszlo filter library file - Extend a class that extends wcfFilter. For example, extend the lzx/commerce/foundation/restricted/ObjectFilter.lzx/wcfObjectTypeFilter class.
- Specify the following attributes:
- filterType
- Used by the Management Center framework to identify the filter.
- displayName
- Used as the text in the filter selector list.
- objectTypes
- Identifies the objects that are visible in the explorer view when the filter is active.
The following code snippet shows an example of these attributes defined within the new class:<class name="catMasterCatalogGroupsFilter" extends="wcfObjectTypeFilter" filterType="MasterCategories" displayName="${catalogResources.masterCategoriesFilterTitle.string}" objectTypes="UnassignedCatalogEntries,Catalog,InheritedCatalog,ChildCatalogGroup,ChildInheritedCatalogGroup" />
- Instantiate the new class as a child of the wcfBusinessObjectEditor
instance:
<class name="extMyTool" extends="wcfBusinessObjectEditor"> ... <!—- Add the instantiations for the filter definitions --> <extMyFilter/> ... </class>
Filter definition file - Create a definition that extends a class that extends wcfFilter. For example, create a definition that extends the lzx/commerce/foundation/restricted/ObjectFilter.lzx/wcfObjectTypeFilter class.
- Specify the following attributes:
- filterType
- Used by the Management Center framework to identify the filter.
- displayName
- Used as the text in the filter selector list.
- objectTypes
- Identifies the objects that are visible in the explorer view when the filter is active.
The following code snippet shows an example of these attributes defined within the new definition:<ObjectTypeFilter definitionName="catMasterCatalogGroupsFilter" filterType="MasterCategories" displayName="${catalogResources.masterCategoriesFilterTitle}" objectTypes="UnassignedCatalogEntries,Catalog,InheritedCatalog, ChildCatalogGroup,ChildInheritedCatalogGroup" />
- Add the new definition as a child element of the wcfBusinessObjectEditor
definition:
<BusinessObjectEditor definitionName="extMyTool"> ... <!-- Add the filter definitions --> <ObjectTypeFilter baseDefinitionName="extMyFilter"/> ... </BusinessObjectEditor>
- Add this new filter library file to the application.
What to do next
Version | Steps |
---|---|
|
|
|