<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<!--NewPage--> | |
<HTML> | |
<HEAD> | |
<!-- Generated by javadoc (build 1.5.0_14) on Mon Apr 26 10:16:14 PDT 2010 --> | |
<TITLE> | |
AbstractSearchTool (VelocityTools 2.0 Documentation) | |
</TITLE> | |
<META NAME="keywords" CONTENT="org.apache.velocity.tools.view.AbstractSearchTool class"> | |
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> | |
<SCRIPT type="text/javascript"> | |
function windowTitle() | |
{ | |
parent.document.title="AbstractSearchTool (VelocityTools 2.0 Documentation)"; | |
} | |
</SCRIPT> | |
<NOSCRIPT> | |
</NOSCRIPT> | |
</HEAD> | |
<BODY BGCOLOR="white" onload="windowTitle();"> | |
<!-- ========= START OF TOP NAVBAR ======= --> | |
<A NAME="navbar_top"><!-- --></A> | |
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> | |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> | |
<TR> | |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> | |
<A NAME="navbar_top_firstrow"><!-- --></A> | |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> | |
<TR ALIGN="center" VALIGN="top"> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> | |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> | |
</TR> | |
</TABLE> | |
</TD> | |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> | |
</EM> | |
</TD> | |
</TR> | |
<TR> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
PREV CLASS | |
<A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view"><B>NEXT CLASS</B></A></FONT></TD> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
<A HREF="../../../../../index.html?org/apache/velocity/tools/view/AbstractSearchTool.html" target="_top"><B>FRAMES</B></A> | |
<A HREF="AbstractSearchTool.html" target="_top"><B>NO FRAMES</B></A> | |
<SCRIPT type="text/javascript"> | |
<!-- | |
if(window==top) { | |
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); | |
} | |
//--> | |
</SCRIPT> | |
<NOSCRIPT> | |
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> | |
</NOSCRIPT> | |
</FONT></TD> | |
</TR> | |
<TR> | |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> | |
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> | |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> | |
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> | |
</TR> | |
</TABLE> | |
<A NAME="skip-navbar_top"></A> | |
<!-- ========= END OF TOP NAVBAR ========= --> | |
<HR> | |
<!-- ======== START OF CLASS DATA ======== --> | |
<H2> | |
<FONT SIZE="-1"> | |
org.apache.velocity.tools.view</FONT> | |
<BR> | |
Class AbstractSearchTool</H2> | |
<PRE> | |
java.lang.Object | |
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html" title="class in org.apache.velocity.tools.view">org.apache.velocity.tools.view.PagerTool</A> | |
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.velocity.tools.view.AbstractSearchTool</B> | |
</PRE> | |
<DL> | |
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/velocity/tools/view/tools/AbstractSearchTool.html" title="class in org.apache.velocity.tools.view.tools">AbstractSearchTool</A></DD> | |
</DL> | |
<HR> | |
<DL> | |
<DT><PRE><FONT SIZE="-1"><A HREF="../../../../../org/apache/velocity/tools/config/DefaultKey.html" title="annotation in org.apache.velocity.tools.config">@DefaultKey</A>(<A HREF="../../../../../org/apache/velocity/tools/config/DefaultKey.html#value()">value</A>="search") | |
<A HREF="../../../../../org/apache/velocity/tools/config/InvalidScope.html" title="annotation in org.apache.velocity.tools.config">@InvalidScope</A>(<A HREF="../../../../../org/apache/velocity/tools/config/InvalidScope.html#value()">value</A>={"application","session"}) | |
</FONT>public abstract class <B>AbstractSearchTool</B><DT>extends <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html" title="class in org.apache.velocity.tools.view">PagerTool</A></DL> | |
</PRE> | |
<P> | |
<p>Abstract view tool for doing "searching" and robust | |
pagination of search results. The goal here is to provide a simple | |
and uniform API for "search tools" that can be used in velocity | |
templates (or even a standard Search.vm template). In particular, | |
this class provides good support for result pagination and some | |
very simple result caching. | |
</p> | |
<p><b>Usage:</b><br> | |
To use this class, you must extend it and implement | |
the executeQuery(Object) method. | |
</p> | |
<p> | |
The setCriteria(Object) method takes an Object in order to | |
allow the search criteria to meet your needs. Your criteria | |
may be as simple as a single string, an array of strings, or | |
whatever you like. The value passed into this method is that | |
which will ultimately be passed into executeQuery(Object) to | |
perform the search and return a list of results. A simple | |
implementation might be like: | |
<pre> | |
protected List executeQuery(Object crit) | |
{ | |
return MyDbUtils.getFooBarsMatching((String)crit); | |
} | |
</pre> | |
<p> | |
Here's an example of how your subclass would be used in a template: | |
<pre> | |
<form name="search" method="get" action="$link.setRelative('search.vm')"> | |
<input type="text"name="find" value="$!search.criteria"> | |
<input type="submit" value="Find"> | |
</form> | |
#if( $search.hasItems() ) | |
Showing $!search.pageDescription<br> | |
#set( $i = $search.index ) | |
#foreach( $item in $search.page ) | |
${i}. $!item <br> | |
#set( $i = $i + 1 ) | |
#end | |
<br> | |
#if ( $search.pagesAvailable > 1 ) | |
#set( $pagelink = $link.setRelative('search.vm').addQueryData("find",$!search.criteria).addQueryData("show",$!search.itemsPerPage) ) | |
#if( $search.prevIndex ) | |
<a href="$pagelink.addQueryData('index',$!search.prevIndex)">Prev</a> | |
#end | |
#foreach( $index in $search.slip ) | |
#if( $index == $search.index ) | |
<b>$search.pageNumber</b> | |
#else | |
<a href="$pagelink.addQueryData('index',$!index)">$!search.getPageNumber($index)</a> | |
#end | |
#end | |
#if( $search.nextIndex ) | |
<a href="$pagelink.addQueryData('index',$!search.nextIndex)">Next</a> | |
#end | |
#end | |
#elseif( $search.criteria ) | |
Sorry, no matches were found for "$!search.criteria". | |
#else | |
Please enter a search term | |
#end | |
</pre> | |
The output of this might look like:<br><br> | |
<form method="get" action=""> | |
<input type="text" value="foo"> | |
<input type="submit" value="Find"> | |
</form> | |
Showing 1-5 of 8<br> | |
1. foo<br> | |
2. bar<br> | |
3. blah<br> | |
4. woogie<br> | |
5. baz<br><br> | |
<b>1</b> <a href="">2</a> <a href="">Next</a> | |
</p> | |
<p> | |
<b>Example toolbox.xml configuration:</b> | |
<pre> | |
<tools> | |
<toolbox scope="request"> | |
<tool class="com.foo.tools.MySearchTool"/> | |
</toolbox> | |
</tools> | |
</pre> | |
</p> | |
<P> | |
<P> | |
<DL> | |
<DT><B>Since:</B></DT> | |
<DD>VelocityTools 2.0</DD> | |
<DT><B>Version:</B></DT> | |
<DD>$Revision: 591088 $ $Date: 2007-11-01 10:11:41 -0700 (Thu, 01 Nov 2007) $</DD> | |
<DT><B>Author:</B></DT> | |
<DD>Nathan Bubna</DD> | |
</DL> | |
<HR> | |
<P> | |
<!-- ======== NESTED CLASS SUMMARY ======== --> | |
<A NAME="nested_class_summary"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> | |
<B>Nested Class Summary</B></FONT></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>static class</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view">AbstractSearchTool.StoredResults</A></B></CODE> | |
<BR> | |
Simple utility class to hold a criterion and its result list.</TD> | |
</TR> | |
</TABLE> | |
<!-- =========== FIELD SUMMARY =========== --> | |
<A NAME="field_summary"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> | |
<B>Field Summary</B></FONT></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>private java.lang.Object</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#criteria">criteria</A></B></CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>private java.lang.String</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#criteriaKey">criteriaKey</A></B></CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>static java.lang.String</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#DEFAULT_CRITERIA_KEY">DEFAULT_CRITERIA_KEY</A></B></CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected org.apache.velocity.runtime.log.Log</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#LOG">LOG</A></B></CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected static java.lang.String</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#STORED_RESULTS_KEY">STORED_RESULTS_KEY</A></B></CODE> | |
<BR> | |
the key under which StoredResults are kept in session</TD> | |
</TR> | |
</TABLE> | |
<A NAME="fields_inherited_from_class_org.apache.velocity.tools.view.PagerTool"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> | |
<TH ALIGN="left"><B>Fields inherited from class org.apache.velocity.tools.view.<A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html" title="class in org.apache.velocity.tools.view">PagerTool</A></B></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD><CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#DEFAULT_INDEX_KEY">DEFAULT_INDEX_KEY</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#DEFAULT_ITEMS_PER_PAGE">DEFAULT_ITEMS_PER_PAGE</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#DEFAULT_ITEMS_PER_PAGE_KEY">DEFAULT_ITEMS_PER_PAGE_KEY</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#DEFAULT_NEW_ITEMS_KEY">DEFAULT_NEW_ITEMS_KEY</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#DEFAULT_SLIP_SIZE">DEFAULT_SLIP_SIZE</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#DEFAULT_SLIP_SIZE_KEY">DEFAULT_SLIP_SIZE_KEY</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#session">session</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#STORED_ITEMS_KEY">STORED_ITEMS_KEY</A></CODE></TD> | |
</TR> | |
</TABLE> | |
| |
<!-- ======== CONSTRUCTOR SUMMARY ======== --> | |
<A NAME="constructor_summary"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> | |
<B>Constructor Summary</B></FONT></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#AbstractSearchTool()">AbstractSearchTool</A></B>()</CODE> | |
<BR> | |
</TD> | |
</TR> | |
</TABLE> | |
| |
<!-- ========== METHOD SUMMARY =========== --> | |
<A NAME="method_summary"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> | |
<B>Method Summary</B></FONT></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected abstract java.util.List</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#executeQuery(java.lang.Object)">executeQuery</A></B>(java.lang.Object criteria)</CODE> | |
<BR> | |
Executes a query for the specified criteria.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> java.lang.Object</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#getCriteria()">getCriteria</A></B>()</CODE> | |
<BR> | |
Return the criteria object for this request.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> java.lang.String</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#getCriteriaKey()">getCriteriaKey</A></B>()</CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> java.util.List</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#getItems()">getItems</A></B>()</CODE> | |
<BR> | |
Gets the results for the given criteria either in memory | |
or by performing a new query for them.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected java.util.List</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#getStoredItems()">getStoredItems</A></B>()</CODE> | |
<BR> | |
Retrieves stored search items (if any) from the user's | |
session attributes.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected <A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view">AbstractSearchTool.StoredResults</A></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#getStoredResults()">getStoredResults</A></B>()</CODE> | |
<BR> | |
Retrieves stored search results (if any) from the user's | |
session attributes.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#reset()">reset</A></B>()</CODE> | |
<BR> | |
Sets the criteria and results to null, page index to zero, and | |
items per page to the default.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#setCriteria(java.lang.Object)">setCriteria</A></B>(java.lang.Object criteria)</CODE> | |
<BR> | |
Sets the criteria for this search.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#setCriteriaKey(java.lang.String)">setCriteriaKey</A></B>(java.lang.String key)</CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#setLog(org.apache.velocity.runtime.log.Log)">setLog</A></B>(org.apache.velocity.runtime.log.Log log)</CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#setStoredItems(java.util.List)">setStoredItems</A></B>(java.util.List items)</CODE> | |
<BR> | |
Stores current search items in the user's session attributes | |
(if one currently exists) in order to do efficient result pagination.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#setStoredResults(org.apache.velocity.tools.view.AbstractSearchTool.StoredResults)">setStoredResults</A></B>(<A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view">AbstractSearchTool.StoredResults</A> results)</CODE> | |
<BR> | |
Stores current search results in the user's session attributes | |
(if one currently exists) in order to do efficient result pagination.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html#setup(javax.servlet.http.HttpServletRequest)">setup</A></B>(javax.servlet.http.HttpServletRequest request)</CODE> | |
<BR> | |
Sets the criteria *if* it is set in the request parameters.</TD> | |
</TR> | |
</TABLE> | |
<A NAME="methods_inherited_from_class_org.apache.velocity.tools.view.PagerTool"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> | |
<TH ALIGN="left"><B>Methods inherited from class org.apache.velocity.tools.view.<A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html" title="class in org.apache.velocity.tools.view">PagerTool</A></B></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD><CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getCreateSession()">getCreateSession</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getFirstIndex()">getFirstIndex</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getIndex()">getIndex</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getIndexKey()">getIndexKey</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getItemsPerPage()">getItemsPerPage</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getItemsPerPageKey()">getItemsPerPageKey</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getLastIndex()">getLastIndex</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getNewItemsKey()">getNewItemsKey</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getNextIndex()">getNextIndex</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPage()">getPage</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPageDescription()">getPageDescription</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPageNumber()">getPageNumber</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPageNumber(int)">getPageNumber</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPagesAvailable()">getPagesAvailable</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPrevIndex()">getPrevIndex</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getSlip()">getSlip</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getSlipSize()">getSlipSize</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getSlipSizeKey()">getSlipSizeKey</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getTotal()">getTotal</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#hasItems()">hasItems</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setCreateSession(boolean)">setCreateSession</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setIndex(int)">setIndex</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setIndexKey(java.lang.String)">setIndexKey</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setItems(java.util.List)">setItems</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setItemsPerPage(int)">setItemsPerPage</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setItemsPerPageKey(java.lang.String)">setItemsPerPageKey</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setNewItemsKey(java.lang.String)">setNewItemsKey</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setRequest(javax.servlet.http.HttpServletRequest)">setRequest</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setSlipSize(int)">setSlipSize</A>, <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setSlipSizeKey(java.lang.String)">setSlipSizeKey</A></CODE></TD> | |
</TR> | |
</TABLE> | |
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> | |
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> | |
</TR> | |
</TABLE> | |
| |
<P> | |
<!-- ============ FIELD DETAIL =========== --> | |
<A NAME="field_detail"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> | |
<B>Field Detail</B></FONT></TH> | |
</TR> | |
</TABLE> | |
<A NAME="DEFAULT_CRITERIA_KEY"><!-- --></A><H3> | |
DEFAULT_CRITERIA_KEY</H3> | |
<PRE> | |
public static final java.lang.String <B>DEFAULT_CRITERIA_KEY</B></PRE> | |
<DL> | |
<DL> | |
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.view.AbstractSearchTool.DEFAULT_CRITERIA_KEY">Constant Field Values</A></DL> | |
</DL> | |
<HR> | |
<A NAME="STORED_RESULTS_KEY"><!-- --></A><H3> | |
STORED_RESULTS_KEY</H3> | |
<PRE> | |
protected static final java.lang.String <B>STORED_RESULTS_KEY</B></PRE> | |
<DL> | |
<DD>the key under which StoredResults are kept in session | |
<P> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="LOG"><!-- --></A><H3> | |
LOG</H3> | |
<PRE> | |
protected org.apache.velocity.runtime.log.Log <B>LOG</B></PRE> | |
<DL> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="criteriaKey"><!-- --></A><H3> | |
criteriaKey</H3> | |
<PRE> | |
private java.lang.String <B>criteriaKey</B></PRE> | |
<DL> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="criteria"><!-- --></A><H3> | |
criteria</H3> | |
<PRE> | |
private java.lang.Object <B>criteria</B></PRE> | |
<DL> | |
<DL> | |
</DL> | |
</DL> | |
<!-- ========= CONSTRUCTOR DETAIL ======== --> | |
<A NAME="constructor_detail"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> | |
<B>Constructor Detail</B></FONT></TH> | |
</TR> | |
</TABLE> | |
<A NAME="AbstractSearchTool()"><!-- --></A><H3> | |
AbstractSearchTool</H3> | |
<PRE> | |
public <B>AbstractSearchTool</B>()</PRE> | |
<DL> | |
</DL> | |
<!-- ============ METHOD DETAIL ========== --> | |
<A NAME="method_detail"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> | |
<B>Method Detail</B></FONT></TH> | |
</TR> | |
</TABLE> | |
<A NAME="setLog(org.apache.velocity.runtime.log.Log)"><!-- --></A><H3> | |
setLog</H3> | |
<PRE> | |
public void <B>setLog</B>(org.apache.velocity.runtime.log.Log log)</PRE> | |
<DL> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="setup(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3> | |
setup</H3> | |
<PRE> | |
public void <B>setup</B>(javax.servlet.http.HttpServletRequest request)</PRE> | |
<DL> | |
<DD>Sets the criteria *if* it is set in the request parameters. | |
<P> | |
<DD><DL> | |
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setup(javax.servlet.http.HttpServletRequest)">setup</A></CODE> in class <CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html" title="class in org.apache.velocity.tools.view">PagerTool</A></CODE></DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>request</CODE> - the current HttpServletRequest</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="setCriteriaKey(java.lang.String)"><!-- --></A><H3> | |
setCriteriaKey</H3> | |
<PRE> | |
public void <B>setCriteriaKey</B>(java.lang.String key)</PRE> | |
<DL> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getCriteriaKey()"><!-- --></A><H3> | |
getCriteriaKey</H3> | |
<PRE> | |
public java.lang.String <B>getCriteriaKey</B>()</PRE> | |
<DL> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="reset()"><!-- --></A><H3> | |
reset</H3> | |
<PRE> | |
public void <B>reset</B>()</PRE> | |
<DL> | |
<DD>Sets the criteria and results to null, page index to zero, and | |
items per page to the default. | |
<P> | |
<DD><DL> | |
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#reset()">reset</A></CODE> in class <CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html" title="class in org.apache.velocity.tools.view">PagerTool</A></CODE></DL> | |
</DD> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="setCriteria(java.lang.Object)"><!-- --></A><H3> | |
setCriteria</H3> | |
<PRE> | |
public void <B>setCriteria</B>(java.lang.Object criteria)</PRE> | |
<DL> | |
<DD>Sets the criteria for this search. | |
<P> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>criteria</CODE> - - the criteria used for this search</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getCriteria()"><!-- --></A><H3> | |
getCriteria</H3> | |
<PRE> | |
public java.lang.Object <B>getCriteria</B>()</PRE> | |
<DL> | |
<DD>Return the criteria object for this request. | |
(for a simple search mechanism, this will typically be | |
just a java.lang.String) | |
<P> | |
<DD><DL> | |
<DT><B>Returns:</B><DD>criteria object</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getItems()"><!-- --></A><H3> | |
getItems</H3> | |
<PRE> | |
public java.util.List <B>getItems</B>()</PRE> | |
<DL> | |
<DD>Gets the results for the given criteria either in memory | |
or by performing a new query for them. If the criteria | |
is null, an empty list will be returned. | |
<P> | |
<DD><DL> | |
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getItems()">getItems</A></CODE> in class <CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html" title="class in org.apache.velocity.tools.view">PagerTool</A></CODE></DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Returns:</B><DD><CODE>List</CODE> of all items for the criteria</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getStoredItems()"><!-- --></A><H3> | |
getStoredItems</H3> | |
<PRE> | |
protected java.util.List <B>getStoredItems</B>()</PRE> | |
<DL> | |
<DD><B>Description copied from class: <CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getStoredItems()">PagerTool</A></CODE></B></DD> | |
<DD>Retrieves stored search items (if any) from the user's | |
session attributes. | |
<P> | |
<DD><DL> | |
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getStoredItems()">getStoredItems</A></CODE> in class <CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html" title="class in org.apache.velocity.tools.view">PagerTool</A></CODE></DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Returns:</B><DD>the <CODE>List</CODE> retrieved from memory</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="setStoredItems(java.util.List)"><!-- --></A><H3> | |
setStoredItems</H3> | |
<PRE> | |
protected void <B>setStoredItems</B>(java.util.List items)</PRE> | |
<DL> | |
<DD><B>Description copied from class: <CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setStoredItems(java.util.List)">PagerTool</A></CODE></B></DD> | |
<DD>Stores current search items in the user's session attributes | |
(if one currently exists) in order to do efficient result pagination. | |
<p>Override this to store search items somewhere besides the | |
HttpSession or to prevent storage of items across requests. In | |
the former situation, you must also override getStoredItems().</p> | |
<P> | |
<DD><DL> | |
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setStoredItems(java.util.List)">setStoredItems</A></CODE> in class <CODE><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html" title="class in org.apache.velocity.tools.view">PagerTool</A></CODE></DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>items</CODE> - the <CODE>List</CODE> to be stored</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="executeQuery(java.lang.Object)"><!-- --></A><H3> | |
executeQuery</H3> | |
<PRE> | |
protected abstract java.util.List <B>executeQuery</B>(java.lang.Object criteria)</PRE> | |
<DL> | |
<DD>Executes a query for the specified criteria. | |
<p>This method must be implemented! A simple | |
implementation might be something like: | |
<pre> | |
protected List executeQuery(Object crit) | |
{ | |
return MyDbUtils.getFooBarsMatching((String)crit); | |
} | |
</pre> | |
<P> | |
<DD><DL> | |
<DT><B>Returns:</B><DD>a <CODE>List</CODE> of results for this query</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getStoredResults()"><!-- --></A><H3> | |
getStoredResults</H3> | |
<PRE> | |
protected <A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view">AbstractSearchTool.StoredResults</A> <B>getStoredResults</B>()</PRE> | |
<DL> | |
<DD>Retrieves stored search results (if any) from the user's | |
session attributes. | |
<P> | |
<DD><DL> | |
<DT><B>Returns:</B><DD>the <A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view"><CODE>AbstractSearchTool.StoredResults</CODE></A> retrieved from memory</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="setStoredResults(org.apache.velocity.tools.view.AbstractSearchTool.StoredResults)"><!-- --></A><H3> | |
setStoredResults</H3> | |
<PRE> | |
protected void <B>setStoredResults</B>(<A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view">AbstractSearchTool.StoredResults</A> results)</PRE> | |
<DL> | |
<DD>Stores current search results in the user's session attributes | |
(if one currently exists) in order to do efficient result pagination. | |
<p>Override this to store search results somewhere besides the | |
HttpSession or to prevent storage of results across requests. In | |
the former situation, you must also override getStoredResults().</p> | |
<P> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>results</CODE> - the <A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view"><CODE>AbstractSearchTool.StoredResults</CODE></A> to be stored</DL> | |
</DD> | |
</DL> | |
<!-- ========= END OF CLASS DATA ========= --> | |
<HR> | |
<!-- ======= START OF BOTTOM NAVBAR ====== --> | |
<A NAME="navbar_bottom"><!-- --></A> | |
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> | |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> | |
<TR> | |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> | |
<A NAME="navbar_bottom_firstrow"><!-- --></A> | |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> | |
<TR ALIGN="center" VALIGN="top"> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> | |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> | |
</TR> | |
</TABLE> | |
</TD> | |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> | |
</EM> | |
</TD> | |
</TR> | |
<TR> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
PREV CLASS | |
<A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view"><B>NEXT CLASS</B></A></FONT></TD> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
<A HREF="../../../../../index.html?org/apache/velocity/tools/view/AbstractSearchTool.html" target="_top"><B>FRAMES</B></A> | |
<A HREF="AbstractSearchTool.html" target="_top"><B>NO FRAMES</B></A> | |
<SCRIPT type="text/javascript"> | |
<!-- | |
if(window==top) { | |
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); | |
} | |
//--> | |
</SCRIPT> | |
<NOSCRIPT> | |
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> | |
</NOSCRIPT> | |
</FONT></TD> | |
</TR> | |
<TR> | |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> | |
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> | |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> | |
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> | |
</TR> | |
</TABLE> | |
<A NAME="skip-navbar_bottom"></A> | |
<!-- ======== END OF BOTTOM NAVBAR ======= --> | |
<HR> | |
Copyright (c) 2003-2007 Apache Software Foundation | |
</BODY> | |
</HTML> |