1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs.lookup;
17
18 import org.apache.commons.collections.MapUtils;
19 import org.apache.commons.lang3.StringUtils;
20 import org.kuali.rice.kim.api.identity.IdentityService;
21 import org.kuali.rice.kim.api.services.KimApiServiceLocator;
22 import org.kuali.rice.krad.lookup.LookupForm;
23 import org.kuali.rice.krad.lookup.LookupableImpl;
24 import org.kuali.rice.krad.service.KRADServiceLocator;
25
26 import java.util.Collection;
27 import java.util.Map;
28
29
30
31
32
33
34
35
36
37
38 public class LabsTravelAccountLookupableImpl extends LookupableImpl {
39
40 private static final long serialVersionUID = -8463531661189633011L;
41
42 private transient IdentityService identityService;
43
44
45
46
47
48
49
50
51 @Override
52 public Collection<?> performSearch(LookupForm form, Map<String, String> searchCriteria, boolean bounded) {
53 if (StringUtils.equals(MapUtils.getString(searchCriteria, "fiscalOfficer.principalName"), "fred")) {
54 String principalName = getIdentityService().getPrincipal("admin").getPrincipalName();
55 searchCriteria.put("fiscalOfficer.principalName", principalName);
56 }
57
58 return super.performSearch(form, searchCriteria, bounded);
59 }
60
61
62
63
64
65
66 public IdentityService getIdentityService() {
67 return identityService;
68 }
69
70
71
72
73
74
75 public void setIdentityService(IdentityService identityService) {
76 this.identityService = identityService;
77 }
78
79 }