1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.rice.kew.routelog.web;
18
19 import org.kuali.rice.core.api.config.property.ConfigContext;
20 import org.kuali.rice.kns.util.UrlFactory;
21 import org.kuali.rice.kns.web.struts.form.KualiForm;
22
23 import java.util.ArrayList;
24 import java.util.List;
25 import java.util.Properties;
26
27
28
29
30
31
32
33 public class RouteLogForm extends KualiForm {
34
35 private static final long serialVersionUID = -3997667167734868281L;
36 private String methodToCall = "";
37 private String documentId;
38 private List rootRequests = new ArrayList();
39 private int pendingActionRequestCount;
40 private List futureRootRequests = new ArrayList();
41 private int futureActionRequestCount;
42 private boolean showFuture;
43 private String showFutureError;
44 private boolean removeHeader;
45 private boolean lookFuture;
46 private boolean showNotes;
47 private String docId;
48 private String returnUrlLocation = null;
49 private boolean showCloseButton = false;
50 private String newRouteLogActionMessage;
51 private boolean enableLogAction = false;
52
53 public boolean isShowCloseButton() {
54 return showCloseButton;
55 }
56 public void setShowCloseButton(boolean showCloseButton) {
57 this.showCloseButton = showCloseButton;
58 }
59 public String getReturnUrlLocation() {
60 return returnUrlLocation;
61 }
62 public void setReturnUrlLocation(String returnUrlLocation) {
63 this.returnUrlLocation = returnUrlLocation;
64 }
65 public String getDocId() {
66 return docId;
67 }
68 public void setDocId(String docId) {
69 this.docId = docId;
70 }
71 public boolean isShowFutureHasError() {
72 return !org.apache.commons.lang.StringUtils.isEmpty(getShowFutureError());
73 }
74 public String getShowFutureError() {
75 return showFutureError;
76 }
77 public void setShowFutureError(String showFutureError) {
78 this.showFutureError = showFutureError;
79 }
80 public boolean isShowFuture() {
81 return showFuture;
82 }
83 public void setShowFuture(boolean showReportURL) {
84 this.showFuture = showReportURL;
85 }
86 public String getMethodToCall() {
87 return methodToCall;
88 }
89 public void setMethodToCall(String methodToCall) {
90 this.methodToCall = methodToCall;
91 }
92 public String getDocumentId() {
93 return documentId;
94 }
95 public void setDocumentId(String documentId) {
96 this.documentId = documentId;
97 }
98
99 public int getPendingActionRequestCount() {
100 return pendingActionRequestCount;
101 }
102
103 public void setPendingActionRequestCount(int pendingActionRequestCount) {
104 this.pendingActionRequestCount = pendingActionRequestCount;
105 }
106
107 public List getRootRequests() {
108 return rootRequests;
109 }
110 public void setRootRequests(List rootRequests) {
111 this.rootRequests = rootRequests;
112 }
113 public int getFutureActionRequestCount() {
114 return futureActionRequestCount;
115 }
116 public void setFutureActionRequestCount(int futureActionRequestCount) {
117 this.futureActionRequestCount = futureActionRequestCount;
118 }
119 public List getFutureRootRequests() {
120 return futureRootRequests;
121 }
122 public void setFutureRootRequests(List futureRootRequests) {
123 this.futureRootRequests = futureRootRequests;
124 }
125 public boolean isRemoveHeader() {
126 return removeHeader;
127 }
128 public void setRemoveHeader(boolean removeBar) {
129 this.removeHeader = removeBar;
130 }
131 public boolean isLookFuture() {
132 return lookFuture;
133 }
134 public void setLookFuture(boolean showFutureLink) {
135 this.lookFuture = showFutureLink;
136 }
137 public boolean isShowNotes() {
138 return showNotes;
139 }
140 public void setShowNotes(boolean showNotes) {
141 this.showNotes = showNotes;
142 }
143
144 public String getNewRouteLogActionMessage() {
145 return this.newRouteLogActionMessage;
146 }
147
148 public void setNewRouteLogActionMessage(String newRouteLogActionMessage) {
149 this.newRouteLogActionMessage = newRouteLogActionMessage;
150 }
151
152 public boolean isEnableLogAction() {
153 return this.enableLogAction;
154 }
155
156 public void setEnableLogAction(boolean enableLogAction) {
157 this.enableLogAction = enableLogAction;
158 }
159
160 public String getHeaderMenuBar() {
161 Properties parameters = new Properties();
162 parameters.put("showFuture", isShowFuture());
163 parameters.put("showNotes", isShowNotes());
164 if (getDocumentId() != null) {
165 parameters.put("documentId", getDocumentId());
166 }
167 if (getDocId() != null) {
168 parameters.put("docId", getDocId());
169 }
170 if (getReturnUrlLocation() != null) {
171 parameters.put("backUrl", getReturnUrlLocation());
172 }
173 String url = UrlFactory.parameterizeUrl("RouteLog.do", parameters);
174 String krBaseUrl = ConfigContext.getCurrentContextConfig().getKRBaseURL();
175 url = "<div class=\"lookupcreatenew\" title=\"Refresh\"><a href=\"" + url + "\"><img src=\""+krBaseUrl+"/images/tinybutton-refresh.gif\" alt=\"refresh\"></a></div>";
176 return url;
177 }
178 }