public ActionForward exportInfoToExcel( ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws IOException { final CerimonyInquiry cerimonyInquiry = getDomainObject(request, "cerimonyInquiryId"); if (cerimonyInquiry != null) { Collection<CerimonyInquiryPerson> requests = cerimonyInquiry.getCerimonyInquiryPersonSet(); String inquiryName = (cerimonyInquiry.getDescription() != null ? cerimonyInquiry.getDescription() : "UnnamedInquiry") .replaceAll(" ", "_"); final String filename = BundleUtil.getString( Bundle.ALUMNI, "label.publicRelationOffice.alumniCerimony.inquiry.report") + "_" + inquiryName + "_" + new DateTime().toString("ddMMyyyyHHmmss"); response.setContentType("application/vnd.ms-excel"); response.setHeader("Content-disposition", "attachment; filename=" + filename + ".xls"); ServletOutputStream writer = response.getOutputStream(); exportToXls(requests, writer); writer.flush(); response.flushBuffer(); } return null; }
public ActionForward toggleObservationFlag( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { final CerimonyInquiry cerimonyInquiry = getDomainObject(request, "cerimonyInquiryId"); cerimonyInquiry.toggleObservationFlag(); return forwardToInquiry(mapping, request, "viewAlumniCerimonyInquiry", cerimonyInquiry); }
public ActionForward addInquiryAnswer( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { final CerimonyInquiry cerimonyInquiry = getDomainObject(request, "cerimonyInquiryId"); final CerimonyInquiryAnswer cerimonyInquiryAnswer = cerimonyInquiry.createNewAnswer(); return editInquiryAnswer(mapping, request, cerimonyInquiryAnswer); }
public ActionForward deleteInquiry( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { final CerimonyInquiry cerimonyInquiry = getDomainObject(request, "cerimonyInquiryId"); cerimonyInquiry.delete(); return manage(mapping, form, request, response); }
public ActionForward sendEmail( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { final CerimonyInquiry cerimonyInquiry = getDomainObject(request, "cerimonyInquiryId"); final Sender sender = getPublicRelationsSender(); final Recipient recipient = cerimonyInquiry.createRecipient(); return EmailsDA.sendEmail(request, sender, recipient); }
public ActionForward addPeople( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { final CerimonyInquiry cerimonyInquiry = getDomainObject(request, "cerimonyInquiryId"); final UsernameFileBean usernameFileBean = getRenderedObject(); final String contents = FileUtils.readFile(usernameFileBean.getInputStream()); final Set<String> usernames = findUsernames(contents); cerimonyInquiry.addPeople(usernames); return forwardToInquiry(mapping, request, "viewAlumniCerimonyInquiry", cerimonyInquiry); }
public ActionForward createNewInquiry( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { final CerimonyInquiry cerimonyInquiry = CerimonyInquiry.createNew(); return forwardToInquiry(mapping, request, "editAlumniCerimonyInquiry", cerimonyInquiry); }