KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > portlets > campaigns > struts > CampaignForm


1 package com.dotmarketing.portlets.campaigns.struts;
2
3 import java.text.ParseException JavaDoc;
4 import java.text.SimpleDateFormat JavaDoc;
5
6 import javax.servlet.http.HttpServletRequest JavaDoc;
7
8 import org.apache.struts.action.ActionErrors;
9 import org.apache.struts.action.ActionMapping;
10 import org.apache.struts.validator.ValidatorForm;
11
12 import com.dotmarketing.util.Logger;
13 import com.dotmarketing.util.UtilMethods;
14 import com.liferay.portal.util.Constants;
15
16 public class CampaignForm extends ValidatorForm {
17
18     private static final long serialVersionUID = 1L;
19     private String JavaDoc title;
20     private java.util.Date JavaDoc startDate;
21     private java.util.Date JavaDoc completedDate;
22     private boolean active;
23     private long mailingList;
24     private String JavaDoc fromName;
25     private String JavaDoc fromEmail;
26     private String JavaDoc subject;
27     private String JavaDoc userId;
28     private String JavaDoc message;
29     private String JavaDoc webCompletedDate;
30     private String JavaDoc webStartDate;
31     private String JavaDoc sendsPerHour;
32     
33     private long inode;
34
35     private long htmlPage;
36     
37     private String JavaDoc selectedHtmlPage;
38     
39     private long communicationInode;
40     private boolean sendEmail;
41
42     /**
43      * Returns the completedDate.
44      * @return java.util.Date
45      */

46     public java.util.Date JavaDoc getCompletedDate() {
47         return completedDate;
48     }
49
50     /**
51      * Returns the fromEmail.
52      * @return String
53      */

54     public String JavaDoc getFromEmail() {
55         return fromEmail;
56     }
57
58     /**
59      * Returns the message.
60      * @return String
61      */

62     public String JavaDoc getMessage() {
63         return message;
64     }
65
66     /**
67      * Returns the startDate.
68      * @return java.util.Date
69      */

70     public java.util.Date JavaDoc getStartDate() {
71         return startDate;
72     }
73
74     /**
75      * Returns the subject.
76      * @return String
77      */

78     public String JavaDoc getSubject() {
79         return subject;
80     }
81
82     /**
83      * Returns the title.
84      * @return String
85      */

86     public String JavaDoc getTitle() {
87         return title;
88     }
89
90
91     /**
92      * Returns the userId.
93      * @return String
94      */

95     public String JavaDoc getUserId() {
96         return userId;
97     }
98
99     /**
100      * Sets the completedDate.
101      * @param completedDate The completedDate to set
102      */

103     public void setCompletedDate(java.util.Date JavaDoc completedDate) {
104         this.completedDate = completedDate;
105     }
106
107     /**
108      * Sets the fromEmail.
109      * @param fromEmail The fromEmail to set
110      */

111     public void setFromEmail(String JavaDoc fromEmail) {
112         this.fromEmail = fromEmail;
113     }
114
115     /**
116      * Sets the message.
117      * @param message The message to set
118      */

119     public void setMessage(String JavaDoc message) {
120         this.message = message;
121     }
122
123     /**
124      * Sets the startDate.
125      * @param startDate The startDate to set
126      */

127     public void setStartDate(java.util.Date JavaDoc startDate) {
128         this.startDate = startDate;
129     }
130
131     /**
132      * Sets the subject.
133      * @param subject The subject to set
134      */

135     public void setSubject(String JavaDoc subject) {
136         this.subject = subject;
137     }
138
139     /**
140      * Sets the title.
141      * @param title The title to set
142      */

143     public void setTitle(String JavaDoc title) {
144         this.title = title;
145     }
146
147
148     /**
149      * Sets the userId.
150      * @param userId The userId to set
151      */

152     public void setUserId(String JavaDoc userId) {
153         this.userId = userId;
154     }
155
156     /**
157      * Returns the webCompletedDate.
158      * @return String
159      */

160     public String JavaDoc getWebCompletedDate() {
161         return UtilMethods.dateToHTMLDate(completedDate) + " " + UtilMethods.dateToHTMLTime(completedDate);
162     }
163
164     /**
165      * Returns the webStartDate.
166      * @return String
167      */

168     public String JavaDoc getWebStartDate() {
169         return UtilMethods.dateToHTMLDate(startDate) + " " + UtilMethods.dateToHTMLTime(startDate);
170
171     }
172
173     /**
174      * Sets the webCompletedDate.
175      * @param webCompletedDate The webCompletedDate to set
176      */

177     public void setWebCompletedDate(String JavaDoc webCompletedDate) {
178
179         this.webCompletedDate = webCompletedDate;
180         try {
181             Logger.debug(this, "Setting Web Completed Date " + webCompletedDate);
182             this.completedDate = new SimpleDateFormat JavaDoc("MM/dd/yyyy HH:mm").parse(webCompletedDate);
183             Logger.debug(this, "Setting Completed Date " + this.completedDate);
184         } catch(ParseException JavaDoc ex) {
185         }
186     }
187
188     /**
189      * Sets the webStartDate.
190      * @param webStartDate The webStartDate to set
191      */

192     public void setWebStartDate(String JavaDoc webStartDate) {
193
194         this.webStartDate = webStartDate;
195         try {
196             Logger.debug(this, "Setting Web Start Date " + webStartDate);
197             this.startDate = new SimpleDateFormat JavaDoc("MM/dd/yyyy HH:mm").parse(webStartDate);
198             Logger.debug(this, "Setting Start Date " + this.startDate);
199         } catch(ParseException JavaDoc ex) {
200         }
201     }
202
203     /**
204      * Returns the inode.
205      * @return long
206      */

207     public long getInode() {
208         return inode;
209     }
210
211     /**
212      * Sets the inode.
213      * @param inode The inode to set
214      */

215     public void setInode(long inode) {
216         this.inode = inode;
217     }
218
219     /**
220      * Returns the active.
221      * @return boolean
222      */

223     public boolean isActive() {
224         return active;
225     }
226
227     /**
228      * Sets the active.
229      * @param active The active to set
230      */

231     public void setActive(boolean active) {
232         this.active = active;
233     }
234
235     /**
236      * Returns the mailingList.
237      * @return long
238      */

239     public long getMailingList() {
240         return mailingList;
241     }
242
243     /**
244      * Sets the mailingList.
245      * @param mailingList The mailingList to set
246      */

247     public void setMailingList(long mailingList) {
248         this.mailingList = mailingList;
249     }
250
251     /**
252      * Returns the htmlPage.
253      * @return long
254      */

255     public long getHtmlPage() {
256         return htmlPage;
257     }
258
259
260
261     /**
262      * Sets the htmlPage.
263      * @param htmlPage The htmlPage to set
264      */

265     public void setHtmlPage(long htmlPage) {
266         this.htmlPage = htmlPage;
267     }
268
269
270     /**
271      * Returns the selectedHtmlPage.
272      * @return String
273      */

274     public String JavaDoc getSelectedHtmlPage() {
275         return selectedHtmlPage;
276     }
277
278     /**
279      * Sets the selectedHtmlPage.
280      * @param selectedHtmlPage The selectedHtmlPage to set
281      */

282     public void setSelectedHtmlPage(String JavaDoc selectedHtmlPage) {
283         this.selectedHtmlPage = selectedHtmlPage;
284     }
285
286     /**
287      * Returns the fromName.
288      * @return String
289      */

290     public String JavaDoc getFromName() {
291         return fromName;
292     }
293
294
295
296     /**
297      * Sets the fromName.
298      * @param fromName The fromName to set
299      */

300     public void setFromName(String JavaDoc fromName) {
301         this.fromName = fromName;
302     }
303
304     public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request) {
305         if(request.getParameter("cmd")!=null && request.getParameter("cmd").equals(Constants.ADD)) {
306             return super.validate(mapping, request);
307         }
308         return null;
309     }
310
311     public String JavaDoc getSendsPerHour() {
312         return sendsPerHour;
313     }
314
315     public void setSendsPerHour(String JavaDoc sendsPerHour) {
316         this.sendsPerHour = sendsPerHour;
317     }
318
319     /**
320      * @return Returns the communicationInode.
321      */

322     public long getCommunicationInode() {
323         return communicationInode;
324     }
325
326     /**
327      * @param communicationInode The communicationInode to set.
328      */

329     public void setCommunicationInode(long communicationInode) {
330         this.communicationInode = communicationInode;
331     }
332
333     /**
334      * @return Returns the sendEmail.
335      */

336     public boolean isSendEmail() {
337         return sendEmail;
338     }
339
340     /**
341      * @param sendEmail The sendEmail to set.
342      */

343     public void setSendEmail(boolean sendEmail) {
344         this.sendEmail = sendEmail;
345     }
346
347
348 }
349
Popular Tags