@Test public final void testPreProcessNextTab() { HttpServletRequest aReq = new MockHttpServletRequest(); TargetInstance targetInstance = getTargetInstanceManager().getTargetInstance(5001L); ProfileOverrides po = getProfileOverrides(20000L); targetInstance.setOverrides(po); aReq.getSession().setAttribute(TargetInstanceCommand.SESSION_TI, targetInstance); aReq.getSession().setAttribute(TargetInstanceCommand.SESSION_MODE, true); HttpServletResponse aResp = new MockHttpServletResponse(); TargetInstanceProfileCommand aCmd = new TargetInstanceProfileCommand(); aCmd.setFromOverrides(targetInstance.getProfileOverrides()); TabbedController tc = new TabbedTargetInstanceController(); TabConfig tabConfig = new TabConfig(); tabConfig.setViewName("targetInstance"); List<Tab> tabs = getTabList(); tabConfig.setTabs(tabs); tc.setTabConfig(tabConfig); tc.setDefaultCommandClass(org.webcurator.ui.target.command.TargetInstanceCommand.class); Tab currentTab = tabs.get(1); BindException aErrors = new BindException(aCmd, aCmd.getActionCmd()); ModelAndView mav = testInstance.preProcessNextTab(tc, currentTab, aReq, aResp, aCmd, aErrors); assertTrue(((TargetInstanceProfileCommand)mav.getModel().get("command")).getExcludedMimeTypes().equals(targetInstance.getProfileOverrides().getExcludedMimeTypes())); }
@Override public TabbedModelAndView preProcessNextTab(TabbedController tc, Tab nextTabID, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { log.debug("preProcessNextTab"); TabbedModelAndView tmav = super.preProcessNextTab(tc, nextTabID, req, res, comm, errors); TargetInstance ti = (TargetInstance) req.getSession().getAttribute(TargetInstanceCommand.SESSION_TI); Boolean editMode = getEditMode(req); tmav.addObject("ownable", ti); tmav.addObject("privlege", Privilege.MANAGE_TARGET_INSTANCES); tmav.addObject("editMode", editMode); return tmav; }
TargetInstanceProfileHandler extends AbstractOverrideTabHandler { @Override public TabbedModelAndView preProcessNextTab(TabbedController tc, Tab nextTabID, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { log.debug("preProcessNextTab"); TabbedModelAndView tmav = super.preProcessNextTab(tc, nextTabID, req, res, comm, errors); TargetInstance ti = (TargetInstance) req.getSession().getAttribute(TargetInstanceCommand.SESSION_TI); Boolean editMode = getEditMode(req); tmav.addObject("ownable", ti); tmav.addObject("privlege", Privilege.MANAGE_TARGET_INSTANCES); tmav.addObject("editMode", editMode); return tmav; } }
TargetInstanceProfileHandler extends AbstractOverrideTabHandler { @Override public TabbedModelAndView preProcessNextTab(TabbedController tc, Tab nextTabID, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { log.debug("preProcessNextTab"); TabbedModelAndView tmav = super.preProcessNextTab(tc, nextTabID, req, res, comm, errors); TargetInstance ti = (TargetInstance) req.getSession().getAttribute(TargetInstanceCommand.SESSION_TI); Boolean editMode = getEditMode(req); tmav.addObject("ownable", ti); tmav.addObject("privlege", Privilege.MANAGE_TARGET_INSTANCES); tmav.addObject("editMode", editMode); return tmav; }  }
TargetInstanceProfileHandler extends AbstractOverrideTabHandler { @Override public TabbedModelAndView preProcessNextTab(TabbedController tc, Tab nextTabID, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { log.debug("preProcessNextTab"); TabbedModelAndView tmav = super.preProcessNextTab(tc, nextTabID, req, res, comm, errors); TargetInstance ti = (TargetInstance) req.getSession().getAttribute(TargetInstanceCommand.SESSION_TI); Boolean editMode = getEditMode(req); tmav.addObject("ownable", ti); tmav.addObject("privlege", Privilege.MANAGE_TARGET_INSTANCES); tmav.addObject("editMode", editMode); return tmav; }  @Override TabbedModelAndView preProcessNextTab(TabbedController tc,
			Tab nextTabID, HttpServletRequest req, HttpServletResponse res,
			Object comm, BindException errors); @Override void processTab(TabbedController tc, Tab currentTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors); @Override ModelAndView processOther(TabbedController tc, Tab currentTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors); }
TargetInstanceProfileHandler extends AbstractOverrideTabHandler { @Override public TabbedModelAndView preProcessNextTab(TabbedController tc, Tab nextTabID, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { log.debug("preProcessNextTab"); TabbedModelAndView tmav = super.preProcessNextTab(tc, nextTabID, req, res, comm, errors); TargetInstance ti = (TargetInstance) req.getSession().getAttribute(TargetInstanceCommand.SESSION_TI); Boolean editMode = getEditMode(req); tmav.addObject("ownable", ti); tmav.addObject("privlege", Privilege.MANAGE_TARGET_INSTANCES); tmav.addObject("editMode", editMode); return tmav; }  @Override TabbedModelAndView preProcessNextTab(TabbedController tc,
			Tab nextTabID, HttpServletRequest req, HttpServletResponse res,
			Object comm, BindException errors); @Override void processTab(TabbedController tc, Tab currentTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors); @Override ModelAndView processOther(TabbedController tc, Tab currentTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors);  }