int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();
TicketVO ticketVO = new TicketVO();
TicketForm ticketForm = (TicketForm)form;
SupportFacadeHome supportFacade = (SupportFacadeHome)CVUtility.getHomeObject("com.centraview.support.supportfacade.SupportFacadeHome", "SupportFacade");
SupportFacade remote = (SupportFacade)supportFacade.create();
remote.setDataSource(dataSource);
if (ticketForm.getSubject() != null) {
ticketVO.setTitle(ticketForm.getSubject());
}
if (ticketForm.getDetail() != null) {
ticketVO.setDetail(ticketForm.getDetail());
}
if (ticketForm.getPriority() != null) {
ticketVO.setPriorityId(Integer.parseInt(ticketForm.getPriority()));
}else{
ticketVO.setPriorityId(Integer.parseInt(request.getParameter("priority")));
}
if (ticketForm.getStatus() != null) {
ticketVO.setStatusId(Integer.parseInt(ticketForm.getStatus()));
}
if ((ticketForm.getManagerid() != null) && (!ticketForm.getManagerid().equals(""))) {
ticketVO.setManagerId(Integer.parseInt(ticketForm.getManagerid()));
}
if ((ticketForm.getAssignedtoid() != null) && (!ticketForm.getAssignedtoid().equals(""))) {
ticketVO.setAssignedToId(Integer.parseInt(ticketForm.getAssignedtoid()));
}
if ((ticketForm.getEntityid() != null) && (!ticketForm.getEntityid().equals(""))) {
ticketVO.setRefEntityId(Integer.parseInt(ticketForm.getEntityid()));
}
if ((ticketForm.getContactid() != null) && (!ticketForm.getContactid().equals(""))) {
ticketVO.setRefIndividualId(Integer.parseInt(ticketForm.getContactid()));
}
ticketVO.setCreatedBy(individualId);
ticketVO.setCustomField(getCustomFieldVO(request, response));
remote.addTicket(individualId, ticketVO);
FORWARD_final = FORWARD_editsavefile;
} catch (Exception e) {
System.out.println("[Exception][SaveTicketHandler.execute] Exception Thrown: " + e);
e.printStackTrace();