} else if (path.equals("/event/deleteCommentsRating")) {
deleteSocialEventComment(request, response, modelFacade);
} else if (path.equals("/event/addEvent") || path.equals("updateEvent")) {
// file upload
logger.finer("AddEvent ... ");
FileUploadHandler fuh = new FileUploadHandler();
Hashtable<String, String> htUpload = fuh.getInitialParams(request, response);
// file is upload check for error and then write to database
if (htUpload != null) {
StringBuilder sb = new StringBuilder();
for (String key : htUpload.keySet()) {
sb.append(key);
sb.append(comma);
}
logger.finer("\n***elements = " + sb.toString());
SocialEvent event = null;
/* Don't check for submit since we're doing upload in 2 phases
* and we may not have read it in. We don't do updates.
String type = htUpload.get("submit");
if (type == null) {
return "/site.jsp?page=error.jsp";
}
if (type.equals("Update")) {
event = getEvent(modelFacade, htUpload);
} else {
*/
event = createEvent(request, modelFacade, htUpload);
if (request.getSession(true).getAttribute("userBean") != null) {
UserBean uBean = (UserBean) request.getSession(true).getAttribute("userBean");
uBean.setDisplayMessage("Event added successfully");
logger.log(Level.FINER, "A new Event has been added and persisted");
}
//}
String id = String.valueOf(event.getSocialEventID());
htUpload = fuh.handleFileUpload(id, request, response);
// Update the event with the right stuff.
updateEvent(event, request, modelFacade, htUpload);
// clear the cache