Ejemplo n.º 1
0
 @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());
   }
 }
Ejemplo n.º 2
0
 @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;
 }
Ejemplo n.º 3
0
 @RequestMapping(value = "/getDocumentTypes", method = RequestMethod.GET)
 public @ResponseBody List<DocumentType> getDocumentTypes() throws Exception {
   return documentTypeDao.getDocumentTypes();
 }