01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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: /*
17: * Created on Jan 14, 2005
18: *
19: */
20: package org.kuali.module.pdp.form.format;
21:
22: import javax.servlet.http.HttpServletRequest;
23:
24: import org.apache.struts.action.ActionErrors;
25: import org.apache.struts.action.ActionForm;
26: import org.apache.struts.action.ActionMapping;
27: import org.apache.struts.action.ActionMessage;
28: import org.kuali.module.pdp.utilities.GeneralUtilities;
29:
30: /**
31: * @author delyea
32: */
33: public class FormatSummaryForm extends ActionForm {
34:
35: private String processId;
36:
37: public FormatSummaryForm() {
38: super ();
39: }
40:
41: public ActionErrors validate(ActionMapping mapping,
42: HttpServletRequest request) {
43: String btnPressed = GeneralUtilities
44: .whichButtonWasPressed(request);
45: ActionErrors actionErrors = new ActionErrors();
46:
47: if ("btnSearch".equals(btnPressed)) {
48: if (GeneralUtilities.isStringEmpty(this .processId)) {
49: actionErrors.add("errors", new ActionMessage(
50: "FormatSummaryForm.criteria.noneEntered"));
51: } else if (!(GeneralUtilities
52: .isStringAllNumbers(this .processId))) {
53: actionErrors.add("errors", new ActionMessage(
54: "FormatSummaryForm.processId.nonNumeric"));
55: }
56: }
57: return actionErrors;
58: }
59:
60: public String getProcessId() {
61: return processId;
62: }
63:
64: public void setProcessId(String processId) {
65: this.processId = processId;
66: }
67: }
|