Application Integration

Filtering Id's

Some of the application integration modules allow the translation of identifiers being sent between Weave and the third party application which can be done by setting up a "filter" and then directing the application integration module to use that filter when sending or receiving a list of identifiers (see the documentation for the application integration module for details on how to link the filter).

To define a new filter you need to add the com.cohga.selection.filter namespace to your config file, e.g.

Adding the filter namespace
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:filter="urn:com.cohga.selection.filter#1.0"> ... </config>

Then you can create a filter that will convert id's from one value to another. e.g.

Example database filter
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:filter="urn:com.cohga.selection.filter#1.0"> <filter:db id="property.filter"> <datasource>main</datasource> <table>GEMS_LINK</table> <keycolumn>PID</keycolumn> <!-- column used in spatial database --> <idcolumn>PRUPI</idcolumn> <!-- column required for third party application --> </filter:db> </config>

When configured to use the above filter Weave will translate PID values to PRUPI when sending to the third party application and will do the reverse, translate PRUPI values to PID, when coming from the third party application into Weave.

You can further extend the filter by adding additional from and where clauses to include additional tables in the translation.

In addition to a db (database) filter you can also create a format filter or a chain filter. A format filter can alter the formatting of the id's, for example, if they need to be padded with spaces, and the chain filter can combine other db and format filters, since you can only specify a single filter and you may want to translate and format the id's.

Format filter
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:filter="urn:com.cohga.selection.filter#1.0"> <filter:format id="property.format"> <idtrimin>true</idtrimin> <keylpadout>8</keylpadout> </filter:format> </config>

The format filter has 12 values that can be set, to determine if the id/key is left or right padded, or if it's trimmed of extra spaces. (id or key) x (lpad, rpad or trim) x (in or out) = 12.

For left or right padding the property should be set to the number of characters the final value should be padded out to, for trim the property should be set to true or false.

e.g. <idlpadout>20</idlpadout>, <keyrpadin>5</keyrpadin>, <keytrimin>true</keytrimin>

Chain filter