1 package org.kuali.ole.select.lookup;
2
3 import java.util.ArrayList;
4 import java.util.List;
5 import java.util.Map;
6
7 import org.kuali.ole.OLEConstants;
8 import org.kuali.ole.select.document.OLEInvoiceIngestLoadReport;
9 import org.kuali.rice.krad.lookup.LookupableImpl;
10 import org.kuali.rice.krad.util.GlobalVariables;
11 import org.kuali.rice.krad.util.KRADConstants;
12 import org.kuali.rice.krad.web.form.LookupForm;
13
14
15
16
17
18
19
20
21 public class OLEInvoiceIngestLoadReportLookupableImpl extends LookupableImpl{
22 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(OLEInvoiceIngestLoadReportLookupableImpl.class);
23
24
25
26
27
28
29
30
31
32 @Override
33 protected List<?> getSearchResults(LookupForm form, Map<String, String> searchCriteria, boolean unbounded) {
34 LOG.debug("Inside getSearchResults()");
35 List<?> searchResults;
36 List<OLEInvoiceIngestLoadReport> finalSearchResult = new ArrayList<OLEInvoiceIngestLoadReport>();
37 List<OLEInvoiceIngestLoadReport> oleInvoiceIngestLoadDetails = new ArrayList<OLEInvoiceIngestLoadReport>();
38 oleInvoiceIngestLoadDetails = (List<OLEInvoiceIngestLoadReport>) super.getSearchResults(form, searchCriteria, unbounded);
39 finalSearchResult.addAll(oleInvoiceIngestLoadDetails);
40 searchResults = finalSearchResult;
41 if (searchResults.size() == 0) {
42 GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS, OLEConstants.NO_RECORD_FOUND);
43 }
44 sortSearchResults(form, searchResults);
45 return searchResults;
46 }
47 }