View Javadoc
1   package org.kuali.ole.describe.lookup;
2   
3   import org.kuali.ole.OLEConstants;
4   import org.kuali.ole.describe.bo.OleLocation;
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: 4:52 PM
19   * To change this template use File | Settings | File Templates.
20   */
21  public class OleLocationLookupableImpl extends LookupableImpl {
22      protected List<?> getSearchResults(LookupForm form, Map<String, String> searchCriteria, boolean unbounded) {
23          List<?> searchResults;
24          List<OleLocation> finalSearchResult = new ArrayList<OleLocation>();
25          List<OleLocation> oleLocation = new ArrayList<OleLocation>();
26  
27  
28          oleLocation = (List<OleLocation>) super.getSearchResults(form, searchCriteria, unbounded);
29          finalSearchResult.addAll(oleLocation);
30  
31          searchResults = finalSearchResult;
32  
33          if (searchResults.size() == 0) {
34              GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS, OLEConstants.NO_RECORD_FOUND);
35          }
36          sortSearchResults(form, searchResults);
37          return searchResults;
38      }
39  }