@Test public void testCreateFilterCommandFromSearchShowSubmittedYes() { mockRequest.setParameter(TargetInstanceCommand.REQ_SHOW_SUBMITTED_MSG, "y"); TargetInstanceCommand searchCommand = new TargetInstanceCommand(); ModelAndView mav = new ModelAndView(); String startedMessage = "submitStarted"; String failedMessage = "submitFailed"; attachMessageSource(startedMessage, failedMessage); testInstance.createFilterCommandFromSearchCommand(mockRequest, command, mav, searchCommand, "10"); String message = (String) mav.getModel().get(Constants.GBL_MESSAGES); assertEquals(message, startedMessage); }
TargetInstanceCommand createFilterCommandFromSearchCommand(HttpServletRequest aReq, TargetInstanceCommand aCmd, ModelAndView mav, TargetInstanceCommand searchCommand, String currentPageSize) { if (aCmd == null) { searchCommand.setSelectedPageSize(currentPageSize); } else if (PAGINATION_ACTIONS.contains(aCmd.getCmd())) { searchCommand.setCmd(aCmd.getCmd()); searchCommand.setPageNo(aCmd.getPageNo()); searchCommand.setSelectedPageSize(aCmd.getSelectedPageSize()); } String showSubmittedMessageParameter = aReq.getParameter(TargetInstanceCommand.REQ_SHOW_SUBMITTED_MSG); if (showSubmittedMessageParameter != null) { if (showSubmittedMessageParameter.equals("y")) { addMessageToModel(mav, "ui.label.targetinstance.submitToArchiveStarted"); } else { addMessageToModel(mav, "ui.label.targetinstance.submitToArchiveFailed"); } } searchCommand.setCmd(TargetInstanceCommand.ACTION_FILTER); return searchCommand; }
QueueController extends AbstractFormController { TargetInstanceCommand createFilterCommandFromSearchCommand(HttpServletRequest aReq, TargetInstanceCommand aCmd, ModelAndView mav, TargetInstanceCommand searchCommand, String currentPageSize) { if (aCmd == null) { searchCommand.setSelectedPageSize(currentPageSize); } else if (PAGINATION_ACTIONS.contains(aCmd.getCmd())) { searchCommand.setCmd(aCmd.getCmd()); searchCommand.setPageNo(aCmd.getPageNo()); searchCommand.setSelectedPageSize(aCmd.getSelectedPageSize()); } String showSubmittedMessageParameter = aReq.getParameter(TargetInstanceCommand.REQ_SHOW_SUBMITTED_MSG); if (showSubmittedMessageParameter != null) { if (showSubmittedMessageParameter.equals("y")) { addMessageToModel(mav, "ui.label.targetinstance.submitToArchiveStarted"); } else { addMessageToModel(mav, "ui.label.targetinstance.submitToArchiveFailed"); } } searchCommand.setCmd(TargetInstanceCommand.ACTION_FILTER); return searchCommand; } }
QueueController extends AbstractFormController { TargetInstanceCommand createFilterCommandFromSearchCommand(HttpServletRequest aReq, TargetInstanceCommand aCmd, ModelAndView mav, TargetInstanceCommand searchCommand, String currentPageSize) { if (aCmd == null) { searchCommand.setSelectedPageSize(currentPageSize); } else if (PAGINATION_ACTIONS.contains(aCmd.getCmd())) { searchCommand.setCmd(aCmd.getCmd()); searchCommand.setPageNo(aCmd.getPageNo()); searchCommand.setSelectedPageSize(aCmd.getSelectedPageSize()); } String showSubmittedMessageParameter = aReq.getParameter(TargetInstanceCommand.REQ_SHOW_SUBMITTED_MSG); if (showSubmittedMessageParameter != null) { if (showSubmittedMessageParameter.equals("y")) { addMessageToModel(mav, "ui.label.targetinstance.submitToArchiveStarted"); } else { addMessageToModel(mav, "ui.label.targetinstance.submitToArchiveFailed"); } } searchCommand.setCmd(TargetInstanceCommand.ACTION_FILTER); return searchCommand; } QueueController(); }
QueueController extends AbstractFormController { TargetInstanceCommand createFilterCommandFromSearchCommand(HttpServletRequest aReq, TargetInstanceCommand aCmd, ModelAndView mav, TargetInstanceCommand searchCommand, String currentPageSize) { if (aCmd == null) { searchCommand.setSelectedPageSize(currentPageSize); } else if (PAGINATION_ACTIONS.contains(aCmd.getCmd())) { searchCommand.setCmd(aCmd.getCmd()); searchCommand.setPageNo(aCmd.getPageNo()); searchCommand.setSelectedPageSize(aCmd.getSelectedPageSize()); } String showSubmittedMessageParameter = aReq.getParameter(TargetInstanceCommand.REQ_SHOW_SUBMITTED_MSG); if (showSubmittedMessageParameter != null) { if (showSubmittedMessageParameter.equals("y")) { addMessageToModel(mav, "ui.label.targetinstance.submitToArchiveStarted"); } else { addMessageToModel(mav, "ui.label.targetinstance.submitToArchiveFailed"); } } searchCommand.setCmd(TargetInstanceCommand.ACTION_FILTER); return searchCommand; } QueueController(); void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); void setTargetInstanceManager(TargetInstanceManager aTargetInstanceManager); void setHarvestCoordinator(HarvestCoordinator harvestCoordinator); void setEnvironment(Environment environment); void setAgencyUserManager(AgencyUserManager agencyUserManager); void setMessageSource(MessageSource messageSource); void setEnableQaModule(Boolean enableQaModule); void setThumbnailWidth(String thumbnailWidth); void setThumbnailHeight(String thumbnailHeight); void setThumbnailRenderer(String thumbnailRenderer); void setHarvestResourceUrlMapper(HarvestResourceUrlMapper harvestResourceUrlMapper); }
QueueController extends AbstractFormController { TargetInstanceCommand createFilterCommandFromSearchCommand(HttpServletRequest aReq, TargetInstanceCommand aCmd, ModelAndView mav, TargetInstanceCommand searchCommand, String currentPageSize) { if (aCmd == null) { searchCommand.setSelectedPageSize(currentPageSize); } else if (PAGINATION_ACTIONS.contains(aCmd.getCmd())) { searchCommand.setCmd(aCmd.getCmd()); searchCommand.setPageNo(aCmd.getPageNo()); searchCommand.setSelectedPageSize(aCmd.getSelectedPageSize()); } String showSubmittedMessageParameter = aReq.getParameter(TargetInstanceCommand.REQ_SHOW_SUBMITTED_MSG); if (showSubmittedMessageParameter != null) { if (showSubmittedMessageParameter.equals("y")) { addMessageToModel(mav, "ui.label.targetinstance.submitToArchiveStarted"); } else { addMessageToModel(mav, "ui.label.targetinstance.submitToArchiveFailed"); } } searchCommand.setCmd(TargetInstanceCommand.ACTION_FILTER); return searchCommand; } QueueController(); void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); void setTargetInstanceManager(TargetInstanceManager aTargetInstanceManager); void setHarvestCoordinator(HarvestCoordinator harvestCoordinator); void setEnvironment(Environment environment); void setAgencyUserManager(AgencyUserManager agencyUserManager); void setMessageSource(MessageSource messageSource); void setEnableQaModule(Boolean enableQaModule); void setThumbnailWidth(String thumbnailWidth); void setThumbnailHeight(String thumbnailHeight); void setThumbnailRenderer(String thumbnailRenderer); void setHarvestResourceUrlMapper(HarvestResourceUrlMapper harvestResourceUrlMapper);  }