View Javadoc
1 /* 2 * Demosys. 3 * 4 * Terms of license - http://opensource.org/licenses/apachepl.php 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 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 setTitle(null); 24 setFromDate("01/01/2003"); 25 setToDate("01/01/03"); 26 setPlannedVelocity(5); 27 setVelocity(0); 28 } 29 30 31 public ActionErrors validate(ActionMapping actionMapping, 32 javax.servlet.http.HttpServletRequest httpServletRequest) { 33 ActionErrors errors = new ActionErrors(); 34 35 if (this.getTitle().length() < 2) { 36 errors.add("title", new ActionError("iteration.new.error.title")); 37 } 38 39 return errors; 40 } 41 42 43 public String getTitle() { 44 return title; 45 } 46 47 48 public void setTitle(String title) { 49 this.title = title; 50 } 51 52 53 public String getFromDate() { 54 return fromDate; 55 } 56 57 58 public void setFromDate(String fromDate) { 59 this.fromDate = fromDate; 60 } 61 62 63 public String getToDate() { 64 return toDate; 65 } 66 67 68 public void setToDate(String toDate) { 69 this.toDate = toDate; 70 } 71 72 73 public int getPlannedVelocity() { 74 return plannedVelocity; 75 } 76 77 78 public void setPlannedVelocity(int plannedVelocity) { 79 this.plannedVelocity = plannedVelocity; 80 } 81 82 83 public int getVelocity() { 84 return velocity; 85 } 86 87 88 public void setVelocity(int velocity) { 89 this.velocity = velocity; 90 } 91 92 93 public IterationView toIterationView() { 94 IterationView iteration = new IterationView(); 95 iteration.setTitle(getTitle()); 96 iteration.setFromDate(getFromDate()); 97 iteration.setToDate(getToDate()); 98 iteration.setPlannedVelocity(getPlannedVelocity()); 99 iteration.setVelocity(getVelocity()); 100 101 return iteration; 102 } 103 }

This page was automatically generated by Maven