1 package com.dotmarketing.portlets.webevents.struts; 2 3 import java.text.SimpleDateFormat ; 4 5 import javax.servlet.http.HttpServletRequest ; 6 7 import org.apache.struts.Globals; 8 import org.apache.struts.action.ActionErrors; 9 import org.apache.struts.action.ActionMapping; 10 import org.apache.struts.action.ActionMessage; 11 import org.apache.struts.validator.ValidatorForm; 12 13 import com.dotmarketing.util.UtilMethods; 14 import com.liferay.portal.util.Constants; 15 import com.dotmarketing.portlets.webevents.factories.WebEventFactory; 16 import com.dotmarketing.portlets.webevents.model.WebEvent; 17 18 public class WebEventLocationForm extends ValidatorForm { 19 20 private static final long serialVersionUID = 1L; 21 22 private long inode; private long webEventInode; private String city; private String state; private String title; 27 28 29 private java.util.Date startDate; private String strStartDate; 31 private java.util.Date endDate; private String strEndDate; 33 private String strStartTime; 34 private String strEndTime; 35 36 private boolean showOnWeb; private boolean webRegActive; private String hotelName; 40 41 private long hotelLink; private String selectedhotelLink; private long pastEventLink; private String selectedpastEventLink; 46 private float partnerPrice; private float nonPartnerPrice; private String shortDescription; private String textEmail; private boolean almostAtCapacity = false; private boolean full = false; private boolean defaultContractPartnerPrice = false; 54 public WebEventLocationForm() { 55 } 56 57 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { 58 if(request.getParameter("cmd")!=null && request.getParameter("cmd").equals(Constants.SAVE)) { 59 ActionErrors ae = new ActionErrors(); 60 WebEvent event = (WebEvent) WebEventFactory.getWebEvent(webEventInode); 61 62 if (event.isInstitute() && !UtilMethods.isSet(city)) { 63 ae.add(Globals.ERROR_KEY,new ActionMessage("message.webeventlocation.city","City")); 64 } 65 if (event.isInstitute() && !UtilMethods.isSet(state)) { 66 ae.add(Globals.ERROR_KEY,new ActionMessage("message.webeventlocation.state","State")); 67 } 68 75 ae.add(super.validate(mapping, request)); 76 return ae; 77 } 78 return null; 79 } 80 81 84 public String getCity() { 85 return city; 86 } 87 88 91 public void setCity(String city) { 92 this.city = city; 93 } 94 95 98 public java.util.Date getEndDate() { 99 return endDate; 100 } 101 102 105 public void setEndDate(java.util.Date endDate) { 106 this.endDate = endDate; 107 } 108 109 112 public long getHotelLink() { 113 return hotelLink; 114 } 115 116 119 public void setHotelLink(long hotelLink) { 120 this.hotelLink = hotelLink; 121 } 122 123 126 public String getHotelName() { 127 return hotelName; 128 } 129 130 133 public void setHotelName(String hotelName) { 134 this.hotelName = hotelName; 135 } 136 137 140 public long getInode() { 141 return inode; 142 } 143 144 147 public void setInode(long inode) { 148 this.inode = inode; 149 } 150 151 154 public float getNonPartnerPrice() { 155 return nonPartnerPrice; 156 } 157 158 161 public void setNonPartnerPrice(float nonPartnerPrice) { 162 this.nonPartnerPrice = nonPartnerPrice; 163 } 164 165 168 public float getPartnerPrice() { 169 return partnerPrice; 170 } 171 172 175 public void setPartnerPrice(float partnerPrice) { 176 this.partnerPrice = partnerPrice; 177 } 178 179 182 public long getPastEventLink() { 183 return pastEventLink; 184 } 185 186 189 public void setPastEventLink(long pastEventLink) { 190 this.pastEventLink = pastEventLink; 191 } 192 193 196 public String getShortDescription() { 197 return shortDescription; 198 } 199 200 203 public void setShortDescription(String shortDescription) { 204 this.shortDescription = shortDescription; 205 } 206 207 210 public boolean isShowOnWeb() { 211 return showOnWeb; 212 } 213 214 217 public void setShowOnWeb(boolean showOnWeb) { 218 this.showOnWeb = showOnWeb; 219 } 220 221 224 public java.util.Date getStartDate() { 225 return startDate; 226 } 227 228 231 public void setStartDate(java.util.Date startDate) { 232 this.startDate = startDate; 233 } 234 235 238 public String getState() { 239 return state; 240 } 241 242 245 public void setState(String state) { 246 this.state = state; 247 } 248 249 252 public String getTextEmail() { 253 return textEmail; 254 } 255 256 259 public void setTextEmail(String textEmail) { 260 this.textEmail = textEmail; 261 } 262 263 266 public long getWebEventInode() { 267 return webEventInode; 268 } 269 270 273 public void setWebEventInode(long webEventInode) { 274 this.webEventInode = webEventInode; 275 } 276 277 280 public boolean isWebRegActive() { 281 return webRegActive; 282 } 283 284 287 public void setWebRegActive(boolean webRegActive) { 288 this.webRegActive = webRegActive; 289 } 290 291 294 public String getSelectedhotelLink() { 295 return selectedhotelLink; 296 } 297 298 301 public void setSelectedhotelLink(String selectedhotelLink) { 302 this.selectedhotelLink = selectedhotelLink; 303 } 304 305 308 public String getSelectedpastEventLink() { 309 return selectedpastEventLink; 310 } 311 312 315 public void setSelectedpastEventLink(String selectedpastEventLink) { 316 this.selectedpastEventLink = selectedpastEventLink; 317 } 318 319 322 public String getStrEndDate() { 323 if (endDate!=null && !UtilMethods.isSet(strEndDate)) { 324 return new SimpleDateFormat ("MM/dd/yyyy").format(endDate); 325 } 326 return strEndDate; 327 } 328 329 332 public void setStrEndDate(String strEndDate) { 333 this.strEndDate = strEndDate; 334 try { 335 if (UtilMethods.isSet(strEndTime)) { 336 this.endDate = new SimpleDateFormat ("MM/dd/yyyy H:mm:ss").parse(strEndDate + " " + strEndTime); 337 } 338 else { 339 this.endDate = new SimpleDateFormat ("MM/dd/yyyy").parse(strEndDate); 340 } 341 } 342 catch(Exception ex) { 343 } 344 } 345 346 349 public String getStrStartDate() { 350 if (startDate!=null && !UtilMethods.isSet(strStartDate)) { 351 return new SimpleDateFormat ("MM/dd/yyyy").format(startDate); 352 } 353 return strStartDate; 354 } 355 358 public void setStrStartDate(String strStartDate) { 359 this.strStartDate = strStartDate; 360 try { 361 if (UtilMethods.isSet(strStartTime)) { 362 this.startDate = new SimpleDateFormat ("MM/dd/yyyy H:mm:ss").parse(strStartDate + " " + strStartTime); 363 } 364 else { 365 this.startDate = new SimpleDateFormat ("MM/dd/yyyy").parse(strStartDate); 366 } 367 } 368 catch(Exception ex) { 369 } 370 } 371 372 375 public String getTitle() { 376 return title; 377 } 378 379 382 public void setTitle(String title) { 383 this.title = title; 384 } 385 386 389 public String getStrEndTime() { 390 if (endDate!=null && !UtilMethods.isSet(strEndTime)) { 391 return new SimpleDateFormat ("H:mm:ss").format(endDate); 392 } 393 return strEndTime; 394 } 395 396 399 public void setStrEndTime(String strEndTime) { 400 this.strEndTime = strEndTime; 401 } 402 403 406 public String getStrStartTime() { 407 if (startDate!=null && !UtilMethods.isSet(strStartTime)) { 408 return new SimpleDateFormat ("H:mm:ss").format(startDate); 409 } 410 return strStartTime; 411 } 412 413 416 public void setStrStartTime(String strStartTime) { 417 this.strStartTime = strStartTime; 418 } 419 420 public boolean isAlmostAtCapacity() { 421 return almostAtCapacity; 422 } 423 424 public void setAlmostAtCapacity(boolean almostAtCapacity) { 425 this.almostAtCapacity = almostAtCapacity; 426 } 427 428 public boolean isFull() { 429 return full; 430 } 431 432 public void setFull(boolean full) { 433 this.full = full; 434 } 435 436 public boolean isDefaultContractPartnerPrice() { 437 return defaultContractPartnerPrice; 438 } 439 440 public void setDefaultContractPartnerPrice(boolean defaultContractPartnerPrice) { 441 this.defaultContractPartnerPrice = defaultContractPartnerPrice; 442 } 443 } 444 | Popular Tags |