1 package org.kuali.student.enrollment.courseoffering.dto;
2
3 import org.kuali.student.enrollment.courseoffering.infc.CourseOfferingDisplay;
4 import org.kuali.student.r2.common.dto.IdNamelessEntityInfo;
5 import org.kuali.student.r2.common.dto.KeyNameInfo;
6 import org.kuali.student.r2.common.dto.RichTextInfo;
7 import org.kuali.student.r2.common.infc.KeyName;
8 import org.kuali.student.r2.common.infc.RichText;
9 import org.w3c.dom.Element;
10
11 import javax.xml.bind.annotation.XmlAccessType;
12 import javax.xml.bind.annotation.XmlAccessorType;
13 import javax.xml.bind.annotation.XmlAnyElement;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlType;
16 import java.io.Serializable;
17 import java.util.ArrayList;
18 import java.util.List;
19
20
21
22
23
24 @XmlAccessorType(XmlAccessType.FIELD)
25 @XmlType(name = "CourseOfferingDisplayInfo", propOrder = {"id", "typeKey", "stateKey", "descr", "courseId",
26 "termId", "courseOfferingCode", "courseOfferingTitle", "subjectArea", "termName", "termCode", "studentRegistrationGradingOptions",
27 "gradingOption", "creditOption", "typeName", "stateName", "isHonorsOffering", "meta", "attributes", "_futureElements"})
28 public class CourseOfferingDisplayInfo extends IdNamelessEntityInfo implements CourseOfferingDisplay, Serializable {
29
30 @XmlElement
31 RichTextInfo descr;
32
33 @XmlElement
34 private String courseId;
35
36 @XmlElement
37 private String termId;
38
39 @XmlElement
40 private String courseOfferingTitle;
41
42 @XmlElement
43 private String courseOfferingCode;
44
45 @XmlElement
46 private String subjectArea;
47
48 @XmlElement
49 private String termName;
50
51 @XmlElement
52 private String termCode;
53
54 @XmlElement
55 private List<KeyNameInfo> studentRegistrationGradingOptions;
56
57 @XmlElement
58 private KeyNameInfo gradingOption;
59
60 @XmlElement
61 private KeyNameInfo creditOption;
62
63
64 @XmlElement
65 private String typeName;
66
67
68 @XmlElement
69 private String stateName;
70
71 @XmlElement
72 private Boolean isHonorsOffering;
73
74 @XmlAnyElement
75 private List<Element> _futureElements;
76
77 public CourseOfferingDisplayInfo() {
78
79 }
80
81 public CourseOfferingDisplayInfo(CourseOfferingDisplay courseOfferingDisplay) {
82
83 super(courseOfferingDisplay);
84 if (courseOfferingDisplay != null) {
85 this.descr = (null != courseOfferingDisplay.getDescr()) ? new RichTextInfo(courseOfferingDisplay.getDescr()) : null;
86 this.termCode = courseOfferingDisplay.getTermCode();
87 this.termName = courseOfferingDisplay.getTermName();
88 this.termId = courseOfferingDisplay.getTermId();
89 this.creditOption = new KeyNameInfo(courseOfferingDisplay.getCreditOption());
90 this.gradingOption = new KeyNameInfo(courseOfferingDisplay.getGradingOption());
91 this.studentRegistrationGradingOptions = new ArrayList<KeyNameInfo>();
92 for(KeyName studentRegGradingOption: courseOfferingDisplay.getStudentRegistrationGradingOptions()) {
93 this.studentRegistrationGradingOptions.add(new KeyNameInfo(studentRegGradingOption));
94 }
95 this.typeName = courseOfferingDisplay.getTypeName();
96 this.stateName = courseOfferingDisplay.getStateName();
97 this.courseId = courseOfferingDisplay.getCourseId();
98 this.termId = courseOfferingDisplay.getTermId();
99 this.courseOfferingTitle = courseOfferingDisplay.getCourseOfferingTitle();
100 this.courseOfferingCode = courseOfferingDisplay.getCourseOfferingCode();
101 this.subjectArea = courseOfferingDisplay.getSubjectArea();
102 }
103 }
104
105 @Override
106 public RichText getDescr() {
107 return this.descr;
108 }
109
110 public void setDescr(RichTextInfo descr) {
111 this.descr = descr;
112 }
113
114 @Override
115 public String getCourseId() {
116 return this.courseId;
117 }
118
119 @Override
120 public String getTermId() {
121 return this.termId;
122 }
123
124 @Override
125 public String getCourseOfferingCode() {
126 return this.courseOfferingCode;
127 }
128
129 @Override
130 public String getSubjectArea() {
131 return this.subjectArea;
132 }
133
134 @Override
135 public String getCourseOfferingTitle() {
136 return this.courseOfferingTitle;
137 }
138
139
140 public void setCourseId(String courseId) {
141 this.courseId = courseId;
142 }
143
144 public void setTermId(String termId) {
145 this.termId = termId;
146 }
147
148 public void setCourseOfferingTitle(String courseTitle) {
149 this.courseOfferingTitle = courseTitle;
150 }
151
152 public void setCourseOfferingCode(String courseOfferingCode) {
153 this.courseOfferingCode = courseOfferingCode;
154 }
155
156 public void setSubjectArea(String subjectArea) {
157 this.subjectArea = subjectArea;
158 }
159
160
161 @Override
162 public String getTermName() {
163 return termName;
164 }
165
166 public void setTermName(String termName) {
167 this.termName = termName;
168 }
169
170 public void setTypeName(String typeName) {
171 this.typeName = typeName;
172 }
173
174 @Override
175 public String getTermCode() {
176 return termCode;
177 }
178
179 public void setTermCode(String termCode) {
180 this.termCode = termCode;
181 }
182
183 @Override
184 public List<KeyNameInfo> getStudentRegistrationGradingOptions() {
185 if (this.studentRegistrationGradingOptions == null) {
186 return new ArrayList<KeyNameInfo>();
187 } else {
188 return studentRegistrationGradingOptions;
189 }
190 }
191
192 public void setStudentRegistrationGradingOptions(List<KeyNameInfo> studentRegistrationGradingOptions) {
193 this.studentRegistrationGradingOptions = studentRegistrationGradingOptions;
194 }
195
196
197 @Override
198 public KeyNameInfo getCreditOption() {
199 return this.creditOption;
200 }
201
202 public void setCreditOption(KeyNameInfo creditOption) {
203 this.creditOption = creditOption;
204 }
205
206 @Override
207 public String getStateName() {
208 return stateName;
209 }
210
211 public void setStateName(String stateName) {
212 this.stateName = stateName;
213 }
214
215 @Override
216 public Boolean getIsHonorsOffering() {
217 return this.isHonorsOffering;
218 }
219
220 public void setHonorsOffering(Boolean honorsOffering) {
221 this.isHonorsOffering = honorsOffering;
222 }
223
224 @Override
225 public String getTypeName() {
226 return typeName;
227 }
228
229 @Override
230 public KeyName getGradingOption() {
231 return this.gradingOption;
232 }
233
234 public void setGradingOption(KeyNameInfo gradingOption) {
235 this.gradingOption = gradingOption;
236 }
237 }