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
28
29 @Deprecated
30 public class DocumentPresentationControllerBase extends org.kuali.rice.krad.document.DocumentPresentationControllerBase implements DocumentPresentationController {
31
32
33
34 @Override
35 public Set<String> getDocumentActions(Document document){
36 Set<String> documentActions = new HashSet<String>();
37 if (canEdit(document)){
38 documentActions.add(KRADConstants.KUALI_ACTION_CAN_EDIT);
39 }
40
41 if(canAnnotate(document)){
42 documentActions.add(KRADConstants.KUALI_ACTION_CAN_ANNOTATE);
43 }
44
45 if(canClose(document)){
46 documentActions.add(KRADConstants.KUALI_ACTION_CAN_CLOSE);
47 }
48
49 if(canSave(document)){
50 documentActions.add(KRADConstants.KUALI_ACTION_CAN_SAVE);
51 }
52 if(canRoute(document)){
53 documentActions.add(KRADConstants.KUALI_ACTION_CAN_ROUTE);
54 }
55
56 if(canCancel(document)){
57 documentActions.add(KRADConstants.KUALI_ACTION_CAN_CANCEL);
58 }
59
60 if(canRecall(document)){
61 documentActions.add(KRADConstants.KUALI_ACTION_CAN_RECALL);
62 }
63
64 if(canReload(document)){
65 documentActions.add(KRADConstants.KUALI_ACTION_CAN_RELOAD);
66 }
67 if(canCopy(document)){
68 documentActions.add(KRADConstants.KUALI_ACTION_CAN_COPY);
69 }
70 if(canPerformRouteReport(document)){
71 documentActions.add(KRADConstants.KUALI_ACTION_PERFORM_ROUTE_REPORT);
72 }
73
74 if(canAddAdhocRequests(document)){
75 documentActions.add(KRADConstants.KUALI_ACTION_CAN_ADD_ADHOC_REQUESTS);
76 }
77
78
79 boolean canComplete = this.canComplete(document);
80 if(!canComplete && canBlanketApprove(document)){
81 documentActions.add(KRADConstants.KUALI_ACTION_CAN_BLANKET_APPROVE);
82 }
83 if (!canComplete && canApprove(document)) {
84 documentActions.add(KRADConstants.KUALI_ACTION_CAN_APPROVE);
85 }
86
87 if (canDisapprove(document)) {
88 documentActions.add(KRADConstants.KUALI_ACTION_CAN_DISAPPROVE);
89 }
90 if (canSendAdhocRequests(document)) {
91 documentActions.add(KRADConstants.KUALI_ACTION_CAN_SEND_ADHOC_REQUESTS);
92 }
93 if(canSendNoteFyi(document)){
94 documentActions.add(KRADConstants.KUALI_ACTION_CAN_SEND_NOTE_FYI);
95 }
96 if(this.canEditDocumentOverview(document)){
97 documentActions.add(KRADConstants.KUALI_ACTION_CAN_EDIT_DOCUMENT_OVERVIEW);
98 }
99 if (canFyi(document)) {
100 documentActions.add(KRADConstants.KUALI_ACTION_CAN_FYI);
101 }
102 if (canAcknowledge(document)) {
103 documentActions.add(KRADConstants.KUALI_ACTION_CAN_ACKNOWLEDGE);
104 }
105 if (canComplete(document)) {
106 documentActions.add(KRADConstants.KUALI_ACTION_CAN_COMPLETE);
107 }
108
109 return documentActions;
110 }
111 }