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.Date;
21  import java.util.List;
22  
23  import org.kuali.student.enrollment.courseoffering.infc.ActivityOffering;
24  import org.kuali.student.enrollment.courseoffering.infc.OfferingInstructor;
25  import org.kuali.student.r2.common.dto.TimeAmountInfo;
26  import org.kuali.student.r2.common.dto.IdEntityInfo;
27  
28  import javax.xml.bind.annotation.XmlAccessType;
29  import javax.xml.bind.annotation.XmlAccessorType;
30  import javax.xml.bind.annotation.XmlAnyElement;
31  import javax.xml.bind.annotation.XmlElement;
32  import javax.xml.bind.annotation.XmlType;
33  
34  import org.w3c.dom.Element;
35  import java.io.Serializable;
36  
37  @XmlAccessorType(XmlAccessType.FIELD)
38  @XmlType(name = "ActivityOfferingInfo", propOrder = {
39                  "id", "typeKey", "stateKey", "name", "descr", 
40                  "formatOfferingId", "formatOfferingName",
41                  "activityId", "termId", "termCode", "activityCode", 
42                  "scheduleId", "schedulingStateKey",
43                  "isHonorsOffering", "gradingOptionKeys", "instructors",
44                  "weeklyInclassContactHours", "weeklyOutofclassContactHours", 
45                  "weeklyTotalContactHours",  "isEvaluated",
46                  "maximumEnrollment", "minimumEnrollment","isMaxEnrollmentEstimate",
47                  "finalExamStartTime", "finalExamEndTime", 
48                  "finalExamSpaceCode", "activityOfferingURL", 
49                  "courseOfferingId", "courseOfferingTitle", 
50                  "courseOfferingCode", "hasWaitlist", "waitlistTypeKey",
51                  "waitlistMaximum", "isWaitlistCheckinRequired", 
52                  "waitlistCheckinFrequency",
53                  "isPartOfColocatedOfferingSet",
54                  "meta", "attributes", "_futureElements"})
55  
56  public class ActivityOfferingInfo
57      extends IdEntityInfo
58      implements ActivityOffering, Serializable {
59  
60      private static final long serialVersionUID = 1L;
61  
62      @XmlElement
63      private String formatOfferingId;
64  
65      @XmlElement
66      private String formatOfferingName;
67      
68      @XmlElement
69      private String activityId;
70          
71      @XmlElement
72      private String termId;
73  
74      @XmlElement
75      private String termCode;
76  
77      @XmlElement
78      private String activityCode;   
79  
80      @XmlElement
81      private String scheduleId;
82      
83      @XmlElement
84      private String schedulingStateKey;
85  
86      @XmlElement
87      private Boolean isHonorsOffering;
88  
89      @XmlElement
90      private List<String> gradingOptionKeys;
91  
92      @XmlElement
93      private List<OfferingInstructorInfo> instructors;
94  
95      @XmlElement
96      private String weeklyInclassContactHours;
97      
98      @XmlElement
99      private String weeklyOutofclassContactHours;
100 
101     @XmlElement
102     private String weeklyTotalContactHours;
103 
104     @XmlElement
105     private Integer maximumEnrollment;
106 
107     @XmlElement
108     private Boolean isMaxEnrollmentEstimate;
109 
110     @XmlElement
111     private Integer minimumEnrollment;
112         
113     @XmlElement
114     private Date finalExamStartTime;
115     
116     @XmlElement
117     private Date finalExamEndTime;
118 
119     @XmlElement
120     private String finalExamSpaceCode;
121 
122     @XmlElement
123     private Boolean isEvaluated;
124 
125     @XmlElement
126     private String activityOfferingURL;
127 
128     @XmlElement
129     private String courseOfferingId;
130 
131     @XmlElement
132     private String courseOfferingTitle;
133 
134     @XmlElement
135     private String courseOfferingCode;
136 
137     @XmlElement
138     private Boolean hasWaitlist;
139 
140     @XmlElement
141     private String waitlistTypeKey;
142 
143     @XmlElement
144     private Integer waitlistMaximum;
145 
146     @XmlElement
147     private Boolean isWaitlistCheckinRequired;
148 
149     @XmlElement
150     private TimeAmountInfo waitlistCheckinFrequency;
151 
152     @XmlAnyElement
153     private List<Element> _futureElements;
154 
155     @XmlElement
156     private Boolean isPartOfColocatedOfferingSet;
157 
158     /**
159      * Constructs a new ActivityOfferingInfo.
160      */
161     public ActivityOfferingInfo() {
162     }
163 
164     /**
165      * Constructs a new ActivityOfferingInfo from another
166      * ActivityOffering.
167      *
168      * @param offering the activity offering to copy
169      */
170     public ActivityOfferingInfo(ActivityOffering offering) {
171         super(offering); 
172         
173         if (offering == null) {
174             return;
175         }
176 
177         this.formatOfferingId = offering.getFormatOfferingId();
178         this.formatOfferingName = offering.getFormatOfferingName();
179         
180         this.courseOfferingId = offering.getCourseOfferingId();
181         this.courseOfferingCode = offering.getCourseOfferingCode();
182         this.courseOfferingTitle = offering.getCourseOfferingTitle();
183         
184         this.activityId = offering.getActivityId();
185         this.termId = offering.getTermId();
186         this.scheduleId = offering.getScheduleId();
187         this.schedulingStateKey = offering.getSchedulingStateKey();
188         this.activityCode = offering.getActivityCode();
189 
190         this.isHonorsOffering = offering.getIsHonorsOffering();
191         this.instructors = new ArrayList<OfferingInstructorInfo>();
192 
193         if (offering.getGradingOptionKeys() != null) {
194             this.gradingOptionKeys = new ArrayList<String>(offering.getGradingOptionKeys());
195         }
196 
197         for (OfferingInstructor instructor : offering.getInstructors()) {
198             this.instructors.add(new OfferingInstructorInfo(instructor));
199         }
200 
201         this.weeklyInclassContactHours = offering.getWeeklyInclassContactHours();
202         this.weeklyOutofclassContactHours = offering.getWeeklyOutofclassContactHours();
203         this.weeklyTotalContactHours = offering.getWeeklyTotalContactHours();
204         this.maximumEnrollment = offering.getMaximumEnrollment();
205 
206         this.minimumEnrollment = offering.getMinimumEnrollment();        
207 
208         this.isMaxEnrollmentEstimate = offering.getIsMaxEnrollmentEstimate();
209 
210         if (offering.getFinalExamStartTime() != null) {
211             this.finalExamStartTime = new Date(offering.getFinalExamStartTime().getTime());
212         }
213 
214         if (offering.getFinalExamEndTime() != null) {
215             this.finalExamEndTime = new Date(offering.getFinalExamEndTime().getTime());
216         }
217 
218         this.finalExamSpaceCode = offering.getFinalExamSpaceCode();
219         this.isEvaluated = offering.getIsEvaluated();
220         this.activityOfferingURL = offering.getActivityOfferingURL();
221 
222         this.hasWaitlist = offering.getHasWaitlist();
223         this.isWaitlistCheckinRequired = offering.getIsWaitlistCheckinRequired();
224         this.waitlistCheckinFrequency = new TimeAmountInfo(offering.getWaitlistCheckinFrequency());
225         this.waitlistMaximum = offering.getWaitlistMaximum();
226         this.waitlistTypeKey = offering.getWaitlistTypeKey();
227     }
228 
229     @Override
230     public String getFormatOfferingId() {
231         return formatOfferingId;
232     }
233 
234     public void setFormatOfferingId(String formatOfferingId) {
235         this.formatOfferingId = formatOfferingId;
236     }
237 
238     @Override
239     public String getFormatOfferingName() {
240         return formatOfferingName;
241     }
242 
243     public void setFormatOfferingName(String formatOfferingName) {
244         this.formatOfferingName = formatOfferingName;
245     }
246 
247     @Override
248     public String getActivityId() {
249         return activityId;
250     }
251 
252     public void setActivityId(String activityId) {
253         this.activityId = activityId;
254     }
255 
256     @Override
257     public String getTermId() {
258         return termId;
259     }
260 
261     public void setTermId(String termId) {
262         this.termId = termId;
263     }
264 
265     @Override
266     public String getTermCode() {
267         return termCode;
268     }
269 
270     public void setTermCode(String termCode) {
271         this.termCode = termCode;
272     }
273 
274 
275     @Override
276     public String getActivityCode() {
277         return activityCode;
278     }
279 
280     public void setActivityCode(String activityCode) {
281         this.activityCode = activityCode;
282     }
283 
284     @Override
285     public String getScheduleId() {
286         return scheduleId;
287     }
288 
289     public void setScheduleId(String scheduleId) {
290         this.scheduleId = scheduleId;
291     }
292 
293     @Override
294     public Boolean getIsHonorsOffering() {
295         return isHonorsOffering;
296     }
297 
298     public void setIsHonorsOffering(Boolean isHonorsOffering) {
299         this.isHonorsOffering = isHonorsOffering;
300     }
301 
302     @Override
303     public List<String> getGradingOptionKeys() {
304         if (gradingOptionKeys == null) {
305             gradingOptionKeys = new ArrayList<String>();
306         }
307 
308         return gradingOptionKeys;
309     }
310 
311     public void setGradingOptionKeys(List<String> gradingOptionKeys) {
312         this.gradingOptionKeys = gradingOptionKeys;
313     }
314 
315     @Override
316     public List<OfferingInstructorInfo> getInstructors() {
317         if (instructors == null) {
318             instructors = new ArrayList<OfferingInstructorInfo>();
319         }
320 
321         return instructors;
322     }
323 
324     public void setInstructors(List<OfferingInstructorInfo> instructors) {
325         this.instructors = instructors;
326     }
327 
328     @Override
329     public String getWeeklyInclassContactHours() {
330         return weeklyInclassContactHours;
331     }
332 
333     public void setWeeklyInclassContactHours(String weeklyInclassContactHours) {
334         this.weeklyInclassContactHours = weeklyInclassContactHours;
335     }
336 
337     @Override
338     public String getWeeklyOutofclassContactHours() {
339         return weeklyOutofclassContactHours;
340     }
341 
342     public void setWeeklyOutofclassContactHours(String weeklyOutofclassContactHours) {
343         this.weeklyOutofclassContactHours = weeklyOutofclassContactHours;
344     }
345 
346     @Override
347     public String getWeeklyTotalContactHours() {
348         return weeklyTotalContactHours;
349     }
350 
351     public void setWeeklyTotalContactHours(String weeklyTotalContactHours) {
352         this.weeklyTotalContactHours = weeklyTotalContactHours;
353     }
354 
355     @Override
356     public Integer getMaximumEnrollment() {
357         return maximumEnrollment;
358     }
359 
360     public void setMaximumEnrollment(Integer maximumEnrollment) {
361         this.maximumEnrollment = maximumEnrollment;
362     }
363 
364     @Override
365     public Integer getMinimumEnrollment() {
366         return minimumEnrollment;
367     }
368 
369     @Override
370     public Boolean getIsEvaluated() {
371         return this.isEvaluated;
372     }
373 
374     public void setMinimumEnrollment(Integer minimumEnrollment) {
375         this.minimumEnrollment = minimumEnrollment;
376     }
377 
378     @Override
379     public Date getFinalExamStartTime() {
380         return finalExamStartTime;
381     }
382 
383     public void setFinalExamStartTime(Date finalExamStartTime) {
384         this.finalExamStartTime = finalExamStartTime;
385     }
386 
387     @Override
388     public Date getFinalExamEndTime() {
389         return finalExamEndTime;
390     }
391 
392     public void setFinalExamEndTime(Date finalExamEndTime) {
393         this.finalExamEndTime = finalExamEndTime;
394     }
395 
396     @Override
397     public String getFinalExamSpaceCode() {
398         return finalExamSpaceCode;
399     }
400 
401     public void setFinalExamSpaceCode(String finalExamSpaceCode) {
402         this.finalExamSpaceCode = finalExamSpaceCode;
403     }
404 
405     public void setHonorsOffering(Boolean honorsOffering) {
406         isHonorsOffering = honorsOffering;
407     }
408 
409     public void setIsEvaluated(Boolean isEvaluated) {
410         this.isEvaluated = isEvaluated;
411     }
412 
413     @Override
414     public Boolean getIsMaxEnrollmentEstimate() {
415        return isMaxEnrollmentEstimate;
416     }
417 
418     public void setIsMaxEnrollmentEstimate(Boolean isMaxEnrollmentEstimate) {
419          this.isMaxEnrollmentEstimate  = isMaxEnrollmentEstimate;
420     }
421 
422     @Override
423     public String getActivityOfferingURL() {
424         return activityOfferingURL;
425     }
426 
427     public void setActivityOfferingURL(String activityOfferingURL) {
428         this.activityOfferingURL = activityOfferingURL;
429     }
430 
431     @Override
432     public String getCourseOfferingId() {
433         return courseOfferingId;
434     }
435 
436     public void setCourseOfferingId(String courseOfferingId) {
437         this.courseOfferingId = courseOfferingId;
438     }
439 
440 
441     @Override
442     public String getCourseOfferingCode() {
443         return courseOfferingCode;
444     }
445 
446     public void setCourseOfferingCode(String courseOfferingCode) {
447         this.courseOfferingCode = courseOfferingCode;
448     }
449 
450     @Override
451     public String getCourseOfferingTitle() {
452         return courseOfferingTitle;
453     }
454 
455     public void setCourseOfferingTitle(String courseOfferingTitle) {
456         this.courseOfferingTitle = courseOfferingTitle;
457     }
458 
459     @Override
460     public Boolean getHasWaitlist() {
461         return hasWaitlist;
462     }
463 
464     public void setHasWaitlist(Boolean hasWaitlist) {
465         this.hasWaitlist = hasWaitlist;
466     }
467 
468     @Override
469     public String getWaitlistTypeKey() {
470         return waitlistTypeKey;
471     }
472 
473     public void setWaitlistTypeKey(String waitlistTypeKey) {
474         this.waitlistTypeKey = waitlistTypeKey;
475     }
476 
477     @Override
478     public Integer getWaitlistMaximum() {
479         return waitlistMaximum;
480     }
481 
482     public void setWaitlistMaximum(Integer waitlistMaximum) {
483         this.waitlistMaximum = waitlistMaximum;
484     }
485 
486     @Override
487     public Boolean getIsWaitlistCheckinRequired() {
488         return isWaitlistCheckinRequired;
489     }
490 
491     public void setIsWaitlistCheckinRequired(Boolean isWaitlistCheckinRequired) {
492         this.isWaitlistCheckinRequired = isWaitlistCheckinRequired;
493     }
494 
495     @Override
496     public TimeAmountInfo getWaitlistCheckinFrequency() {
497         return waitlistCheckinFrequency;
498     }
499 
500     public void setWaitlistCheckinFrequency(TimeAmountInfo waitlistCheckinFrequency) {
501         this.waitlistCheckinFrequency = waitlistCheckinFrequency;
502     }
503 
504     public void setSchedulingStateKey(String schedulingStateKey) {
505 		this.schedulingStateKey = schedulingStateKey;
506 	}
507 
508 	@Override
509 	public String getSchedulingStateKey() {
510 		return schedulingStateKey;
511 	}
512 
513     @Override
514     public Boolean getIsPartOfColocatedOfferingSet() {
515         return isPartOfColocatedOfferingSet;
516     }
517 
518     public void setIsPartOfColocatedOfferingSet(Boolean partOfColocatedOfferingSet) {
519         isPartOfColocatedOfferingSet = partOfColocatedOfferingSet;
520     }
521 
522     @Override
523     public String toString() {
524         StringBuilder builder = new StringBuilder();
525         builder.append("ActivityOfferingInfo [id=");
526         builder.append(getId());
527         builder.append (", formatOfferingId=");
528         builder.append(formatOfferingId);
529         builder.append(", formatOfferingName=");
530         builder.append(formatOfferingName);
531         builder.append(", courseOfferingId=");
532         builder.append(courseOfferingId);
533         builder.append(", activityId=");
534         builder.append(activityId);
535         builder.append(", termId=");
536         builder.append(termId);
537         builder.append(", scheduleId=");
538         builder.append(scheduleId);
539         builder.append(", schedulingStateKey=");
540         builder.append(schedulingStateKey);
541         builder.append("]");
542         return builder.toString();
543     }
544 }