| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.student.r2.core.scheduling.dto; |
| 17 | |
|
| 18 | |
import org.kuali.student.r2.common.dto.DateRangeInfo; |
| 19 | |
import org.kuali.student.r2.common.dto.IdEntityInfo; |
| 20 | |
import org.kuali.student.r2.common.infc.DateRange; |
| 21 | |
import org.kuali.student.r2.core.scheduling.infc.MeetingTime; |
| 22 | |
import org.kuali.student.r2.core.scheduling.infc.Schedule; |
| 23 | |
import org.kuali.student.r2.core.scheduling.infc.ScheduleComponent; |
| 24 | |
import org.w3c.dom.Element; |
| 25 | |
|
| 26 | |
import javax.xml.bind.annotation.XmlAccessType; |
| 27 | |
import javax.xml.bind.annotation.XmlAccessorType; |
| 28 | |
import javax.xml.bind.annotation.XmlAnyElement; |
| 29 | |
import javax.xml.bind.annotation.XmlElement; |
| 30 | |
import javax.xml.bind.annotation.XmlType; |
| 31 | |
import java.io.Serializable; |
| 32 | |
import java.util.ArrayList; |
| 33 | |
import java.util.List; |
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
@XmlAccessorType(XmlAccessType.FIELD) |
| 40 | |
@XmlType(name = "ScheduleInfo", propOrder = {"id", "typeKey", "stateKey", "name", "descr", |
| 41 | |
"atpId", "scheduleComponents", "blackoutDates", "blackoutMilestoneIds", "additionalMeetingTimes", |
| 42 | |
"meta", "attributes", "_futureElements"}) |
| 43 | |
public class ScheduleInfo extends IdEntityInfo implements Schedule, Serializable { |
| 44 | |
|
| 45 | |
@XmlElement |
| 46 | |
private String atpId; |
| 47 | |
@XmlElement |
| 48 | |
private List<ScheduleComponentInfo> scheduleComponents; |
| 49 | |
@XmlElement |
| 50 | |
private List<DateRangeInfo> blackoutDates; |
| 51 | |
@XmlElement |
| 52 | |
private List<String> blackoutMilestoneIds; |
| 53 | |
@XmlElement |
| 54 | |
private List<MeetingTimeInfo> additionalMeetingTimes; |
| 55 | |
@XmlAnyElement |
| 56 | |
private List<Element> _futureElements; |
| 57 | |
|
| 58 | 0 | public ScheduleInfo() { |
| 59 | 0 | } |
| 60 | |
|
| 61 | |
public ScheduleInfo(Schedule schedule) { |
| 62 | 0 | super (schedule); |
| 63 | 0 | if (null != schedule) { |
| 64 | 0 | this.atpId = schedule.getAtpId(); |
| 65 | 0 | this.scheduleComponents = new ArrayList<ScheduleComponentInfo>(); |
| 66 | 0 | for (ScheduleComponent scheduleComponent : schedule.getScheduleComponents()) { |
| 67 | 0 | this.scheduleComponents.add(new ScheduleComponentInfo(scheduleComponent)); |
| 68 | |
} |
| 69 | 0 | this.blackoutDates = new ArrayList<DateRangeInfo>(); |
| 70 | 0 | for (DateRange dateRange : schedule.getBlackoutDates()) { |
| 71 | 0 | this.blackoutDates.add(new DateRangeInfo(dateRange)); |
| 72 | |
} |
| 73 | 0 | this.blackoutMilestoneIds = new ArrayList<String>(schedule.getBlackoutMilestoneIds()); |
| 74 | 0 | this.additionalMeetingTimes = new ArrayList<MeetingTimeInfo>(); |
| 75 | 0 | for (MeetingTime meetingTime : schedule.getAdditionalMeetingTimes()) { |
| 76 | 0 | this.additionalMeetingTimes.add(new MeetingTimeInfo(meetingTime)); |
| 77 | |
} |
| 78 | |
} |
| 79 | 0 | } |
| 80 | |
|
| 81 | |
@Override |
| 82 | |
public String getAtpId() { |
| 83 | 0 | return this.atpId; |
| 84 | |
} |
| 85 | |
|
| 86 | |
public void setAtpId(String atpId) { |
| 87 | 0 | this.atpId = atpId; |
| 88 | 0 | } |
| 89 | |
|
| 90 | |
@Override |
| 91 | |
public List<ScheduleComponentInfo> getScheduleComponents() { |
| 92 | 0 | if (null == this.scheduleComponents) { |
| 93 | 0 | return new ArrayList<ScheduleComponentInfo>(); |
| 94 | |
} |
| 95 | |
else { |
| 96 | 0 | return this.scheduleComponents; |
| 97 | |
} |
| 98 | |
} |
| 99 | |
|
| 100 | |
public void setScheduleComponentIds(List<ScheduleComponentInfo> scheduleComponents) { |
| 101 | 0 | this.scheduleComponents = scheduleComponents; |
| 102 | 0 | } |
| 103 | |
|
| 104 | |
@Override |
| 105 | |
public List<DateRangeInfo> getBlackoutDates() { |
| 106 | 0 | if (null == this.blackoutDates) { |
| 107 | 0 | return new ArrayList<DateRangeInfo>(); |
| 108 | |
} |
| 109 | |
else { |
| 110 | 0 | return this.blackoutDates; |
| 111 | |
} |
| 112 | |
} |
| 113 | |
|
| 114 | |
public void setBlackoutDates(List<DateRangeInfo> blackoutDates) { |
| 115 | 0 | this.blackoutDates = blackoutDates; |
| 116 | 0 | } |
| 117 | |
|
| 118 | |
@Override |
| 119 | |
public List<String> getBlackoutMilestoneIds() { |
| 120 | 0 | if (null == this.blackoutMilestoneIds) { |
| 121 | 0 | return new ArrayList<String>(); |
| 122 | |
} |
| 123 | |
else { |
| 124 | 0 | return this.blackoutMilestoneIds; |
| 125 | |
} |
| 126 | |
} |
| 127 | |
|
| 128 | |
public void setBlackoutMilestoneIds(List<String> blackoutMilestoneIds) { |
| 129 | 0 | this.blackoutMilestoneIds = blackoutMilestoneIds; |
| 130 | 0 | } |
| 131 | |
|
| 132 | |
@Override |
| 133 | |
public List<MeetingTimeInfo> getAdditionalMeetingTimes() { |
| 134 | 0 | if (null == this.additionalMeetingTimes) { |
| 135 | 0 | return new ArrayList<MeetingTimeInfo>(); |
| 136 | |
} |
| 137 | |
else { |
| 138 | 0 | return this.additionalMeetingTimes; |
| 139 | |
} |
| 140 | |
} |
| 141 | |
|
| 142 | |
public void setAdditionalMeetingTimes(List<MeetingTimeInfo> additionalMeetingTimes) { |
| 143 | 0 | this.additionalMeetingTimes = additionalMeetingTimes; |
| 144 | 0 | } |
| 145 | |
|
| 146 | |
} |