Ejemplo n.º 1
0
 @Transactional
 @RequestMapping(
     value = "/proposalDevelopment",
     params = {"methodToCall=viewUserAttachedFormPDF"})
 public ModelAndView viewUserAttachedFormPDF(
     ProposalDevelopmentDocumentForm form,
     HttpServletResponse response,
     @RequestParam("selectedLine") String selectedLine)
     throws Exception {
   DevelopmentProposal developmentProposal = form.getDevelopmentProposal();
   List<S2sUserAttachedForm> s2sAttachedForms = developmentProposal.getS2sUserAttachedForms();
   S2sUserAttachedForm selectedForm = s2sAttachedForms.get(Integer.parseInt(selectedLine));
   S2sUserAttachedFormFileContract userAttachedFormFile =
       getUserAttachedFormService().findUserAttachedFormFile(selectedForm);
   if (userAttachedFormFile != null) {
     ControllerFileUtils.streamToResponse(
         userAttachedFormFile.getFormFile(),
         selectedForm.getFormFileName(),
         CONTENT_TYPE_PDF,
         response);
   } else {
     return getModelAndViewService().getModelAndView(form);
   }
   return null;
 }
Ejemplo n.º 2
0
 @Transactional
 @RequestMapping(
     value = "/proposalDevelopment",
     params = {"methodToCall=printFormsXml"})
 public ModelAndView printFormsXml(
     @ModelAttribute("KualiForm") ProposalDevelopmentDocumentForm form,
     HttpServletResponse response)
     throws Exception {
   form.getDevelopmentProposal().setGrantsGovSelectFlag(true);
   return printForms(form, response);
 }
Ejemplo n.º 3
0
 @Transactional
 @RequestMapping(
     value = "/proposalDevelopment",
     params = {"methodToCall=clearOpportunity"})
 public ModelAndView clearOpportunity(
     @ModelAttribute("KualiForm") ProposalDevelopmentDocumentForm form,
     BindingResult result,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   ((ProposalDevelopmentViewHelperServiceImpl) form.getViewHelperService())
       .clearOpportunity(form.getDevelopmentProposal());
   return getRefreshControllerService().refresh(form);
 }
Ejemplo n.º 4
0
 @Transactional
 @RequestMapping(
     value = "/proposalDevelopment",
     params = {"methodToCall=deleteUserAttachedForm"})
 public ModelAndView deleteUserAttachedForm(
     ProposalDevelopmentDocumentForm form,
     HttpServletResponse response,
     @RequestParam("selectedLine") String selectedLine)
     throws Exception {
   S2sUserAttachedForm deleteForm =
       form.getDevelopmentProposal()
           .getS2sUserAttachedForms()
           .remove(Integer.parseInt(selectedLine));
   getDataObjectService().delete(deleteForm);
   getS2sUserAttachedFormService()
       .resetFormAvailability(form.getProposalDevelopmentDocument(), deleteForm.getNamespace());
   return getModelAndViewService().getModelAndView(form);
 }