@Test public final void testPreProcessNextTab() { HttpServletRequest aReq = new MockHttpServletRequest(); TargetManager targetManager = new MockTargetManager(testFile); testInstance.setTargetManager(targetManager); testSetSubGroupSeparator(); TargetGroup targetGroup = targetManager.loadGroup(15000L); GroupsEditorContext groupsEditorContext = new GroupsEditorContext(targetGroup,true); aReq.getSession().setAttribute(TabbedGroupController.EDITOR_CONTEXT, groupsEditorContext); HttpServletResponse aResp = new MockHttpServletResponse(); MembersCommand aCmd = new MembersCommand(); TabbedController tc = new TabbedGroupController(); TabConfig tabConfig = new TabConfig(); tabConfig.setViewName("group"); List<Tab> tabs = getTabList(targetManager); tabConfig.setTabs(tabs); tc.setTabConfig(tabConfig); tc.setDefaultCommandClass(org.webcurator.ui.groups.command.DefaultCommand.class); Tab currentTab = tabs.get(1); BindException aErrors = new BindException(aCmd, "MembersCommand"); ModelAndView mav = testInstance.preProcessNextTab(tc, currentTab, aReq, aResp, aCmd, aErrors); assertTrue(mav.getModel().get("command") instanceof MembersCommand); }
@Override public TabbedModelAndView preProcessNextTab(TabbedController tc, Tab nextTabID, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { String currentPageSize = CookieUtils.getPageSize(req); MembersCommand command = new MembersCommand(); command.setSelectedPageSize(currentPageSize); TargetGroup targetGroup = getEditorContext(req).getTargetGroup(); Pagination members = targetManager.getMembers(targetGroup, 0, Integer.parseInt(currentPageSize)); TabbedModelAndView tmav = tc.new TabbedModelAndView(); tmav.addObject("members", members); tmav.addObject("page", members); tmav.addObject("subGroupSeparator", subGroupSeparator); tmav.addObject(Constants.GBL_CMD_DATA, command); return tmav; }
MembersHandler extends AbstractGroupTabHandler { @Override public TabbedModelAndView preProcessNextTab(TabbedController tc, Tab nextTabID, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { String currentPageSize = CookieUtils.getPageSize(req); MembersCommand command = new MembersCommand(); command.setSelectedPageSize(currentPageSize); TargetGroup targetGroup = getEditorContext(req).getTargetGroup(); Pagination members = targetManager.getMembers(targetGroup, 0, Integer.parseInt(currentPageSize)); TabbedModelAndView tmav = tc.new TabbedModelAndView(); tmav.addObject("members", members); tmav.addObject("page", members); tmav.addObject("subGroupSeparator", subGroupSeparator); tmav.addObject(Constants.GBL_CMD_DATA, command); return tmav; } }
MembersHandler extends AbstractGroupTabHandler { @Override public TabbedModelAndView preProcessNextTab(TabbedController tc, Tab nextTabID, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { String currentPageSize = CookieUtils.getPageSize(req); MembersCommand command = new MembersCommand(); command.setSelectedPageSize(currentPageSize); TargetGroup targetGroup = getEditorContext(req).getTargetGroup(); Pagination members = targetManager.getMembers(targetGroup, 0, Integer.parseInt(currentPageSize)); TabbedModelAndView tmav = tc.new TabbedModelAndView(); tmav.addObject("members", members); tmav.addObject("page", members); tmav.addObject("subGroupSeparator", subGroupSeparator); tmav.addObject(Constants.GBL_CMD_DATA, command); return tmav; }  }
MembersHandler extends AbstractGroupTabHandler { @Override public TabbedModelAndView preProcessNextTab(TabbedController tc, Tab nextTabID, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { String currentPageSize = CookieUtils.getPageSize(req); MembersCommand command = new MembersCommand(); command.setSelectedPageSize(currentPageSize); TargetGroup targetGroup = getEditorContext(req).getTargetGroup(); Pagination members = targetManager.getMembers(targetGroup, 0, Integer.parseInt(currentPageSize)); TabbedModelAndView tmav = tc.new TabbedModelAndView(); tmav.addObject("members", members); tmav.addObject("page", members); tmav.addObject("subGroupSeparator", subGroupSeparator); tmav.addObject(Constants.GBL_CMD_DATA, command); return tmav; }  @Override void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); @Override void processTab(TabbedController tc, Tab currentTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors); @Override TabbedModelAndView preProcessNextTab(TabbedController tc,
			Tab nextTabID, HttpServletRequest req, HttpServletResponse res,
			Object comm, BindException errors); @Override ModelAndView processOther(TabbedController tc, Tab currentTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors); void setTargetManager(TargetManager aTargetManager); void setSubGroupSeparator(String subGroupSeparator); }
MembersHandler extends AbstractGroupTabHandler { @Override public TabbedModelAndView preProcessNextTab(TabbedController tc, Tab nextTabID, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { String currentPageSize = CookieUtils.getPageSize(req); MembersCommand command = new MembersCommand(); command.setSelectedPageSize(currentPageSize); TargetGroup targetGroup = getEditorContext(req).getTargetGroup(); Pagination members = targetManager.getMembers(targetGroup, 0, Integer.parseInt(currentPageSize)); TabbedModelAndView tmav = tc.new TabbedModelAndView(); tmav.addObject("members", members); tmav.addObject("page", members); tmav.addObject("subGroupSeparator", subGroupSeparator); tmav.addObject(Constants.GBL_CMD_DATA, command); return tmav; }  @Override void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); @Override void processTab(TabbedController tc, Tab currentTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors); @Override TabbedModelAndView preProcessNextTab(TabbedController tc,
			Tab nextTabID, HttpServletRequest req, HttpServletResponse res,
			Object comm, BindException errors); @Override ModelAndView processOther(TabbedController tc, Tab currentTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors); void setTargetManager(TargetManager aTargetManager); void setSubGroupSeparator(String subGroupSeparator);  }