001    package org.kuali.ole.license.lookup;
002    
003    import org.kuali.ole.service.OleAgreementSearchService;
004    import org.kuali.rice.krad.lookup.LookupUtils;
005    import org.kuali.rice.krad.lookup.LookupableImpl;
006    import org.kuali.rice.krad.web.form.LookupForm;
007    
008    import java.util.Collection;
009    import java.util.List;
010    import java.util.Map;
011    
012    /**
013     * OleAgreementSearchLookupableImpl is the view helper service class for Agreement Search
014     */
015    public class OleAgreementSearchLookupableImpl extends LookupableImpl {
016    
017        OleAgreementSearchService agreementSearchService = new OleAgreementSearchService();
018        @Override
019        public Collection<?> performSearch(LookupForm form, Map<String, String> searchCriteria, boolean bounded) {
020            Collection<?> displayList;
021    
022            LookupUtils.preprocessDateFields(searchCriteria);
023            displayList = agreementSearchService.getAgreementInformation(searchCriteria);
024    
025    
026            for (Object object : displayList) {
027                if (isResultReturnable(object)) {
028                    form.setAtLeastOneRowReturnable(true);
029                }
030            }
031    
032            return displayList;
033        }
034    }