1 package org.kuali.ole.editor.keyvalue;
2
3 import org.kuali.ole.catalog.bo.OleElectronicLocationAndAccessRelationship;
4 import org.kuali.rice.core.api.util.ConcreteKeyValue;
5 import org.kuali.rice.core.api.util.KeyValue;
6 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
7 import org.kuali.rice.krad.service.KRADServiceLocator;
8
9 import java.util.ArrayList;
10 import java.util.Collection;
11 import java.util.List;
12
13
14
15
16 public class Relationship extends KeyValuesBase {
17
18
19
20
21
22
23 @Override
24 public List<KeyValue> getKeyValues() {
25 List<KeyValue> options = new ArrayList<KeyValue>();
26 Collection<OleElectronicLocationAndAccessRelationship> oleElectronicLocationAndAccessRelationships =
27 KRADServiceLocator.getBusinessObjectService().findAll(OleElectronicLocationAndAccessRelationship.class);
28 options.add(new ConcreteKeyValue("", ""));
29 for (OleElectronicLocationAndAccessRelationship type : oleElectronicLocationAndAccessRelationships) {
30 options.add(new ConcreteKeyValue(type.getElaRelationshipCode(), type.getElaRelationshipName()));
31 }
32 return options;
33 }
34 }