public class QueryArgs extends Object
| Constructor and Description |
|---|
QueryArgs() |
| Modifier and Type | Method and Description |
|---|---|
String |
buildHTTPQuery(javax.servlet.http.HttpServletRequest request)
Builds an HTTP query string for some parameters with the value
taken from the request context passed in.
|
String |
buildQuery(javax.servlet.http.HttpServletRequest request)
Builds an advanced-query description string.
|
Map<String,String> |
buildQueryMap(javax.servlet.http.HttpServletRequest request)
Constructs a HashMap with the keys field{1,2,3}, query{1,2,3} and
conjunction{1,2} taking the values from the passed-in argument
defaulting to "".
|
int |
getEtAl() |
int |
getPageSize()
get the count of hits to return
|
String |
getQuery()
retrieve the query string
|
SortOption |
getSortOption() |
String |
getSortOrder() |
int |
getStart()
read the search's starting offset
|
void |
setEtAl(int etAl)
set the number of metadata fields at which to truncate with "et al"
|
void |
setPageSize(int newSize)
set the count of hits to return; used to implement paged searching see
the initializer for the default value
|
void |
setQuery(String newQuery)
set the query string
|
void |
setSortOption(SortOption sortOption) |
void |
setSortOrder(String sortOrder) |
void |
setStart(int newStart)
set the offset of the desired search results, beginning with 0 ; used to
page results (the default value is 0)
|
public int getEtAl()
public void setEtAl(int etAl)
etAl - public void setQuery(String newQuery)
newQuery - public String getQuery()
public void setStart(int newStart)
newStart - index of first desired resultpublic int getStart()
public void setPageSize(int newSize)
newSize - number of hits per pagepublic int getPageSize()
public SortOption getSortOption()
public void setSortOption(SortOption sortOption)
public String getSortOrder()
public void setSortOrder(String sortOrder)
public String buildQuery(javax.servlet.http.HttpServletRequest request)
request - the request object to take the values frompublic Map<String,String> buildQueryMap(javax.servlet.http.HttpServletRequest request)
request - the request-describing object to take the values frompublic String buildHTTPQuery(javax.servlet.http.HttpServletRequest request) throws UnsupportedEncodingException
Note, that the values are url-encoded using the UTF-8 encoding scheme as the corresponding W3C recommendation states.
Also note that neither leading ? (question mark) nor leading & (ampersand mark) is included. Take this into account when appending to a real URL.
request - the request object to take the values fromUnsupportedEncodingExceptionCopyright © 2015 DuraSpace. All Rights Reserved.