@RequestMapping( value = Routes.RETAIL_CUSTOMER_MEMBER, method = RequestMethod.PUT, consumes = "application/atom+xml", produces = "application/atom+xml") @ResponseBody public void update( HttpServletResponse response, @PathVariable Long applicationInformationId, @RequestParam Map<String, String> params, InputStream stream) throws IOException, FeedException { RetailCustomer retailCustomer = retailCustomerService.findById(applicationInformationId); if (retailCustomer != null) { try { RetailCustomer newRetailCustomer = retailCustomerService.importResource(stream); retailCustomer.merge(newRetailCustomer); } catch (Exception e) { System.out.printf( "***** Error Caused by RetailCustomer.x.IndentifiedObject need: %s", e.toString()); response.setStatus(HttpServletResponse.SC_BAD_REQUEST); } } }
@RequestMapping(value = Routes.RETAIL_CUSTOMER_MEMBER, method = RequestMethod.DELETE) public void delete( HttpServletResponse response, @PathVariable Long applicationInformationId, @RequestParam Map<String, String> params, InputStream stream) throws IOException, FeedException { RetailCustomer retailCustomer = retailCustomerService.findById(applicationInformationId); if (retailCustomer != null) { retailCustomerService.delete(retailCustomer); } }
@RequestMapping(value = Routes.DATA_CUSTODIAN_RETAIL_CUSTOMER_SHOW, method = RequestMethod.GET) public String show(@PathVariable Long retailCustomerId, ModelMap model) { RetailCustomer retailCustomer = service.findById(retailCustomerId); model.put("retailCustomer", retailCustomer); return "/custodian/retailcustomers/show"; }