@RequestMapping(value = "/licensing/organisation/list", method = RequestMethod.GET, params = "filterType=ipRange")
@Secured(ConsoleSecurityRoles.ROLE_LICENSE_VIEW)
public ModelAndView findIpRange(@ModelAttribute("filter") @Valid OrganisationFilter filter, Errors errors, ModelMap model) {
if(StringUtils.isEmpty(filter.getIpFrom()) && StringUtils.isEmpty(filter.getIpTo()) || errors.hasErrors()){
return listOrganisations(filter, model);
}
OrganisationIpRangeQuery query = new OrganisationIpRangeQuery();
updateQuery(filter, query);
query.setIpFrom(filter.getIpFrom());
query.setIpTo(filter.getIpTo());
ModelAndView results = new ModelAndView("container.platform.licensing.organisation.list");
Page<Organisation> organisationPage = licensingService.findOrgansationByRange(query);
String queryString = messageSource.getMessage(IP_RANGE_MESSAGE, new Object[]{filter.getIpFrom(), filter.getIpTo()}, LocaleContextHolder.getLocale());
updateResults(results, organisationPage, queryString, filter.getOrder(), filter.getField());
return results;
}