@RequestMapping(value = "/{siteId}/{pageId}/fileVersions.htm", method = RequestMethod.GET) protected ModelAndView getFileVersion( @PathVariable String siteId, @PathVariable String pageId, HttpServletRequest request, HttpServletResponse response) throws Exception { ModelAndView modelAndView = null; try { AuthRequest ar = AuthRequest.getOrCreate(request, response); NGPage ngp = registerRequiredProject(ar, siteId, pageId); if (!ar.isLoggedIn()) { return showWarningView(ar, "nugen.project.file.version.login.msg"); } if (!ar.isMember()) { request.setAttribute("roleName", "Members"); return showWarningView(ar, "nugen.attachment.file.version.memberlogin"); } String aid = ar.reqParam("aid"); ngp.findAttachmentByIDOrFail(aid); modelAndView = createNamedView(siteId, pageId, ar, "fileVersions", "Project Documents"); request.setAttribute("subTabId", "nugen.projectdocument.subtab.fileversions"); request.setAttribute("aid", aid); request.setAttribute("realRequestURL", ar.getRequestURL()); request.setAttribute("title", ngp.getFullName()); } catch (Exception ex) { throw new NGException( "nugen.operation.fail.project.file.version.page", new Object[] {pageId, siteId}, ex); } return modelAndView; }
@RequestMapping(value = "/{siteId}/{pageId}/docinfo{docId}.htm", method = RequestMethod.GET) protected ModelAndView docInfoView( @PathVariable String siteId, @PathVariable String pageId, @PathVariable String docId, HttpServletRequest request, HttpServletResponse response) throws Exception { try { AuthRequest ar = AuthRequest.getOrCreate(request, response); NGPage ngp = registerRequiredProject(ar, siteId, pageId); ngp.findAttachmentByIDOrFail(docId); request.setAttribute("realRequestURL", ar.getRequestURL()); request.setAttribute("subTabId", "nugen.projectdocument.subtab.attachmentdetails"); request.setAttribute("aid", docId); return createNamedView(siteId, pageId, ar, "docinfo", "Project Documents"); } catch (Exception ex) { throw new NGException( "nugen.operation.fail.project.download.document.page", new Object[] {pageId, siteId}, ex); } }