View Javadoc

1   package org.kuali.student.enrollment.class2.courseoffering.dto;
2   
3   import org.apache.commons.lang.BooleanUtils;
4   import org.apache.commons.lang.StringUtils;
5   import org.kuali.student.enrollment.courseoffering.dto.ActivityOfferingInfo;
6   import org.kuali.student.enrollment.courseoffering.dto.ColocatedOfferingSetInfo;
7   import org.kuali.student.enrollment.courseoffering.dto.FormatOfferingInfo;
8   import org.kuali.student.enrollment.courseofferingset.dto.SocInfo;
9   import org.kuali.student.r2.common.util.constants.CourseOfferingSetServiceConstants;
10  import org.kuali.student.r2.common.util.constants.LuiServiceConstants;
11  import org.kuali.student.r2.core.acal.dto.TermInfo;
12  import org.kuali.student.r2.core.scheduling.dto.ScheduleInfo;
13  import org.kuali.student.r2.core.scheduling.dto.ScheduleRequestInfo;
14  import org.kuali.student.r2.lum.course.dto.CourseInfo;
15  import org.kuali.student.r2.lum.course.infc.CourseCrossListing;
16  
17  import java.io.Serializable;
18  import java.util.ArrayList;
19  import java.util.Date;
20  import java.util.List;
21  
22  /**
23   * Main model object in Edit AO view.
24   *
25   * @see ColocatedActivity
26   *
27   */
28  public class ActivityOfferingWrapper implements Serializable{
29  
30      private String aoClusterName;
31      private String aoClusterID;
32  
33      private ActivityOfferingInfo aoInfo;
34      private FormatOfferingInfo formatOffering;
35      private TermInfo term;
36      private List<OfferingInstructorWrapper> instructors;
37      private List<ScheduleComponentWrapper> scheduleComponentWrappers;
38      private List<SeatPoolWrapper> seatpools;
39      private boolean readOnlyView;
40      private boolean isChecked;
41      private boolean isCheckedByCluster;
42      private String courseOfferingId;
43      // Tanveer 06/13/2012
44      private String stateName;
45      private String typeName;
46      private String typeKey;
47  
48      private String termName;
49  
50      private String formatOfferingName;
51  
52      private Date termRegStartDate;
53  
54      // Tanveer 06/27/2012
55      private String waitListLevelTypeKey;
56      private String waitListTypeKey;
57      private boolean hasWaitList;
58      private String waitListText = "";
59      private String toolTipText = "";
60  
61      private String instructorNameHighestPercentEffort = "";
62  
63      private String firstInstructorDisplayName;
64      private String instructorDisplayNames;
65  
66      private String courseOfferingCode = "";
67  
68      private List<ScheduleWrapper> actualScheduleComponents;
69      private List<ScheduleWrapper> requestedScheduleComponents;
70  //    private List<ScheduleWrapper> revisedScheduleRequestComponents;
71      private ScheduleWrapper newScheduleRequest;
72  
73      private ScheduleRequestInfo scheduleRequestInfo;
74      private ScheduleInfo scheduleInfo;
75      private SocInfo socInfo;
76  
77      private String startTimeDisplay = "";
78      private String endTimeDisplay = "";
79      private String daysDisplayName = "";
80      private String buildingName = "";
81      private String roomName = "";
82      private String tbaDisplayName = "";
83      private String colocatedAoInfo = "";
84  
85      private boolean schedulesModified;
86  
87      private String adminOrg;
88  
89        //hidden columns for toolbar
90      private boolean enableApproveButton = false;
91      private boolean enableDraftButton = false;
92      private boolean enableSuspendButton = false;
93      private boolean enableCancelButton = false;
94      private boolean enableReinstateButton = false;
95      private boolean enableMoveToButton = false;
96      private boolean enableDeleteButton = false;
97      private boolean enableCopyAOActionLink = false;
98      private boolean enableEditAOActionLink = false;
99  
100     private boolean colocatedAO;
101     private List<ColocatedActivity> colocatedActivities;
102     private boolean maxEnrollmentShared;
103     private boolean hiddenMaxEnrollmentShared;
104     private int sharedMaxEnrollment;
105 
106     private ColocatedOfferingSetInfo colocatedOfferingSetInfo;
107 
108     private EditRenderHelper editRenderHelper;
109     private boolean isPartOfColoSetOnLoadAlready;
110     private boolean isSendRDLsToSchedulerAfterMSE;
111 
112     //This is needed to display the cross listed courses
113     private CourseInfo course;
114 
115     public ActivityOfferingWrapper(){
116         aoInfo = new ActivityOfferingInfo();
117         instructors = new ArrayList<OfferingInstructorWrapper>();
118         seatpools = new ArrayList<SeatPoolWrapper>();
119         aoInfo.setStateKey(LuiServiceConstants.LUI_AO_STATE_DRAFT_KEY);
120         aoInfo.setTypeKey(LuiServiceConstants.LECTURE_ACTIVITY_OFFERING_TYPE_KEY);
121         formatOffering = new FormatOfferingInfo();
122         term = new TermInfo();
123         scheduleComponentWrappers = new ArrayList<ScheduleComponentWrapper>();
124         this.setReadOnlyView(false);
125         this.setIsChecked(false);
126         actualScheduleComponents = new ArrayList<ScheduleWrapper>();
127         requestedScheduleComponents = new ArrayList<ScheduleWrapper>();
128 //        revisedScheduleRequestComponents = new ArrayList<ScheduleWrapper>();
129         newScheduleRequest = new ScheduleWrapper();
130         colocatedActivities = new ArrayList<ColocatedActivity>();
131         maxEnrollmentShared = true;
132         editRenderHelper = new EditRenderHelper();
133         colocatedOfferingSetInfo = new ColocatedOfferingSetInfo();
134     }
135 
136     public ActivityOfferingWrapper(ActivityOfferingInfo info){
137         this();
138         aoInfo = info;
139         instructors = new ArrayList<OfferingInstructorWrapper>();
140         seatpools = new ArrayList<SeatPoolWrapper>();
141     }
142 
143     public String getAoClusterName() {
144         return aoClusterName;
145     }
146 
147     public void setAoClusterName(String aoClusterName) {
148         this.aoClusterName = aoClusterName;
149     }
150 
151     public String getAoClusterID() {
152         return aoClusterID;
153     }
154 
155     public void setAoClusterID(String aoClusterID) {
156         this.aoClusterID = aoClusterID;
157     }
158 
159     public boolean isEnableApproveButton() {
160         return enableApproveButton;
161     }
162 
163     public void setEnableApproveButton(boolean enableApproveButton) {
164         this.enableApproveButton = enableApproveButton;
165     }
166 
167     public boolean isEnableDraftButton() {
168         return enableDraftButton;
169     }
170 
171     public void setEnableDraftButton(boolean enableDraftButton) {
172         this.enableDraftButton = enableDraftButton;
173     }
174 
175     public boolean isEnableSuspendButton() {
176         return enableSuspendButton;
177     }
178 
179     public void setEnableSuspendButton(boolean enableSuspendButton) {
180         this.enableSuspendButton = enableSuspendButton;
181     }
182 
183     public boolean isEnableCancelButton() {
184         return enableCancelButton;
185     }
186 
187     public void setEnableCancelButton(boolean enableCancelButton) {
188         this.enableCancelButton = enableCancelButton;
189     }
190 
191     public boolean isEnableMoveToButton() {
192         return enableMoveToButton;
193     }
194 
195     public void setEnableMoveToButton(boolean enableMoveToButton) {
196         this.enableMoveToButton = enableMoveToButton;
197     }
198 
199     public boolean isEnableReinstateButton() {
200         return enableReinstateButton;
201     }
202 
203     public void setEnableReinstateButton(boolean enableReinstateButton) {
204         this.enableReinstateButton = enableReinstateButton;
205     }
206 
207     public boolean isEnableDeleteButton() {
208         return enableDeleteButton;
209     }
210 
211     public void setEnableDeleteButton(boolean enableDeleteButton) {
212         this.enableDeleteButton = enableDeleteButton;
213     }
214 
215     public boolean isEnableCopyAOActionLink() {
216         return enableCopyAOActionLink;
217     }
218 
219     public void setEnableCopyAOActionLink(boolean enableCopyAOActionLink) {
220         this.enableCopyAOActionLink = enableCopyAOActionLink;
221     }
222 
223     public boolean isEnableEditAOActionLink() {
224         return enableEditAOActionLink;
225     }
226 
227     public void setEnableEditAOActionLink(boolean enableEditAOActionLink) {
228         this.enableEditAOActionLink = enableEditAOActionLink;
229     }
230 
231     public String getCourseOfferingCode() {
232         return courseOfferingCode;
233     }
234 
235     public void setCourseOfferingCode(String courseOfferingCode) {
236         this.courseOfferingCode = courseOfferingCode;
237     }
238 
239     public String courseOfferingTitle;
240     public void setCourseOfferingTitle(String courseOfferingTitle) {
241         this.courseOfferingTitle = courseOfferingTitle;
242     }
243 
244     public String getCourseOfferingTitle() {
245         return courseOfferingTitle;
246     }
247 
248     private String credits = "";
249     public String getCredits() {
250         return credits;
251     }
252 
253     public void setCredits(String credits) {
254         this.credits = credits;
255     }
256 
257     private String activityCode = "";
258 
259     public String getActivityCode() {
260         return activityCode;
261     }
262 
263     public void setActivityCode(String activityCode) {
264         this.activityCode = activityCode;
265     }
266 
267     private String abbreviatedCourseType = "";
268 
269     public String getAbbreviatedCourseType() {
270         return abbreviatedCourseType;
271     }
272 
273     public void setAbbreviatedCourseType(String abbreviatedCourseType) {
274         this.abbreviatedCourseType= abbreviatedCourseType;
275     }
276 
277     private String termDisplayString = "";
278 
279     public String getTermDisplayString() {
280         return termDisplayString;
281     }
282 
283     public void setTermDisplayString(String termDisplayString) {
284         this.termDisplayString = termDisplayString;
285     }
286 
287     public String getToolTipText() {
288         return toolTipText;
289     }
290 
291     public void setToolTipText(String toolTipText) {
292         this.toolTipText = toolTipText;
293     }
294 
295     public String getWaitListText() {
296         return waitListText;
297     }
298 
299     public void setWaitListText(String waitListText) {
300         this.waitListText = waitListText;
301     }
302 
303 
304 
305     public boolean getHasWaitList() {
306         return hasWaitList;
307     }
308 
309     public String getTbaDisplayName() {
310         return tbaDisplayName;
311     }
312 
313     public void setTbaDisplayName(boolean tba,boolean appendForDisplay) {
314         if (appendForDisplay){
315             tbaDisplayName =  tbaDisplayName + "<br>" + (tba ? "TBA" : StringUtils.EMPTY);
316         } else {
317             tbaDisplayName = StringUtils.EMPTY;
318             if (tba){
319                 tbaDisplayName =  "TBA";
320             }
321         }
322     }
323 
324     public void setHasWaitList(boolean hasWaitList) {
325         this.hasWaitList = hasWaitList;
326     }
327 
328     public String getWaitListLevelTypeKey() {
329         return waitListLevelTypeKey;
330     }
331     public void setWaitListLevelTypeKey(String waitListLevelTypeKey) {
332         this.waitListLevelTypeKey = waitListLevelTypeKey;
333     }
334     public String getWaitListTypeKey() {
335         return waitListTypeKey;
336     }
337     public void setWaitListTypeKey(String waitListTypeKey) {
338         this.waitListTypeKey = waitListTypeKey;
339     }
340 
341     public FormatOfferingInfo getFormatOffering() {
342         return formatOffering;
343     }
344 
345     public void setFormatOffering(FormatOfferingInfo formatOffering) {
346         this.formatOffering = formatOffering;
347     }
348 
349     public TermInfo getTerm() {
350         return term;
351     }
352 
353     public void setTerm(TermInfo term) {
354         this.term = term;
355     }
356 
357     public String getTermId(){
358         if (term != null){
359             return term.getId();
360         }
361         return StringUtils.EMPTY;
362     }
363 
364     public ActivityOfferingInfo getAoInfo() {
365         return aoInfo;
366     }
367 
368     public void setAoInfo(ActivityOfferingInfo aoInfo) {
369         this.aoInfo = aoInfo;
370     }
371 
372     public List<ScheduleComponentWrapper> getScheduleComponentWrappers() {
373         return scheduleComponentWrappers;
374     }
375 
376     public void setScheduleComponentWrappers(List<ScheduleComponentWrapper> scheduleComponentWrappers) {
377         this.scheduleComponentWrappers = scheduleComponentWrappers;
378     }
379 
380     public boolean getReadOnlyView() {
381         return readOnlyView;
382     }
383 
384     public void setReadOnlyView(boolean readOnlyView) {
385         this.readOnlyView = readOnlyView;
386     }
387 
388     public boolean getIsChecked() {
389         return isChecked;
390     }
391 
392     public void setIsChecked(boolean checked) {
393         this.isChecked = checked;
394     }
395 
396     public boolean getIsCheckedByCluster() {
397         return isCheckedByCluster;
398     }
399 
400     public void setIsCheckedByCluster(boolean checkedByCluster) {
401         isCheckedByCluster = checkedByCluster;
402     }
403 
404 
405     public String getStateName() {
406         return stateName;
407     }
408 
409     public void setStateName(String stateName) {
410         this.stateName = stateName;
411     }
412 
413     public String getTypeName() {
414         return typeName;
415     }
416 
417     public void setTypeName(String typeName) {
418         this.typeName = typeName;
419     }
420 
421     public String getCourseOfferingId() {
422         return courseOfferingId;
423     }
424 
425     public void setCourseOfferingId(String courseOfferingId) {
426         this.courseOfferingId = courseOfferingId;
427     }
428 
429     public List<OfferingInstructorWrapper> getInstructors() {
430         return instructors;
431     }
432 
433     public void setInstructors(List<OfferingInstructorWrapper> instructors) {
434         this.instructors = instructors;
435     }
436 
437     public List<SeatPoolWrapper> getSeatpools() {
438         return seatpools;
439     }
440 
441     public void setSeatpools(List<SeatPoolWrapper> seatpools) {
442         this.seatpools = seatpools;
443     }
444 
445     public String getFirstInstructorDisplayName() {
446         return firstInstructorDisplayName;
447     }
448 
449     public void setFirstInstructorDisplayName(String firstInstructorDisplayName) {
450         this.firstInstructorDisplayName = firstInstructorDisplayName;
451     }
452 
453     public String getId() {
454         return aoInfo.getId();
455     }
456 
457     public void setId(String id) {
458         aoInfo.setId(id);
459     }
460 
461     public String getTermName() {
462         return termName;
463     }
464 
465     public void setTermName(String termName) {
466         this.termName = termName;
467     }
468 
469     public String getFormatOfferingName() {
470         return formatOfferingName;
471     }
472 
473     public void setFormatOfferingName(String formatOfferingName) {
474         this.formatOfferingName = formatOfferingName;
475     }
476 
477     public String getIsMaxEnrollmentEstimateUI(){
478         return StringUtils.capitalize(BooleanUtils.toStringYesNo(aoInfo.getIsMaxEnrollmentEstimate()));
479     }
480 
481     public String getIsEvaluatedUI(){
482         return StringUtils.capitalize(BooleanUtils.toStringYesNo(aoInfo.getIsEvaluated()));
483     }
484 
485     public String getIsHonorsOfferingUI(){
486         return StringUtils.capitalize(BooleanUtils.toStringYesNo(aoInfo.getIsHonorsOffering()));
487     }
488 
489     public String getInstructorNameHighestPercentEffort() {
490         return instructorNameHighestPercentEffort;
491     }
492 
493     public void setInstructorNameHighestPercentEffort(String instructorNameHighestPercentEffort) {
494         this.instructorNameHighestPercentEffort = instructorNameHighestPercentEffort;
495     }
496 
497     public boolean isLegalToDelete() {
498         if (StringUtils.equals(aoInfo.getStateKey(), LuiServiceConstants.LUI_AO_STATE_DRAFT_KEY) ||
499                 StringUtils.equals(aoInfo.getStateKey(), LuiServiceConstants.LUI_AO_STATE_APPROVED_KEY) ||
500                 StringUtils.equals(aoInfo.getStateKey(), LuiServiceConstants.LUI_AO_STATE_SUBMITTED_KEY) ||
501                 StringUtils.equals(aoInfo.getStateKey(), LuiServiceConstants.LUI_AO_STATE_OFFERED_KEY) ||
502                 StringUtils.equals(aoInfo.getStateKey(), LuiServiceConstants.LUI_CO_STATE_OFFERED_KEY) ) {
503             return true;
504         }
505         return false;
506     }
507 
508     public List<ScheduleWrapper> getActualScheduleComponents() {
509         if (actualScheduleComponents == null){
510             actualScheduleComponents = new ArrayList<ScheduleWrapper>();
511         }
512         return actualScheduleComponents;
513     }
514 
515     public void setActualScheduleComponents(List<ScheduleWrapper> actualScheduleComponents) {
516         this.actualScheduleComponents = actualScheduleComponents;
517     }
518 
519     public List<ScheduleWrapper> getRequestedScheduleComponents() {
520         if (requestedScheduleComponents == null){
521             requestedScheduleComponents = new ArrayList<ScheduleWrapper>();
522         }
523         return requestedScheduleComponents;
524     }
525 
526     public void setRequestedScheduleComponents(List<ScheduleWrapper> requestedScheduleComponents) {
527         this.requestedScheduleComponents = requestedScheduleComponents;
528     }
529 
530     public ScheduleWrapper getNewScheduleRequest() {
531         return newScheduleRequest;
532     }
533 
534     public void setNewScheduleRequest(ScheduleWrapper newScheduleRequest) {
535         this.newScheduleRequest = newScheduleRequest;
536     }
537 
538     public String getStartTimeDisplay() {
539         return startTimeDisplay;
540     }
541 
542     public void setStartTimeDisplay(String startTimeDisplay,boolean appendForDisplay) {
543         if (appendForDisplay){
544             this.startTimeDisplay = this.startTimeDisplay + "<br>" + StringUtils.defaultString(startTimeDisplay);
545         }else{
546             this.startTimeDisplay = StringUtils.defaultString(startTimeDisplay);
547         }
548 
549     }
550 
551     public void setStartTimeDisplay(String startTimeDisplay, boolean appendForDisplay, String dlTypeClass) {
552         String cssClass = "";
553         if(!StringUtils.isEmpty(dlTypeClass)){
554             cssClass = "class=\"" + dlTypeClass + "\"";
555         }
556         if(StringUtils.isEmpty(this.startTimeDisplay)){
557             appendForDisplay = false;
558         }
559         if (appendForDisplay){
560             this.startTimeDisplay = this.startTimeDisplay + "<br><span " + cssClass + " >" + startTimeDisplay + "</span>";
561         }else{
562             this.startTimeDisplay = "<span " + cssClass + " >" + startTimeDisplay + "</span>";
563         }
564     }
565 
566     public String getInstructorDisplayNames() {
567         return instructorDisplayNames;
568     }
569 
570     public void setInstructorDisplayNames(String instructorDisplayNames) {
571         this.instructorDisplayNames = instructorDisplayNames;
572     }
573 
574     public void setInstructorDisplayNames(String instructorDisplayNames,boolean appendForDisplay) {
575         if (appendForDisplay && this.instructorDisplayNames!=null){
576             this.instructorDisplayNames = this.instructorDisplayNames + "<br>" + StringUtils.defaultString(instructorDisplayNames);
577         }else{
578             this.instructorDisplayNames = StringUtils.defaultString(instructorDisplayNames);
579         }
580 
581     }
582 
583     public String getEndTimeDisplay() {
584         return endTimeDisplay;
585     }
586 
587     public void setEndTimeDisplay(String endTimeDisplay,boolean appendForDisplay) {
588         if (appendForDisplay){
589             this.endTimeDisplay = this.endTimeDisplay + "<br>" + StringUtils.defaultString(endTimeDisplay);
590         }else{
591             this.endTimeDisplay = StringUtils.defaultString(endTimeDisplay);
592         }
593     }
594 
595     public void setEndTimeDisplay(String endTimeDisplay,boolean appendForDisplay, String dlTypeClass) {
596         String cssClass = "";
597         if(!StringUtils.isEmpty(dlTypeClass)){
598             cssClass = "class=\"" + dlTypeClass + "\"";
599         }
600         if(StringUtils.isEmpty(this.endTimeDisplay)){
601             appendForDisplay = false;
602         }
603         if (appendForDisplay){
604             this.endTimeDisplay = this.endTimeDisplay + "<br><span " + cssClass + " >" + endTimeDisplay + "</span>";
605         }else{
606             this.endTimeDisplay = "<span " + cssClass + " >" + endTimeDisplay + "</span>";
607         }
608     }
609 
610     public String getDaysDisplayName() {
611         return daysDisplayName;
612     }
613 
614     public void setDaysDisplayName(String daysDisplayName,boolean appendForDisplay) {
615         if (appendForDisplay){
616             this.daysDisplayName = this.daysDisplayName + "<br>" + StringUtils.defaultString(daysDisplayName);
617         }else{
618             this.daysDisplayName = StringUtils.defaultString(daysDisplayName);
619         }
620     }
621 
622     public void setDaysDisplayName(String daysDisplayName,boolean appendForDisplay, String dlTypeClass) {
623         String cssClass = "";
624         if(!StringUtils.isEmpty(dlTypeClass)){
625             cssClass = "class=\"" + dlTypeClass + "\"";
626         }
627         if(StringUtils.isEmpty(this.daysDisplayName)){
628             appendForDisplay = false;
629         }
630         if (appendForDisplay){
631             this.daysDisplayName = this.daysDisplayName + "<br><span " + cssClass + " >" + daysDisplayName + "</span>";
632         }else{
633             this.daysDisplayName = "<span " + cssClass + " >" + daysDisplayName + "</span>";
634         }
635     }
636 
637     public String getBuildingName() {
638         return buildingName;
639     }
640 
641     public void setBuildingName(String buildingName,boolean appendForDisplay) {
642         if (appendForDisplay){
643             this.buildingName = this.buildingName + "<br>" + StringUtils.defaultString(buildingName);
644         }else{
645             this.buildingName = StringUtils.defaultString(buildingName);
646         }
647     }
648     public void setBuildingName(String buildingName,boolean appendForDisplay, String dlTypeClass) {
649         String cssClass = "";
650         if(!StringUtils.isEmpty(dlTypeClass)){
651             cssClass = "class=\"" + dlTypeClass + "\"";
652         }
653         if(StringUtils.isEmpty(this.buildingName)){
654             appendForDisplay = false;
655         }
656         if (appendForDisplay){
657             this.buildingName = this.buildingName + "<br><span " + cssClass + " >" + buildingName + "</span>";
658         }else{
659             this.buildingName = "<span " + cssClass + " >" + buildingName + "</span>";
660         }
661     }
662 
663     public String getRoomName() {
664         return roomName;
665     }
666 
667     public void setRoomName(String roomName,boolean appendForDisplay) {
668         if (appendForDisplay){
669             this.roomName = this.roomName + "<br>" + StringUtils.defaultString(roomName);
670         }else{
671             this.roomName = StringUtils.defaultString(roomName);
672         }
673     }
674     public void setRoomName(String roomName,boolean appendForDisplay, String dlTypeClass) {
675         String cssClass = "";
676         if(!StringUtils.isEmpty(dlTypeClass)){
677             cssClass = "class=\"" + dlTypeClass + "\"";
678         }
679         if(StringUtils.isEmpty(this.roomName)){
680             appendForDisplay = false;
681         }
682         if (appendForDisplay){
683             this.roomName = this.roomName + "<br><span " + cssClass + " >" + roomName + "</span>";
684         }else{
685             this.roomName = "<span " + cssClass + " >" + roomName + "</span>";
686         }
687     }
688 
689     public ScheduleRequestInfo getScheduleRequestInfo() {
690         return scheduleRequestInfo;
691     }
692 
693     public void setScheduleRequestInfo(ScheduleRequestInfo scheduleRequestInfo) {
694         this.scheduleRequestInfo = scheduleRequestInfo;
695     }
696 
697     public ScheduleInfo getScheduleInfo() {
698         return scheduleInfo;
699     }
700 
701     public void setScheduleInfo(ScheduleInfo scheduleInfo) {
702         this.scheduleInfo = scheduleInfo;
703     }
704 
705     public String getTypeKey() {
706         return typeKey;
707     }
708 
709     public void setTypeKey(String typeKey) {
710         this.typeKey = typeKey;
711     }
712 
713     public boolean isSendRDLsToSchedulerAfterMSE() {
714         return isSendRDLsToSchedulerAfterMSE;
715     }
716 
717     public void setSendRDLsToSchedulerAfterMSE(boolean sendRDLsToSchedulerAfterMSE) {
718         isSendRDLsToSchedulerAfterMSE = sendRDLsToSchedulerAfterMSE;
719     }
720 
721     public boolean isSchedulesModified() {
722        return schedulesModified;
723     }
724 
725     public void setSchedulesModified(boolean schedulesModified) {
726        this.schedulesModified = schedulesModified;
727     }
728 
729     public SocInfo getSocInfo() {
730         return socInfo;
731     }
732 
733     public void setSocInfo(SocInfo socInfo) {
734         this.socInfo = socInfo;
735     }
736 
737     public String getAdminOrg(){
738         return adminOrg;
739     }
740     public void setAdminOrg(String adminOrg){
741         this.adminOrg=adminOrg;
742     }
743 
744     public Date getTermRegStartDate() {
745         return termRegStartDate;
746     }
747 
748     public void setTermRegStartDate(Date termRegStartDate) {
749         this.termRegStartDate = termRegStartDate;
750     }
751 
752     public CourseInfo getCourse() {
753         return course;
754     }
755 
756     public void setCourse(CourseInfo course) {
757         this.course = course;
758     }
759 
760     public String getColocatedAoInfo() {
761         return colocatedAoInfo;
762     }
763 
764     public void setColocatedAoInfo(String colocatedAoInfo) {
765         this.colocatedAoInfo = colocatedAoInfo;
766     }
767 
768     /**
769      * This method returns a list of comma seperated alternate course codes.
770      * This is used in create and edit course offerings screen.
771      * @return
772      */
773     @SuppressWarnings("unused")
774     public String getCrossListedCourseCodes(){
775         StringBuilder builder = new StringBuilder();
776         if (course != null){
777             for (CourseCrossListing crossListing : course.getCrossListings()){
778                 builder.append(crossListing.getCode() + ", ");
779             }
780         }
781         return StringUtils.removeEnd(builder.toString(), ", ");
782     }
783 
784     /**
785      * @see #setColocatedAO(boolean)
786      * @return
787      */
788     public boolean isColocatedAO() {
789         return colocatedAO;
790     }
791 
792     /**
793      * Whether this AO is part of a colocated set
794      *
795      * @param colocatedAO
796      */
797     public void setColocatedAO(boolean colocatedAO) {
798         this.colocatedAO = colocatedAO;
799     }
800 
801     public List<ColocatedActivity> getColocatedActivities() {
802         return colocatedActivities;
803     }
804 
805     public void setColocatedActivities(List<ColocatedActivity> colocatedActivities) {
806         this.colocatedActivities = colocatedActivities;
807     }
808 
809     public boolean isMaxEnrollmentShared() {
810         return maxEnrollmentShared;
811     }
812 
813     public void setMaxEnrollmentShared(boolean maxEnrollmentShared) {
814         this.maxEnrollmentShared = maxEnrollmentShared;
815     }
816 
817     public boolean getHiddenMaxEnrollmentShared(){
818         return maxEnrollmentShared;
819     }
820 
821     public int getSharedMaxEnrollment() {
822         return sharedMaxEnrollment;
823     }
824 
825     public void setSharedMaxEnrollment(int sharedMaxEnrollment) {
826         this.sharedMaxEnrollment = sharedMaxEnrollment;
827     }
828 
829     /**
830      * This method return a colocated AO code for current course. This will
831      * be displayed as the tooltip (if colocated AO exists) at manage and delete AO screen.
832      *
833      * @return
834      */
835     @SuppressWarnings("unused")
836     public String getColocatedAoInfoUI(){
837         StringBuffer buffer = new StringBuffer();
838         buffer.append("This activity is colocated with:<br>");
839         buffer.append(colocatedAoInfo + "<br>");
840 
841         return StringUtils.removeEnd(buffer.toString(),"<br>");
842     }
843 
844     public ColocatedOfferingSetInfo getColocatedOfferingSetInfo() {
845         return colocatedOfferingSetInfo;
846     }
847 
848     public void setColocatedOfferingSetInfo(ColocatedOfferingSetInfo colocatedOfferingSetInfo) {
849         this.colocatedOfferingSetInfo = colocatedOfferingSetInfo;
850     }
851 
852     public boolean isPartOfColoSetOnLoadAlready() {
853         return isPartOfColoSetOnLoadAlready;
854     }
855 
856     public void setPartOfColoSetOnLoadAlready(boolean isPartOfColoSetOnLoadAlready) {
857         this.isPartOfColoSetOnLoadAlready = isPartOfColoSetOnLoadAlready;
858     }
859 
860     public boolean isSchedulingCompleted(){
861         if (getSocInfo() != null){
862             if (StringUtils.equals(CourseOfferingSetServiceConstants.SOC_SCHEDULING_STATE_COMPLETED,getSocInfo().getSchedulingStateKey())){
863                 return true;
864             }
865         }
866         return false;
867     }
868 
869     /**
870      * Returns the Edit Helper.
871      *
872      * @return
873      */
874     public EditRenderHelper getEditRenderHelper() {
875         return editRenderHelper;
876     }
877 
878     /**
879      * Helper to render the colocated activites in Edit AO screen.
880      */
881     public class EditRenderHelper implements Serializable {
882 
883         private List<ColocatedActivity> manageSeperateEnrollmentList;
884 
885         private boolean scheduleEditInProgress;
886         private boolean isPersistedRDLsExists;
887 
888         public EditRenderHelper(){
889             manageSeperateEnrollmentList = new ArrayList<ColocatedActivity>();
890         }
891 
892         /**
893          * @see #setManageSeperateEnrollmentList(java.util.List)
894          * @return
895          */
896         public List<ColocatedActivity> getManageSeperateEnrollmentList() {
897             return manageSeperateEnrollmentList;
898         }
899 
900         /**
901          * If the user is going to manage the enrollment list seperately for each activity offerings in a
902          * cross listed set, this list is used to display that section at the ui.
903          *
904          * It's just a seperate list but it holds the same reference elements from {@link #setColocatedActivities(java.util.List)} plus
905          * the current AO.
906          *
907          * @param manageSeperateEnrollmentList
908          */
909         @SuppressWarnings("unused")
910         public void setManageSeperateEnrollmentList(List<ColocatedActivity> manageSeperateEnrollmentList) {
911             this.manageSeperateEnrollmentList = manageSeperateEnrollmentList;
912         }
913 
914         public boolean isPersistedRDLsExists() {
915             return isPersistedRDLsExists;
916         }
917 
918         public void setPersistedRDLsExists(boolean persistedRDLsExists) {
919             isPersistedRDLsExists = persistedRDLsExists;
920         }
921 
922         public String getColocatedActivitiesAsString(){
923             StringBuffer s = new StringBuffer();
924             for (ColocatedActivity colo : getColocatedActivities()){
925                 s.append(colo.getEditRenderHelper().getCode() + ", ");
926             }
927             return StringUtils.stripEnd(s.toString(),", ");
928         }
929 
930         public boolean isScheduleEditInProgress() {
931             return scheduleEditInProgress;
932         }
933 
934         public void setScheduleEditInProgress(boolean scheduleEditInProgress) {
935             this.scheduleEditInProgress = scheduleEditInProgress;
936         }
937     }
938 
939 }