| <!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.4.2_08) on Mon Nov 14 10:15:17 PST 2005 -->
|
| <TITLE>
|
| AbstractSearchTool (Velocity Tools 1.2 Documentation)
|
| </TITLE>
|
|
|
| <META NAME="keywords" CONTENT="org.apache.velocity.tools.view.tools.AbstractSearchTool class">
|
|
|
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
|
|
|
| <SCRIPT type="text/javascript">
|
| function windowTitle()
|
| {
|
| parent.document.title="AbstractSearchTool (Velocity Tools 1.2 Documentation)";
|
| }
|
| </SCRIPT>
|
|
|
| </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=3 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">
|
| <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools"><B>PREV CLASS</B></A>
|
| <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view.tools"><B>NEXT CLASS</B></A></FONT></TD>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../../../index.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.tools</FONT>
|
| <BR>
|
| Class AbstractSearchTool</H2>
|
| <PRE>
|
| java.lang.Object
|
| <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools">org.apache.velocity.tools.view.tools.AbstractPagerTool</A>
|
| <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by"><B>org.apache.velocity.tools.view.tools.AbstractSearchTool</B>
|
| </PRE>
|
| <DL>
|
| <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../../org/apache/velocity/tools/view/tools/ViewTool.html" title="interface in org.apache.velocity.tools.view.tools">ViewTool</A></DD>
|
| </DL>
|
| <HR>
|
| <DL>
|
| <DT>public abstract class <B>AbstractSearchTool</B><DT>extends <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools">AbstractPagerTool</A></DL>
|
|
|
| <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 setup(HttpServletRequest) and executeQuery(Object) |
| methods. |
| <p> |
| The setup(HttpServletRequest) method ought to extract |
| from the current request the search criteria, the current |
| list index, and optionally, the number of items to display |
| per page of results. Upon extracting these parameters, they |
| should be set using the provided setCriteria(Object), |
| setIndex(int), and setItemsPerPage(int) methods. A simple |
| implementation would be: |
| <pre> |
| public void setup(HttpServletRequest req) |
| { |
| ParameterParser pp = new ParameterParser(req); |
| setCriteria(pp.getString("find")); |
| setIndex(pp.getInt("index", 0)); |
| setItemsPerPage(pp.getInt("show", DEFAULT_ITEMS_PER_PAGE)); |
| } |
| </pre> |
| <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><tool> |
| <key>search</key> |
| <scope>request</scope> |
| <class>com.foo.tools.MySearchTool</class> |
| </tool> |
| </pre> |
| </p>
|
| <P>
|
|
|
| <P>
|
| <DL>
|
| <DT><B>Since:</B></DT> |
| <DD>VelocityTools 1.0</DD> |
| <DT><B>Version:</B></DT> |
| <DD>$Revision: 155305 $ $Date: 2005-02-24 20:40:59 -0800 (Thu, 24 Feb 2005) $</DD> |
| <DT><B>Author:</B></DT> |
| <DD><a href="mailto:nathan@esha.com">Nathan Bubna</a></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">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Nested Class Summary</B></FONT></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> class</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view.tools">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">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Field Summary</B></FONT></TD>
|
| </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/tools/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>protected static java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/tools/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.tools.AbstractPagerTool"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
| <TD><B>Fields inherited from class org.apache.velocity.tools.view.tools.<A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools">AbstractPagerTool</A></B></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE><A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#DEFAULT_ITEMS_PER_PAGE">DEFAULT_ITEMS_PER_PAGE</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#DEFAULT_SLIP_SIZE">DEFAULT_SLIP_SIZE</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#session">session</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.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">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Constructor Summary</B></FONT></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/tools/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">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Method Summary</B></FONT></TD>
|
| </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/tools/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/tools/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.util.List</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/tools/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> java.util.List</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractSearchTool.html#getResults()">getResults</A></B>()</CODE>
|
|
|
| <BR>
|
| <B>Deprecated.</B> <I>Use <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getItems()"><CODE>AbstractPagerTool.getItems()</CODE></A>.</I></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/tools/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/tools/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view.tools">AbstractSearchTool.StoredResults</A></CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/tools/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> boolean</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractSearchTool.html#hasResults()">hasResults</A></B>()</CODE>
|
|
|
| <BR>
|
| <B>Deprecated.</B> <I>Use <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#hasItems()"><CODE>AbstractPagerTool.hasItems()</CODE></A></I></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/tools/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/tools/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>protected void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/tools/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/tools/AbstractSearchTool.html#setStoredResults(org.apache.velocity.tools.view.tools.AbstractSearchTool.StoredResults)">setStoredResults</A></B>(<A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view.tools">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>
|
| </TABLE>
|
| <A NAME="methods_inherited_from_class_org.apache.velocity.tools.view.tools.AbstractPagerTool"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
| <TD><B>Methods inherited from class org.apache.velocity.tools.view.tools.<A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools">AbstractPagerTool</A></B></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE><A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getIndex()">getIndex</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getItemsPerPage()">getItemsPerPage</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getNextIndex()">getNextIndex</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getPage()">getPage</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getPageDescription()">getPageDescription</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getPageNumber()">getPageNumber</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getPageNumber(int)">getPageNumber</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getPagesAvailable()">getPagesAvailable</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getPrevIndex()">getPrevIndex</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getSlip()">getSlip</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getSlipSize()">getSlipSize</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#hasItems()">hasItems</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#init(java.lang.Object)">init</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#setIndex(int)">setIndex</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#setItems(java.util.List)">setItems</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#setItemsPerPage(int)">setItemsPerPage</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#setSlipSize(int)">setSlipSize</A>, <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#setup(javax.servlet.http.HttpServletRequest)">setup</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">
|
| <TD><B>Methods inherited from class java.lang.Object</B></TD>
|
| </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">
|
| <TD COLSPAN=1><FONT SIZE="+2">
|
| <B>Field Detail</B></FONT></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <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="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">
|
| <TD COLSPAN=1><FONT SIZE="+2">
|
| <B>Constructor Detail</B></FONT></TD>
|
| </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">
|
| <TD COLSPAN=1><FONT SIZE="+2">
|
| <B>Method Detail</B></FONT></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <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/tools/AbstractPagerTool.html#reset()">reset</A></CODE> in class <CODE><A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools">AbstractPagerTool</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="hasResults()"><!-- --></A><H3>
|
| hasResults</H3>
|
| <PRE>
|
| public boolean <B>hasResults</B>()</PRE>
|
| <DL>
|
| <DD><B>Deprecated.</B> <I>Use <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#hasItems()"><CODE>AbstractPagerTool.hasItems()</CODE></A></I>
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getResults()"><!-- --></A><H3>
|
| getResults</H3>
|
| <PRE>
|
| public java.util.List <B>getResults</B>()</PRE>
|
| <DL>
|
| <DD><B>Deprecated.</B> <I>Use <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html#getItems()"><CODE>AbstractPagerTool.getItems()</CODE></A>.</I>
|
| <P>
|
| <DD><DL>
|
| </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/tools/AbstractPagerTool.html#getItems()">getItems</A></CODE> in class <CODE><A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools">AbstractPagerTool</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/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools">AbstractPagerTool</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/tools/AbstractPagerTool.html#getStoredItems()">getStoredItems</A></CODE> in class <CODE><A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools">AbstractPagerTool</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/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools">AbstractPagerTool</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/tools/AbstractPagerTool.html#setStoredItems(java.util.List)">setStoredItems</A></CODE> in class <CODE><A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools">AbstractPagerTool</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/tools/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view.tools">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/tools/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view.tools"><CODE>AbstractSearchTool.StoredResults</CODE></A> retrieved from memory</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setStoredResults(org.apache.velocity.tools.view.tools.AbstractSearchTool.StoredResults)"><!-- --></A><H3>
|
| setStoredResults</H3>
|
| <PRE>
|
| protected void <B>setStoredResults</B>(<A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view.tools">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/tools/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view.tools"><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=3 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">
|
| <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools"><B>PREV CLASS</B></A>
|
| <A HREF="../../../../../../org/apache/velocity/tools/view/tools/AbstractSearchTool.StoredResults.html" title="class in org.apache.velocity.tools.view.tools"><B>NEXT CLASS</B></A></FONT></TD>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../../../index.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 Apache Software Foundation
|
| </BODY>
|
| </HTML>
|