001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package edu.sampleu.travel;
017
018import org.kuali.rice.krad.lookup.LookupForm;
019import org.kuali.rice.krad.lookup.LookupableImpl;
020import java.util.Collection;
021import java.util.Map;
022
023/**
024 * @author Kuali Rice Team (rice.collab@kuali.org)
025 */
026public class TravelLookupableImpl extends LookupableImpl {
027
028    /**
029     * Override the performSearch method so that we can perform any additional filtering of results from the standard query.
030     * Here we are getting the additional parameters being passed in and filtering on minSubsidized value.
031     *
032     * @{inheritDoc}
033     */
034    @Override
035    public Collection<?> performSearch(LookupForm form, Map<String, String> searchCriteria, boolean bounded) {
036        // get additional parameter
037        String minSubsidized = form.getInitialRequestParameters().get("minSubsidized")[0];
038
039        searchCriteria.put("subsidizedPercent", ">=" + minSubsidized);
040
041        return super.performSearch(form, searchCriteria,bounded);
042    }
043
044}