001package org.kuali.ole.select.lookup;
002
003import org.kuali.ole.OLEConstants;
004import org.kuali.ole.select.bo.OleLicenseRequestLocation;
005import org.kuali.rice.krad.lookup.LookupableImpl;
006import org.kuali.rice.krad.util.GlobalVariables;
007import org.kuali.rice.krad.util.KRADConstants;
008import org.kuali.rice.krad.web.form.LookupForm;
009
010import java.util.ArrayList;
011import java.util.List;
012import java.util.Map;
013
014/**
015 * Created with IntelliJ IDEA.
016 * User: asham
017 * Date: 7/15/13
018 * Time: 5:30 PM
019 * To change this template use File | Settings | File Templates.
020 */
021public class OleLicenseRequestLocationLookupableImpl extends LookupableImpl {
022    @Override
023    protected List<?> getSearchResults(LookupForm form, Map<String, String> searchCriteria, boolean unbounded) {
024        List<?> searchResults;
025        List<OleLicenseRequestLocation> finalSearchResult = new ArrayList<OleLicenseRequestLocation>();
026        List<OleLicenseRequestLocation> oleLicenseRequestLocation = new ArrayList<OleLicenseRequestLocation>();
027
028
029        oleLicenseRequestLocation = (List<OleLicenseRequestLocation>) super.getSearchResults(form, searchCriteria, unbounded);
030        finalSearchResult.addAll(oleLicenseRequestLocation);
031
032        searchResults = finalSearchResult;
033
034        if (searchResults.size() == 0) {
035            GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS, OLEConstants.NO_RECORD_FOUND);
036        }
037        sortSearchResults(form, searchResults);
038        return searchResults;
039    }
040}