Example: Modifying list filter options

The Overview, Home, and other pages of the TCM application use list filters to control which tasks, meetings and polls are displayed for a user. (See Filtering lists for more information.) List filters can also appear on the Tasks, Meetings, Polls, Discussions, and Email tabs. On the Tasks, Meetings, Polls, Discussions, and Email tabs, list filters work in conjunction with the Mine Only checkbox. On the Home tab, this checkbox is hidden and is in the selected state.

If you are modifying the list filters for the Home or Overview tab, your changes will apply to three different objects - tasks, meetings, and polls. Be sure that your changes are compatible with each of the object types.

The following procedures illustrate how to change the list options displayed for a list filter, and also how to redefine what one of the options in the list means.

Change the default filter for Tasks

  1. Open TCMConfig.xml in an XML editor. Search the file for <filter id="TasksFilter">
  2. Each of the possible task filters is a label within this section. By default, the available options are All, Open, Today, Next 7 Days, Assigned by Me, Closed, and Closed in Last 7 Days.
  3. Locate the current default filter. (The state is set to true for the default.) For task filters, Open is the default:
        <!-- tasks filter -->
    <filter id="TasksFilter">
    <module>FilterBar</module>
    <options target="filter1">
    <option>
    <label localKey="cwexml.TCMConfig_xml.TasksFilter.allLabel">All</label>
    </option>
    <option>
    <state>true</state>
    <label localKey="cwexml.TCMConfig_xml.TasksFilter.openLabel">Open</label
    >
    <value type="xml">
    <conditions>
    <condition id="byProperty" type="task" operation="lt">
    <propsymname>TaskState</propsymname>
    <propvalue type="integer">8</propvalue>
    </condition>
    </conditions>
    </value>
    </option>
  4. Remove (or comment out) the <state>true</state> line for the Open option, and add it to the code for the new default option. For example, to make All the new default, the code would look like this:
            <option>
<state>true</state> <label localKey="cwexml.TCMConfig_xml.TasksFilter.allLabel">All</label>
</option>
<option>
<!-- <state>true</state> -->
<label localKey="cwexml.TCMConfig_xml.TasksFilter.openLabel">Open</label>
<value type="xml">
<conditions>
<condition id="byProperty" type="task" operation="lt">
<propsymname>TaskState</propsymname>
<propvalue type="integer">8</propvalue>
</condition>
</conditions>
</value>
</option>
  1. Save and close all files. Recycle the Application Server (Tomcat, Weblogic, etc.) to eliminate any cached copies of the configuration files, then restart the Collaboration Engine.

Edit one of the list options from the Tasks filter

  1. Open TCMConfig.xml in an xml editor. Search the file for <filter id="TasksFilter">
  2. Each of the possible task filters is a label within this section. By default, the available options are All, Open, Today, Next 7 days, Assigned by Me, Closed, and Closed in last 7 days.
  3. To change the label for "Next 7 days " to "Next Week " do the following:

    change: <label localKey="cwexml.TCMConfig_xml.TasksFilter.next7Label">Next 7 days</label>

    to: <label localKey="cwexml.TCMConfig_xml.TasksFilter.next7Label">Next Week</label>

  4. You must also change the string associated with the label in the resource file, cwexml.strings.<locale>.prb. This file is located by default in the Collaboration\TCM\WEB-INF\resources folder on the Collaboration Engine. (The <locale> identifies the language and locale. You may have different versions of the resource string file for different localized versions.)

    change: cwexml.TCMConfig_xml.TasksFilter.next7Label=Next 7 days

  5. to: cwexml.TCMConfig_xml.TasksFilter.next7Label=Next Week

  6. Save and close all files. Recycle the Application Server (Tomcat, Weblogic, etc.) to eliminate any cached copies of the configuration files, then restart the Collaboration Engine.

Remove a list option from the Tasks filter

  1. Using the steps above, locate the list of options for the Tasks filter.
  2. To remove the "Closed" option from the list comment out the following section of the code:
         <!--    <option>
<label localKey="cwexml.TCMConfig_xml.TasksFilter.closedLabel">Closed</label>
<value type="xml">
<conditions>
<condition id="byProperty" type="task">
<propsymname>TaskState</propsymname>
<propvalue type="integer">8</propvalue>
</condition>
</conditions>
</value>
</option> -->
  1. Save and close all files. Recycle the Application Server (Tomcat, Weblogic, etc.) to eliminate any cached copies of the configuration files, then restart the Collaboration Engine.

Add a list item to the Tasks filter

You can add your own custom list items by inserting additional code into the same section. In the case of list filters, you will be filtering based on various properties of the collaboration objects, so you need to have an understanding of the collaboration objects and their properties. Refer to the Collaboration Developer's Guide for more information on designing the filter logic.

Below is an example of how you could add a new item to the list filters:

 <option>
   <label localKey="cwexml.TCMConfig_xml.TasksFilter.myNewOptionLabel">My New Option</label>
      <value type="xml">
         <conditions> 
            Conditions that define the new filter go here. 
Refer to the Collaboration Developer's Guide for proper syntax. </conditions> </value> </option>

You would also add the key to the label to the resource file, cwexml.strings.<locale>.prb:

cwexml.TCMConfig_xml.TasksFilter.myNewOptionLabel=My New Option