Developer Resource - Filter Overrides

Customizing a filter specification doesn't mean you have to write rewrite the existing ones when you take advantage of filter overrides. You can write a config file just describing the customizations you need for each filter specification. These XML config override files live in source\Web\Filters\custom\.

An example overrides file is provided that demonstrates the capabilities of filter overrides. It is located at source\Web\Filters\custom\cases.overrides.example.filter.config

Filter Override File Format

<filter overrides="">>
  <removeFacet key="" />
  <removeField key="" />
  <removeCategory value="" />
  <removeColumn key="" />

  <!-- all inherited attributes are available, here are the additions -->
  <query>
    <addFacet label="" />
    <addField label="" />
  </query>
  <columns>
    <addColumn index="" />
  </columns>
</filter>

Example Filter Config File

<filter overrides="Cases">
  <removeFacet key="priority" />
  <removeColumn key="priority" />
  <removeColumn key="contact" />

  <query>
    <addJoin relationship="case_reporter2contact">
      <addField key="case_reporter2contact" field="objid" dataType="int"/>
    </addJoin>
  </query>

  <columns>
    <addColumn key="contact" template="entityLink" entity="Contact" idField="case_reporter2contact" index="-3" width="200">
      <sorts>
        <addSort key="contactLastName" />
        <addSort key="contactFirstName" />
      </sorts>
    </addColumn>
  </columns>
</filter>

One important thing to note is that when re-adding in columns, facets or fields you must pay attention to whether or not you want to re-implement the child elements of what you've removed. In this example we removed the column key contact and had to re-add the sorts children to maintain our desired functionality.

XML Reference

<filter>

Attribute Name Description
overrides This value matches the filter element's name attribute of which you wish to override

<removeColumn><removeFacet><removeField>

Attribute Name Description
key This value matches the column, facet or field element you wish to remove form the inherited filter spec

<removeCategory>

Attribute Name Description
value This value matches the category you wish to remove form the inherited filter spec

<addFacet><addField>

Attribute Name Description
label This attribute is used to change or add a label to your new facet or field. For example the facet label appears in the dropdown listing of available facets.

<addColumn>

Attribute Name Description
index Instead of duplicating the existing column elements you can specify the position of your added column. The columns are 0 indexed. A setting of 7 would place this element in the 9th visible column since it comes after the inherited column's index. You can also use negative numbers here to force a column towards the left most position.