1 package org.kuali.ole.deliver.lookup;
2
3 import org.kuali.ole.OLEConstants;
4 import org.kuali.ole.deliver.bo.OleSourceBo;
5 import org.kuali.rice.krad.lookup.LookupableImpl;
6 import org.kuali.rice.krad.util.GlobalVariables;
7 import org.kuali.rice.krad.util.KRADConstants;
8 import org.kuali.rice.krad.web.form.LookupForm;
9
10 import java.util.ArrayList;
11 import java.util.List;
12 import java.util.Map;
13
14
15
16
17
18
19
20
21 public class OleSourceBoLookupableImpl extends LookupableImpl {
22 @Override
23 protected List<?> getSearchResults(LookupForm form, Map<String, String> searchCriteria, boolean unbounded) {
24 List<?> searchResults;
25 List<OleSourceBo> finalSearchResult = new ArrayList<OleSourceBo>();
26 List<OleSourceBo> oleSourceBo = new ArrayList<OleSourceBo>();
27 oleSourceBo = (List<OleSourceBo>) super.getSearchResults(form, searchCriteria, unbounded);
28 finalSearchResult.addAll(oleSourceBo);
29
30 searchResults = finalSearchResult;
31
32 if (searchResults.size() == 0) {
33 GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS, OLEConstants.NO_RECORD_FOUND);
34 }
35 sortSearchResults(form, searchResults);
36 return searchResults;
37 }
38 }