1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.keyvalues;
17
18 import org.kuali.rice.core.api.util.ConcreteKeyValue;
19 import org.kuali.rice.core.api.util.KeyValue;
20 import org.kuali.rice.kew.api.KewApiConstants;
21 import org.kuali.rice.krad.document.Document;
22 import org.kuali.rice.krad.uif.control.UifKeyValuesFinderBase;
23 import org.kuali.rice.krad.uif.view.ViewModel;
24 import org.kuali.rice.krad.web.form.DocumentFormBase;
25
26 import java.util.ArrayList;
27 import java.util.List;
28
29 public class AdHocActionRequestCodesValuesFinder extends UifKeyValuesFinderBase {
30 private static final long serialVersionUID = 8457876358655872234L;
31
32
33
34
35 @Override
36 public List<KeyValue> getKeyValues(ViewModel model) {
37 DocumentFormBase documentFormBase = (DocumentFormBase) model;
38 Document document = documentFormBase.getDocument();
39 List<KeyValue> keyValues = new ArrayList<KeyValue>();
40 keyValues.add(new ConcreteKeyValue(KewApiConstants.ACTION_REQUEST_FYI_REQ, KewApiConstants.ACTION_REQUEST_FYI_REQ_LABEL));
41 keyValues.add(new ConcreteKeyValue(KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ, KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ_LABEL));
42 keyValues.add(new ConcreteKeyValue(KewApiConstants.ACTION_REQUEST_APPROVE_REQ, KewApiConstants.ACTION_REQUEST_APPROVE_REQ_LABEL));
43
44 if ((document.getDocumentHeader().getWorkflowDocument().isInitiated() || document.getDocumentHeader().getWorkflowDocument().isSaved())) {
45 keyValues.add(new ConcreteKeyValue(KewApiConstants.ACTION_REQUEST_COMPLETE_REQ, KewApiConstants.ACTION_REQUEST_COMPLETE_REQ_LABEL));
46 }
47 return keyValues;
48 }
49 }