com.raritantechnologies.quickstart.userInterface
Class SearchServletHandler

java.lang.Object
  extended bycom.raritantechnologies.quickstart.userInterface.SearchServletHandler
All Implemented Interfaces:
IActionHandler, IConfigurable, IServletHandler
Direct Known Subclasses:
OpenSearchServletHandler

public class SearchServletHandler
extends java.lang.Object
implements IServletHandler, IActionHandler

Provides an interface for configurable classes that can service an HTTP request through the J2EE Servlet container model. Supports the HTTP "REST" (Representational State Transfer) form of a Web Service.

Converts a RTI-formatted HTTP search request into a search result using an RTI SearchSource using standard RTI Source mapping. Results are returned in the format defined by a IDisplayFormRenderer (for example XML using an XMLDisplayFormRenderer). The SearchSource implementation can be a QueryProcessorFilterSource which can provide pre-processing of the query input and/or post-processing of the result set. This enables any HTTP request or response format to be supported respectively.

XML Configuration Template:
   <SystemObject type="ServletHandler" 
                    name="[ name of this ServletHandler - needs to match param-value in web.xml ]" 
                    configurableClass="com.raritantechnologies.userInterface.SearchServletHandler"
                    sourceType="[ type of Search Source Map ]"
                    sourceCategory="[ source category - maps to category in application SourceMap xml ]"
                    pageSizeParam="[ http request parameter that contains page size request ]"
                    startRecParam="[ http request parameter that contains start record request ]"
                    displayFormName="[ name of an IDisplayFormRenderer - defined in the Configuration DisplayForms section ]" 
                    cacheName="[ name to use for session caching ]" >

      <!-- Optional mapping of a request parameter to a return contentType -->
      <ContentTypeMap requestParam="[ name of http request parameter that controls the contentType returned ]"
                         defaultContentType="[ default type to return if request parameter is missing ]" >
        <Type requestValue="[ value of request parameter ]" contentType="[ content type (e.g. 'text/xml' ]" />
      </ContentTypeMap>
   </SystemObject>

 

Can also be used in Struts framework as an IActionHandler: Note - should probably include cacheName

   <ActionHandler class="com.raritantechnologies.userInterface.SearchServletHandler"
                     sourceType="[ type of Search Source Map ]"
                     sourceCategory="[ source category - maps to category in application SourceMap xml ]"
                     pageSizeParam="[ http request parameter that contains page size request ]"
                     startRecParam="[ http request parameter that contains start record request ]"
                     displayFormName="[ name of an IDisplayFormRenderer - defined in the Configuration DisplayForms section ]" 
                     cacheName="[ name to use for session caching ]" >

      <!-- Optional mapping of a request parameter to a return contentType -->
      <ContentTypeMap requestParam="[ name of http request parameter that controls the contentType returned ]"
                         defaultContentType="[ default type to return if request parameter is missing ]" >
        <Type requestValue="[ value of request parameter ]" contentType="[ content type (e.g. 'text/xml' ]" />
      </ContentTypeMap>
   </ActionHandler> 
 


Constructor Summary
SearchServletHandler()
           
 
Method Summary
 ActionForward handleAction(ActionMapping mapping, ActionForm form, DynamicHttpServletRequest request, HttpServletResponse response)
           
 void init(SearchServlet searchServlet)
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void service(DynamicHttpServletRequest pReq, HttpServletResponse pRes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchServletHandler

public SearchServletHandler()
Method Detail

handleAction

public ActionForward handleAction(ActionMapping mapping,
                                  ActionForm form,
                                  DynamicHttpServletRequest request,
                                  HttpServletResponse response)
                           throws java.lang.Exception
Specified by:
handleAction in interface IActionHandler
Throws:
java.lang.Exception

service

public void service(DynamicHttpServletRequest pReq,
                    HttpServletResponse pRes)
             throws ServletException,
                    java.io.IOException
Specified by:
service in interface IServletHandler
Throws:
ServletException
java.io.IOException

init

public void init(SearchServlet searchServlet)
Specified by:
init in interface IServletHandler

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable