|
|
|
A Document Content Handler is an configurable object that can retrieve content (text or binary content) from some source. Content Handlers are used to generate an HTTP response via the GetContentServlet. Document Content Handlers are added to a Raritan framework application by the addition of a <ContentHandler> element in the application configuration XML. The GetContentServlet retrieves the correct Content Handler from the ConfigurationManager given a unique handler 'contentType'. Each source type defines its own <ContentHandler> configuration schema but all implement the same API so that they can be used by all other framework modules such as, Display Forms, and data processing pipelines.
Content Handlers are divided into two major types: Basic or direct Document Content Handlers that can retrieve document content from a specific source such as a file system, URL or FTP site and Composite Document Content Handlers that can provide pre- or post processing such as logging, filtering, tagging, entity extraction, caching, etc. to the content retrieved by some nested ContentHandler which can be either direct or a composite content handler. This enables multiple layers of functionality to be composed in the XML configuration layer.
The basic processing pathway is shown in the collaboration diagram below. The GetContentHandler (in its "service" method) gets the name of the configured content handler from the HttpServletRequest. It then obtains an IDocumentContentHandler reference from the RTI ConfigurationManager and passes the HttpServletRequest and HttpServletResponse references. The IDocumentContentHandler then gets a javax.servlet.ServletOutputStream handle and pushes the content to the client.