Creating a request or response filter
You can create a plug-in to filter a request that is made to a service or to filter a response that is received from a service. For example, you might create a request filter to modify the parameters that are sent to a service to provide custom validations and error handling. You can also create a request filter to override a service. For example, you might create a response filter to apply custom formatting to the data that is received from a service before the data is displayed.
About this task
The external data service plug-in uses request and response filters to enable a service to provide custom choice lists and validation.
To
use a filter, a plug-in must handle the JSONArtifact object
that is sent in the request or the JSONObject object
that is returned in the response.
Important: The JSON format
that is used for request and response filters is subject to change
without notice. If you create request and response filters for plug-ins,
you might need to make updates to your code if a new version of the IBM Content Navigator Java™ application programming interface is released.
Procedure
To create a request or response filter:
Sample plug-in files for a custom response filter
The following files in the sample plug-in define a response filter.File | Description |
---|---|
SamplePluginResponseFilter.java | This file extends the PluginResponseFilter class to define a filter that applies custom property formatting to search results. |