com.raritantechnologies.recommend.rti
Class RecommendServletHandler

java.lang.Object
  extended bycom.raritantechnologies.recommend.rti.RecommendServletHandler
All Implemented Interfaces:
IConfigurable, IServletHandler

public class RecommendServletHandler
extends java.lang.Object
implements IServletHandler

A Servlet Handler that sends recommendation requests to an IRecommend Recommendation Engine implementation. Used with the RecommendThisResultRenderer.

To Recommend documents, the document metadata can be sent in the http request or a lookup SearchSource can be used to retrieve the full document metadata from a key field. This can be a CurrentResultsSource that will contain the results of the last user query.

XML Configuration Template:
   <SystemObject type="ServletHandler" 
                    name="[ name of this ServletHandler - needs to match param-value in web.xml ]" 
                    configurableClass="com.raritantechnologies.recommend.rti.RecommendServletHandler"
                    recommendationEngineName="[ name of Recommendation Engine (if SystemObject) ]"
                    recommendationMode="[ mode of recommendation a combination of: ADD_USER | ADD_DOCUMENTS | ADD_QUERY ]"
                    useLastQuery="[ true(default)|false - if true use last submitted query if false use http request ]"
                    docURLField="[ name of document url field ]" 
                    docIDField="[ name of document ID field ]"
                    docTitleField="[ name of document title field ]" >

     <!-- Use for local Recommendation Engine definition: -->
     <RecommendationEngine class="[ class of com.raritantechnologies.recommend.IRecommend ]" >

     </RecommendationEngine>

     <!-- Lookup map to create query for Lookup SearchSource if request parameters contain lookup metadata -->
     <LookupQueryMap documentLookupSource="[ name of SearchSource that will be used to lookup document metadata for recommendation ]">
        <!-- One or more Field tags: -->
        <Field requestParam="[ result field name ]" queryParam="[ name of lookup query parameter ]" />

        <!-- etc. . . -->
     </LookupQueryMap>

     <!-- Use this if Document metadata is contained in the HTTP request -->
     <DocumentFieldsMap>
        <!-- One or more Field tags: -->
        <Field ID="[ document field name ]" requestParam="[ name of http request parameter ]" />

        <!-- etc. . . -->
     </DocumentFieldsMap>

   </SystemObject>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
RecommendServletHandler()
           
 
Method Summary
 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

RecommendServletHandler

public RecommendServletHandler()
Method Detail

init

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

service

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

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