1 package com.dotmarketing.portlets.banners.struts; 2 3 4 import java.text.ParseException ; 5 import java.text.SimpleDateFormat ; 6 7 import javax.servlet.http.HttpServletRequest ; 8 9 import org.apache.struts.action.ActionErrors; 10 import org.apache.struts.action.ActionMapping; 11 import org.apache.struts.validator.ValidatorForm; 12 13 import com.dotmarketing.util.Logger; 14 import com.liferay.portal.util.Constants; 15 16 public class BannerForm extends ValidatorForm { 17 18 private String [] categories; 19 20 21 private long inode; 22 23 24 private long parent; 25 26 27 private String title; 28 29 30 private String caption; 31 32 33 private String imageFile; 34 35 36 private int imageWidth; 37 38 39 private int imageHeight; 40 41 42 private String altText; 43 44 45 private boolean newWindow; 46 47 48 private String link; 49 50 51 private java.util.Date startDate; 52 53 54 private java.util.Date endDate; 55 56 57 private String webStartDate; 58 59 60 private String webEndDate; 61 62 63 private String body; 64 65 66 private boolean active; 67 68 69 private String selectedimage; 70 71 72 private String imageExtension; 73 74 75 private long image; 76 77 78 private String selectedparent; 79 80 81 private String selectedparentPath; 82 83 84 private long htmlpage; 85 86 87 private String selectedhtmlpage; 88 89 90 public BannerForm() { 91 } 92 93 public long getInode() { 94 return this.inode; 95 } 96 97 public void setInode(long inode) { 98 this.inode = inode; 99 } 100 public java.lang.String getTitle() { 101 return this.title; 102 } 103 104 public void setTitle(java.lang.String title) { 105 this.title = title; 106 } 107 public java.lang.String getImageFile() { 108 return this.imageFile; 109 } 110 111 public void setImageFile(java.lang.String imageFile) { 112 this.imageFile = imageFile; 113 } 114 public int getImageWidth() { 115 return this.imageWidth; 116 } 117 118 public void setImageWidth(int imageWidth) { 119 this.imageWidth = imageWidth; 120 } 121 public int getImageHeight() { 122 return this.imageHeight; 123 } 124 125 public void setImageHeight(int imageHeight) { 126 this.imageHeight = imageHeight; 127 } 128 public java.lang.String getAltText() { 129 return this.altText; 130 } 131 132 public void setAltText(java.lang.String altText) { 133 this.altText = altText; 134 } 135 public java.lang.String getLink() { 136 return this.link; 137 } 138 139 public void setLink(java.lang.String link) { 140 this.link = link; 141 } 142 public java.util.Date getStartDate() { 143 return this.startDate; 144 } 145 146 public void setStartDate(java.util.Date startDate) { 147 this.startDate = startDate; 148 } 149 public java.util.Date getEndDate() { 150 return this.endDate; 151 } 152 153 public void setEndDate(java.util.Date endDate) { 154 this.endDate = endDate; 155 } 156 public java.lang.String getBody() { 157 return this.body; 158 } 159 160 public void setBody(java.lang.String body) { 161 this.body = body; 162 } 163 170 174 public String getWebEndDate() { 175 return webEndDate; 176 } 177 178 182 public String getWebStartDate() { 183 return webStartDate; 184 } 185 186 190 public void setWebEndDate(String webEndDate) { 191 this.webEndDate = webEndDate; 192 try { 193 this.endDate = new SimpleDateFormat ("MM/dd/yyyy").parse(webEndDate); 194 } catch(ParseException ex) { 195 } 196 } 197 198 202 public void setWebStartDate(String webStartDate) { 203 this.webStartDate = webStartDate; 204 try { 205 this.startDate = new SimpleDateFormat ("MM/dd/yyyy").parse(webStartDate); 206 } catch(ParseException ex) { 207 } 208 } 209 210 214 public boolean isActive() { 215 return active; 216 } 217 218 222 public boolean isNewWindow() { 223 return newWindow; 224 } 225 226 230 public void setActive(boolean active) { 231 this.active = active; 232 } 233 234 238 public void setNewWindow(boolean newWindow) { 239 this.newWindow = newWindow; 240 } 241 242 246 public String [] getCategories() { 247 return categories; 248 } 249 250 254 public void setCategories(String [] categories) { 255 this.categories = categories; 256 } 257 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { 258 if(request.getParameter("cmd")!=null && request.getParameter("cmd").equals(Constants.ADD)) { 259 Logger.debug(this, "Banner validation!!!!!!" + mapping.getForward()); 260 return super.validate(mapping, request); 261 } 262 return null; 263 } 264 268 public String getCaption() { 269 return caption; 270 } 271 272 276 public void setCaption(String caption) { 277 this.caption = caption; 278 } 279 280 281 282 283 286 public long getImage() { 287 return image; 288 } 289 292 public void setImage(long image) { 293 this.image = image; 294 } 295 298 public String getSelectedimage() { 299 return selectedimage; 300 } 301 304 public void setSelectedimage(String selectedimage) { 305 this.selectedimage = selectedimage; 306 } 307 308 309 312 public String getImageExtension() { 313 return imageExtension; 314 } 315 318 public void setImageExtension(String imageExtension) { 319 this.imageExtension = imageExtension; 320 } 321 322 325 public long getParent() { 326 return parent; 327 } 328 331 public void setParent(long parent) { 332 this.parent = parent; 333 } 334 337 public String getSelectedparent() { 338 return selectedparent; 339 } 340 343 public void setSelectedparent(String selectedparent) { 344 this.selectedparent = selectedparent; 345 } 346 349 public String getSelectedparentPath() { 350 return selectedparentPath; 351 } 352 355 public void setSelectedparentPath(String selectedparentPath) { 356 this.selectedparentPath = selectedparentPath; 357 } 358 359 362 public long getHtmlpage() { 363 return htmlpage; 364 } 365 368 public void setHtmlpage(long htmlpage) { 369 this.htmlpage = htmlpage; 370 } 371 374 public String getSelectedhtmlpage() { 375 return selectedhtmlpage; 376 } 377 380 public void setSelectedhtmlpage(String selectedhtmlpage) { 381 this.selectedhtmlpage = selectedhtmlpage; 382 } 383 } 384 | Popular Tags |