1 package com.dotmarketing.portlets.campaigns.struts; 2 3 import java.text.ParseException ; 4 import java.text.SimpleDateFormat ; 5 6 import javax.servlet.http.HttpServletRequest ; 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 title; 20 private java.util.Date startDate; 21 private java.util.Date completedDate; 22 private boolean active; 23 private long mailingList; 24 private String fromName; 25 private String fromEmail; 26 private String subject; 27 private String userId; 28 private String message; 29 private String webCompletedDate; 30 private String webStartDate; 31 private String sendsPerHour; 32 33 private long inode; 34 35 private long htmlPage; 36 37 private String selectedHtmlPage; 38 39 private long communicationInode; 40 private boolean sendEmail; 41 42 46 public java.util.Date getCompletedDate() { 47 return completedDate; 48 } 49 50 54 public String getFromEmail() { 55 return fromEmail; 56 } 57 58 62 public String getMessage() { 63 return message; 64 } 65 66 70 public java.util.Date getStartDate() { 71 return startDate; 72 } 73 74 78 public String getSubject() { 79 return subject; 80 } 81 82 86 public String getTitle() { 87 return title; 88 } 89 90 91 95 public String getUserId() { 96 return userId; 97 } 98 99 103 public void setCompletedDate(java.util.Date completedDate) { 104 this.completedDate = completedDate; 105 } 106 107 111 public void setFromEmail(String fromEmail) { 112 this.fromEmail = fromEmail; 113 } 114 115 119 public void setMessage(String message) { 120 this.message = message; 121 } 122 123 127 public void setStartDate(java.util.Date startDate) { 128 this.startDate = startDate; 129 } 130 131 135 public void setSubject(String subject) { 136 this.subject = subject; 137 } 138 139 143 public void setTitle(String title) { 144 this.title = title; 145 } 146 147 148 152 public void setUserId(String userId) { 153 this.userId = userId; 154 } 155 156 160 public String getWebCompletedDate() { 161 return UtilMethods.dateToHTMLDate(completedDate) + " " + UtilMethods.dateToHTMLTime(completedDate); 162 } 163 164 168 public String getWebStartDate() { 169 return UtilMethods.dateToHTMLDate(startDate) + " " + UtilMethods.dateToHTMLTime(startDate); 170 171 } 172 173 177 public void setWebCompletedDate(String webCompletedDate) { 178 179 this.webCompletedDate = webCompletedDate; 180 try { 181 Logger.debug(this, "Setting Web Completed Date " + webCompletedDate); 182 this.completedDate = new SimpleDateFormat ("MM/dd/yyyy HH:mm").parse(webCompletedDate); 183 Logger.debug(this, "Setting Completed Date " + this.completedDate); 184 } catch(ParseException ex) { 185 } 186 } 187 188 192 public void setWebStartDate(String webStartDate) { 193 194 this.webStartDate = webStartDate; 195 try { 196 Logger.debug(this, "Setting Web Start Date " + webStartDate); 197 this.startDate = new SimpleDateFormat ("MM/dd/yyyy HH:mm").parse(webStartDate); 198 Logger.debug(this, "Setting Start Date " + this.startDate); 199 } catch(ParseException ex) { 200 } 201 } 202 203 207 public long getInode() { 208 return inode; 209 } 210 211 215 public void setInode(long inode) { 216 this.inode = inode; 217 } 218 219 223 public boolean isActive() { 224 return active; 225 } 226 227 231 public void setActive(boolean active) { 232 this.active = active; 233 } 234 235 239 public long getMailingList() { 240 return mailingList; 241 } 242 243 247 public void setMailingList(long mailingList) { 248 this.mailingList = mailingList; 249 } 250 251 255 public long getHtmlPage() { 256 return htmlPage; 257 } 258 259 260 261 265 public void setHtmlPage(long htmlPage) { 266 this.htmlPage = htmlPage; 267 } 268 269 270 274 public String getSelectedHtmlPage() { 275 return selectedHtmlPage; 276 } 277 278 282 public void setSelectedHtmlPage(String selectedHtmlPage) { 283 this.selectedHtmlPage = selectedHtmlPage; 284 } 285 286 290 public String getFromName() { 291 return fromName; 292 } 293 294 295 296 300 public void setFromName(String fromName) { 301 this.fromName = fromName; 302 } 303 304 public ActionErrors validate(ActionMapping mapping, HttpServletRequest 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 getSendsPerHour() { 312 return sendsPerHour; 313 } 314 315 public void setSendsPerHour(String sendsPerHour) { 316 this.sendsPerHour = sendsPerHour; 317 } 318 319 322 public long getCommunicationInode() { 323 return communicationInode; 324 } 325 326 329 public void setCommunicationInode(long communicationInode) { 330 this.communicationInode = communicationInode; 331 } 332 333 336 public boolean isSendEmail() { 337 return sendEmail; 338 } 339 340 343 public void setSendEmail(boolean sendEmail) { 344 this.sendEmail = sendEmail; 345 } 346 347 348 } 349 | Popular Tags |