Develop > Presentation layer > Management Center framework > Customize the Management Center user interface > Create a new tool for the Management Center > Define OpenLaszlo classes instantiated in a tool definition class
Define 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
Before defining a filter, review the following classes:
To define a filter:
Procedure
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx.
- Create a directory to store the new 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 the new custom tool.
- Create an OpenLaszlo filter library file with this syntax: 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.
- Within the filter library file:
- Extend a class that extends wcfFilter. For example, extend the wcfObjectTypeFilter class.
- Specify the following attributes:
- filterType
- Used by the Management Center framework to identify the filter.
The following code snippet shows an example of these attributes defined within the new class:
- 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.
<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>
- Add this new filter library file to the application.
What to do next
After you complete the work:
- Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under the WCDE_INSTALL\workspace\LOBTools\WebContent directory. This is the default environment setting.
- Test the work by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
- Deploy your files to the production environment.
Related concepts
Management Center user interface
Related tasks
Create a new tool for the Management Center
Define OpenLaszlo classes instantiated in a tool definition class