View Javadoc
1   /*
2    * This software was designed and created by Jason Carroll.
3    * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4    * The author can be reached at jcarroll@cowsultants.com
5    * ITracker website: http://www.cowsultants.com
6    * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7    *
8    * This program is free software; you can redistribute it and/or modify
9    * it only under the terms of the GNU General Public License as published by
10   * the Free Software Foundation; either version 2 of the License, or
11   * (at your option) any later version.
12   *
13   * This program is distributed in the hope that it will be useful,
14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   * GNU General Public License for more details.
17   */
18  
19  package org.itracker.web.forms;
20  
21  import org.apache.struts.action.ActionErrors;
22  import org.apache.struts.action.ActionMapping;
23  import org.apache.struts.validator.ValidatorForm;
24  
25  import javax.servlet.http.HttpServletRequest;
26  
27  /**
28   * This is the LoginForm Struts Form. It is used by Login form.
29   *
30   * @author ready
31   */
32  public class SearchForm extends ValidatorForm {
33      /**
34       *
35       */
36      private static final long serialVersionUID = 1L;
37      private String action;
38      private Integer[] components;
39      private Integer creator;
40      private String orderBy;
41      private Integer owner;
42      private Integer project;
43      private Integer[] projects;
44      private String resolution;
45      private Integer[] severities;
46      private Integer[] statuses;
47      private Integer targetVersion;
48      private String textphrase;
49      private Integer type;
50      private Integer[] versions;
51  
52      public void reset(ActionMapping mapping, HttpServletRequest request) {
53          action = null;
54          components = null;
55          creator = null;
56          orderBy = null;
57          owner = null;
58          project = null;
59          projects = null;
60          resolution = null;
61          severities = null;
62          statuses = null;
63          targetVersion = null;
64          textphrase = null;
65          type = null;
66          versions = null;
67  
68      }
69  
70      public ActionErrors validate(ActionMapping mapping,
71                                   HttpServletRequest request) {
72          ActionErrors errors = super.validate(mapping, request);
73  
74          return errors;
75      }
76  
77      public String getAction() {
78          return action;
79      }
80  
81      public void setAction(String action) {
82          this.action = action;
83      }
84  
85      public Integer[] getComponents() {
86          if (null == components)
87              return null;
88          return components.clone();
89      }
90  
91      public void setComponents(Integer[] components) {
92          if (null == components)
93              this.components = null;
94          else
95              this.components = components.clone();
96      }
97  
98      public Integer getCreator() {
99          return creator;
100     }
101 
102     public void setCreator(Integer creator) {
103         this.creator = creator;
104     }
105 
106     public String getOrderBy() {
107         return orderBy;
108     }
109 
110     public void setOrderBy(String orderBy) {
111         this.orderBy = orderBy;
112     }
113 
114     public Integer getOwner() {
115         return owner;
116     }
117 
118     public void setOwner(Integer owner) {
119         this.owner = owner;
120     }
121 
122     public Integer getProject() {
123         return project;
124     }
125 
126     public void setProject(Integer project) {
127         this.project = project;
128     }
129 
130     public Integer[] getProjects() {
131         if (null == projects)
132             return null;
133         return projects.clone();
134     }
135 
136     public void setProjects(Integer[] projects) {
137         if (null == projects)
138             this.projects = null;
139         else
140             this.projects = projects.clone();
141     }
142 
143     public String getResolution() {
144         return resolution;
145     }
146 
147     public void setResolution(String resolution) {
148         this.resolution = resolution;
149     }
150 
151     public Integer[] getSeverities() {
152         if (null == severities)
153             return null;
154         return severities.clone();
155     }
156 
157     public void setSeverities(Integer[] severities) {
158         if (null == severities)
159             this.severities = null;
160         else
161             this.severities = severities.clone();
162     }
163 
164     public Integer[] getStatuses() {
165         if (null == statuses)
166             return null;
167         return statuses.clone();
168     }
169 
170     public void setStatuses(Integer[] statuses) {
171         if (null == statuses)
172             this.statuses = null;
173         else
174             this.statuses = statuses.clone();
175     }
176 
177     public Integer getTargetVersion() {
178         return targetVersion;
179     }
180 
181     public void setTargetVersion(Integer targetVersion) {
182         this.targetVersion = targetVersion;
183     }
184 
185     public String getTextphrase() {
186         return textphrase;
187     }
188 
189     public void setTextphrase(String textphrase) {
190         this.textphrase = textphrase;
191     }
192 
193     public Integer getType() {
194         return type;
195     }
196 
197     public void setType(Integer type) {
198         this.type = type;
199     }
200 
201     public Integer[] getVersions() {
202         if (null == this.versions)
203             return null;
204         return versions.clone();
205     }
206 
207     public void setVersions(Integer[] versions) {
208         if (null == versions)
209             this.versions = null;
210         else
211             this.versions = versions.clone();
212     }
213 
214 }