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 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 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 setTitle(""); 25 setTitleSelect(null); 26 setFromDate(""); 27 setToDate(""); 28 setPlannedVelocity(0); 29 setVelocity(0); 30 31 String value = request.getParameter("CookieTitle"); 32 33 setTitle(value); 34 } 35 36 37 public ActionErrors validate(ActionMapping actionMapping, 38 javax.servlet.http.HttpServletRequest httpServletRequest) { 39 ActionErrors errors = new ActionErrors(); 40 41 if (this.getTitle().length() < 2) { 42 errors.add("title", new ActionError("iteration.new.error.title")); 43 } 44 45 return errors; 46 } 47 48 49 public String getTitleSelect() { 50 return titleSelect; 51 } 52 53 54 public void setTitleSelect(String titleSelect) { 55 this.titleSelect = titleSelect; 56 } 57 58 59 public String getTitle() { 60 return title; 61 } 62 63 64 public void setTitle(String title) { 65 this.title = title; 66 } 67 68 69 public String getFromDate() { 70 return fromDate; 71 } 72 73 74 public void setFromDate(String fromDate) { 75 this.fromDate = fromDate; 76 } 77 78 79 public String getToDate() { 80 return toDate; 81 } 82 83 84 public void setToDate(String toDate) { 85 this.toDate = toDate; 86 } 87 88 89 public int getPlannedVelocity() { 90 return plannedVelocity; 91 } 92 93 94 public void setPlannedVelocity(int plannedVelocity) { 95 this.plannedVelocity = plannedVelocity; 96 } 97 98 99 public int getVelocity() { 100 return velocity; 101 } 102 103 104 public void setVelocity(int velocity) { 105 this.velocity = velocity; 106 } 107 108 109 public IterationView toIterationView() { 110 IterationView iteration = new IterationView(); 111 iteration.setTitle(getTitle()); 112 iteration.setFromDate(getFromDate()); 113 iteration.setToDate(getToDate()); 114 iteration.setPlannedVelocity(getPlannedVelocity()); 115 iteration.setVelocity(getVelocity()); 116 117 return iteration; 118 } 119 }

This page was automatically generated by Maven