View Javadoc
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   * Created with IntelliJ IDEA.
16   * User: arunag
17   * Date: 3/5/14
18   * Time: 11:55 AM
19   * To change this template use File | Settings | File Templates.
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       * This method will populate the search criteria and return the search results
26       *
27       * @param form
28       * @param searchCriteria
29       * @param unbounded
30       * @return searchResults(list)
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  }