Class DCSQueryForm

java.lang.Object
org.apache.struts.action.ActionForm
org.dlese.dpc.schemedit.action.form.DCSQueryForm
All Implemented Interfaces:
Serializable

public final class DCSQueryForm extends org.apache.struts.action.ActionForm implements Serializable
A Struts Form bean for handling query requests that access a SimpleLuceneIndex. This class works in conjuction with the DCSQueryAction Struts Action class.
Author:
Jonathan Ostwald
See Also:
  • Field Details

    • DEFAULT_REC_SORT

      public static String DEFAULT_REC_SORT
    • RELEVANCE_REC_SORT

      public static String RELEVANCE_REC_SORT
  • Constructor Details

    • DCSQueryForm

      public DCSQueryForm()
      Constructor for the DCSQueryForm object
  • Method Details

    • getResultsPerPageOptions

      public String[] getResultsPerPageOptions()
      Gets the resultsPerPageOptions attribute of the DCSQueryForm object
      Returns:
      The resultsPerPageOptions value
    • setSortField

      public void setSortField(String sortField)
      Sets the sortField attribute of the DCSQueryForm object
      Parameters:
      sortField - The new sortField value
    • getSortField

      public String getSortField()
      Gets the sortField attribute of the DCSQueryForm object
      Returns:
      The sortField value
    • getSortWidgets

      public Map getSortWidgets()
      The sortField of the widgets must be indexed! The sortWidgets key must match the sortField for each widget.
    • getCurrentSortWidget

      public SortWidget getCurrentSortWidget()
    • getRecordIdWidget

      public SortWidget getRecordIdWidget()
    • getLastEditorWidget

      public SortWidget getLastEditorWidget()
    • getStatusWidget

      public SortWidget getStatusWidget()
    • getLastTouchDateWidget

      public SortWidget getLastTouchDateWidget()
    • getResultsPerPage

      public String getResultsPerPage()
      A string representation of the numPagingRecords attribute
      Returns:
      The resultsPerPage value
    • setResultsPerPage

      public void setResultsPerPage(String s)
      Sets the resultsPerPage attribute of the DCSQueryForm object
      Parameters:
      s - The new resultsPerPage value
    • getSearchMode

      public String getSearchMode()
      Gets the searchMode attribute of the DCSQueryForm object
      Returns:
      The searchMode value
    • setSearchMode

      public void setSearchMode(String s)
      Sets the searchMode attribute of the DCSQueryForm object
      Parameters:
      s - The new searchMode value
    • getShowQueryOptions

      public String getShowQueryOptions()
      Gets the showQueryOptions attribute of the DCSQueryForm object
      Returns:
      The showQueryOptions value
    • setShowQueryOptions

      public void setShowQueryOptions(String showQueryOptions)
      Sets the showQueryOptions attribute of the DCSQueryForm object
      Parameters:
      showQueryOptions - The new showQueryOptions value
    • getContextURL

      public String getContextURL()
      Gets the contextURL attribute of the DCSQueryForm object
      Returns:
      The contextURL value
    • setContextURL

      public void setContextURL(String contextURL)
      Sets the contextURL attribute of the DCSQueryForm object
      Parameters:
      contextURL - The new contextURL value
    • getEditors

      public List getEditors()
      return the list of Editors for the currently selected collection; we don't use "selectedCollection" but rather getSelectedSet().getSetSpec() because the former does not seem to be properly initialized after system restart?
      Returns:
      The editors value
    • setEditors

      public void setEditors(List editors)
      Sets the editors attribute of the DCSBrowseForm object
      Parameters:
      editors - The new editors value
    • getVld

      public String getVld()
      Gets the vld attribute of the DCSQueryForm object
      Returns:
      The vld value
    • setVld

      public void setVld(String v)
      Sets the vld attribute of the DCSQueryForm object
      Parameters:
      v - The new vld value
    • getSrcs

      public String[] getSrcs()
      Gets the ses (Selected Creators) attribute of the DCSBrowseForm object
      Returns:
      The ses value
    • setSrcs

      public void setSrcs(String[] selectedCreators)
      Sets the collection that has been selected by the user in the UI. For example 'jones'. For use with a Struts select tag that has multiple selection enabled.
      Parameters:
      selectedCreators - The new ses value
    • getSes

      public String[] getSes()
      Gets the ses (Selected Editors) attribute of the DCSBrowseForm object
      Returns:
      The ses value
    • setSes

      public void setSes(String[] selectedEditors)
      Sets the collection that has been selected by the user in the UI. For example '0dcc' '0comet'. For use with a Struts select tag that has multiple selection enabled.
      Parameters:
      selectedEditors - The new ses value
    • getStatuses

      public Map getStatuses()
      return the list of Statuses for the currently selected collection; we don't use "selectedCollection" but rather getSelectedSet().getSetSpec() because the former does not seem to be properly initialized after system restart?
      Returns:
      The statuses value
    • setStatuses

      public void setStatuses(Map statuses)
      Sets the statuses attribute of the DCSBrowseForm object
      Parameters:
      statuses - The new statuses value
    • getSss

      public String[] getSss()
      Gets the sss (selectedStatuses) attribute of the DCSBrowseForm object
      Returns:
      The sss value
    • setSss

      public void setSss(String[] selectedStatuses)
      Sets the sss (selectedStatuses) attribute of the DCSBrowseForm object
      Parameters:
      selectedStatuses - The new sss value
    • setIdMapperErrors

      public void setIdMapperErrors(List errors)
      Sets the id mapper errors that are available in the index.
      Parameters:
      errors - The ID mapper errors, as a list of integers.
    • getIdMapperErrors

      public List getIdMapperErrors()
      Gets the idMapperErrors that are in the index, as integer strings.
      Returns:
      The idMapperErrors value
    • getIdMapperErrorLabels

      public List getIdMapperErrorLabels()
      Gets the idMapperErrorLabels, as strings.
      Returns:
      The idMapperErrorLabels value
    • setIndexedAccessionStatuses

      public void setIndexedAccessionStatuses(List statusus)
      Sets the indexedAccessionStatuses attribute of the DCSQueryForm object
      Parameters:
      statusus - The new indexedAccessionStatuses value
    • getIndexedAccessionStatuses

      public List getIndexedAccessionStatuses()
      Gets the indexedAccessionStatuses attribute of the DCSQueryForm object
      Returns:
      The indexedAccessionStatuses value
    • getFormats

      public List getFormats()
      Gets all possible metadata formats that may be disiminated by the RepositoryManager. This includes formats that are available via the XMLConversionService.
      Returns:
      The formats value
    • setFormats

      public void setFormats(List formats)
      Sets the formats attribute of the DCSQueryForm object
      Parameters:
      formats - The new formats value
    • getIndexedFormats

      public List getIndexedFormats()
      Gets all formats that exist natively in the index.
      Returns:
      The indexedFormats value
    • setIndexedFormats

      public void setIndexedFormats(List formats)
      Gets all formats that exist natively in the index.
      Parameters:
      formats - The new indexedFormats value
    • getIndexedFormatsLabels

      public List getIndexedFormatsLabels()
      Gets all formats that exist natively in the index.
      Returns:
      The indexedFormatsLabels value
    • setIndexedFormatsLabels

      public void setIndexedFormatsLabels(List formatsLabels)
      Gets all formats that exist natively in the index.
      Parameters:
      formatsLabels - The new indexedFormatsLabels value
    • getFormatLabels

      public List getFormatLabels()
      Gets the formatLabels attribute of the DCSQueryForm object
      Returns:
      The formatLabels value
    • getSfmts

      public String[] getSfmts()
      Gets the selected formats. These include formats that are available via the XMLConversionService.
      Returns:
      The sfmts value
    • setSfmts

      public void setSfmts(String[] selectedFormats)
      Sets the selected formats. These include formats that are available via the XMLConversionService.
      Parameters:
      selectedFormats - The new sfmts value
    • getSc

      public String getSc()
      Gets the collection that has been selected by the user in the UI via a Select tag. For example '0dcc'. For use with a Struts select tag that does not have multiple selection enabled.

      Sample HTML code using Struts:

      <html:select property="sc" size="1" >
        <html:options name="queryForm" property="collections" labelProperty="collectionLabels"/>
      </html:select>

      Returns:
      The selected collection.
    • setSc

      public void setSc(String selectedCollection)
      Sets the collection that has been selected by the user in the UI via a Select tag. For example '0dcc'. For use with a Struts select tag that does not have multiple selection enabled.
      Parameters:
      selectedCollection - The new sc value
    • getScs

      public String[] getScs()
      Gets the collections that have been selected by the user in the UI. For example '0dcc' '0comet'. For use with a Struts select tag that has multiple selection enabled.

      Sample HTML code using Struts:

      <html:select property="scs" size="5" multiple="t">
        <html:options name="queryForm" property="collections" labelProperty="collectionLabels"/>
      </html:select>

      Returns:
      The selected collections.
    • getSelectedIdMapperErrors

      public String[] getSelectedIdMapperErrors()
      Gets the selectedIdMapperErrors attribute of the DCSQueryForm object
      Returns:
      The selectedIdMapperErrors value
    • getselectedAccessionStatuses

      public String[] getselectedAccessionStatuses()
      DESCRIPTION
      Returns:
      DESCRIPTION
    • setselectedAccessionStatuses

      public void setselectedAccessionStatuses(String[] selectedAccessionStatuses)
      DESCRIPTION
      Parameters:
      selectedAccessionStatuses - DESCRIPTION
    • setSelectedIdMapperErrors

      public void setSelectedIdMapperErrors(String[] selectedIdMapperErrors)
      Sets the selectedIdMapperErrors attribute of the DCSQueryForm object
      Parameters:
      selectedIdMapperErrors - The new selectedIdMapperErrors value
    • reset

      public void reset(org.apache.struts.action.ActionMapping mapping, HttpServletRequest request)
      DESCRIPTION
      Overrides:
      reset in class org.apache.struts.action.ActionForm
      Parameters:
      mapping - DESCRIPTION
      request - DESCRIPTION
    • setScs

      public void setScs(String[] selectedCollections)
      Sets the collection that has been selected by the user in the UI. For example '0dcc' '0comet'. For use with a Struts select tag that has multiple selection enabled.
      Parameters:
      selectedCollections - The new sc value
    • getScparams

      public String getScparams()
      Gets the selected collection(s) parameter to be inserted in the URL that gets the next set of results.
      Returns:
      The scparams value.
    • setResults

      public void setResults(SearchHelper results)
      Sets the search results returned by the SimpleLuceneIndex after sorting them.

      we DON'T want to sort results if:

    • this is a NEW sort (if searchString is different from lastSearchString)
    • there is no sortField value to sort it by (note: we explicitly set sortField to null in the case of a new search)
    • Parameters:
      results - The new results value.
    • setMetadata

      public void setMetadata(String metadata)
      Sets the metadata attribute of the DCSQueryForm object
      Parameters:
      metadata - The new metadata value
    • getMetadata

      public String getMetadata()
      Gets the metadata attribute of the DCSQueryForm object
      Returns:
      The metadata value
    • getHits

      public List getHits()
    • getNumResults

      public String getNumResults()
      Gets the numResults attribute of the DCSQueryForm object
      Returns:
      The numResults value
    • getQ

      public String getQ()
      Gets the query string entered by the user.
      Returns:
      The query value.
    • getQe

      public String getQe()
      Gets the query string entered by the user, encoded for use in a URL string.
      Returns:
      The query value ncoded for use in a URL string.
    • setQ

      public void setQ(String queryString)
      Sets the q attribute of the DCSQueryForm object
      Parameters:
      queryString - The new q value
    • getRq

      public String getRq()
      Gets the refined query string entered by the user, used to search within results.
      Returns:
      The query value.
    • setRq

      public void setRq(String refineQueryString)
      Sets the refined query string entered by the user, used to search within results.
      Parameters:
      refineQueryString - The new rq value
    • getNrqParams

      public ArrayList getNrqParams()
      Gets all request parameters except the refined query Rq parameter.
      Returns:
      The nrqParams value.
    • setReportTitle

      public void setReportTitle(String reportTitle)
      Sets the reportTitle attribute of the DCSQueryForm object
      Parameters:
      reportTitle - The new reportTitle value
    • getReportTitle

      public String getReportTitle()
      Gets the reportTitle attribute of the DCSQueryForm object
      Returns:
      The reportTitle value
    • setStart

      public void setStart(int start)
      Sets the starting index for the records to display.
      Parameters:
      start - The new start value
    • getStart

      public String getStart()
      Gets the starting index for the records that will be displayed.
      Returns:
      The start value
    • getEnd

      public String getEnd()
      Gets the ending index for the records that will be displayed.
      Returns:
      The end value
    • getOffset

      public String getOffset()
      Gets the offset into the results array to begin iterating.
      Returns:
      The offset value
    • getLength

      public String getLength()
      Gets the length of iterations to loop over the results array.
      Returns:
      The length value
    • getNumPagingRecords

      public int getNumPagingRecords()
      Gets the numPagingRecords attribute of the DCSQueryForm object
      Returns:
      The numPagingRecords value
    • setNumPagingRecords

      public void setNumPagingRecords(int numPagingRecords)
      Sets the number of records to display per paiging request. Defaults to 10.
      Parameters:
      numPagingRecords - The new numPagingRecords value
    • getNextResultsUrl

      public String getNextResultsUrl()
      Gets the HTTP parameters that should be used to retrieve the next set of results.
      Returns:
      Everything after the ? that should be included in the pager URL.
    • getPrevResultsUrl

      public String getPrevResultsUrl()
      Gets the HTTP parameters that should be used to retrieve the previous set of results.
      Returns:
      Everything after the ? that should be included in the pager URL.
    • setRequest

      public void setRequest(HttpServletRequest request)
      Sets the request attribute of the DCSQueryForm object.
      Parameters:
      request - The new request value
    • setNonPaigingParams

      public void setNonPaigingParams(String nonPaigingParams)
      Sets the nonPaigingParams attribute of the DCSQueryForm object
      Parameters:
      nonPaigingParams - The new nonPaigingParams value
    • getNonPaigingParams

      public final String getNonPaigingParams()
      Gets all the parameters that existed in the request other than those used for paiging.
      Returns:
      The NonPaigingParams returned as an HTTP query string.
    • getPaigingParam

      public int getPaigingParam()
      the current result page.
    • getPaigingParam

      public int getPaigingParam(String id)
    • setSortWidgetParams

      public void setSortWidgetParams(String sortWidgetParams)
      Sets the sortWidgetParams attribute of the DCSQueryForm object.

      Used by the sortWidget (see tags/sortWidget.tag) to contstruct a URL that will reproduce search but accomodate new sorting, ordering, and paiging params.

      Parameters:
      sortWidgetParams - The new sortWidgetParams value
    • getSortWidgetParams

      public final String getSortWidgetParams()
      Gets all the parameters that existed in the request other than those used for paiging or sorting.

      Returns:
      The SortWidgetParams returned as an HTTP query string.
    • setDebug

      public static void setDebug(boolean db)
      Sets the debug attribute of the object
      Parameters:
      db - The new debug value