private FlexiBean createSearchResultData(PagingRequest pr, HolidaySearchSortOrder sort, String name, String type, String currencyISO,
List<String> holidayIdStrs, UriInfo uriInfo) {
FlexiBean out = createRootData();
HolidaySearchRequest searchRequest = new HolidaySearchRequest();
searchRequest.setPagingRequest(pr);
searchRequest.setSortOrder(sort);
searchRequest.setName(StringUtils.trimToNull(name));
if (StringUtils.isNotEmpty(type)) {
searchRequest.setType(HolidayType.valueOf(type));
}
if (currencyISO != null) {
searchRequest.setCurrency(Currency.of(currencyISO));
}
MultivaluedMap<String, String> query = uriInfo.getQueryParameters();
for (int i = 0; query.containsKey("idscheme." + i) && query.containsKey("idvalue." + i); i++) {
ExternalId id = ExternalId.of(query.getFirst("idscheme." + i), query.getFirst("idvalue." + i));
if (HolidayType.BANK.name().equals(type)) {
searchRequest.addRegionExternalId(id);
} else { // assume settlement/trading
searchRequest.addExchangeExternalId(id);
}
}
for (String holidayIdStr : holidayIdStrs) {
searchRequest.addHolidayObjectId(ObjectId.parse(holidayIdStr));
}
out.put("searchRequest", searchRequest);
if (data().getUriInfo().getQueryParameters().size() > 0) {
HolidaySearchResult searchResult = data().getHolidayMaster().search(searchRequest);