1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.lookup.keyvalues; |
17 | |
|
18 | |
import java.util.ArrayList; |
19 | |
import java.util.List; |
20 | |
|
21 | |
import org.apache.log4j.Logger; |
22 | |
import org.kuali.rice.core.util.KeyLabelPair; |
23 | |
import org.kuali.rice.kim.bo.types.dto.KimTypeInfo; |
24 | |
import org.kuali.rice.kim.service.KIMServiceLocator; |
25 | |
import org.kuali.rice.kim.service.support.KimTypeService; |
26 | |
import org.kuali.rice.kim.util.KimCommonUtils; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | 0 | public class KimAttributeValuesFinder extends KeyValuesBase { |
32 | |
|
33 | 0 | private static final Logger LOG = Logger.getLogger( KimAttributeValuesFinder.class ); |
34 | |
|
35 | |
protected String kimTypeId; |
36 | |
protected String kimAttributeName; |
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
public List<KeyLabelPair> getKeyValues() { |
42 | 0 | KimTypeInfo kimType = KIMServiceLocator.getTypeInfoService().getKimType(kimTypeId); |
43 | 0 | if ( kimType != null ) { |
44 | 0 | KimTypeService service = KimCommonUtils.getKimTypeService(kimType); |
45 | 0 | if ( service != null ) { |
46 | 0 | return service.getAttributeValidValues(kimTypeId,kimAttributeName); |
47 | |
} else { |
48 | 0 | LOG.error( "Unable to get type service " + kimType.getKimTypeServiceName() ); |
49 | |
} |
50 | 0 | } else { |
51 | 0 | LOG.error( "Unable to obtain KIM type for kimTypeId=" + kimTypeId ); |
52 | |
} |
53 | 0 | return new ArrayList<KeyLabelPair>(0); |
54 | |
} |
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
public String getKimAttributeName() { |
60 | 0 | return this.kimAttributeName; |
61 | |
} |
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
public void setKimAttributeName(String kimAttributeName) { |
67 | 0 | this.kimAttributeName = kimAttributeName; |
68 | 0 | } |
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
public String getKimTypeId() { |
74 | 0 | return this.kimTypeId; |
75 | |
} |
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
public void setKimTypeId(String kimTypeId) { |
81 | 0 | this.kimTypeId = kimTypeId; |
82 | 0 | } |
83 | |
|
84 | |
} |