@RequestMapping(value = "/removeDocumentType", method = RequestMethod.GET) public @ResponseBody void removeDocumentType( @RequestParam(value = "nID") Long nID, HttpServletResponse response) { try { documentTypeDao.removeDocumentType(nID); } catch (RuntimeException e) { response.setStatus(403); response.setHeader("Reason", e.getMessage()); } }
@RequestMapping(value = "/setDocumentType", method = RequestMethod.GET) public @ResponseBody ResponseEntity<DocumentType> setDocumentType( @RequestParam(value = "nID") Long nID, @RequestParam(value = "sName") String sName, @RequestParam(value = "bHidden", required = false) Boolean bHidden) { ResponseEntity<DocumentType> result; try { DocumentType documentType = documentTypeDao.setDocumentType(nID, sName, bHidden); result = JsonRestUtils.toJsonResponse(documentType); } catch (RuntimeException e) { result = toJsonErrorResponse(403, e.getMessage()); } return result; }
@RequestMapping(value = "/getDocumentTypes", method = RequestMethod.GET) public @ResponseBody List<DocumentType> getDocumentTypes() throws Exception { return documentTypeDao.getDocumentTypes(); }