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="">
  <removeJoin relationship="" />
  <removeJoin from="" to="" table="" />
  <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" />

  <removeJoin relationship="case_reporter2site"/>
  <removeColumn key="siteName"/>

  <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 from the inherited filter spec

<removeJoin>

Removing a standard <addJoin> element:

Attribute Name Description
relationship This value matches the join element you wish to remove from the inherited filter spec

Removing an adhoc <addJoin> element:

Attribute Name Description
from The field on the parent table/view
to The field on the joined table
table The table being joined

When removing a join, you should also remove any columns, fields, facets, or dependent joins that have downstream references to the join being removed.

<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.