DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.action
Class DCSQueryAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.dlese.dpc.schemedit.action.DCSAction
          extended by org.dlese.dpc.schemedit.action.DCSQueryAction

public final class DCSQueryAction
extends DCSAction

A Struts Action for handling query requests that access a SimpleLuceneIndex. This class works in conjunction with the DCSQueryForm Struts form bean class.

Author:
Jonathan Ostwald

Field Summary
static String NO_ERRORS
          DESCRIPTION
static String SELECT_ALL
          DESCRIPTION
static String SELECT_NONE
          DESCRIPTION
 
Fields inherited from class org.dlese.dpc.schemedit.action.DCSAction
accessManager, collectionRegistry, dcsDataManager, frameworkRegistry, ndrServiceEnabled, repositoryManager, repositoryService, requiredRole, sessionRegistry, userManager
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
DCSQueryAction()
           
 
Method Summary
static org.apache.lucene.search.BooleanQuery dcsStandardQuery(HttpServletRequest request, RepositoryManager rm, SessionBean sessionBean, org.apache.struts.action.ActionForm form, ServletContext context)
          Create a query object to search for results specified in request, with custom query expansion.
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          Processes the specified HTTP request and creates the corresponding HTTP response by forwarding to a JSP that will create it.
static org.apache.lucene.search.BooleanQuery getEmptyQuery(RepositoryManager rm)
          Return a query object that will find no records.
 Map getQueryStatusMap(SessionBean sb)
          Create a mapping from unique status labels to a list of all the status values that have that label.
static String getSelectionParamsQueryString(HttpServletRequest request, DCSQueryForm queryForm, RepositoryManager rm, SessionBean sessionBean)
          Gets the selectionParamsQueryString attribute of the DCSQueryAction class
 org.apache.struts.action.ActionForward handleMetadataSearchRequest(SessionBean sessionBean, org.apache.struts.action.ActionMapping mapping, DCSQueryForm queryForm, HttpServletRequest request, HttpServletResponse response)
          Handle a request to search over metadata collections and forwared to the appropriate jsp page to render the response.
static void setDebug(boolean isDebugOutput)
          Sets the debug attribute of the DCSQueryAction class
 
Methods inherited from class org.dlese.dpc.schemedit.action.DCSAction
getMetaDataFramework, getRequiredContextAttributeValue, getSessionBean, getSessionUser, getSessionUser, getSessionUserName, initializeFromContext
 
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
 

Field Detail

SELECT_ALL

public static String SELECT_ALL
DESCRIPTION


SELECT_NONE

public static String SELECT_NONE
DESCRIPTION


NO_ERRORS

public static String NO_ERRORS
DESCRIPTION

Constructor Detail

DCSQueryAction

public DCSQueryAction()
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 IOException,
                                                      ServletException
Processes the specified HTTP request and creates the corresponding HTTP response by forwarding to a JSP that will create it. A SimpleLuceneIndex must be available to this class via a ServletContext attribute under the key "index." Returns an ActionForward instance that maps to the Struts forwarding name "browse.query," which must be configured in struts-config.xml to forward to the JSP page that will handle the request.

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:
IOException - if an input/output error occurs
ServletException - if a servlet exception occurs

handleMetadataSearchRequest

public org.apache.struts.action.ActionForward handleMetadataSearchRequest(SessionBean sessionBean,
                                                                          org.apache.struts.action.ActionMapping mapping,
                                                                          DCSQueryForm queryForm,
                                                                          HttpServletRequest request,
                                                                          HttpServletResponse response)
                                                                   throws IOException,
                                                                          ServletException
Handle a request to search over metadata collections and forwared to the appropriate jsp page to render the response.

Parameters:
mapping - The ActionMapping used to select this instance
request - The HTTP request we are processing
response - The HTTP response we are creating
queryForm - DESCRIPTION
sessionBean - NOT YET DOCUMENTED
Returns:
The ActionForward instance describing where and how control should be forwarded
Throws:
IOException - if an input/output error occurs
ServletException - if a servlet exception occurs

getEmptyQuery

public static org.apache.lucene.search.BooleanQuery getEmptyQuery(RepositoryManager rm)
Return a query object that will find no records.

Parameters:
rm - NOT YET DOCUMENTED
Returns:
The emptyQuery value

dcsStandardQuery

public static org.apache.lucene.search.BooleanQuery dcsStandardQuery(HttpServletRequest request,
                                                                     RepositoryManager rm,
                                                                     SessionBean sessionBean,
                                                                     org.apache.struts.action.ActionForm form,
                                                                     ServletContext context)
Create a query object to search for results specified in request, with custom query expansion.

Returns empty query if query param cannot be parsed.

Parameters:
request - the Request
rm - the RepositoryManager
sessionBean - the SessionBean
form - the ActionForm been
context - the servletContext
Returns:
a query object

getSelectionParamsQueryString

public static String getSelectionParamsQueryString(HttpServletRequest request,
                                                   DCSQueryForm queryForm,
                                                   RepositoryManager rm,
                                                   SessionBean sessionBean)
Gets the selectionParamsQueryString attribute of the DCSQueryAction class

Parameters:
request - NOT YET DOCUMENTED
queryForm - NOT YET DOCUMENTED
sessionBean - NOT YET DOCUMENTED
rm - NOT YET DOCUMENTED
Returns:
The selectionParamsQueryString value

getQueryStatusMap

public Map getQueryStatusMap(SessionBean sb)
Create a mapping from unique status labels to a list of all the status values that have that label.

Parameters:
sb - NOT YET DOCUMENTED
Returns:
A List of statuses

setDebug

public static void setDebug(boolean isDebugOutput)
Sets the debug attribute of the DCSQueryAction class

Parameters:
isDebugOutput - The new debug value

DLESE Tools
v1.6.0