@Test public final void testGetDefaultCommand() { User currentUser = AuthUtil.getRemoteUserObject(); SearchCommand command = testInstance.getDefaultCommand(); assertTrue(command.getAgency().equals(currentUser.getAgency().getName())); assertTrue(command.getPageNumber() == 0); assertTrue(command.getGroupType() == null); assertTrue(command.getOwner().equals(currentUser.getUsername())); assertTrue(command.getSearchOid() == null); testInstance.setDefaultSearchOnAgencyOnly(true); command = testInstance.getDefaultCommand(); assertTrue(command.getAgency().equals(currentUser.getAgency().getName())); assertTrue(command.getPageNumber() == 0); assertTrue(command.getGroupType() == null); assertTrue(command.getOwner() == null); assertTrue(command.getSearchOid() == null); testInstance.setDefaultSearchOnAgencyOnly(false); command = testInstance.getDefaultCommand(); assertTrue(command.getAgency().equals(currentUser.getAgency().getName())); assertTrue(command.getPageNumber() == 0); assertTrue(command.getGroupType() == null); assertTrue(command.getOwner().equals(currentUser.getUsername())); assertTrue(command.getSearchOid() == null); }
public SearchCommand getDefaultCommand() { SearchCommand command = new SearchCommand(); Agency usersAgency = AuthUtil.getRemoteUserObject().getAgency(); command.setPageNumber(0); command.setAgency(usersAgency.getName()); if(!defaultSearchOnAgencyOnly) { command.setOwner(AuthUtil.getRemoteUserObject().getUsername()); } command.setSearchOid(null); return command; }
GroupSearchController extends AbstractFormController { public SearchCommand getDefaultCommand() { SearchCommand command = new SearchCommand(); Agency usersAgency = AuthUtil.getRemoteUserObject().getAgency(); command.setPageNumber(0); command.setAgency(usersAgency.getName()); if(!defaultSearchOnAgencyOnly) { command.setOwner(AuthUtil.getRemoteUserObject().getUsername()); } command.setSearchOid(null); return command; } }
GroupSearchController extends AbstractFormController { public SearchCommand getDefaultCommand() { SearchCommand command = new SearchCommand(); Agency usersAgency = AuthUtil.getRemoteUserObject().getAgency(); command.setPageNumber(0); command.setAgency(usersAgency.getName()); if(!defaultSearchOnAgencyOnly) { command.setOwner(AuthUtil.getRemoteUserObject().getUsername()); } command.setSearchOid(null); return command; } GroupSearchController(); }
GroupSearchController extends AbstractFormController { public SearchCommand getDefaultCommand() { SearchCommand command = new SearchCommand(); Agency usersAgency = AuthUtil.getRemoteUserObject().getAgency(); command.setPageNumber(0); command.setAgency(usersAgency.getName()); if(!defaultSearchOnAgencyOnly) { command.setOwner(AuthUtil.getRemoteUserObject().getUsername()); } command.setSearchOid(null); return command; } GroupSearchController(); @Override void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); SearchCommand getDefaultCommand(); @SuppressWarnings("unchecked") ModelAndView prepareSearchView(HttpServletRequest request, 
			                              HttpServletResponse response,
			                              BindException errors); @SuppressWarnings("unchecked") ModelAndView prepareSearchView(HttpServletRequest request, 
			                              HttpServletResponse response,
			                              SearchCommand command,
			                              BindException errors); void setTargetManager(TargetManager targetManager); void setAgencyUserManager(AgencyUserManager agencyUserManager); void setMessageSource(MessageSource messageSource); void setDefaultSearchOnAgencyOnly(boolean defaultSearchOnAgencyOnly); boolean getDefaultSearchOnAgencyOnly(); void setGroupTypesList(WCTTreeSet groupTypesList); void setSubGroupType(String subGroupType); void setSubGroupSeparator(String subGroupSeparator); }
GroupSearchController extends AbstractFormController { public SearchCommand getDefaultCommand() { SearchCommand command = new SearchCommand(); Agency usersAgency = AuthUtil.getRemoteUserObject().getAgency(); command.setPageNumber(0); command.setAgency(usersAgency.getName()); if(!defaultSearchOnAgencyOnly) { command.setOwner(AuthUtil.getRemoteUserObject().getUsername()); } command.setSearchOid(null); return command; } GroupSearchController(); @Override void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); SearchCommand getDefaultCommand(); @SuppressWarnings("unchecked") ModelAndView prepareSearchView(HttpServletRequest request, 
			                              HttpServletResponse response,
			                              BindException errors); @SuppressWarnings("unchecked") ModelAndView prepareSearchView(HttpServletRequest request, 
			                              HttpServletResponse response,
			                              SearchCommand command,
			                              BindException errors); void setTargetManager(TargetManager targetManager); void setAgencyUserManager(AgencyUserManager agencyUserManager); void setMessageSource(MessageSource messageSource); void setDefaultSearchOnAgencyOnly(boolean defaultSearchOnAgencyOnly); boolean getDefaultSearchOnAgencyOnly(); void setGroupTypesList(WCTTreeSet groupTypesList); void setSubGroupType(String subGroupType); void setSubGroupSeparator(String subGroupSeparator);  }