001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/search/tags/sakai_2-4-1/search-tool/tool/src/java/org/sakaiproject/search/tool/api/SearchBean.java $
003: * $Id: SearchBean.java 30222 2007-05-09 18:34:57Z ajpoland@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.search.tool.api;
021:
022: import java.io.UnsupportedEncodingException;
023: import java.util.List;
024:
025: import org.sakaiproject.search.tool.model.SearchOutputItem;
026: import org.sakaiproject.search.tool.model.SearchPage;
027: import org.sakaiproject.search.tool.model.SearchTerm;
028:
029: /**
030: * An interface describing the backing bean to the search page
031: *
032: * @author ieb
033: */
034: public interface SearchBean {
035:
036: /**
037: * get an html fragmnent representing the search results
038: *
039: * @param searchItemFormat
040: * A Message format string {0} is the result index, {1} is the item
041: * UR, {2} is the item title, {3} is the content fragment, {4} is the
042: * score
043: * @param errorFeedbackFormat {0} is the error message location
044: * @return
045: * @deprecated
046: */
047: String getSearchResults(String searchItemFormat,
048: String errorFeedbackFormat);
049:
050: /**
051: * get an html fragment representing a pager the
052: *
053: * @param pagerFormat
054: * A MessageFormat format string {0} is the page URL, {1} is the page
055: * text, {2} is a css class id, 0 for first, 1 for middle, 2 for end
056: * @return
057: * @deprecated
058: */
059: String getPager(String pagerFormati, String singlePageFormat)
060: throws UnsupportedEncodingException;
061:
062: /**
063: * Title for the search page
064: *
065: * @return
066: */
067: String getSearchTitle();
068:
069: /**
070: * true if the user has admin rights
071: *
072: * @return
073: */
074: boolean hasAdmin();
075:
076: /**
077: * Gets the base url for the tool
078: *
079: * @return
080: */
081: String getToolUrl();
082:
083: /**
084: * The search text
085: *
086: * @return
087: */
088: String getSearch();
089:
090: /**
091: * Format the header, param {0} is the start doc on the page {1} is the end
092: * doc {2} is the total docs, {3} is the time taken.
093: *
094: * @param headerFormat
095: * @return
096: * @deprecated
097: */
098: String getHeader(String headerFormat);
099:
100: /**
101: * returns true if search isEnabled
102: * @return
103: */
104: boolean isEnabled();
105:
106: /**
107: * Get a formatted list of terms
108: * @param format format is {0} is the term {1} is the frequency
109: * @return
110: */
111:
112: String getTerms(String format);
113:
114: /**
115: * Returns true if a search has been performed and there are some results
116: * @return
117: */
118: boolean hasResults();
119:
120: /**
121: * Get the OpensearchURL
122: * @return
123: */
124: String getOpenSearchUrl();
125:
126: /**
127: * Get the site title
128: * @return
129: */
130: String getSiteTitle();
131:
132: /**
133: * get the base URL
134: * @return
135: */
136: String getBaseUrl();
137:
138: /**
139: * get the name of the system
140: * @return
141: */
142: String getSystemName();
143:
144: /**
145: * get the found string
146: * @return
147: */
148: String getSearchFound();
149:
150: /**
151: * get a pager objects
152: * @return
153: */
154: List<SearchPage> getPages();
155:
156: /**
157: * get the results for the current pages
158: * @return
159: */
160: List<SearchOutputItem> getResults();
161:
162: /**
163: * get the terms on the current page
164: * @return
165: */
166: List<SearchTerm> getTerms();
167:
168: /**
169: * does the page have an error
170: * @return
171: */
172: boolean hasError();
173:
174: /**
175: * get the error message
176: * @return
177: */
178: String getErrorMessage();
179:
180: /**
181: * get the RSS URL
182: * @return
183: */
184: String getRssURL();
185:
186: /**
187: * get the date now in RFS-822 format
188: * @return
189: */
190: String getDateNow();
191:
192: /**
193: * get the request URL
194: * @return
195: */
196: String getRequestUrl();
197:
198: /**
199: * @return
200: */
201: int getNresults();
202:
203: /**
204: * @return
205: */
206: boolean foundNoResults();
207:
208: /**
209: * @return
210: */
211: String getSherlockIconUrl();
212:
213: /**
214: * @return
215: */
216: String getSherlockUpdateUrl();
217:
218: /**
219: * @return
220: */
221: String getPortalBaseUrl();
222: }
|