InputStream inputStream = new ByteArrayInputStream(criteria.getBytes());
Document doc = XMLUtils.newDocument(new InputSource(inputStream));
SearchCriteria searchCriteria = new SearchCriteria(doc);
MessageBroker messageBroker =
new FacesContextBroker(request,response).extractMessageBroker();
RestUrlBuilder builder = RestUrlBuilder.newBuilder(context,request,
messageBroker);
String id = SearchEngineLocal.ID;
for(ISearchFilter filter : searchCriteria.getMiscelleniousFilters()) {
if(filter instanceof SearchFilterHarvestSites) {
SearchFilterHarvestSites hFilter = (SearchFilterHarvestSites) filter;
id = hFilter.getSelectedHarvestSiteId();
}
}
String params = builder.buildParameters(searchCriteria,
"searchPage",
id);
criteria = params;
} catch(Exception e) {
LOG.log(Level.FINER, "" , e);