1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.service.impl;
17
18 import org.kuali.rice.core.api.config.property.ConfigurationService;
19 import org.kuali.rice.krad.service.LegacyDataAdapter;
20 import org.kuali.rice.krad.service.LookupService;
21
22 import java.util.Collection;
23 import java.util.List;
24 import java.util.Map;
25
26
27
28
29
30
31
32
33 public class LookupServiceImpl implements LookupService {
34 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(LookupServiceImpl.class);
35
36 private ConfigurationService kualiConfigurationService;
37 private LegacyDataAdapter legacyDataAdapter;
38
39 @Override
40 @Deprecated
41 public <T> Collection<T> findCollectionBySearchUnbounded(Class<T> example,
42 Map<String, String> formProps) {
43 return findCollectionBySearchHelper(example, formProps, true);
44 }
45
46 @Override
47 @Deprecated
48 public <T> Collection<T> findCollectionBySearch(Class<T> type, Map<String, String> formProps) {
49 return findCollectionBySearchHelper(type, formProps, false);
50 }
51
52 @Override
53 @Deprecated
54 public <T> Collection<T> findCollectionBySearchHelper(Class<T> type,
55 Map<String, String> formProps, boolean unbounded) {
56 return findCollectionBySearchHelper(type, formProps, unbounded, null);
57 }
58
59 @Override
60 @Deprecated
61 public <T> Collection<T> findCollectionBySearchHelper(Class<T> type,
62 Map<String, String> formProps, boolean unbounded, Integer searchResultsLimit) {
63 return getLegacyDataAdapter().findCollectionBySearchHelper(type, formProps, unbounded,
64 allPrimaryKeyValuesPresentAndNotWildcard(type, formProps), searchResultsLimit);
65 }
66
67 @Override
68 public <T> Collection<T> findCollectionBySearchHelper(Class<T> type,Map<String, String> formProps,
69 List<String> wildcardAsLiteralPropertyNames, boolean unbounded, Integer searchResultsLimit) {
70 return getLegacyDataAdapter().findCollectionBySearchHelper(type, formProps, wildcardAsLiteralPropertyNames,
71 unbounded, allPrimaryKeyValuesPresentAndNotWildcard(type, formProps), searchResultsLimit);
72 }
73
74 @Override
75 public <T> T findObjectBySearch(Class<T> type, Map<String, String> formProps) {
76 if (type == null || formProps == null) {
77 throw new IllegalArgumentException("Object and Map must not be null");
78 }
79 return getLegacyDataAdapter().findObjectBySearch(type, formProps);
80 }
81
82 @Override
83 public boolean allPrimaryKeyValuesPresentAndNotWildcard(Class<?> boClass, Map<String, String> formProps) {
84 return getLegacyDataAdapter().allPrimaryKeyValuesPresentAndNotWildcard(boClass, formProps);
85 }
86
87 public ConfigurationService getKualiConfigurationService() {
88 return kualiConfigurationService;
89 }
90
91 public void setKualiConfigurationService(ConfigurationService kualiConfigurationService) {
92 this.kualiConfigurationService = kualiConfigurationService;
93 }
94
95 public LegacyDataAdapter getLegacyDataAdapter() {
96 return legacyDataAdapter;
97 }
98
99 public void setLegacyDataAdapter(LegacyDataAdapter legacyDataAdapter) {
100 this.legacyDataAdapter = legacyDataAdapter;
101 }
102
103 }