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 | 0 | public ScheduleInfo(Schedule schedule) { |
62 | 0 | if (null != schedule) { |
63 | 0 | this.atpId = schedule.getAtpId(); |
64 | 0 | this.scheduleComponents = new ArrayList<ScheduleComponentInfo>(); |
65 | 0 | for (ScheduleComponent scheduleComponent : schedule.getScheduleComponents()) { |
66 | 0 | this.scheduleComponents.add(new ScheduleComponentInfo(scheduleComponent)); |
67 | |
} |
68 | 0 | this.blackoutDates = new ArrayList<DateRangeInfo>(); |
69 | 0 | for (DateRange dateRange : schedule.getBlackoutDates()) { |
70 | 0 | this.blackoutDates.add(new DateRangeInfo(dateRange)); |
71 | |
} |
72 | 0 | this.blackoutMilestoneIds = new ArrayList<String>(schedule.getBlackoutMilestoneIds()); |
73 | 0 | this.additionalMeetingTimes = new ArrayList<MeetingTimeInfo>(); |
74 | 0 | for (MeetingTime meetingTime : schedule.getAdditionalMeetingTimes()) { |
75 | 0 | this.additionalMeetingTimes.add(new MeetingTimeInfo(meetingTime)); |
76 | |
} |
77 | |
} |
78 | 0 | } |
79 | |
|
80 | |
@Override |
81 | |
public String getAtpId() { |
82 | 0 | return this.atpId; |
83 | |
} |
84 | |
|
85 | |
public void setAtpId(String atpId) { |
86 | 0 | this.atpId = atpId; |
87 | 0 | } |
88 | |
|
89 | |
@Override |
90 | |
public List<ScheduleComponentInfo> getScheduleComponents() { |
91 | 0 | if (null == this.scheduleComponents) { |
92 | 0 | return new ArrayList<ScheduleComponentInfo>(); |
93 | |
} |
94 | |
else { |
95 | 0 | return this.scheduleComponents; |
96 | |
} |
97 | |
} |
98 | |
|
99 | |
public void setScheduleComponentIds(List<ScheduleComponentInfo> scheduleComponents) { |
100 | 0 | this.scheduleComponents = scheduleComponents; |
101 | 0 | } |
102 | |
|
103 | |
@Override |
104 | |
public List<DateRangeInfo> getBlackoutDates() { |
105 | 0 | if (null == this.blackoutDates) { |
106 | 0 | return new ArrayList<DateRangeInfo>(); |
107 | |
} |
108 | |
else { |
109 | 0 | return this.blackoutDates; |
110 | |
} |
111 | |
} |
112 | |
|
113 | |
public void setBlackoutDates(List<DateRangeInfo> blackoutDates) { |
114 | 0 | this.blackoutDates = blackoutDates; |
115 | 0 | } |
116 | |
|
117 | |
@Override |
118 | |
public List<String> getBlackoutMilestoneIds() { |
119 | 0 | if (null == this.blackoutMilestoneIds) { |
120 | 0 | return new ArrayList<String>(); |
121 | |
} |
122 | |
else { |
123 | 0 | return this.blackoutMilestoneIds; |
124 | |
} |
125 | |
} |
126 | |
|
127 | |
public void setBlackoutMilestoneIds(List<String> blackoutMilestoneIds) { |
128 | 0 | this.blackoutMilestoneIds = blackoutMilestoneIds; |
129 | 0 | } |
130 | |
|
131 | |
@Override |
132 | |
public List<MeetingTimeInfo> getAdditionalMeetingTimes() { |
133 | 0 | if (null == this.additionalMeetingTimes) { |
134 | 0 | return new ArrayList<MeetingTimeInfo>(); |
135 | |
} |
136 | |
else { |
137 | 0 | return this.additionalMeetingTimes; |
138 | |
} |
139 | |
} |
140 | |
|
141 | |
public void setAdditionalMeetingTimes(List<MeetingTimeInfo> additionalMeetingTimes) { |
142 | 0 | this.additionalMeetingTimes = additionalMeetingTimes; |
143 | 0 | } |
144 | |
|
145 | |
} |