com.ibm.ecm.extension

Class PluginResponseFilter

  1. java.lang.Object
  2. extended bycom.ibm.ecm.extension.PluginResponseFilter

  1. public abstract class PluginResponseFilter
  2. extends java.lang.Object
Provides an abstract class that is extended to create a filter for responses from a particular service. The response from the service is provided to the filter in JSON format before it is returned to the web browser. The filter can then modify that response, and the modified response is returned to the web browser.

Constructor Summary

Constructor and Description
PluginResponseFilter()

Method Summary

Modifier and Type Method and Description
  1. abstract
  2. void
filter(java.lang.String serverType,PluginServiceCallbacks callbacks,javax.servlet.http.HttpServletRequest request,JSONObject jsonResponse)
Filters the response from the service.
  1. abstract
  2. java.lang.String[]
getFilteredServices()
Returns an array of the services that are extended by this filter.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PluginResponseFilter

  1. public PluginResponseFilter()

Method Detail

getFilteredServices

  1. public abstract java.lang.String[] getFilteredServices( )
Returns an array of the services that are extended by this filter.
Returns:
A String array of names of the services. These are the servlet paths or Struts action names.

filter

  1. public abstract void filter(java.lang.String serverType,
  2. PluginServiceCallbacks callbacks,
  3. javax.servlet.http.HttpServletRequest request,
  4. JSONObject jsonResponse)
  5. throws java.lang.Exception
Filters the response from the service.
Parameters:
serverType - A String that indicates the type of server that is associated with the service. This value can be one or more of the following values separated by commas:
Server Type Description
p8 IBM FileNet P8
cm IBM Content Manager
od IBM Content Manager OnDemand
common For services that are not associated with a particular server
callbacks - An instance of the PluginServiceCallbacks class that contains functions that can be used by the service. These functions provide access to plug-in configuration and content server APIs.
request - An HttpServletRequest object that provides the request. The service can access the invocation parameters from the request.
jsonResponse - The JSONObject object that is generated by the service. Typically, this object is serialized and sent as the response. The filter modifies this object to change the response that is sent.
Throws:
java.lang.Exception - For exceptions that occur when the service is running. Information about the exception is logged as part of the client logging and an error response is automatically generated and returned.