1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.vnd.businessobject.lookup;
17
18 import java.util.Collections;
19 import java.util.List;
20 import java.util.Map;
21
22 import org.kuali.ole.sys.OLEConstants;
23 import org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl;
24 import org.kuali.rice.krad.bo.BusinessObject;
25 import org.kuali.rice.krad.util.BeanPropertyComparator;
26
27
28 public class VendorCustomerNumberLookupableHelperServiceImpl extends KualiLookupableHelperServiceImpl {
29 private boolean searchUsingOnlyPrimaryKeyValues = false;
30
31
32
33
34
35
36 @SuppressWarnings("unchecked")
37 @Override
38 protected List<? extends BusinessObject> getSearchResultsHelper(Map<String, String> fieldValues, boolean unbounded) {
39 searchUsingOnlyPrimaryKeyValues = getLookupService().allPrimaryKeyValuesPresentAndNotWildcard(getBusinessObjectClass(), fieldValues);
40
41 setBackLocation(fieldValues.get(OLEConstants.BACK_LOCATION));
42 setDocFormKey(fieldValues.get(OLEConstants.DOC_FORM_KEY));
43 setReferencesToRefresh(fieldValues.get(OLEConstants.REFERENCES_TO_REFRESH));
44 List searchResults = (List) getLookupService().findCollectionBySearchHelper(getBusinessObjectClass(), fieldValues, unbounded);
45
46 List defaultSortColumns = getDefaultSortColumns();
47 if (defaultSortColumns.size() > 0) {
48 Collections.sort(searchResults, new BeanPropertyComparator(getDefaultSortColumns(), true));
49 }
50
51 return searchResults;
52 }
53
54
55
56
57 @Override
58 public boolean isSearchUsingOnlyPrimaryKeyValues() {
59
60 return searchUsingOnlyPrimaryKeyValues;
61 }
62 }
63