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