com.raritantechnologies.searchApp.query.taglibrary
Class SaveQueryServletHandler
java.lang.Object
com.raritantechnologies.searchApp.query.taglibrary.SaveQueryServletHandler
- All Implemented Interfaces:
- IActionHandler, IConfigurable, IServletHandler
- public class SaveQueryServletHandler
- extends java.lang.Object
- implements IServletHandler, IActionHandler
ServletHandler that saves the current request as a saved query, using
an IQueryResultSetWriter
or an IGatewayOutputProcessor.
XML Configuration Template:
<SystemObject type="ServletHandler" name="[ name of servlet handler ]"
configurableClass="com.raritantechnologies.searchApp.query.taglibrary.SaveQueryServletHandler"
cachedQueryKey="[ cache key used to store Query in Session Data cache ]" >
<!-- Optional QueryParser to manipulate query map before saving: -->
<QueryParser class="[ class of com.raritantechnologies.searchApp.IQueryParser ]" >
</QueryParser>
<!-- Use with an IQueryResultSetWriter: -->
<QueryResultSetWriter class="[ class of com.raritantechnologies.searchApp.query.IQueryResultSetWriter ]" >
</QueryResultSetWriter>
<!-- Alternatively, use an IQueryParser (optional) and a GatewayOutputProcessor -->
<GatewayOutputProcessor class="[ class of com.raritantechnologies.searchApp.dataCollection.IGatewayOutputProcessor ]" >
</GatewayOutputProcessor>
<!-- Map of http request parameters to saved query parameters -->
<RequestParams>
<Param requestField="[ field in request ]" queryField="[ field in saved query ]" />
</RequestParams>
<!-- Session parameters that should be saved -->
<SessionParams>
<Param sessionField="[ field in session map ]" queryField="[ field in saved query ]" />
</SessionParams>
<OutputFields>
<Field queryField="[ name of query parameter ]" resultField="[ field in output result ]" />
</OutputFields>
</SystemObject>
Can also be configured as a Struts ActionHandler:
<ActionHandler class="com.raritantechnologies.searchApp.query.taglibrary.SaveQueryServletHandler"
cachedQueryKey="[ cache key used to store Query in Session Data cache ]" >
<!-- Optional QueryParser to manipulate query map before saving: -->
<QueryParser class="[ class of com.raritantechnologies.searchApp.IQueryParser ]" >
</QueryParser>
<!-- Use with an IQueryResultSetWriter: -->
<QueryResultSetWriter class="[ class of com.raritantechnologies.searchApp.query.IQueryResultSetWriter ]" >
</QueryResultSetWriter>
<!-- Alternatively, use an IQueryParser (optional) and a GatewayOutputProcessor -->
<GatewayOutputProcessor class="[ class of com.raritantechnologies.searchApp.dataCollection.IGatewayOutputProcessor ]" >
</GatewayOutputProcessor>
<!-- Map of http request parameters to saved query parameters -->
<RequestParams>
<Param requestField="[ field in request ]" queryField="[ field in saved query ]" />
</RequestParams>
<SessionParams>
<Param sessionField="[ field in request ]" queryField="[ field in saved query ]" />
</SessionParams>
<OutputFields>
<Field queryField="[ name of query parameter ]" resultField="[ field in output result ]" />
</OutputFields>
</ActionHandler>
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SaveQueryServletHandler
public SaveQueryServletHandler()
init
public void init(SearchServlet searchServlet)
- Specified by:
init in interface IServletHandler
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
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