1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.kuali.rice.student.lookup.keyvalues;
20
21 import javax.xml.namespace.QName;
22
23 import org.apache.commons.lang.StringUtils;
24 import org.kuali.rice.core.resourceloader.GlobalResourceLoader;
25 import org.kuali.rice.core.util.KeyLabelPair;
26 import org.kuali.rice.kns.lookup.keyvalues.KeyValuesBase;
27 import org.kuali.student.core.organization.service.OrganizationService;
28
29
30
31
32
33 public abstract class StudentKeyValuesBase extends KeyValuesBase {
34
35 private static OrganizationService organizationService;
36
37 protected static OrganizationService getOrganizationService() {
38 if (organizationService == null) {
39 organizationService = (OrganizationService) GlobalResourceLoader
40 .getService(new QName("http://student.kuali.org/wsdl/organization","OrganizationService"));
41 }
42 return organizationService;
43 }
44
45
46
47
48
49
50
51
52
53
54
55 protected static KeyLabelPair buildKeyLabelPair(String orgId, String orgShortName, String orgLongName, String orgType) {
56 if (StringUtils.isBlank(orgShortName)) {
57 throw new IllegalArgumentException("Blank value for orgShortName is invalid.");
58 }
59 return new KeyLabelPair(orgShortName, orgShortName);
60 }
61
62 }