How to write a custom item filter?

How would I go about writing a custom item filter, to add to the unpublish filter, such that a particular full page template is excluded from the standard unpublish content list?

It’s a long long while since I last looked at anything to do with writing Java extensions, so dummy-level information welcome.


Background:
We publish xml files containing intranet page metadata into a holding location. They are picked up and processed by an external Intranet Subscriptions application. The app then moves the processed xml files to a different location.

In order to get metadata for archived intranet pages into the app, we run a separate contentlist which publishes the xml files, using a publishedflag itemfilter for items in an archived state. (The xml files relating to normal public items are picked up by the main contentlist.)

The issue is that when the following unpublish runs, Rx tries to delete these ‘archived item’ xml files. But they’re not there any more, they’ve been processed and moved by the external app. In any case, we don’t want them deleted. As a result of the failure, errors appear in the publishing logs. They’re benign errors, but they clutter up the logs, mask real errors, and I want them gone.

I’ve tried a number of methods to get round this behaviour. The neatest and ‘right’ way would be to exclude the xml files completely from the unpublish content list. Hence asking about filters.

many thanks
Roz