1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
package org.demosys.task; |
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 ModificationTaskForm extends ActionForm { |
15 |
|
private String title; |
16 |
|
|
17 |
|
public void reset(ActionMapping actionMapping, |
18 |
|
javax.servlet.http.HttpServletRequest httpServletRequest) { |
19 |
0 |
setTitle(null); |
20 |
0 |
} |
21 |
|
|
22 |
|
|
23 |
|
public ActionErrors validate(ActionMapping actionMapping, |
24 |
|
javax.servlet.http.HttpServletRequest httpServletRequest) { |
25 |
0 |
ActionErrors errors = new ActionErrors(); |
26 |
|
|
27 |
0 |
if (this.getTitle().length() < 2) { |
28 |
0 |
errors.add("title", new ActionError("task.modification.error.title")); |
29 |
|
} |
30 |
|
|
31 |
0 |
return errors; |
32 |
|
} |
33 |
|
|
34 |
|
|
35 |
|
public String getTitle() { |
36 |
0 |
return title; |
37 |
|
} |
38 |
|
|
39 |
|
|
40 |
|
public void setTitle(String title) { |
41 |
0 |
this.title = title; |
42 |
0 |
} |
43 |
|
|
44 |
|
|
45 |
|
public TaskView toTaskView() { |
46 |
0 |
TaskView task = new TaskView(); |
47 |
0 |
task.setTitle(getTitle()); |
48 |
|
|
49 |
0 |
return task; |
50 |
|
} |
51 |
|
} |