01: package org.sakaiproject.coursemanagement.impl;
02:
03: import java.io.Serializable;
04: import java.util.Set;
05:
06: import org.sakaiproject.coursemanagement.api.CourseOffering;
07: import org.sakaiproject.coursemanagement.api.EnrollmentSet;
08: import org.sakaiproject.coursemanagement.api.Section;
09:
10: public class SectionCmImpl extends AbstractMembershipContainerCmImpl
11: implements Section, Serializable {
12:
13: private static final long serialVersionUID = 1L;
14:
15: private String category;
16: private Set meetings;
17: private CourseOffering courseOffering;
18: private String courseOfferingEid; // We keep this here to avoid lazy loading of the courseOffering
19: private Section parent;
20: private EnrollmentSet enrollmentSet;
21: private Integer maxSize;
22:
23: public SectionCmImpl() {
24: }
25:
26: public SectionCmImpl(String eid, String title, String description,
27: String category, Section parent,
28: CourseOffering courseOffering, EnrollmentSet enrollmentSet,
29: Integer maxSize) {
30: this .eid = eid;
31: this .title = title;
32: this .description = description;
33: this .category = category;
34: this .parent = parent;
35: this .courseOffering = courseOffering;
36: if (courseOffering != null) {
37: this .courseOfferingEid = courseOffering.getEid();
38: }
39: this .enrollmentSet = enrollmentSet;
40: this .maxSize = maxSize;
41: }
42:
43: public String getCategory() {
44: return category;
45: }
46:
47: public void setCategory(String category) {
48: this .category = category;
49: }
50:
51: public CourseOffering getCourseOffering() {
52: return courseOffering;
53: }
54:
55: public String getCourseOfferingEid() {
56: return courseOfferingEid;
57: }
58:
59: public void setCourseOffering(CourseOffering courseOffering) {
60: this .courseOffering = courseOffering;
61: if (courseOffering == null) {
62: this .courseOfferingEid = null;
63: } else {
64: this .courseOfferingEid = courseOffering.getEid(); // Make sure we update the cached eid
65: }
66: }
67:
68: public Section getParent() {
69: return parent;
70: }
71:
72: public void setParent(Section parent) {
73: this .parent = parent;
74: }
75:
76: public EnrollmentSet getEnrollmentSet() {
77: return enrollmentSet;
78: }
79:
80: public void setEnrollmentSet(EnrollmentSet enrollmentSet) {
81: this .enrollmentSet = enrollmentSet;
82: }
83:
84: public Set getMeetings() {
85: return meetings;
86: }
87:
88: public void setMeetings(Set meetings) {
89: this .meetings = meetings;
90: }
91:
92: public Integer getMaxSize() {
93: return maxSize;
94: }
95:
96: public void setMaxSize(Integer maxSize) {
97: this.maxSize = maxSize;
98: }
99: }
|