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