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

Before defining a filter, review the following classes:

About this task

To define a filter:

Procedure

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  2. Complete one of the following steps:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx.
    • Introduced in Feature Pack 2In the Enterprise Explorer view, expand LOBTools > WebContent > config.
  3. Create a directory to store your new file.
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1OpenLaszlo library file WebSphere Commerce Version 7.0.0.0Feature Pack 1Use 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.
    Introduced in Feature Pack 2Definition file Introduced in Feature Pack 2Use 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.
  4. Create your new filter file:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1OpenLaszlo filter library file WebSphere Commerce Version 7.0.0.0Feature Pack 1Use 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.
    Introduced in Feature Pack 2Filter definition file Introduced in Feature Pack 2Use 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.
  5. Within the new filter file:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1OpenLaszlo filter library file WebSphere Commerce Version 7.0.0.0Feature Pack 1
    1. Extend a class that extends wcfFilter. For example, extend the lzx/commerce/foundation/restricted/ObjectFilter.lzx/wcfObjectTypeFilter class.
    2. 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" />
    3. 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> 
    Introduced in Feature Pack 2Filter definition file Introduced in Feature Pack 2
    1. 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.
    2. 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" />
    3. Add the new definition as a child element of the wcfBusinessObjectEditor definition:
      <BusinessObjectEditor definitionName="extMyTool"> 
      
      	... 
      
      	<!-- Add the filter definitions --> 
      	<ObjectTypeFilter baseDefinitionName="extMyFilter"/>
      
      	... 
      
      </BusinessObjectEditor>
  6. WebSphere Commerce Version 7.0.0.0Feature Pack 1Add this new filter library file to the application.

What to do next

After you complete your customization:
Version Steps
  1. Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under the workspace_dir\LOBTools\WebContent directory. This setting is the default environment setting.
  2. Test your changes by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  3. Deploy your changes to your production environment.
Introduced in Feature Pack 2
  1. Test your changes by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  2. Deploy your changes to your production environment.