Using a Post-Transaction Filter

For detailed information about configuration files, configuration layers and an explanation of the configuration-root placeholder used in the file paths in this section, see the CUE Content Store Server Administration Guide.

The post-transaction filters executed by the Content Store are defined in a configuration file called configuration-root/Initial.properties. To enable a filter called MyPostTransFilter filter, therefore, you must add a declaration to this file in one or more of your configuration layers. For example:

service.60-myPostFilter=/com/mycompany/MyPostTransFilter

You must also create a properties file for the filter called MyPostTransFilter.properties, and save it in the location you have specified in the same configuration layer(s) - configuration-root/com/mycompany/MyPostTransFilter.properties in this case. The file must at least contain $class, filterName and objectUpdater entries. These specify the class that implements the filter, a name, and the component to register the PostTransactionFilter against:

$class=com.mycompany.MyPostTransFilter
filterName=MyWordCountFilter
objectUpdater=/io/api/ObjectUpdater

You can also set class properties in this file. For example:

$class=com.mycompany.MyPostTransFilter
filterName=MyWordCountFilter
objectUpdater=/io/api/ObjectUpdater

myFilterParameter=99

Once you have added these configuration files the filter will be called every time a create/delete/update operation is performed. The PostTransactionFilterService class has an serviceEnabled property that can be used to enable/disable filters. You can therefore disable any filter by adding

serviceEnabled=false

to the properties file.

If no other transaction or post-transaction filters have been defined, then there may be no configuration-root/Initial.properties file. In this case you must create one.