1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
package org.demosys.web.iteration; |
7 |
|
import javax.servlet.http.Cookie; |
8 |
|
import org.apache.struts.action.ActionError; |
9 |
|
import org.apache.struts.action.ActionErrors; |
10 |
|
import org.apache.struts.action.ActionForm; |
11 |
|
import org.apache.struts.action.ActionMapping; |
12 |
|
|
13 |
|
|
14 |
0 |
public class UpdateIterationForm extends ActionForm { |
15 |
|
private String title; |
16 |
|
private String titleSelect; |
17 |
|
private String fromDate; |
18 |
|
private String toDate; |
19 |
|
private int plannedVelocity; |
20 |
|
private int velocity; |
21 |
|
|
22 |
|
public void reset(ActionMapping actionMapping, |
23 |
|
javax.servlet.http.HttpServletRequest request) { |
24 |
0 |
setTitle(""); |
25 |
0 |
setTitleSelect(null); |
26 |
0 |
setFromDate(""); |
27 |
0 |
setToDate(""); |
28 |
0 |
setPlannedVelocity(0); |
29 |
0 |
setVelocity(0); |
30 |
|
|
31 |
0 |
String value = request.getParameter("CookieTitle"); |
32 |
|
|
33 |
0 |
setTitle(value); |
34 |
0 |
} |
35 |
|
|
36 |
|
|
37 |
|
public ActionErrors validate(ActionMapping actionMapping, |
38 |
|
javax.servlet.http.HttpServletRequest httpServletRequest) { |
39 |
0 |
ActionErrors errors = new ActionErrors(); |
40 |
|
|
41 |
0 |
if (this.getTitle().length() < 2) { |
42 |
0 |
errors.add("title", new ActionError("iteration.new.error.title")); |
43 |
|
} |
44 |
|
|
45 |
0 |
return errors; |
46 |
|
} |
47 |
|
|
48 |
|
|
49 |
|
public String getTitleSelect() { |
50 |
0 |
return titleSelect; |
51 |
|
} |
52 |
|
|
53 |
|
|
54 |
|
public void setTitleSelect(String titleSelect) { |
55 |
0 |
this.titleSelect = titleSelect; |
56 |
0 |
} |
57 |
|
|
58 |
|
|
59 |
|
public String getTitle() { |
60 |
0 |
return title; |
61 |
|
} |
62 |
|
|
63 |
|
|
64 |
|
public void setTitle(String title) { |
65 |
0 |
this.title = title; |
66 |
0 |
} |
67 |
|
|
68 |
|
|
69 |
|
public String getFromDate() { |
70 |
0 |
return fromDate; |
71 |
|
} |
72 |
|
|
73 |
|
|
74 |
|
public void setFromDate(String fromDate) { |
75 |
0 |
this.fromDate = fromDate; |
76 |
0 |
} |
77 |
|
|
78 |
|
|
79 |
|
public String getToDate() { |
80 |
0 |
return toDate; |
81 |
|
} |
82 |
|
|
83 |
|
|
84 |
|
public void setToDate(String toDate) { |
85 |
0 |
this.toDate = toDate; |
86 |
0 |
} |
87 |
|
|
88 |
|
|
89 |
|
public int getPlannedVelocity() { |
90 |
0 |
return plannedVelocity; |
91 |
|
} |
92 |
|
|
93 |
|
|
94 |
|
public void setPlannedVelocity(int plannedVelocity) { |
95 |
0 |
this.plannedVelocity = plannedVelocity; |
96 |
0 |
} |
97 |
|
|
98 |
|
|
99 |
|
public int getVelocity() { |
100 |
0 |
return velocity; |
101 |
|
} |
102 |
|
|
103 |
|
|
104 |
|
public void setVelocity(int velocity) { |
105 |
0 |
this.velocity = velocity; |
106 |
0 |
} |
107 |
|
|
108 |
|
|
109 |
|
public IterationView toIterationView() { |
110 |
0 |
IterationView iteration = new IterationView(); |
111 |
0 |
iteration.setTitle(getTitle()); |
112 |
0 |
iteration.setFromDate(getFromDate()); |
113 |
0 |
iteration.setToDate(getToDate()); |
114 |
0 |
iteration.setPlannedVelocity(getPlannedVelocity()); |
115 |
0 |
iteration.setVelocity(getVelocity()); |
116 |
|
|
117 |
0 |
return iteration; |
118 |
|
} |
119 |
|
} |