1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.pm.position;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.kuali.kpme.pm.PMConstants;
22 import org.kuali.kpme.pm.pstnqlfrtype.PstnQlfrType;
23 import org.kuali.kpme.pm.service.base.PmServiceLocator;
24 import org.kuali.rice.core.api.util.ConcreteKeyValue;
25 import org.kuali.rice.core.api.util.KeyValue;
26 import org.kuali.rice.krad.uif.control.UifKeyValuesFinderBase;
27 import org.kuali.rice.krad.uif.view.ViewModel;
28 import org.kuali.rice.krad.web.form.MaintenanceDocumentForm;
29
30 public class PositionQualifierValueKeyValueFinder extends UifKeyValuesFinderBase {
31
32 private static final long serialVersionUID = 1L;
33
34 @Override
35 public List<KeyValue> getKeyValues(ViewModel model) {
36 MaintenanceDocumentForm docForm = (MaintenanceDocumentForm) model;
37 List<KeyValue> options = new ArrayList<KeyValue>();
38
39 PositionQualification aQualification = (PositionQualification) docForm.getNewCollectionLines().get("document.newMaintainableObject.dataObject.qualificationList");
40 if(aQualification != null) {
41 String aTypeId = aQualification.getQualificationType();
42 PstnQlfrType aTypeObj = PmServiceLocator.getPstnQlfrTypeService().getPstnQlfrTypeById(aTypeId);
43 if(aTypeObj != null) {
44 if(aTypeObj.getTypeValue().equals(PMConstants.PSTN_QLFR_SELECT)){
45 String[] aCol = aTypeObj.getSelectValues().split(",");
46 for(String aString : aCol){
47 options.add(new ConcreteKeyValue(aString, aString));
48 }
49 } else{
50 return new ArrayList<KeyValue>();
51 }
52 }
53 }
54 return options;
55 }
56
57
58 }