Rev 1425 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1425 | jmachado | 1 | package pt.estgp.estgweb.web.form.questionarios; |
2 | |||
3 | import org.apache.struts.action.ActionErrors; |
||
4 | import org.apache.struts.action.ActionMapping; |
||
5 | import pt.estgp.estgweb.web.form.ApplicationForm; |
||
6 | |||
7 | import javax.servlet.http.HttpServletRequest; |
||
8 | |||
9 | |||
10 | public class QuestionarioMessage extends ApplicationForm |
||
11 | { |
||
12 | boolean onlyNotAnswered = false; |
||
13 | 1.5.0/docs/api/java/lang/String.html">String message; |
||
14 | private long cursoAfetoOrUnidadeAfetaOrQuestionarioAfetoId; |
||
15 | 1.5.0/docs/api/java/lang/String.html">String fromEmail; |
||
16 | 1.5.0/docs/api/java/lang/String.html">String fromPerson; |
||
17 | 1.5.0/docs/api/java/lang/String.html">String subject; |
||
18 | |||
1426 | jmachado | 19 | 1.5.0/docs/api/java/lang/String.html">String formDescription; |
20 | 1.5.0/docs/api/java/lang/String.html">String dispatch; |
||
21 | long questionarioId; |
||
22 | |||
23 | |||
24 | public long getQuestionarioId() { |
||
25 | return questionarioId; |
||
26 | } |
||
27 | |||
28 | public void setQuestionarioId(long questionarioId) { |
||
29 | this.questionarioId = questionarioId; |
||
30 | } |
||
31 | |||
32 | public 1.5.0/docs/api/java/lang/String.html">String getDispatch() { |
||
33 | return dispatch; |
||
34 | } |
||
35 | |||
36 | public void setDispatch(1.5.0/docs/api/java/lang/String.html">String dispatch) { |
||
37 | this.dispatch = dispatch; |
||
38 | } |
||
39 | |||
40 | public 1.5.0/docs/api/java/lang/String.html">String getFormDescription() { |
||
41 | return formDescription; |
||
42 | } |
||
43 | |||
44 | public void setFormDescription(1.5.0/docs/api/java/lang/String.html">String formDescription) { |
||
45 | this.formDescription = formDescription; |
||
46 | } |
||
47 | |||
1425 | jmachado | 48 | public 1.5.0/docs/api/java/lang/String.html">String getSubject() { |
49 | return subject; |
||
50 | } |
||
51 | |||
52 | public void setSubject(1.5.0/docs/api/java/lang/String.html">String subject) { |
||
53 | this.subject = subject; |
||
54 | } |
||
55 | |||
56 | public boolean isOnlyNotAnswered() { |
||
57 | return onlyNotAnswered; |
||
58 | } |
||
59 | |||
60 | public void setOnlyNotAnswered(boolean onlyNotAnswered) { |
||
61 | this.onlyNotAnswered = onlyNotAnswered; |
||
62 | } |
||
63 | |||
64 | public 1.5.0/docs/api/java/lang/String.html">String getFromEmail() { |
||
65 | return fromEmail; |
||
66 | } |
||
67 | |||
68 | public void setFromEmail(1.5.0/docs/api/java/lang/String.html">String fromEmail) { |
||
69 | this.fromEmail = fromEmail; |
||
70 | } |
||
71 | |||
72 | public 1.5.0/docs/api/java/lang/String.html">String getFromPerson() { |
||
73 | return fromPerson; |
||
74 | } |
||
75 | |||
76 | public void setFromPerson(1.5.0/docs/api/java/lang/String.html">String fromPerson) { |
||
77 | this.fromPerson = fromPerson; |
||
78 | } |
||
79 | |||
80 | public 1.5.0/docs/api/java/lang/String.html">String getMessage() { |
||
81 | return message; |
||
82 | } |
||
83 | |||
84 | public void setMessage(1.5.0/docs/api/java/lang/String.html">String message) { |
||
85 | this.message = message; |
||
86 | } |
||
87 | |||
88 | public long getCursoAfetoOrUnidadeAfetaOrQuestionarioAfetoId() { |
||
89 | return cursoAfetoOrUnidadeAfetaOrQuestionarioAfetoId; |
||
90 | } |
||
91 | |||
92 | public void setCursoAfetoOrUnidadeAfetaOrQuestionarioAfetoId(long cursoAfetoOrUnidadeAfetaOrQuestionarioAfetoId) { |
||
93 | this.cursoAfetoOrUnidadeAfetaOrQuestionarioAfetoId = cursoAfetoOrUnidadeAfetaOrQuestionarioAfetoId; |
||
94 | } |
||
95 | |||
96 | |||
97 | public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) |
||
98 | { |
||
99 | ActionErrors errors = new ActionErrors(); |
||
100 | if(getSubject() == null || getSubject().trim().length() == 0) |
||
101 | { |
||
102 | addMessageWithKeys(errors,request,"errors.required","questionario.email.subject"); |
||
103 | } |
||
104 | if(getFromEmail() == null || getFromEmail().trim().length() == 0) |
||
105 | { |
||
106 | addMessageWithKeys(errors,request,"errors.required","questionario.email.from.email"); |
||
107 | } |
||
108 | if(getFromPerson() == null || getFromPerson().trim().length() == 0) |
||
109 | { |
||
110 | addMessageWithKeys(errors,request,"errors.required","questionario.email.from.person"); |
||
111 | } |
||
112 | if(getMessage() == null || getMessage().trim().length() == 0) |
||
113 | { |
||
114 | addMessageWithKeys(errors,request,"errors.required","questionario.email.message"); |
||
115 | } |
||
116 | return errors; |
||
117 | } |
||
118 | } |