1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.student.enrollment.class2.courseoffering.form;
18
19 import org.apache.commons.lang.StringUtils;
20 import org.kuali.rice.krad.web.form.UifFormBase;
21 import org.kuali.student.enrollment.class2.courseoffering.dto.CourseOfferingContextBar;
22 import org.kuali.student.r2.core.acal.dto.TermInfo;
23 import org.kuali.student.enrollment.class2.courseoffering.dto.ManageSOCStatusHistory;
24 import org.kuali.student.enrollment.class2.courseoffering.util.ManageSocConstants;
25 import org.kuali.student.enrollment.courseofferingset.dto.SocInfo;
26 import org.kuali.student.r2.common.util.constants.CourseOfferingSetServiceConstants;
27
28 import java.util.ArrayList;
29 import java.util.List;
30
31
32
33
34
35
36 public class ManageSOCForm extends UifFormBase {
37
38 private String scheduleInitiatedDate;
39 private String scheduleCompleteDate;
40 private String scheduleDuration;
41
42 private String publishInitiatedDate;
43 private String publishCompleteDate;
44 private String publishDuration;
45
46 private String socStatus;
47 private String socSchedulingStatus;
48 private String socPublishingStatus;
49
50 private String termCode;
51 private List<ManageSOCStatusHistory> statusHistory;
52
53 private TermInfo termInfo;
54 private SocInfo socInfo;
55
56 private CourseOfferingContextBar contextBar = CourseOfferingContextBar.NULL_SAFE_INSTANCE;
57
58 public ManageSOCForm() {
59 statusHistory = new ArrayList<ManageSOCStatusHistory> ();
60 }
61
62 public String getScheduleInitiatedDate() {
63 return scheduleInitiatedDate;
64 }
65
66 public void setScheduleInitiatedDate(String scheduleInitiatedDate) {
67 this.scheduleInitiatedDate = scheduleInitiatedDate;
68 }
69
70 public String getScheduleCompleteDate() {
71 return scheduleCompleteDate;
72 }
73
74 public void setScheduleCompleteDate(String scheduleCompleteDate) {
75 this.scheduleCompleteDate = scheduleCompleteDate;
76 }
77
78 public String getScheduleDuration() {
79 return scheduleDuration;
80 }
81
82 public void setScheduleDuration(String scheduleDuration) {
83 this.scheduleDuration = scheduleDuration;
84 }
85
86 public String getPublishInitiatedDate() {
87 return publishInitiatedDate;
88 }
89
90 public void setPublishInitiatedDate(String publishInitiatedDate) {
91 this.publishInitiatedDate = publishInitiatedDate;
92 }
93
94 public String getPublishCompleteDate() {
95 return publishCompleteDate;
96 }
97
98 public void setPublishCompleteDate(String publishCompleteDate) {
99 this.publishCompleteDate = publishCompleteDate;
100 }
101
102 public String getPublishDuration() {
103 return publishDuration;
104 }
105
106 public void setPublishDuration(String publishDuration) {
107 this.publishDuration = publishDuration;
108 }
109
110 public String getSocStatus() {
111 return socStatus;
112 }
113
114 public void setSocStatus(String socStatus) {
115 this.socStatus = socStatus;
116 }
117
118 public List<ManageSOCStatusHistory> getStatusHistory() {
119 return statusHistory;
120 }
121
122 public void setStatusHistory(List<ManageSOCStatusHistory> statusHistory) {
123 this.statusHistory = statusHistory;
124 }
125
126 public String getTermCode() {
127 return termCode;
128 }
129
130 public void setTermCode(String termCode) {
131 this.termCode = termCode;
132 }
133
134 public String getSocSchedulingStatus() {
135 return socSchedulingStatus;
136 }
137
138 public void setSocSchedulingStatus(String socSchedulingStatus) {
139 this.socSchedulingStatus = socSchedulingStatus;
140 }
141
142 public String getSocPublishingStatus() {
143 return socPublishingStatus;
144 }
145
146 public void setSocPublishingStatus(String socPublishingStatus) {
147 this.socPublishingStatus = socPublishingStatus;
148 }
149
150 public TermInfo getTermInfo() {
151 return termInfo;
152 }
153
154 public void setTermInfo(TermInfo termInfo) {
155 this.termInfo = termInfo;
156 }
157
158 public SocInfo getSocInfo() {
159 return socInfo;
160 }
161
162 public void setSocInfo(SocInfo socInfo) {
163 this.socInfo = socInfo;
164 }
165
166
167
168
169
170
171 public boolean isEnableLockButton(){
172 if (socInfo != null){
173 if (StringUtils.equals(socInfo.getStateKey(), CourseOfferingSetServiceConstants.OPEN_SOC_STATE_KEY)){
174 return true;
175 }
176 }
177 return false;
178 }
179
180 public boolean isEnablePublishButton() {
181
182 if (socInfo != null){
183 if (!StringUtils.equals(socInfo.getStateKey(), CourseOfferingSetServiceConstants.PUBLISHING_SOC_STATE_KEY)){
184 return true;
185 }
186 }
187
188 return false;
189 }
190
191
192
193
194
195
196
197 public boolean isShowLockButton(){
198
199 if (socInfo != null){
200 if (StringUtils.equals(socInfo.getStateKey(), CourseOfferingSetServiceConstants.DRAFT_SOC_STATE_KEY) ||
201 StringUtils.equals(socInfo.getStateKey(), CourseOfferingSetServiceConstants.OPEN_SOC_STATE_KEY)){
202 return true;
203 }
204 }
205
206 return false;
207 }
208
209
210
211
212
213
214
215 public boolean isShowFinalEditButton(){
216
217 if (socInfo != null){
218 if (StringUtils.equals(socInfo.getStateKey(), CourseOfferingSetServiceConstants.LOCKED_SOC_STATE_KEY)){
219 return true;
220 }
221 }
222
223 return false;
224 }
225
226
227
228
229
230
231 public boolean isEnableFinalEditButton(){
232
233 if (socInfo != null){
234 if (StringUtils.equals(socInfo.getSchedulingStateKey(), CourseOfferingSetServiceConstants.SOC_SCHEDULING_STATE_COMPLETED) &&
235 StringUtils.equals(socInfo.getStateKey(), CourseOfferingSetServiceConstants.LOCKED_SOC_STATE_KEY)){
236 return true;
237 }
238 }
239
240 return false;
241 }
242
243
244
245
246
247
248
249 public boolean isShowPublishSetButton(){
250 boolean retVal = false;
251 if (socInfo != null){
252 if (StringUtils.equals(socInfo.getStateKey(), CourseOfferingSetServiceConstants.FINALEDITS_SOC_STATE_KEY)){
253 retVal = true;
254 }
255 }
256 if(StringUtils.equals(getSocPublishingStatus(), ManageSocConstants.SOC_IN_PROGRESS_PUBLISHING_STATUS_UI) ||
257 StringUtils.equals(getSocPublishingStatus(), ManageSocConstants.SOC_COMPLETED_PUBLISHING_STATUS_UI)) {
258 retVal = false;
259 }
260 return retVal;
261 }
262
263
264
265
266
267
268 public boolean isShowCloseSetButton(){
269 if (socInfo != null){
270 if (StringUtils.equals(socInfo.getStateKey(), CourseOfferingSetServiceConstants.PUBLISHED_SOC_STATE_KEY) ||
271 StringUtils.equals(socInfo.getStateKey(), CourseOfferingSetServiceConstants.PUBLISHING_SOC_STATE_KEY)){
272 return true;
273 }
274 if(StringUtils.equals(getSocPublishingStatus(), ManageSocConstants.SOC_IN_PROGRESS_PUBLISHING_STATUS_UI) ||
275 StringUtils.equals(getSocPublishingStatus(), ManageSocConstants.SOC_COMPLETED_PUBLISHING_STATUS_UI)) {
276 return true;
277 }
278
279 }
280 return false;
281 }
282
283
284
285
286
287
288
289 public boolean isRenderDetailsSection(){
290 return getTermInfo() != null;
291 }
292
293
294
295
296
297
298
299 public boolean isEnableMSEButton(){
300
301 boolean retVal = false;
302
303 if (socInfo != null){
304 if (StringUtils.equals(socInfo.getStateKey(), CourseOfferingSetServiceConstants.LOCKED_SOC_STATE_KEY)){
305 if(socInfo.getSchedulingStateKey() == null || socInfo.getSchedulingStateKey().isEmpty() || StringUtils.equals(socInfo.getSchedulingStateKey(), CourseOfferingSetServiceConstants.SOC_SCHEDULING_STATE_NOT_STARTED) ) {
306 retVal = true;
307 }
308 }
309 }
310
311 if(StringUtils.equals(getSocSchedulingStatus(), ManageSocConstants.SOC_IN_PROGRESS_PUBLISHING_STATUS_UI) ||
312 StringUtils.equals(getSocSchedulingStatus(), ManageSocConstants.SOC_COMPLETED_PUBLISHING_STATUS_UI)) {
313 retVal = false;
314 }
315
316 return retVal;
317 }
318
319
320
321
322
323 public void clear(){
324 setTermInfo(null);
325 setSocInfo(null);
326 statusHistory.clear();
327 setScheduleDuration(StringUtils.EMPTY);
328 setPublishDuration(StringUtils.EMPTY);
329 setSocStatus(StringUtils.EMPTY);
330 setSocPublishingStatus(StringUtils.EMPTY);
331 setSocSchedulingStatus(StringUtils.EMPTY);
332 }
333
334 public CourseOfferingContextBar getContextBar() {
335 return contextBar;
336 }
337
338 public void setContextBar(CourseOfferingContextBar contextBar) {
339 this.contextBar = contextBar;
340 }
341
342
343 }