|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.uploader.ExhibitHandlerBeanBase
org.hd.d.pg2k.webSvr.catalogue.SearchPageJavaBean
public final class SearchPageJavaBean
This is the JavaBean that backs the (HTML) catalogue search page. This should be held at page scope so that its state is set from fresh on each page load.
This attempts to sanitise values as they are set.
Most methods are synchronized to provide thread-safety.
| Field Summary | |
|---|---|
static int |
DAY_MS
How long in milliseconds we consider a day to be. |
static java.util.SortedMap<java.lang.Integer,java.lang.String> |
daysFilterSym
Sorted map from number of days back to symbolic name if any (Integer to String). |
private long |
lastSearchTimeMs
Last search time in ms, -1 if no search yet done. |
static int |
MAX_GET_QUERY_CHARS
Maximum (UTF-8 URL-encoded) GET-style query string that we will generate; strictly positive. |
private java.lang.String |
q
The sanitised simple text query, or "" if none. |
private int |
recentDaysFilter
The number of recent days to filter for; 0 means no filter. |
private static long |
serialVersionUID
Unique Serialisation class ID generated by http://random.hd.org/. |
static java.util.Map<java.lang.String,java.lang.Integer> |
symFilterDays
Map from symbolic filter period to number of days (String to Integer); immutable. |
| Fields inherited from class org.hd.d.pg2k.svrCore.uploader.ExhibitHandlerBeanBase |
|---|
onlyAllowExtant, SETTER_ALL |
| Constructor Summary | |
|---|---|
SearchPageJavaBean()
|
|
| Method Summary | |
|---|---|
java.lang.String |
computeGETQueryStringURLTail(int pg)
Make simple (length-limited) GET query string. |
java.util.List<Name.ExhibitFull> |
doLookup(DataSourceBean dataSource,
int maxResults)
Get search results as immutable list of full exhibit names; may be zero-length but never null. |
long |
getLastSearchTimeMs()
Gets the last search time in ms, -1 if no search yet done. |
java.lang.String |
getQ()
Get the sanitised query text, or "" if none (never null, never longer than WebConsts.MAX_SIMPLE_QUERY_LEN). |
int |
getRecentDaysFilter()
Get the "recent days" filter period; 0 for none else (positive) number of days. |
ORG.hd.d.jIndexer.server.JIndexBean.SearchFilterByName |
getSearchFilter()
Gets the search filter, or null if none. |
java.lang.String |
makeRecentDaysFilterBody(LocaleBeanBase l)
Generates body of recent-days filter select statement (dependent on old value, if any). |
void |
setQ(java.lang.String rawQueryText)
Sets the simple query, or "" if none. |
void |
setRecentDaysFilter(java.lang.String sRecentDaysFilter)
Set the recent period (to today) for which exhibits are wanted. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String q
public static final int DAY_MS
private int recentDaysFilter
public static final java.util.Map<java.lang.String,java.lang.Integer> symFilterDays
public static final java.util.SortedMap<java.lang.Integer,java.lang.String> daysFilterSym
public static final int MAX_GET_QUERY_CHARS
private long lastSearchTimeMs
private static final long serialVersionUID
| Constructor Detail |
|---|
public SearchPageJavaBean()
| Method Detail |
|---|
public void setQ(java.lang.String rawQueryText)
public java.lang.String getQ()
public void setRecentDaysFilter(java.lang.String sRecentDaysFilter)
public int getRecentDaysFilter()
public java.lang.String makeRecentDaysFilterBody(LocaleBeanBase l)
This takes the symbolic values in increasing number of days. If the locale bean is passed in this makes full labels else it makes none.
public ORG.hd.d.jIndexer.server.JIndexBean.SearchFilterByName getSearchFilter()
public java.util.List<Name.ExhibitFull> doLookup(DataSourceBean dataSource,
int maxResults)
throws java.io.IOException
As a side-effect this sets the time the search takes in milliseconds accessible by getLastSearchTimeMs().
maxResults - maximum length list of results to return;
should be positive
java.io.IOExceptionpublic java.lang.String computeGETQueryStringURLTail(int pg)
Takes an optional (positive) page number argument.
This is UTF-8 encoded.
Parameter are separated with &
ready for direct inclusion at the end of a URL.
If the result is getting too long we stop adding fields, so we encode the more critical ones first.
pg - if positive then the pg (page) parameter is included
public long getLastSearchTimeMs()
|
DHD Multimedia Gallery V1.57.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||