View Javadoc

1   /*
2    * Copyright 2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 1.0 (the
5    * "License"); you may not use this file except in compliance with the
6    * License.  You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl1.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13   * implied.  See the License for the specific language governing
14   * permissions and limitations under the License.
15   */
16  
17  package org.kuali.student.enrollment.courseoffering.dto;
18  
19  import java.util.ArrayList;
20  import java.util.List;
21  
22  import org.kuali.student.enrollment.courseoffering.infc.ActivityOffering;
23  import org.kuali.student.enrollment.courseoffering.infc.OfferingInstructor;
24  import org.kuali.student.r2.common.dto.IdEntityInfo;
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  
32  import org.w3c.dom.Element;
33  import java.io.Serializable;
34  
35  @XmlAccessorType(XmlAccessType.FIELD)
36  @XmlType(name = "ActivityOfferingInfo", propOrder = {
37                  "id", "typeKey", "stateKey", "name", "descr", 
38                  "formatOfferingId", "formatOfferingName",
39                  "activityId", "termId", "termCode", "activityCode", 
40                  "scheduleIds", "schedulingStateKey",
41                  "isHonorsOffering", "gradingOptionKeys", "instructors",
42                  "weeklyInclassContactHours", "weeklyOutofclassContactHours", 
43                  "weeklyTotalContactHours",  "isEvaluated",
44                  "maximumEnrollment", "minimumEnrollment","isMaxEnrollmentEstimate",
45                  "activityOfferingURL",
46                  "courseOfferingId", "courseOfferingTitle", 
47                  "courseOfferingCode", "isColocated",
48                  "isApprovedForNonStandardTimeSlots",
49                  "meta", "attributes", "_futureElements"})
50  
51  public class ActivityOfferingInfo
52      extends IdEntityInfo
53      implements ActivityOffering, Serializable {
54  
55      private static final long serialVersionUID = 1L;
56  
57      @XmlElement
58      private String formatOfferingId;
59  
60      @XmlElement
61      private String formatOfferingName;
62      
63      @XmlElement
64      private String activityId;
65          
66      @XmlElement
67      private String termId;
68  
69      @XmlElement
70      private String termCode;
71  
72      @XmlElement
73      private String activityCode;   
74  
75      @XmlElement
76      private List<String> scheduleIds;
77      
78      @XmlElement
79      private String schedulingStateKey;
80  
81      @XmlElement
82      private Boolean isHonorsOffering;
83  
84      @XmlElement
85      private List<String> gradingOptionKeys;
86  
87      @XmlElement
88      private List<OfferingInstructorInfo> instructors;
89  
90      @XmlElement
91      private String weeklyInclassContactHours;
92      
93      @XmlElement
94      private String weeklyOutofclassContactHours;
95  
96      @XmlElement
97      private String weeklyTotalContactHours;
98  
99      @XmlElement
100     private Integer maximumEnrollment;
101 
102     @XmlElement
103     private Boolean isMaxEnrollmentEstimate;
104 
105     @XmlElement
106     private Integer minimumEnrollment;
107 
108     @XmlElement
109     private Boolean isEvaluated;
110 
111     @XmlElement
112     private String activityOfferingURL;
113 
114     @XmlElement
115     private String courseOfferingId;
116 
117     @XmlElement
118     private String courseOfferingTitle;
119 
120     @XmlElement
121     private String courseOfferingCode;
122 
123     @XmlAnyElement
124     private List<Element> _futureElements;
125 
126     @XmlElement
127     private Boolean isColocated;
128 
129     @XmlElement
130     private Boolean isApprovedForNonStandardTimeSlots = Boolean.FALSE;
131 
132     /**
133      * Constructs a new ActivityOfferingInfo.
134      */
135     public ActivityOfferingInfo() {
136     }
137 
138     /**
139      * Constructs a new ActivityOfferingInfo from another
140      * ActivityOffering.
141      *
142      * @param offering the activity offering to copy
143      */
144     public ActivityOfferingInfo(ActivityOffering offering) {
145         super(offering); 
146         
147         if (offering == null) {
148             return;
149         }
150 
151         this.formatOfferingId = offering.getFormatOfferingId();
152         this.formatOfferingName = offering.getFormatOfferingName();
153         
154         this.courseOfferingId = offering.getCourseOfferingId();
155         this.courseOfferingCode = offering.getCourseOfferingCode();
156         this.courseOfferingTitle = offering.getCourseOfferingTitle();
157         
158         this.activityId = offering.getActivityId();
159         this.termId = offering.getTermId();
160         if (offering.getScheduleIds() != null) {
161             this.scheduleIds = new ArrayList<String>(offering.getScheduleIds());
162         }
163         this.schedulingStateKey = offering.getSchedulingStateKey();
164         this.activityCode = offering.getActivityCode();
165 
166         this.isHonorsOffering = offering.getIsHonorsOffering();
167         this.instructors = new ArrayList<OfferingInstructorInfo>();
168 
169         if (offering.getGradingOptionKeys() != null) {
170             this.gradingOptionKeys = new ArrayList<String>(offering.getGradingOptionKeys());
171         }
172 
173         for (OfferingInstructor instructor : offering.getInstructors()) {
174             this.instructors.add(new OfferingInstructorInfo(instructor));
175         }
176 
177         this.weeklyInclassContactHours = offering.getWeeklyInclassContactHours();
178         this.weeklyOutofclassContactHours = offering.getWeeklyOutofclassContactHours();
179         this.weeklyTotalContactHours = offering.getWeeklyTotalContactHours();
180         this.maximumEnrollment = offering.getMaximumEnrollment();
181 
182         this.minimumEnrollment = offering.getMinimumEnrollment();        
183 
184         this.isMaxEnrollmentEstimate = offering.getIsMaxEnrollmentEstimate();
185 
186         this.isEvaluated = offering.getIsEvaluated();
187         this.activityOfferingURL = offering.getActivityOfferingURL();
188 
189         this.isColocated = offering.getIsColocated();
190 
191         this.isApprovedForNonStandardTimeSlots = offering.getIsApprovedForNonStandardTimeSlots();
192     }
193 
194     @Override
195     public String getFormatOfferingId() {
196         return formatOfferingId;
197     }
198 
199     public void setFormatOfferingId(String formatOfferingId) {
200         this.formatOfferingId = formatOfferingId;
201     }
202 
203     @Override
204     public String getFormatOfferingName() {
205         return formatOfferingName;
206     }
207 
208     public void setFormatOfferingName(String formatOfferingName) {
209         this.formatOfferingName = formatOfferingName;
210     }
211 
212     @Override
213     public String getActivityId() {
214         return activityId;
215     }
216 
217     public void setActivityId(String activityId) {
218         this.activityId = activityId;
219     }
220 
221     @Override
222     public String getTermId() {
223         return termId;
224     }
225 
226     public void setTermId(String termId) {
227         this.termId = termId;
228     }
229 
230     @Override
231     public String getTermCode() {
232         return termCode;
233     }
234 
235     public void setTermCode(String termCode) {
236         this.termCode = termCode;
237     }
238 
239 
240     @Override
241     public String getActivityCode() {
242         return activityCode;
243     }
244 
245     public void setActivityCode(String activityCode) {
246         this.activityCode = activityCode;
247     }
248 
249     @Override
250     public List<String> getScheduleIds() {
251         if (this.scheduleIds == null) {
252             this.scheduleIds =  new ArrayList<String>();
253         }
254         return this.scheduleIds;
255     }
256 
257     public void setScheduleIds(List<String> scheduleIds) {
258         this.scheduleIds = scheduleIds;
259     }
260 
261     @Override
262     public Boolean getIsHonorsOffering() {
263         return isHonorsOffering;
264     }
265 
266     public void setIsHonorsOffering(Boolean isHonorsOffering) {
267         this.isHonorsOffering = isHonorsOffering;
268     }
269 
270     @Override
271     public List<String> getGradingOptionKeys() {
272         if (gradingOptionKeys == null) {
273             gradingOptionKeys = new ArrayList<String>();
274         }
275 
276         return gradingOptionKeys;
277     }
278 
279     public void setGradingOptionKeys(List<String> gradingOptionKeys) {
280         this.gradingOptionKeys = gradingOptionKeys;
281     }
282 
283     @Override
284     public List<OfferingInstructorInfo> getInstructors() {
285         if (instructors == null) {
286             instructors = new ArrayList<OfferingInstructorInfo>();
287         }
288 
289         return instructors;
290     }
291 
292     public void setInstructors(List<OfferingInstructorInfo> instructors) {
293         this.instructors = instructors;
294     }
295 
296     @Override
297     public String getWeeklyInclassContactHours() {
298         return weeklyInclassContactHours;
299     }
300 
301     public void setWeeklyInclassContactHours(String weeklyInclassContactHours) {
302         this.weeklyInclassContactHours = weeklyInclassContactHours;
303     }
304 
305     @Override
306     public String getWeeklyOutofclassContactHours() {
307         return weeklyOutofclassContactHours;
308     }
309 
310     public void setWeeklyOutofclassContactHours(String weeklyOutofclassContactHours) {
311         this.weeklyOutofclassContactHours = weeklyOutofclassContactHours;
312     }
313 
314     @Override
315     public String getWeeklyTotalContactHours() {
316         return weeklyTotalContactHours;
317     }
318 
319     public void setWeeklyTotalContactHours(String weeklyTotalContactHours) {
320         this.weeklyTotalContactHours = weeklyTotalContactHours;
321     }
322 
323     @Override
324     public Integer getMaximumEnrollment() {
325         return maximumEnrollment;
326     }
327 
328     public void setMaximumEnrollment(Integer maximumEnrollment) {
329         this.maximumEnrollment = maximumEnrollment;
330     }
331 
332     @Override
333     public Integer getMinimumEnrollment() {
334         return minimumEnrollment;
335     }
336 
337     @Override
338     public Boolean getIsEvaluated() {
339         return this.isEvaluated;
340     }
341 
342     public void setMinimumEnrollment(Integer minimumEnrollment) {
343         this.minimumEnrollment = minimumEnrollment;
344     }
345 
346     public void setHonorsOffering(Boolean honorsOffering) {
347         isHonorsOffering = honorsOffering;
348     }
349 
350     public void setIsEvaluated(Boolean isEvaluated) {
351         this.isEvaluated = isEvaluated;
352     }
353 
354     @Override
355     public Boolean getIsMaxEnrollmentEstimate() {
356        return isMaxEnrollmentEstimate;
357     }
358 
359     public void setIsMaxEnrollmentEstimate(Boolean isMaxEnrollmentEstimate) {
360          this.isMaxEnrollmentEstimate  = isMaxEnrollmentEstimate;
361     }
362 
363     @Override
364     public String getActivityOfferingURL() {
365         return activityOfferingURL;
366     }
367 
368     public void setActivityOfferingURL(String activityOfferingURL) {
369         this.activityOfferingURL = activityOfferingURL;
370     }
371 
372     @Override
373     public String getCourseOfferingId() {
374         return courseOfferingId;
375     }
376 
377     public void setCourseOfferingId(String courseOfferingId) {
378         this.courseOfferingId = courseOfferingId;
379     }
380 
381 
382     @Override
383     public String getCourseOfferingCode() {
384         return courseOfferingCode;
385     }
386 
387     public void setCourseOfferingCode(String courseOfferingCode) {
388         this.courseOfferingCode = courseOfferingCode;
389     }
390 
391     @Override
392     public String getCourseOfferingTitle() {
393         return courseOfferingTitle;
394     }
395 
396     public void setCourseOfferingTitle(String courseOfferingTitle) {
397         this.courseOfferingTitle = courseOfferingTitle;
398     }
399 
400     public void setSchedulingStateKey(String schedulingStateKey) {
401 		this.schedulingStateKey = schedulingStateKey;
402 	}
403 
404 	@Override
405 	public String getSchedulingStateKey() {
406 		return schedulingStateKey;
407 	}
408 
409     @Override
410     public Boolean getIsColocated() {
411         return isColocated;
412     }
413 
414     public void setIsColocated(Boolean isColocated) {
415         this.isColocated = isColocated;
416     }
417 
418     public void setIsApprovedForNonStandardTimeSlots( Boolean isApprovedForNonStandardTimeSlots ) {
419         this.isApprovedForNonStandardTimeSlots = isApprovedForNonStandardTimeSlots;
420     }
421 
422     @Override
423     public Boolean getIsApprovedForNonStandardTimeSlots() {
424         return this.isApprovedForNonStandardTimeSlots;
425     }
426 
427     @Override
428     public String toString() {
429         StringBuilder builder = new StringBuilder();
430         builder.append("ActivityOfferingInfo [id=");
431         builder.append(getId());
432         builder.append (", formatOfferingId=");
433         builder.append(formatOfferingId);
434         builder.append(", formatOfferingName=");
435         builder.append(formatOfferingName);
436         builder.append(", courseOfferingId=");
437         builder.append(courseOfferingId);
438         builder.append(", activityId=");
439         builder.append(activityId);
440         builder.append(", termId=");
441         builder.append(termId);
442         builder.append(", scheduleIds=");
443         builder.append(scheduleIds.toString());
444         builder.append(", schedulingStateKey=");
445         builder.append(schedulingStateKey);
446         builder.append("]");
447         return builder.toString();
448     }
449 }