} else if (eventType.equals(SearchEvents.Event.EVENT_LOADSAVEDSEARCH.name())){
LOG.info("Loading Search Criteria");
boolean success = false;
try {
FacesContextBroker facesBroker = new FacesContextBroker();
Map requestMap = facesBroker.getExternalContext().getRequestParameterMap();
String searchId = (String)
requestMap.get(SearchEvents.Event.PARAM_UUID);
doLoad(searchId);
success = true;
SearchCriteria searchCriteria = this.getSearchCriteria();
searchCriteria.getSearchFilterPageCursor().setCurrentPage(1);
this.getSearchResult().reset();
for(ISearchFilter iSearchFilter
: searchCriteria.getMiscelleniousFilters()) {
if(iSearchFilter instanceof SearchFilterHarvestSites) {
SearchFilterHarvestSites sfHvSites =
(SearchFilterHarvestSites) iSearchFilter;
try {
String url = sfHvSites.getSearchUrl();
if (!url.equals("")) {
url = url.replaceAll("(?i)F=[^&]*", "f=searchpage" );
facesBroker.getExternalContext().redirect(url);
FacesContext facesContext = facesBroker.getFacesContext();
context.onExecutionPhaseCompleted();
facesContext.responseComplete();
return;
}
} catch (MalformedURLException ex) {
// Not a url, use the other workflow
}
}
}
} finally {
// either redo current search if unsuccessful, or do new loaded search
// if successful
redoSearch(event, success);
}
} else if(eventType.equals(SearchEvents.Event.EVENT_DELTESAVEDSEARCH.name())){
LOG.info("Deleting Search Criteria");
FacesContextBroker facesBroker = new FacesContextBroker();
Map requestMap = facesBroker.getExternalContext().getRequestParameterMap();
try {
String searchId = (String)
requestMap.get(SearchEvents.Event.PARAM_UUID);
ISearchSaveRepository searchSaveRepository =
SearchSaveRpstryFactory.getSearchSaveRepository();