com.ibm.ecm.extension

Class PluginService

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

  1. public abstract class PluginService
  2. extends java.lang.Object
Provides an abstract class that is extended to create a class implementing each service provided by the plug-in. Services are actions, similar to servlets or Struts actions, that perform operations on the IBM Content Navigator server. A service can access content server application programming interfaces (APIs) and Java EE APIs.

Services are invoked from the JavaScript functions that are defined for the plug-in by using the ecm.model.Request.invokePluginService function.

Follow best practices for servlets when implementing an IBM Content Navigator plug-in service. In particular, always assume multi-threaded use and do not keep unshared information in instance variables.

Constructor Summary

Constructor and Description
PluginService()

Method Summary

Modifier and Type Method and Description
  1. abstract
  2. void
execute(PluginServiceCallbacks callbacks,javax.servlet.http.HttpServletRequest request,javax.servlet.http.HttpServletResponse response)
Performs the action of this service.
  1. abstract
  2. java.lang.String
getId()
Returns the unique identifier for this service.
  1. java.lang.String
getOverriddenService()
Deprecated. This method is not used. To override a service, use a request filter, returning the alternate JSON response.
  1. boolean
isSecureService(javax.servlet.http.HttpServletRequest request)
Check if secure service is enabled.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PluginService

  1. public PluginService()

Method Detail

getId

  1. public abstract java.lang.String getId( )
Returns the unique identifier for this service.

Important: This identifier is used in URLs so it must contain only alphanumeric characters.

Returns:
A String that is used to identify the service.

getOverriddenService

  1. public java.lang.String getOverriddenService( )
Deprecated. This method is not used. To override a service, use a request filter, returning the alternate JSON response.
Returns the name of the IBM Content Navigator service that this service overrides. If this service does not override an IBM Content Navigator service, this method returns null.

execute

  1. public abstract void execute(PluginServiceCallbacks callbacks,
  2. javax.servlet.http.HttpServletRequest request,
  3. javax.servlet.http.HttpServletResponse response)
  4. throws java.lang.Exception
Performs the action of this service.
Parameters:
callbacks - An instance of the PluginServiceCallbacks class that contains several functions that can be used by the service. These functions provide access to the plug-in configuration and content server APIs.
request - The HttpServletRequest object that provides the request. The service can access the invocation parameters from the request.
response - The HttpServletResponse object that is generated by the service. The service can get the output stream and write the response. The response must be in JSON format.
Throws:
java.lang.Exception - For exceptions that occur when the service is running. If the logging level is high enough to log errors, information about the exception is logged by IBM Content Navigator.

isSecureService

  1. public boolean isSecureService( javax.servlet.http.HttpServletRequest request)
Check if secure service is enabled. Implemented plug-in services can override this setting.
Returns:
true if enabled, otherwise, false