|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jalios.jcms.context.JcmsContext
com.jalios.jcms.context.JcmsJspContext
com.jalios.jcms.handler.JcmsFormHandler
com.jalios.jcms.handler.AbstractQueryHandler<E>
E
- The type of Object being manipulated by the implementation of AbstractQueryHandlerpublic abstract class AbstractQueryHandler<E>
Superclass of query handlers.
Nested Class Summary | |
---|---|
static class |
AbstractQueryHandler.HiddenParamQhPrinter
HTML hidden input implementation of a QueryHandlerPrinter |
protected static class |
AbstractQueryHandler.QueryHandlerPrinter
Abstract class defining method used during params printing. |
static class |
AbstractQueryHandler.QueryStringQhPrinter
QueryString implementation of a QueryHandlerPrinter |
Field Summary | |
---|---|
static String |
REVISION
|
Fields inherited from class com.jalios.jcms.handler.JcmsFormHandler |
---|
contextMap, editFieldSet, noRedirect, noSendRedirect, popupEdition, redirect, redirectOnClosePopup, workspaceForced |
Fields inherited from class com.jalios.jcms.context.JcmsJspContext |
---|
AJAX_REQUEST_ATTRIBUTES, BODY_HEADER, CSS_HEADER, cssboMap, cssfoMap, CUSTOM_HEADER, editIcon, HTTPEQUIV_HEADER, httpequivMap, HTTPNAME_HEADER, httpnameMap, initEditIcon, JAVASCRIPT_CODE_SET_ATTRIBUTE, JAVASCRIPT_SET_ATTRIBUTE, jsboSet, jsfoSet, out, pageContext, SHOW_EDIT_ICON, STYLE_HEADER |
Fields inherited from class com.jalios.jcms.context.JcmsContext |
---|
browser, caddy, channel, inFO, initDone, initWorkspace, isAdmin, isAjaxRequest, isDBMember, isDebug, isLogged, loggedMember, request, response, userCountry, userLang, userLocale, workspace |
Fields inherited from interface com.jalios.util.JaliosConstants |
---|
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR |
Constructor Summary | |
---|---|
AbstractQueryHandler()
|
Method Summary | |
---|---|
Object |
getAttribute(String name)
Returns the value of the named attribute as an Object ,
or null if no attribute of the given name exists. |
Map<String,Object> |
getAttributeMap()
Returns a java.util.Map of the attributes of this results. |
Set<? extends E> |
getDataSet()
Retrieves the base Set of Data to use
for the query, results of this query will be taken from this Set. |
String |
getHiddenParams()
Returns all parameters of this QueryHandler as a hidden input. For example : |
protected abstract org.apache.log4j.Logger |
getLogger()
|
String |
getQueryString()
Returns all parameters of this handler as a queryString. For example : |
protected void |
init(String queryString,
javax.servlet.http.HttpServletRequest request)
Method to be called by constructor to initialize this handler from a querystring and an optionnal request. |
static Hashtable<String,String[]> |
parseQueryString(String s)
Parses a query string passed from the client to the server and builds a HashTable object
with key-value pairs. |
protected abstract void |
parseQueryStringParam(String paramName,
String[] paramValues)
Method to be implemented by subclass to decode parameter from queryString. |
protected abstract String |
printParams(AbstractQueryHandler.QueryHandlerPrinter printer)
Method to be implemented by subclass to provide params printing in query or hidden input format. Typical implementation : |
Object |
removeAttribute(String name)
Removes an attribute from this result. |
Object |
setAttribute(String name,
Object obj)
Stores an attribute in this query. |
void |
setDataSet(Set<? extends E> proposedDataSet)
Defines the base Set of Data to use
for the query, results of this query will be taken from this Set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
Constructor Detail |
---|
public AbstractQueryHandler()
Method Detail |
---|
protected abstract org.apache.log4j.Logger getLogger()
protected abstract void parseQueryStringParam(String paramName, String[] paramValues)
paramName
- the parameter name, never null nor empty.paramValues
- the parameter values, NEVER NULL NOR EMPTY.
You can safely invoke paramValues[0]
protected void init(String queryString, javax.servlet.http.HttpServletRequest request)
queryString
- a query String consisting of parameters (key=value) to be set in this handler.
"groupText=welcome&gid=j_42"
request
- the HttpServletRequest
to use to
retrieve loggedMember
, userLang
,
userLocale
that will be used by this handler,
ignored if null.public static Hashtable<String,String[]> parseQueryString(String s)
HashTable
object
with key-value pairs.
The query string should be in the form of a string
packaged by the GET or POST method, that is, it
should have key-value pairs in the form key=value,
with each pair separated from the next by a & character.
A key can appear more than once in the query string with different values. However, the key appears only once in the hashtable, with its value being an array of strings containing the multiple values sent by the query string.
The keys and values in the hashtable are stored in their decoded form, so any + characters are converted to spaces, and characters sent in hexadecimal notation (like %wx%yz) are converted to UTF-8 characters.
Method taken from deprecated package javax.servlet.http.HttpUtils.
s
- a string containing the query to be parsed
HashTable
object built
from the parsed key-value pairs
IllegalArgumentException
- if the query string
is invalidpublic void setDataSet(Set<? extends E> proposedDataSet)
Set
of Data
to use
for the query, results of this query will be taken from this Set.
Default is null, which performs a search in all data, invoke
this method to provide a smaller set to optimize the query.
proposedDataSet
- a Set
of Data
public Set<? extends E> getDataSet()
Set
of Data
to use
for the query, results of this query will be taken from this Set.
Set
of Data
of null if no
base set has been defined (and that all data will be used).setDataSet(Set)
public Object setAttribute(String name, Object obj)
removeAttribute(java.lang.String)
.
name
- a String
specifying the name of the attributeobj
- the Object
to be stored
public Object removeAttribute(String name)
name
- a String
specifying
public Object getAttribute(String name)
Object
,
or null
if no attribute of the given name exists.
name
- a String
specifying the name of the attribute
Object
containing the value of the attribute,
or null
if the attribute does not existpublic Map<String,Object> getAttributeMap()
public String getQueryString()
"types=Content&cids=c_42"
public String getHiddenParams()
<input type="hidden" name="types" value="Content"/> <input type="hidden" name="cids" value="c_42"/>
protected abstract String printParams(AbstractQueryHandler.QueryHandlerPrinter printer)
protected String printParams(QueryHandlerPrinter printer) { printer.printParam("foo", getFoo()); printer.printParam("bar", getBar()); return printer.toString(); }
printer
- a QueryHandlerPrinter to use
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |