@Test public final void testProcessOther() { HttpServletRequest aReq = new MockHttpServletRequest(); TargetManager targetManager = new MockTargetManager(testFile); testInstance.setTargetManager(targetManager); testSetAuthorityManager(); testSetAgencyUserManager(); testSetGroupTypesList(); testSetSubGroupTypeName(); TargetGroup targetGroup = targetManager.loadGroup(15000L); GroupsEditorContext groupsEditorContext = new GroupsEditorContext(targetGroup,true); aReq.getSession().setAttribute(TabbedGroupController.EDITOR_CONTEXT, groupsEditorContext); HttpServletResponse aResp = new MockHttpServletResponse(); GeneralCommand aCmd = new GeneralCommand(); 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(0); BindException aErrors = new BindException(aCmd, "GeneralCommand"); ModelAndView mav = testInstance.processOther(tc, currentTab, aReq, aResp, aCmd, aErrors); assertTrue(mav != null); assertEquals("group", mav.getViewName()); assertTrue(((GeneralCommand)mav.getModel().get("command")).getName() == targetGroup.getName()); }
@Override public ModelAndView processOther(TabbedController tc, Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { TabbedModelAndView nextView = null; processTab(tc, currentTab, req, res, comm, errors); nextView = preProcessNextTab(tc, currentTab, req, res, comm, errors); nextView.getTabStatus().setCurrentTab(currentTab); GeneralCommand command = (GeneralCommand) comm; if(!errors.hasErrors() && command.getAction().equals(GeneralCommand.ACTION_ADD_PARENT)) { String currentPageSize = CookieUtils.getPageSize(req); AddParentsCommand cmd = new AddParentsCommand(); cmd.setSearch(""); cmd.setSelectedPageSize(currentPageSize); Pagination results = targetManager.getSubGroupParentDTOs(cmd.getSearch() + "%", 0, Integer.parseInt(cmd.getSelectedPageSize())); ModelAndView mav = new ModelAndView("group-add-parents"); mav.addObject(Constants.GBL_CMD_DATA, cmd); mav.addObject("page", results); return mav; } return nextView; }
GeneralHandler extends AbstractGroupTabHandler { @Override public ModelAndView processOther(TabbedController tc, Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { TabbedModelAndView nextView = null; processTab(tc, currentTab, req, res, comm, errors); nextView = preProcessNextTab(tc, currentTab, req, res, comm, errors); nextView.getTabStatus().setCurrentTab(currentTab); GeneralCommand command = (GeneralCommand) comm; if(!errors.hasErrors() && command.getAction().equals(GeneralCommand.ACTION_ADD_PARENT)) { String currentPageSize = CookieUtils.getPageSize(req); AddParentsCommand cmd = new AddParentsCommand(); cmd.setSearch(""); cmd.setSelectedPageSize(currentPageSize); Pagination results = targetManager.getSubGroupParentDTOs(cmd.getSearch() + "%", 0, Integer.parseInt(cmd.getSelectedPageSize())); ModelAndView mav = new ModelAndView("group-add-parents"); mav.addObject(Constants.GBL_CMD_DATA, cmd); mav.addObject("page", results); return mav; } return nextView; } }
GeneralHandler extends AbstractGroupTabHandler { @Override public ModelAndView processOther(TabbedController tc, Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { TabbedModelAndView nextView = null; processTab(tc, currentTab, req, res, comm, errors); nextView = preProcessNextTab(tc, currentTab, req, res, comm, errors); nextView.getTabStatus().setCurrentTab(currentTab); GeneralCommand command = (GeneralCommand) comm; if(!errors.hasErrors() && command.getAction().equals(GeneralCommand.ACTION_ADD_PARENT)) { String currentPageSize = CookieUtils.getPageSize(req); AddParentsCommand cmd = new AddParentsCommand(); cmd.setSearch(""); cmd.setSelectedPageSize(currentPageSize); Pagination results = targetManager.getSubGroupParentDTOs(cmd.getSearch() + "%", 0, Integer.parseInt(cmd.getSelectedPageSize())); ModelAndView mav = new ModelAndView("group-add-parents"); mav.addObject(Constants.GBL_CMD_DATA, cmd); mav.addObject("page", results); return mav; } return nextView; }  }
GeneralHandler extends AbstractGroupTabHandler { @Override public ModelAndView processOther(TabbedController tc, Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { TabbedModelAndView nextView = null; processTab(tc, currentTab, req, res, comm, errors); nextView = preProcessNextTab(tc, currentTab, req, res, comm, errors); nextView.getTabStatus().setCurrentTab(currentTab); GeneralCommand command = (GeneralCommand) comm; if(!errors.hasErrors() && command.getAction().equals(GeneralCommand.ACTION_ADD_PARENT)) { String currentPageSize = CookieUtils.getPageSize(req); AddParentsCommand cmd = new AddParentsCommand(); cmd.setSearch(""); cmd.setSelectedPageSize(currentPageSize); Pagination results = targetManager.getSubGroupParentDTOs(cmd.getSearch() + "%", 0, Integer.parseInt(cmd.getSelectedPageSize())); ModelAndView mav = new ModelAndView("group-add-parents"); mav.addObject(Constants.GBL_CMD_DATA, cmd); mav.addObject("page", results); return mav; } return nextView; }  @Override void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); void setAuthorityManager(AuthorityManager authorityManager); @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 setAgencyUserManager(AgencyUserManager agencyUserManager); void setTargetManager(TargetManager targetManager); void setGroupTypesList(WCTTreeSet groupTypesList); void setSubGroupTypeName(String subGroupTypeName); void setSubGroupSeparator(String subGroupSeparator); }
GeneralHandler extends AbstractGroupTabHandler { @Override public ModelAndView processOther(TabbedController tc, Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { TabbedModelAndView nextView = null; processTab(tc, currentTab, req, res, comm, errors); nextView = preProcessNextTab(tc, currentTab, req, res, comm, errors); nextView.getTabStatus().setCurrentTab(currentTab); GeneralCommand command = (GeneralCommand) comm; if(!errors.hasErrors() && command.getAction().equals(GeneralCommand.ACTION_ADD_PARENT)) { String currentPageSize = CookieUtils.getPageSize(req); AddParentsCommand cmd = new AddParentsCommand(); cmd.setSearch(""); cmd.setSelectedPageSize(currentPageSize); Pagination results = targetManager.getSubGroupParentDTOs(cmd.getSearch() + "%", 0, Integer.parseInt(cmd.getSelectedPageSize())); ModelAndView mav = new ModelAndView("group-add-parents"); mav.addObject(Constants.GBL_CMD_DATA, cmd); mav.addObject("page", results); return mav; } return nextView; }  @Override void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); void setAuthorityManager(AuthorityManager authorityManager); @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 setAgencyUserManager(AgencyUserManager agencyUserManager); void setTargetManager(TargetManager targetManager); void setGroupTypesList(WCTTreeSet groupTypesList); void setSubGroupTypeName(String subGroupTypeName); void setSubGroupSeparator(String subGroupSeparator);  }