1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.document.authorization;
17
18 import java.util.HashSet;
19 import java.util.Set;
20
21 import org.kuali.rice.krad.document.Document;
22 import org.kuali.rice.krad.util.KRADConstants;
23
24
25
26
27 public class DocumentPresentationControllerBase extends org.kuali.rice.krad.document.DocumentPresentationControllerBase implements DocumentPresentationController {
28
29
30
31 @Override
32 public Set<String> getDocumentActions(Document document){
33 Set<String> documentActions = new HashSet<String>();
34 if (canEdit(document)){
35 documentActions.add(KRADConstants.KUALI_ACTION_CAN_EDIT);
36 }
37
38 if(canAnnotate(document)){
39 documentActions.add(KRADConstants.KUALI_ACTION_CAN_ANNOTATE);
40 }
41
42 if(canClose(document)){
43 documentActions.add(KRADConstants.KUALI_ACTION_CAN_CLOSE);
44 }
45
46 if(canSave(document)){
47 documentActions.add(KRADConstants.KUALI_ACTION_CAN_SAVE);
48 }
49 if(canRoute(document)){
50 documentActions.add(KRADConstants.KUALI_ACTION_CAN_ROUTE);
51 }
52
53 if(canCancel(document)){
54 documentActions.add(KRADConstants.KUALI_ACTION_CAN_CANCEL);
55 }
56
57 if(canRecall(document)){
58 documentActions.add(KRADConstants.KUALI_ACTION_CAN_RECALL);
59 }
60
61 if(canReload(document)){
62 documentActions.add(KRADConstants.KUALI_ACTION_CAN_RELOAD);
63 }
64 if(canCopy(document)){
65 documentActions.add(KRADConstants.KUALI_ACTION_CAN_COPY);
66 }
67 if(canPerformRouteReport(document)){
68 documentActions.add(KRADConstants.KUALI_ACTION_PERFORM_ROUTE_REPORT);
69 }
70
71 if(canAddAdhocRequests(document)){
72 documentActions.add(KRADConstants.KUALI_ACTION_CAN_ADD_ADHOC_REQUESTS);
73 }
74
75 if(canBlanketApprove(document)){
76 documentActions.add(KRADConstants.KUALI_ACTION_CAN_BLANKET_APPROVE);
77 }
78 if (canApprove(document)) {
79 documentActions.add(KRADConstants.KUALI_ACTION_CAN_APPROVE);
80 }
81 if (canDisapprove(document)) {
82 documentActions.add(KRADConstants.KUALI_ACTION_CAN_DISAPPROVE);
83 }
84 if (canSendAdhocRequests(document)) {
85 documentActions.add(KRADConstants.KUALI_ACTION_CAN_SEND_ADHOC_REQUESTS);
86 }
87 if(canSendNoteFyi(document)){
88 documentActions.add(KRADConstants.KUALI_ACTION_CAN_SEND_NOTE_FYI);
89 }
90 if(this.canEditDocumentOverview(document)){
91 documentActions.add(KRADConstants.KUALI_ACTION_CAN_EDIT_DOCUMENT_OVERVIEW);
92 }
93 if (canFyi(document)) {
94 documentActions.add(KRADConstants.KUALI_ACTION_CAN_FYI);
95 }
96 if (canAcknowledge(document)) {
97 documentActions.add(KRADConstants.KUALI_ACTION_CAN_ACKNOWLEDGE);
98 }
99 return documentActions;
100 }
101 }