1 /**
2 * Copyright 2013 The Kuali Foundation Licensed under the
3 * Educational Community License, Version 2.0 (the "License"); you may
4 * not use this file except in compliance with the License. You may
5 * obtain a copy of the License at
6 *
7 * http://www.osedu.org/licenses/ECL-2.0
8 *
9 * Unless required by applicable law or agreed to in writing,
10 * software distributed under the License is distributed on an "AS IS"
11 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12 * or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 *
15 */
16 package org.kuali.student.enrollment.class2.courseoffering.dto;
17
18 import org.kuali.student.r2.lum.course.dto.CourseInfo;
19 import org.kuali.student.r2.lum.course.dto.CourseJointInfo;
20
21 import java.util.ArrayList;
22 import java.util.List;
23
24 /**
25 * Wrapper class around {@link CourseJointInfo} and it's used only in Create CO screen to display a list of joint offerings and allowing user
26 * to select/deselect a CO
27 *
28 * @see CourseOfferingCreateWrapper
29 * @see FormatOfferingWrapper
30 * @author Kuali Student Team
31 */
32 public class JointCourseWrapper {
33
34 private CourseJointInfo courseJointInfo;
35 private CourseInfo courseInfo;
36 private boolean selectedToJointlyOfferred;
37 private boolean alreadyOffered;
38 private boolean enableCreateNewCOActionLink = false;
39
40 private List<FormatOfferingWrapper> formatOfferingWrappers;
41
42 public JointCourseWrapper(){
43 courseJointInfo = new CourseJointInfo();
44 courseInfo = new CourseInfo();
45 formatOfferingWrappers = new ArrayList<FormatOfferingWrapper>();
46 }
47
48 /**
49 * @see #setAlreadyOffered
50 * @return
51 */
52 @SuppressWarnings("unused")
53 public boolean isAlreadyOffered() {
54 return alreadyOffered;
55 }
56
57 /**
58 * Sets whether this joint course has already been offered.
59 *
60 * <p>
61 * This is set during load when there are course offerings exists for this course code
62 * in the user selected term.
63 * </p>
64 * @param alreadyOffered boolean
65 */
66 public void setAlreadyOffered(boolean alreadyOffered) {
67 this.alreadyOffered = alreadyOffered;
68 }
69
70 /**
71 * @see #setSelectedToJointlyOfferred
72 * @return
73 */
74 public boolean isSelectedToJointlyOfferred() {
75 return selectedToJointlyOfferred;
76 }
77
78 /**
79 * This is set when the user selects a joint course to add formats.
80 *
81 * @param selectedToJointlyOfferred
82 */
83 public void setSelectedToJointlyOfferred(boolean selectedToJointlyOfferred) {
84 this.selectedToJointlyOfferred = selectedToJointlyOfferred;
85 }
86
87 /**
88 * @see #setCourseJointInfo(org.kuali.student.r2.lum.course.dto.CourseJointInfo)
89 * @return
90 */
91 @SuppressWarnings("unused")
92 public CourseJointInfo getCourseJointInfo() {
93 return courseJointInfo;
94 }
95
96 /**
97 * Sets the {@link CourseJointInfo} dto associated with this wrapper.
98 * @param courseJointInfo
99 */
100 public void setCourseJointInfo(CourseJointInfo courseJointInfo) {
101 this.courseJointInfo = courseJointInfo;
102 }
103
104 /**
105 * This is called from the view xml to display the course title at the ui.
106 *
107 * @return course title
108 */
109 @SuppressWarnings("unused")
110 public String getCourseTitle(){
111 return courseJointInfo.getCourseTitle();
112 }
113
114 /**
115 * Sets the {@link CourseInfo} associated with this joint course.
116 *
117 * @see #setCourseJointInfo
118 * @param courseInfo
119 */
120 public void setCourseInfo(CourseInfo courseInfo) {
121 this.courseInfo = courseInfo;
122 }
123
124 /**
125 * Returns the {@link CourseInfo} associated with the wrapper
126 *
127 * @return
128 */
129 public CourseInfo getCourseInfo(){
130 return courseInfo;
131 }
132
133 /**
134 * Returns the course code for a joint course
135 *
136 * @return
137 */
138 public String getCourseCode(){
139 return courseInfo.getCode();
140 }
141
142 /**
143 * List of {@link FormatOfferingWrapper} for a joint course
144 *
145 * @return formatOfferingWrappers
146 */
147 public List<FormatOfferingWrapper> getFormatOfferingWrappers() {
148 return formatOfferingWrappers;
149 }
150
151 /**
152 *
153 * @see #getFormatOfferingWrappers()
154 * @param formatOfferingWrappers
155 */
156 public void setFormatOfferingWrappers(List<FormatOfferingWrapper> formatOfferingWrappers) {
157 this.formatOfferingWrappers = formatOfferingWrappers;
158 }
159
160 public boolean isEnableCreateNewCOActionLink() {
161 return enableCreateNewCOActionLink;
162 }
163
164 public void setEnableCreateNewCOActionLink(boolean enableCreateNewCOActionLink) {
165 this.enableCreateNewCOActionLink = enableCreateNewCOActionLink;
166 }
167
168 }