@Test public final void testEditButtonVisiblityScopeAgency2() { try { MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); DefaultSiteCommand comm = new DefaultSiteCommand(); comm.setEditMode(false); comm.setSiteOid(9001L); this.removeAllCurrentUserPrivileges(); assertFalse(authorityManager.hasPrivilege(Privilege.MODIFY_SITE,Privilege.SCOPE_AGENCY)); BindException aError = new BindException(new DefaultSiteCommand(), null); ModelAndView mav = testInstance.showForm(request, response, comm, aError); assertTrue(mav != null); assertTrue(mav.getViewName().equals("site")); assertFalse((Boolean)request.getSession().getAttribute(Constants.GBL_SESS_CAN_EDIT)); addCurrentUserPrivilege(Privilege.SCOPE_AGENCY, Privilege.MODIFY_SITE); assertTrue(authorityManager.hasPrivilege(Privilege.MODIFY_SITE,Privilege.SCOPE_AGENCY)); mav = testInstance.showForm(request, response, comm, aError); assertTrue(mav != null); assertTrue(mav.getViewName().equals("site")); assertFalse((Boolean)request.getSession().getAttribute(Constants.GBL_SESS_CAN_EDIT)); } catch (Exception e) { String message = e.getClass().toString() + " - " + e.getMessage(); log.debug(message); fail(message); } }
@Override protected ModelAndView showForm(HttpServletRequest req, HttpServletResponse res, Object comm, BindException bex) throws Exception { log.debug("------------------------showForm-------------------------------"); return processInitial(req, res, comm, bex); }
SiteController extends TabbedController { @Override protected ModelAndView showForm(HttpServletRequest req, HttpServletResponse res, Object comm, BindException bex) throws Exception { log.debug("------------------------showForm-------------------------------"); return processInitial(req, res, comm, bex); } }
SiteController extends TabbedController { @Override protected ModelAndView showForm(HttpServletRequest req, HttpServletResponse res, Object comm, BindException bex) throws Exception { log.debug("------------------------showForm-------------------------------"); return processInitial(req, res, comm, bex); } SiteController(); }
SiteController extends TabbedController { @Override protected ModelAndView showForm(HttpServletRequest req, HttpServletResponse res, Object comm, BindException bex) throws Exception { log.debug("------------------------showForm-------------------------------"); return processInitial(req, res, comm, bex); } SiteController(); void bindEditorContext(HttpServletRequest req, SiteEditorContext context); void unbindEditorContext(HttpServletRequest req); SiteEditorContext getEditorContext(HttpServletRequest req); void checkSave(HttpServletRequest req, BindException errors); ModelAndView getErrorsView(Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors); void setSiteManager(SiteManager siteManager); void setAuthorityManager(AuthorityManager authorityManager); void setBusinessObjectFactory(BusinessObjectFactory businessObjectFactory); void setMessageSource(MessageSource messageSource); void setSiteSearchController(SiteSearchController siteSearchController); }
SiteController extends TabbedController { @Override protected ModelAndView showForm(HttpServletRequest req, HttpServletResponse res, Object comm, BindException bex) throws Exception { log.debug("------------------------showForm-------------------------------"); return processInitial(req, res, comm, bex); } SiteController(); void bindEditorContext(HttpServletRequest req, SiteEditorContext context); void unbindEditorContext(HttpServletRequest req); SiteEditorContext getEditorContext(HttpServletRequest req); void checkSave(HttpServletRequest req, BindException errors); ModelAndView getErrorsView(Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors); void setSiteManager(SiteManager siteManager); void setAuthorityManager(AuthorityManager authorityManager); void setBusinessObjectFactory(BusinessObjectFactory businessObjectFactory); void setMessageSource(MessageSource messageSource); void setSiteSearchController(SiteSearchController siteSearchController); static final String EDITOR_CONTEXT; }