logger.error("[Exception] GlobalReplaceHandler.Execute Handler ", e);
}
// If the user selecte the New Search then build Search VO.
// Else pass the searchId to the EJB and get the searchVO.
SearchVO searchObject = new SearchVO();
String searchType = (String)globalReplaceForm.get("searchType");
if (searchType != null && searchType.equals("New Search")) {
searchObject.setModuleID(moduleId);
searchObject.setName("New Search");
List searchCriteria = Arrays.asList((SearchCriteriaVO[])globalReplaceForm.get("searchCriteria"));
searchObject.setSearchCriteria(searchCriteria);
} else {
String savedSearchID = (String)globalReplaceForm.get("savedSearchID");
if (!(savedSearchID.equals("0") || savedSearchID.equals(""))) {
searchObject = remoteAdvancedSearch.getSavedSearch(Integer.parseInt(savedSearchID),"ADVANCE",null);
}
}
// Add an extra search Criteria on User selected criteria
// The Criteria is defined so that user is categorizing the search should be applied to
// Marketing List 1 or 2 etc.,
// If the user selects he wants to apply to all Records then we will not add the criteria
if (!(marketingListID.equals("0") || marketingListID.equals(""))) {
int fieldID = globalReplace.getSearchFieldID(replaceTableID);
if (fieldID != -1) {
SearchCriteriaVO searchCriteriaVO = new SearchCriteriaVO();
searchCriteriaVO.setTableID(replaceTableID+"");
searchCriteriaVO.setFieldID(replaceTableID+"");
searchCriteriaVO.setConditionID((SearchVO.EQUALS_INTEGER).toString());
searchCriteriaVO.setExpressionType(GlobalReplaceConstantKeys.SEARCH_AND_OR);
searchCriteriaVO.setValue(marketingListID);
searchObject.addSearchCriteria(searchCriteriaVO);
}
}
session.setAttribute("searchObject",searchObject);
ArrayList resultsIDs = new ArrayList();