DLESE Tools
v1.6.0

org.dlese.dpc.services.dds.action
Class JSHTMLAction_1_1

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.dlese.dpc.services.dds.action.JSHTMLAction_1_1

public final class JSHTMLAction_1_1
extends org.apache.struts.action.Action

An Action controller that handles requests for the JavaScript HTML search service. This class handles JSHTML search service verions 1.1. Note that web_service_connection.jsp in the context acts partially as a controller as well.

Version:
$Id: JSHTMLAction_1_1.java,v 1.15 2010/07/14 00:19:27 jweather Exp $
Author:
John Weatherley
See Also:
JSHTMLForm_1_1

Field Summary
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
JSHTMLAction_1_1()
           
 
Method Summary
protected  org.apache.struts.action.ActionForward doGetRecord(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, JSHTMLForm_1_1 jsform, org.apache.struts.action.ActionMapping mapping)
          Handles a request to get a given record from the repository.
protected  org.apache.struts.action.ActionForward doSearch(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, JSHTMLForm_1_1 jsform, org.apache.struts.action.ActionMapping mapping)
          Handles a request to perform a search over all records using the Lucene Query Language.
protected  org.apache.struts.action.ActionForward doUserSearch(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, JSHTMLForm_1_1 jsform, Map customSearchMappings, org.apache.struts.action.ActionMapping mapping)
          Handles a request to perform a search over item-level records using the User Query Language.
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          Processes the JavaScript service request by forwarding to the appropriate corresponding JSP page for rendering.
protected static String getDateStamp()
          Return a string for the current time and date, sutiable for display in log files and output to standout:
static int getNumRecords(RepositoryManager rm)
          Gets the number of records that have been indexed inclucing adn, collection, anno and other metadata types regardless of status.
protected  void prtln(String s)
          Output a line of text to standard out, with datestamp, if debug is set to true.
protected  void prtlnErr(String s)
          Output a line of text to error out, with datestamp.
static void setDebug(boolean db)
          Sets the debug attribute of the object
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSHTMLAction_1_1

public JSHTMLAction_1_1()
Method Detail

execute

public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      HttpServletRequest request,
                                                      HttpServletResponse response)
                                               throws Exception
Processes the JavaScript service request by forwarding to the appropriate corresponding JSP page for rendering.

Overrides:
execute in class org.apache.struts.action.Action
Parameters:
mapping - The ActionMapping used to select this instance
request - The HTTP request we are processing
response - The HTTP response we are creating
form - The ActionForm for the given page
Returns:
The ActionForward instance describing where and how control should be forwarded
Throws:
Exception - If error.

doGetRecord

protected org.apache.struts.action.ActionForward doGetRecord(HttpServletRequest request,
                                                             HttpServletResponse response,
                                                             RepositoryManager rm,
                                                             JSHTMLForm_1_1 jsform,
                                                             org.apache.struts.action.ActionMapping mapping)
                                                      throws Exception
Handles a request to get a given record from the repository.

Arguments: identifier, metadataPrefix.

Error Exception Conditions:
badArgument - The request includes illegal arguments.

Parameters:
request - The HTTP request
response - The HTTP response
rm - The RepositoryManager used
mapping - ActionMapping used
jsform - The Form Bean
Returns:
An ActionForward to the JSP page that will handle the response
Throws:
Exception - If error.

doUserSearch

protected org.apache.struts.action.ActionForward doUserSearch(HttpServletRequest request,
                                                              HttpServletResponse response,
                                                              RepositoryManager rm,
                                                              JSHTMLForm_1_1 jsform,
                                                              Map customSearchMappings,
                                                              org.apache.struts.action.ActionMapping mapping)
                                                       throws Exception
Handles a request to perform a search over item-level records using the User Query Language. This request exposes the same search options that users experience when performing a search for educational resources in the DDS.

Arguments: identifier, metadataPrefix.

Error Exception Conditions:
badArgument - The request includes illegal parameters.

Parameters:
request - The HTTP request
response - The HTTP response
rm - The RepositoryManager used
mapping - ActionMapping used
jsform - The Form
customSearchMappings - A Map of search queries keyed by menu-item ID
Returns:
An ActionForward to the JSP page that will handle the response
Throws:
Exception - If error.

doSearch

protected org.apache.struts.action.ActionForward doSearch(HttpServletRequest request,
                                                          HttpServletResponse response,
                                                          RepositoryManager rm,
                                                          JSHTMLForm_1_1 jsform,
                                                          org.apache.struts.action.ActionMapping mapping)
                                                   throws Exception
Handles a request to perform a search over all records using the Lucene Query Language.

Parameters:
request - The HTTP request
response - The HTTP response
rm - The RepositoryManager used
mapping - ActionMapping used
jsform - The form bean
Returns:
An ActionForward to the JSP page that will handle the response
Throws:
Exception - If error.

getNumRecords

public static final int getNumRecords(RepositoryManager rm)
Gets the number of records that have been indexed inclucing adn, collection, anno and other metadata types regardless of status. Specifically, number of index entries that are not errordocs.

Parameters:
rm - The RepositoryManager being used.
Returns:
The number of records that are currently in the index.

getDateStamp

protected static final String getDateStamp()
Return a string for the current time and date, sutiable for display in log files and output to standout:

Returns:
The dateStamp value

prtlnErr

protected final void prtlnErr(String s)
Output a line of text to error out, with datestamp.

Parameters:
s - The text that will be output to error out.

prtln

protected final void prtln(String s)
Output a line of text to standard out, with datestamp, if debug is set to true.

Parameters:
s - The String that will be output.

setDebug

public static void setDebug(boolean db)
Sets the debug attribute of the object

Parameters:
db - The new debug value

DLESE Tools
v1.6.0