Class Query
- java.lang.Object
-
- edu.indiana.lib.twinpeaks.search.QueryBase
-
- edu.indiana.lib.twinpeaks.search.HttpTransactionQueryBase
-
- edu.indiana.lib.twinpeaks.search.sru.SruQueryBase
-
- edu.indiana.lib.twinpeaks.search.sru.ss360search.Query
-
- All Implemented Interfaces:
HttpTransactionQueryInterface,QueryInterface,Constants
public class Query extends SruQueryBase implements Constants
Send a query to the Serials Solutions 360 Search server
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_SORT_KEYDefault sort keystatic StringRECORDS_PER_PAGERecords displayed "per page" (default value)-
Fields inherited from class edu.indiana.lib.twinpeaks.search.sru.SruQueryBase
SRU_EXPLAIN, SRU_MAX_RECORD, SRU_OPERATION, SRU_QUERY, SRU_RECORD_PACKING, SRU_RECORD_SCHEMA, SRU_SEARCH_RETRIEVE, SRU_SORT, SRU_START_RECORD, SRU_STATUS, SRU_VERSION
-
Fields inherited from interface edu.indiana.lib.twinpeaks.search.sru.ss360search.Constants
CS_ACTION, CS_CATEGORIES, CS_CONTINUE, CS_DATABASES, CS_GROUPS, CS_SCHEMA, CS_SRU_VERSION, NS_CS, NS_DC, NS_DCTERMS, NS_SRW
-
Fields inherited from interface edu.indiana.lib.twinpeaks.search.HttpTransactionQueryInterface
METHOD_GET, METHOD_POST, REDIRECT_AUTOMATIC, REDIRECT_MANAGED, REDIRECT_MANAGED_SINGLESTEP
-
-
Constructor Summary
Constructors Constructor Description Query()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoNewPage()Set up for pagination (method = GET) Set up the required "searchRetrieve" parameters for pagination Set the global _url (the base URL)protected voiddoNewSearch()Set up a URL for the new search (method = GET) Set up the required SRU "searchRetrieve" parameters Set the global _url (the base URL plus all SRU parameters)voiddoQuery()Searchprotected voidflagInitialSearchComplete()Clear the "start a new search" flagprotected voidflagSearchInProgress()Set the "start a new search" flagprotected StringformatDatabaseList(String databaseList)Build up comma separated database listprotected booleanisNewPage()Is this a new page (pagination, not a brand new search)?voidparseRequest(Map parameterMap)Parse user request parameters.protected voidparseStatusRecord(Document responseDocument)Parse the status record.protected voidpostNewPage()Set up a URL for pagination (method = POST) Set up the required "searchRetrieve" parameters for pagination Set the global _url (the base URL plus all pagination parameters)protected voidpostNewSearch()Set up a URL for the new search (method = POST) Set up the required SRU "searchRetrieve" parameters Set the global _url (the base URL plus all SRU parameters)protected StringsaveResultSetId(Document responseDocument)Look up the result set ID (and save it in session state)intsubmit()Custom submit behavior (override HttpTransactionQueryBase)protected StringxcsContinue()Make a 360 Search "continue" parameterprotected StringxcsDatabase(String databaseList)Make the database list (SRU extension)protected voidxcsPostContinue()Make a 360 Search "continue" parameterprotected voidxcsPostDatabase(String databaseList)Make the database list (SRU extension)-
Methods inherited from class edu.indiana.lib.twinpeaks.search.sru.SruQueryBase
addFirstParameter, addParameter, appendItems, formatParameter, normalizeParameter, sruExplain, sruMaximumRecords, sruMaximumRecords, sruOperation, sruPostExplain, sruPostMaximumRecords, sruPostMaximumRecords, sruPostOperation, sruPostQuery, sruPostRecordPacking, sruPostRecordSchema, sruPostSearchRetrieve, sruPostSort, sruPostStartRecord, sruPostStartRecord, sruPostStatus, sruPostVersion, sruQuery, sruRecordPacking, sruRecordSchema, sruSearchRetrieve, sruSort, sruStartRecord, sruStartRecord, sruStatus, sruVersion
-
Methods inherited from class edu.indiana.lib.twinpeaks.search.HttpTransactionQueryBase
clearParameters, getBody, getFollowRedirects, getFormElement, getParameter, getParameterName, getQueryDocument, getQueryMethod, getQueryUrl, getResponseBytes, getResponseCharacterSet, getResponseDocument, getResponseHeader, getResponseString, getSearchString, getSessionContext, getSessionParameter, getSessionValue, getUrl, initialize, newFullUrl, removeQueryUrl, removeSessionParameter, setDefaultCharacterSet, setParameter, setParametersFromFormInputs, setParametersFromInputNames, setParametersFromInputs, setParametersFromInputValues, setParametersFromNameList, setParametersFromValueList, setPreserveBaseUrlFile, setQueryDocument, setQueryMethod, setQueryUrl, setRedirectBehavior, setSearchString, setSessionParameter, setSessionValue, setUrl, setUrl, setUrlFromAnchor, setUrlFromForm
-
Methods inherited from class edu.indiana.lib.twinpeaks.search.QueryBase
getIntegerRequestParameter, getRequestParameter, getRequestParameterMap, populateRequestParameters
-
-
-
-
Field Detail
-
RECORDS_PER_PAGE
public static final String RECORDS_PER_PAGE
Records displayed "per page" (default value)- See Also:
- Constant Field Values
-
DEFAULT_SORT_KEY
public static final String DEFAULT_SORT_KEY
Default sort key- See Also:
- Constant Field Values
-
-
Method Detail
-
parseRequest
public void parseRequest(Map parameterMap)
Parse user request parameters.- Specified by:
parseRequestin interfaceQueryInterface- Overrides:
parseRequestin classQueryBase- Parameters:
parameterMap- Request details (name=value pairs)
-
doQuery
public void doQuery()
Search- Specified by:
doQueryin interfaceQueryInterface
-
doNewSearch
protected void doNewSearch()
Set up a URL for the new search (method = GET)- Set up the required SRU "searchRetrieve" parameters
- Set the global _url (the base URL plus all SRU parameters)
-
postNewSearch
protected void postNewSearch()
Set up a URL for the new search (method = POST)- Set up the required SRU "searchRetrieve" parameters
- Set the global _url (the base URL plus all SRU parameters)
-
doNewPage
protected void doNewPage()
Set up for pagination (method = GET)- Set up the required "searchRetrieve" parameters for pagination
- Set the global _url (the base URL)
-
postNewPage
protected void postNewPage()
Set up a URL for pagination (method = POST)- Set up the required "searchRetrieve" parameters for pagination
- Set the global _url (the base URL plus all pagination parameters)
-
parseStatusRecord
protected void parseStatusRecord(Document responseDocument)
Parse the status record. We establish the global search status block here, saving the result set id, estimated hit count, etc.- Parameters:
responseDocument- The server response
-
saveResultSetId
protected String saveResultSetId(Document responseDocument)
Look up the result set ID (and save it in session state)- Parameters:
responseDocument- The server response- Returns:
- The ID
-
submit
public int submit()
Custom submit behavior (override HttpTransactionQueryBase)- Overrides:
submitin classHttpTransactionQueryBase- Returns:
- Submission status code (200 = success)
-
xcsDatabase
protected String xcsDatabase(String databaseList)
Make the database list (SRU extension)- Parameters:
databaseList- The list of databases- Returns:
- A fully formed database parameter
-
xcsContinue
protected String xcsContinue()
Make a 360 Search "continue" parameter- Returns:
- The continue parameter
-
xcsPostDatabase
protected void xcsPostDatabase(String databaseList)
Make the database list (SRU extension)- Parameters:
databaseList- The list of databases
-
xcsPostContinue
protected void xcsPostContinue()
Make a 360 Search "continue" parameter
-
formatDatabaseList
protected String formatDatabaseList(String databaseList)
Build up comma separated database list- Parameters:
databaseList- Databases:db1 bd2 bd3- Returns:
- Comma separated list:
db1,bd2,bd3
-
isNewPage
protected boolean isNewPage()
Is this a new page (pagination, not a brand new search)?- Returns:
- true if so
-
flagInitialSearchComplete
protected void flagInitialSearchComplete()
Clear the "start a new search" flag
-
flagSearchInProgress
protected void flagSearchInProgress()
Set the "start a new search" flag
-
-