01: package com.technoetic.xplanner.forms;
02:
03: import java.util.Date;
04: import javax.servlet.http.HttpServletRequest;
05:
06: import com.technoetic.xplanner.XPlannerProperties;
07: import com.technoetic.xplanner.actions.ContinueUnfinishedStoriesAction;
08: import org.apache.struts.action.ActionErrors;
09: import org.apache.struts.action.ActionMapping;
10:
11: public class ContinueUnfinishedStoriesForm extends AbstractEditorForm {
12: private int iterationId;
13: private int targetIterationId;
14: private int projectId;
15: private Date startDate;
16: private static final String SAME_ITERATION_ERROR_KEY = "iteration.status.editor.continue_in_same_iteration";
17:
18: public ActionErrors validate(ActionMapping mapping,
19: HttpServletRequest request) {
20: ActionErrors errors = new ActionErrors();
21: if (isSubmitted()
22: && getAction().equals(
23: ContinueUnfinishedStoriesAction.OK_ACTION)) {
24: require(errors, targetIterationId != iterationId,
25: SAME_ITERATION_ERROR_KEY);
26: }
27: return errors;
28: }
29:
30: public void reset(ActionMapping mapping, HttpServletRequest request) {
31: XPlannerProperties props = new XPlannerProperties();
32: reset(mapping, request, props);
33: }
34:
35: public void reset(ActionMapping mapping,
36: HttpServletRequest request, XPlannerProperties props) {
37: super .reset(mapping, request);
38: iterationId = 0;
39: targetIterationId = 0;
40: projectId = 0;
41: }
42:
43: public int getIterationId() {
44: return iterationId;
45: }
46:
47: public void setIterationId(int iterationId) {
48: this .iterationId = iterationId;
49: }
50:
51: public int getTargetIterationId() {
52: return targetIterationId;
53: }
54:
55: public void setTargetIterationId(int targetIterationId) {
56: this .targetIterationId = targetIterationId;
57: }
58:
59: public void setProjectId(int projectId) {
60: this .projectId = projectId;
61: }
62:
63: public int getProjectId() {
64: return projectId;
65: }
66:
67: public Date getStartDate() {
68: return startDate;
69: }
70:
71: public void setStartDate(Date startDate) {
72: this.startDate = startDate;
73: }
74: }
|