예제 #1
0
  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;
  }
예제 #2
0
 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);
 }
예제 #3
0
 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);
 }
예제 #4
0
 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);
 }
예제 #5
0
 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);
 }
예제 #6
0
 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);
 }
예제 #7
0
 public ActionForward createNewInquiry(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   final CerimonyInquiry cerimonyInquiry = CerimonyInquiry.createNew();
   return forwardToInquiry(mapping, request, "editAlumniCerimonyInquiry", cerimonyInquiry);
 }