|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.restafarian.core.servlets.RestServletBase
org.restafarian.core.servlets.SelectListServletBase
public abstract class SelectListServletBase
This abstract class is the base code for select list servlets.
| Field Summary |
|---|
| Fields inherited from class org.restafarian.core.servlets.RestServletBase |
|---|
context, log |
| Constructor Summary | |
|---|---|
SelectListServletBase()
|
|
| Method Summary | |
|---|---|
void |
doDelete(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
The Servlet "doDelete()" method. |
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
The Servlet "doGet()" method. |
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
The Servlet "doPost()" method. |
void |
doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
The Servlet "doPut()" method. |
protected java.util.List |
fetchOptions(javax.servlet.http.HttpServletRequest req,
java.lang.String startsWith,
java.lang.String contains,
java.lang.String orderBy)
This method obtains the requested options from the data source. |
protected java.lang.String |
formatOptions(javax.servlet.http.HttpServletRequest req,
java.util.List options)
This method formats the options. |
protected java.lang.String |
getCacheKeyQualifier(javax.servlet.http.HttpServletRequest req)
This method returns any additional qualifiers for the key to the query cache. |
java.lang.String |
getContextKey()
|
protected java.util.Map |
getCurrentDataFields(javax.servlet.http.HttpServletRequest req)
This method returns the current map of data fields. |
java.util.Map |
getDataFields()
|
protected javax.sql.DataSource |
getDataSource()
This method is used to look up the DataSource
by name. |
java.lang.String |
getDataSourceName()
|
java.lang.String |
getDefaultContains()
|
java.lang.String |
getDefaultOrderBy()
|
java.lang.String |
getDefaultStartsWith()
|
protected java.util.List |
getOptions(javax.servlet.http.HttpServletRequest req)
This method retrieves the requested options from the session. |
protected static java.util.Map |
getQueryCache(javax.servlet.http.HttpServletRequest req,
java.lang.String contextKey)
Fetch the query cache from the servlet context, or creates a new one. |
protected java.lang.String |
getQueryStatement(javax.servlet.http.HttpServletRequest req,
java.lang.String startsWith,
java.lang.String contains,
java.lang.String orderBy)
This method creates the SQL statement. |
protected abstract java.lang.String |
getQueryStatement(java.lang.String startsWith,
java.lang.String contains,
java.lang.String orderBy)
This method creates the SQL statement. |
protected static java.util.Date |
getReviewCompareDate()
Fetch the query cache from the servlet context, or creates a new one. |
protected static void |
reviewQueryCache(java.util.Map queryCache)
Review the query cache and remove expired items. |
void |
setContextKey(java.lang.String contextKey)
|
void |
setDataFields(java.util.Map dataFields)
|
void |
setDataSourceName(java.lang.String dataSourceName)
|
void |
setDefaultContains(java.lang.String defaultContains)
|
void |
setDefaultOrderBy(java.lang.String defaultOrderBy)
|
void |
setDefaultStartsWith(java.lang.String defaultStartsWith)
|
| Methods inherited from class org.restafarian.core.servlets.RestServletBase |
|---|
destroy, filter, getIdFromUrl, getNameSpaceUrl, getNumericIdFromUrl, init, sendError, sendError, service |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doHead, doOptions, doTrace, getLastModified, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SelectListServletBase()
| Method Detail |
|---|
public void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
The Servlet "doGet()" method.
doGet in class RestServletBasereq - the HttpServletRequest objectres - the HttpServletResponse object
javax.servlet.ServletException
java.io.IOException
public void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
The Servlet "doPost()" method.
doPost in class RestServletBasereq - the HttpServletRequest objectres - the HttpServletResponse object
javax.servlet.ServletException
java.io.IOException
public void doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
The Servlet "doPut()" method.
doPut in class RestServletBasereq - the HttpServletRequest objectres - the HttpServletResponse object
javax.servlet.ServletException
java.io.IOException
public void doDelete(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
The Servlet "doDelete()" method.
doDelete in class RestServletBasereq - the HttpServletRequest objectres - the HttpServletResponse object
javax.servlet.ServletException
java.io.IOExceptionprotected java.util.Map getCurrentDataFields(javax.servlet.http.HttpServletRequest req)
This method returns the current map of data fields.
req - the HttpServletRequest object
protected java.lang.String formatOptions(javax.servlet.http.HttpServletRequest req,
java.util.List options)
This method formats the options.
req - the HttpServletRequest objectoptions - the List of options
protected java.util.List getOptions(javax.servlet.http.HttpServletRequest req)
This method retrieves the requested options from the session.
req - the HttpServletRequest object
protected java.lang.String getCacheKeyQualifier(javax.servlet.http.HttpServletRequest req)
This method returns any additional qualifiers for the key to the query cache.
req - the HttpServletRequest object
protected java.util.List fetchOptions(javax.servlet.http.HttpServletRequest req,
java.lang.String startsWith,
java.lang.String contains,
java.lang.String orderBy)
This method obtains the requested options from the data source.
req - the HttpServletRequest objectstartsWith - the "starts with" query parametercontains - the "contains" query parameterorderBy - the sort order
protected java.lang.String getQueryStatement(javax.servlet.http.HttpServletRequest req,
java.lang.String startsWith,
java.lang.String contains,
java.lang.String orderBy)
This method creates the SQL statement.
req - the HttpServletRequest objectstartsWith - the "starts with" query parametercontains - the "contains" query parameterorderBy - the sort order
protected abstract java.lang.String getQueryStatement(java.lang.String startsWith,
java.lang.String contains,
java.lang.String orderBy)
This method creates the SQL statement.
startsWith - the "starts with" query parametercontains - the "contains" query parameterorderBy - the sort order
protected static java.util.Map getQueryCache(javax.servlet.http.HttpServletRequest req,
java.lang.String contextKey)
Fetch the query cache from the servlet context, or creates a new one.
req - the HttpServletRequest objectcontextKey - the servlet context keyprotected static void reviewQueryCache(java.util.Map queryCache)
Review the query cache and remove expired items.
protected static java.util.Date getReviewCompareDate()
Fetch the query cache from the servlet context, or creates a new one.
protected javax.sql.DataSource getDataSource()
This method is used to look up the DataSource
by name.
dataSource - the DataSourcepublic java.lang.String getContextKey()
public void setContextKey(java.lang.String contextKey)
contextKey - The contextKey to set.public java.util.Map getDataFields()
public void setDataFields(java.util.Map dataFields)
dataFields - The dataFields to set.public java.lang.String getDataSourceName()
public void setDataSourceName(java.lang.String dataSourceName)
dataSourceName - The dataSourceName to set.public java.lang.String getDefaultContains()
public void setDefaultContains(java.lang.String defaultContains)
defaultContains - The defaultContains to set.public java.lang.String getDefaultOrderBy()
public void setDefaultOrderBy(java.lang.String defaultOrderBy)
defaultOrderBy - The defaultOrderBy to set.public java.lang.String getDefaultStartsWith()
public void setDefaultStartsWith(java.lang.String defaultStartsWith)
defaultStartsWith - The defaultStartsWith to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||