@Test public void testSaveAdminTabLockdownValueException() throws IOException { assertNull(admin.saveAdminTabLockdownValue(request, response)); }
@RequestMapping( value = {"/adminTabController/save_LockDownValue.htm"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST}) public ModelAndView saveAdminTabLockdownValue(HttpServletRequest request, HttpServletResponse response) throws IOException { response.setCharacterEncoding(PolicyUtils.CHARACTER_ENCODING); request.setCharacterEncoding(PolicyUtils.CHARACTER_ENCODING); try { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); String userId = UserUtils.getUserSession(request).getOrgUserId(); LOGGER.info( "********************Logging UserID for Application Lockdown Function**************************"); LOGGER.info("UserId: " + userId); LOGGER.info( "**********************************************************************************************"); JsonNode root = mapper.readTree(request.getReader()); GlobalRoleSettings globalRole = mapper.readValue(root.get("lockdowndata").toString(), GlobalRoleSettings.class); globalRole.setRole("super-admin"); commonClassDao.update(globalRole); response.setContentType(PolicyUtils.APPLICATION_JSON); String responseString = mapper.writeValueAsString(commonClassDao.getData(GlobalRoleSettings.class)); response.getWriter().write(new JSONObject("{descriptiveScopeDictionaryDatas: " + responseString + "}").toString()); } catch (Exception e) { LOGGER.error("Exception Occured" + e); response.getWriter().write(PolicyUtils.CATCH_EXCEPTION); } return null; }
AdminTabController extends RestrictedBaseController { @RequestMapping( value = {"/adminTabController/save_LockDownValue.htm"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST}) public ModelAndView saveAdminTabLockdownValue(HttpServletRequest request, HttpServletResponse response) throws IOException { response.setCharacterEncoding(PolicyUtils.CHARACTER_ENCODING); request.setCharacterEncoding(PolicyUtils.CHARACTER_ENCODING); try { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); String userId = UserUtils.getUserSession(request).getOrgUserId(); LOGGER.info( "********************Logging UserID for Application Lockdown Function**************************"); LOGGER.info("UserId: " + userId); LOGGER.info( "**********************************************************************************************"); JsonNode root = mapper.readTree(request.getReader()); GlobalRoleSettings globalRole = mapper.readValue(root.get("lockdowndata").toString(), GlobalRoleSettings.class); globalRole.setRole("super-admin"); commonClassDao.update(globalRole); response.setContentType(PolicyUtils.APPLICATION_JSON); String responseString = mapper.writeValueAsString(commonClassDao.getData(GlobalRoleSettings.class)); response.getWriter().write(new JSONObject("{descriptiveScopeDictionaryDatas: " + responseString + "}").toString()); } catch (Exception e) { LOGGER.error("Exception Occured" + e); response.getWriter().write(PolicyUtils.CATCH_EXCEPTION); } return null; } }
AdminTabController extends RestrictedBaseController { @RequestMapping( value = {"/adminTabController/save_LockDownValue.htm"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST}) public ModelAndView saveAdminTabLockdownValue(HttpServletRequest request, HttpServletResponse response) throws IOException { response.setCharacterEncoding(PolicyUtils.CHARACTER_ENCODING); request.setCharacterEncoding(PolicyUtils.CHARACTER_ENCODING); try { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); String userId = UserUtils.getUserSession(request).getOrgUserId(); LOGGER.info( "********************Logging UserID for Application Lockdown Function**************************"); LOGGER.info("UserId: " + userId); LOGGER.info( "**********************************************************************************************"); JsonNode root = mapper.readTree(request.getReader()); GlobalRoleSettings globalRole = mapper.readValue(root.get("lockdowndata").toString(), GlobalRoleSettings.class); globalRole.setRole("super-admin"); commonClassDao.update(globalRole); response.setContentType(PolicyUtils.APPLICATION_JSON); String responseString = mapper.writeValueAsString(commonClassDao.getData(GlobalRoleSettings.class)); response.getWriter().write(new JSONObject("{descriptiveScopeDictionaryDatas: " + responseString + "}").toString()); } catch (Exception e) { LOGGER.error("Exception Occured" + e); response.getWriter().write(PolicyUtils.CATCH_EXCEPTION); } return null; } AdminTabController(); @Autowired private  AdminTabController(CommonClassDao commonClassDao); }
AdminTabController extends RestrictedBaseController { @RequestMapping( value = {"/adminTabController/save_LockDownValue.htm"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST}) public ModelAndView saveAdminTabLockdownValue(HttpServletRequest request, HttpServletResponse response) throws IOException { response.setCharacterEncoding(PolicyUtils.CHARACTER_ENCODING); request.setCharacterEncoding(PolicyUtils.CHARACTER_ENCODING); try { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); String userId = UserUtils.getUserSession(request).getOrgUserId(); LOGGER.info( "********************Logging UserID for Application Lockdown Function**************************"); LOGGER.info("UserId: " + userId); LOGGER.info( "**********************************************************************************************"); JsonNode root = mapper.readTree(request.getReader()); GlobalRoleSettings globalRole = mapper.readValue(root.get("lockdowndata").toString(), GlobalRoleSettings.class); globalRole.setRole("super-admin"); commonClassDao.update(globalRole); response.setContentType(PolicyUtils.APPLICATION_JSON); String responseString = mapper.writeValueAsString(commonClassDao.getData(GlobalRoleSettings.class)); response.getWriter().write(new JSONObject("{descriptiveScopeDictionaryDatas: " + responseString + "}").toString()); } catch (Exception e) { LOGGER.error("Exception Occured" + e); response.getWriter().write(PolicyUtils.CATCH_EXCEPTION); } return null; } AdminTabController(); @Autowired private  AdminTabController(CommonClassDao commonClassDao); static CommonClassDao getCommonClassDao(); static void setCommonClassDao(CommonClassDao commonClassDao); @RequestMapping( value = {"/get_LockDownData"}, method = {org.springframework.web.bind.annotation.RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getAdminTabEntityData(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/adminTabController/save_LockDownValue.htm"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST}) ModelAndView saveAdminTabLockdownValue(HttpServletRequest request, HttpServletResponse response); }
AdminTabController extends RestrictedBaseController { @RequestMapping( value = {"/adminTabController/save_LockDownValue.htm"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST}) public ModelAndView saveAdminTabLockdownValue(HttpServletRequest request, HttpServletResponse response) throws IOException { response.setCharacterEncoding(PolicyUtils.CHARACTER_ENCODING); request.setCharacterEncoding(PolicyUtils.CHARACTER_ENCODING); try { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); String userId = UserUtils.getUserSession(request).getOrgUserId(); LOGGER.info( "********************Logging UserID for Application Lockdown Function**************************"); LOGGER.info("UserId: " + userId); LOGGER.info( "**********************************************************************************************"); JsonNode root = mapper.readTree(request.getReader()); GlobalRoleSettings globalRole = mapper.readValue(root.get("lockdowndata").toString(), GlobalRoleSettings.class); globalRole.setRole("super-admin"); commonClassDao.update(globalRole); response.setContentType(PolicyUtils.APPLICATION_JSON); String responseString = mapper.writeValueAsString(commonClassDao.getData(GlobalRoleSettings.class)); response.getWriter().write(new JSONObject("{descriptiveScopeDictionaryDatas: " + responseString + "}").toString()); } catch (Exception e) { LOGGER.error("Exception Occured" + e); response.getWriter().write(PolicyUtils.CATCH_EXCEPTION); } return null; } AdminTabController(); @Autowired private  AdminTabController(CommonClassDao commonClassDao); static CommonClassDao getCommonClassDao(); static void setCommonClassDao(CommonClassDao commonClassDao); @RequestMapping( value = {"/get_LockDownData"}, method = {org.springframework.web.bind.annotation.RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getAdminTabEntityData(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/adminTabController/save_LockDownValue.htm"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST}) ModelAndView saveAdminTabLockdownValue(HttpServletRequest request, HttpServletResponse response);  }