View Javadoc
1   package org.kuali.ole.select.lookup;
2   
3   import org.kuali.ole.OLEConstants;
4   import org.kuali.ole.select.bo.OleLicenseRequestLocation;
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   * Created with IntelliJ IDEA.
16   * User: asham
17   * Date: 7/15/13
18   * Time: 5:30 PM
19   * To change this template use File | Settings | File Templates.
20   */
21  public class OleLicenseRequestLocationLookupableImpl extends LookupableImpl {
22      @Override
23      protected List<?> getSearchResults(LookupForm form, Map<String, String> searchCriteria, boolean unbounded) {
24          List<?> searchResults;
25          List<OleLicenseRequestLocation> finalSearchResult = new ArrayList<OleLicenseRequestLocation>();
26          List<OleLicenseRequestLocation> oleLicenseRequestLocation = new ArrayList<OleLicenseRequestLocation>();
27  
28  
29          oleLicenseRequestLocation = (List<OleLicenseRequestLocation>) super.getSearchResults(form, searchCriteria, unbounded);
30          finalSearchResult.addAll(oleLicenseRequestLocation);
31  
32          searchResults = finalSearchResult;
33  
34          if (searchResults.size() == 0) {
35              GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS, OLEConstants.NO_RECORD_FOUND);
36          }
37          sortSearchResults(form, searchResults);
38          return searchResults;
39      }
40  }