KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > webapp > form > core > SearchForm


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.blandware.atleap.webapp.form.core;
17
18 import com.blandware.atleap.webapp.form.BaseForm;
19 import org.apache.struts.action.ActionMapping;
20
21 import javax.servlet.http.HttpServletRequest JavaDoc;
22
23 /**
24  * <p>Form bean for search and advanced search
25  * </p>
26  * <p><a HREF="SearchForm.java.htm"><i>View Source</i></a></p>
27  * <p/>
28  *
29  * @author Andrey Grebnev <a HREF="mailto:andrey.grebnev@blandware.com">&lt;andrey.grebnev@blandware.com&gt;</a>
30  * @version $Revision: 1.8 $ $Date: 2005/08/24 10:22:29 $
31  * @struts.form name="searchForm"
32  */

33 public class SearchForm extends BaseForm {
34
35     /**
36      * Search query
37      */

38     protected String JavaDoc query = null;
39     /**
40      * Search language
41      */

42     protected String JavaDoc searchLanguage = null;
43     /**
44      * Number of days that define how old may be found material
45      */

46     protected String JavaDoc timePeriod = "0";
47
48     /**
49      * Returns search query
50      *
51      * @return search query
52      */

53     public String JavaDoc getQuery() {
54         return query;
55     }
56
57     /**
58      * Sets search query
59      *
60      * @param query search query to set
61      */

62     public void setQuery(String JavaDoc query) {
63         this.query = query;
64     }
65
66     /**
67      * Returns search language
68      *
69      * @return search language
70      */

71     public String JavaDoc getSearchLanguage() {
72         return searchLanguage;
73     }
74
75     /**
76      * Sets search language
77      *
78      * @param searchLanguage search query to set
79      */

80     public void setSearchLanguage(String JavaDoc searchLanguage) {
81         this.searchLanguage = searchLanguage;
82     }
83
84     /**
85      * Returns time period. That's the number of days that define how old may
86      * be found material
87      *
88      * @return time period
89      */

90     public String JavaDoc getTimePeriod() {
91         return timePeriod;
92     }
93
94     /**
95      * Sets time period. That's the number of days that define how old may
96      * be found material
97      *
98      * @param timePeriod time period to set
99      * @struts.validator type="integer"
100      */

101     public void setTimePeriod(String JavaDoc timePeriod) {
102         this.timePeriod = timePeriod;
103     }
104
105
106     /**
107      * Resets all properties to their default values
108      *
109      * @param mapping The ActionMapping used to select this instance
110      * @param request The non-http request we are proceeding
111      */

112     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
113         this.query = null;
114         this.searchLanguage = null;
115         this.timePeriod = "0";
116     }
117
118 }
Popular Tags