View Javadoc

1   /**
2    * Copyright 2010 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  package org.kuali.student.r2.lum.clu.dto;
16  
17  import org.kuali.student.r2.common.dto.AmountInfo;
18  import org.kuali.student.r2.common.dto.IdNamelessEntityInfo;
19  import org.kuali.student.r2.common.dto.TimeAmountInfo;
20  import org.kuali.student.r2.core.versionmanagement.dto.VersionInfo;
21  import org.kuali.student.r2.lum.clu.infc.Accreditation;
22  import org.kuali.student.r2.lum.clu.infc.AdminOrg;
23  import org.kuali.student.r2.lum.clu.infc.Clu;
24  import org.kuali.student.r2.lum.clu.infc.CluIdentifier;
25  import org.kuali.student.r2.lum.clu.infc.CluInstructor;
26  import org.kuali.student.r2.lum.clu.infc.LuCode;
27  
28  import javax.xml.bind.annotation.XmlAccessType;
29  import javax.xml.bind.annotation.XmlAccessorType;
30  import javax.xml.bind.annotation.XmlElement;
31  import javax.xml.bind.annotation.XmlType;
32  import java.io.Serializable;
33  import java.util.ArrayList;
34  import java.util.Date;
35  import java.util.List;
36  
37  import org.kuali.student.r2.common.dto.RichTextInfo;
38  
39  @XmlAccessorType(XmlAccessType.FIELD)
40  @XmlType(name = "CluInfo", propOrder = {"id",
41      "typeKey",
42      "stateKey",
43      "descr",
44      "officialIdentifier",
45      "alternateIdentifiers",
46      "studySubjectArea",
47      "campusLocations",
48      "accreditations",
49      "adminOrgs",
50      "primaryInstructor",
51      "instructors",
52      "expectedFirstAtp",
53      "lastAtp",
54      "lastAdmitAtp",
55      "intensity",
56      "stdDuration",
57      "canCreateLui",
58      "referenceURL",
59      "luCodes",
60      "nextReviewPeriod",
61      "isEnrollable",
62      "offeredAtpTypes",
63      "isHasEarlyDropDeadline",
64      "defaultEnrollmentEstimate",
65      "defaultMaximumEnrollment",
66      "isHazardousForDisabledStudents",
67      "feeInfo",
68      "accountingInfo",
69      "version",
70      "effectiveDate",
71      "expirationDate",
72      "meta",
73      "attributes"})//, "_futureElements" }) TODO KSCM-372: Non-GWT translatable code
74  public class CluInfo extends IdNamelessEntityInfo implements Serializable, Clu {
75  
76      private static final long serialVersionUID = 1L;
77      @XmlElement 
78      private RichTextInfo descr;
79      @XmlElement
80      private CluIdentifierInfo officialIdentifier;
81      @XmlElement
82      private List<CluIdentifierInfo> alternateIdentifiers;
83      @XmlElement
84      private String studySubjectArea;
85      @XmlElement
86      private List<String> campusLocations;
87      @XmlElement
88      private List<AccreditationInfo> accreditations;
89      @XmlElement
90      private List<AdminOrgInfo> adminOrgs;
91      @XmlElement
92      private CluInstructorInfo primaryInstructor;
93      @XmlElement
94      private List<CluInstructorInfo> instructors;
95      @XmlElement
96      private String expectedFirstAtp;
97      @XmlElement
98      private String lastAtp;
99      @XmlElement
100     private String lastAdmitAtp;
101     @XmlElement
102     private AmountInfo intensity;
103     @XmlElement
104     private TimeAmountInfo stdDuration;
105     @XmlElement
106     private Boolean canCreateLui;
107     @XmlElement
108     private String referenceURL;
109     @XmlElement
110     private List<LuCodeInfo> luCodes;
111     @XmlElement
112     private String nextReviewPeriod;
113     @XmlElement
114     private Boolean isEnrollable;
115     @XmlElement
116     private List<String> offeredAtpTypes;
117     @XmlElement
118     private Boolean isHasEarlyDropDeadline;
119     @XmlElement
120     private int defaultEnrollmentEstimate;
121     @XmlElement
122     private int defaultMaximumEnrollment;
123     @XmlElement
124     private Boolean isHazardousForDisabledStudents;
125     @XmlElement
126     private CluFeeInfo feeInfo;
127     @XmlElement
128     private CluAccountingInfo accountingInfo;
129     @XmlElement
130     private VersionInfo version;
131     @XmlElement
132     private Date effectiveDate;
133     @XmlElement
134     private Date expirationDate;
135 //    TODO KSCM-372: Non-GWT translatable code
136 //    @XmlAnyElement
137 //    private List<Element> _futureElements;
138 
139     public CluInfo() {
140     }
141 
142     public CluInfo(Clu clu) {
143         super(clu);
144         if (null != clu) {
145             if (clu.getDescr() != null) {
146                 this.descr = new RichTextInfo (clu.getDescr());
147             }
148             this.officialIdentifier = (null != clu.getOfficialIdentifier()) ? new CluIdentifierInfo(clu.getOfficialIdentifier()) : null;
149             this.alternateIdentifiers = new ArrayList<CluIdentifierInfo>();
150             for (CluIdentifier cluIdentifier : clu.getAlternateIdentifiers()) {
151                 this.alternateIdentifiers.add(new CluIdentifierInfo(cluIdentifier));
152             }
153             this.studySubjectArea = clu.getStudySubjectArea();
154             this.campusLocations = (null != clu.getCampusLocations()) ? new ArrayList<String>(clu.getCampusLocations()) : null;
155             this.accreditations = new ArrayList<AccreditationInfo>();
156             for (Accreditation accreditation : clu.getAccreditations()) {
157                 this.accreditations.add(new AccreditationInfo(accreditation));
158             }
159             this.adminOrgs = new ArrayList<AdminOrgInfo>();
160             for (AdminOrg adminOrg : clu.getAdminOrgs()) {
161                 this.adminOrgs.add(new AdminOrgInfo(adminOrg));
162             }
163             this.primaryInstructor = (null != clu.getPrimaryInstructor()) ? new CluInstructorInfo(clu.getPrimaryInstructor()) : null;
164             this.instructors = new ArrayList<CluInstructorInfo>();
165             for (CluInstructor cluInstructor : clu.getInstructors()) {
166                 this.instructors.add(new CluInstructorInfo(cluInstructor));
167             }
168             this.expectedFirstAtp = clu.getExpectedFirstAtp();
169             this.lastAtp = clu.getLastAtp();
170             this.lastAdmitAtp = clu.getLastAdmitAtp();
171             this.intensity = (null != clu.getIntensity()) ? new AmountInfo(clu.getIntensity()) : null;
172             this.stdDuration = (null != clu.getStdDuration()) ? new TimeAmountInfo(clu.getStdDuration()) : null;
173             this.canCreateLui = clu.getCanCreateLui();
174             this.referenceURL = clu.getReferenceURL();
175             this.luCodes = new ArrayList<LuCodeInfo>();
176             for (LuCode luCode : clu.getLuCodes()) {
177                 this.luCodes.add(new LuCodeInfo(luCode));
178             }
179             this.nextReviewPeriod = clu.getNextReviewPeriod();
180             this.isEnrollable = clu.getIsEnrollable();
181             this.offeredAtpTypes = (null != clu.getOfferedAtpTypes()) ? new ArrayList<String>(clu.getOfferedAtpTypes()) : null;
182             this.isHasEarlyDropDeadline = clu.getIsHasEarlyDropDeadline();
183             this.defaultEnrollmentEstimate = clu.getDefaultEnrollmentEstimate();
184             this.defaultMaximumEnrollment = clu.getDefaultMaximumEnrollment();
185             this.isHazardousForDisabledStudents = clu.getIsHazardousForDisabledStudents();
186             this.feeInfo = (null != clu.getFeeInfo()) ? new CluFeeInfo(clu.getFeeInfo()) : null;
187             this.accountingInfo = (null != clu.getAccountingInfo()) ? new CluAccountingInfo(clu.getAccountingInfo()) : null;
188             this.version = (null != clu.getVersion()) ? new VersionInfo(clu.getVersion()) : null;
189             this.effectiveDate = (null != clu.getEffectiveDate()) ? new Date(clu.getEffectiveDate().getTime()) : null;
190             this.expirationDate = (null != clu.getExpirationDate()) ? new Date(clu.getExpirationDate().getTime()) : null;
191         }
192     }
193 
194     @Override
195     public RichTextInfo getDescr() {
196         return descr;
197     }
198 
199     public void setDescr(RichTextInfo descr) {
200         this.descr = descr;
201     }
202 
203     @Override
204     public CluIdentifierInfo getOfficialIdentifier() {
205         return officialIdentifier;
206     }
207 
208     public void setOfficialIdentifier(CluIdentifierInfo officialIdentifier) {
209         this.officialIdentifier = officialIdentifier;
210     }
211 
212     @Override
213     public List<CluIdentifierInfo> getAlternateIdentifiers() {
214         if (alternateIdentifiers == null) {
215             alternateIdentifiers = new ArrayList<CluIdentifierInfo>();
216         }
217         return alternateIdentifiers;
218     }
219 
220     public void setAlternateIdentifiers(List<CluIdentifierInfo> alternateIdentifiers) {
221         this.alternateIdentifiers = alternateIdentifiers;
222     }
223 
224     @Override
225     public String getStudySubjectArea() {
226         return studySubjectArea;
227     }
228 
229     public void setStudySubjectArea(String studySubjectArea) {
230         this.studySubjectArea = studySubjectArea;
231     }
232 
233     @Override
234     public List<AccreditationInfo> getAccreditations() {
235         if (accreditations == null) {
236             accreditations = new ArrayList<AccreditationInfo>();
237         }
238         return accreditations;
239     }
240 
241     public void setAccreditations(List<AccreditationInfo> accreditations) {
242         this.accreditations = accreditations;
243     }
244 
245     @Override
246     public List<String> getCampusLocations() {
247         if (campusLocations == null) {
248             campusLocations = new ArrayList<String>();
249         }
250         return campusLocations;
251     }
252 
253     public void setCampusLocations(List<String> campusLocations) {
254         this.campusLocations = campusLocations;
255     }
256 
257     @Override
258     public List<AdminOrgInfo> getAdminOrgs() {
259         if (adminOrgs == null) {
260             adminOrgs = new ArrayList<AdminOrgInfo>();
261         }
262         return adminOrgs;
263     }
264 
265     public void setAdminOrgs(List<AdminOrgInfo> adminOrgs) {
266         this.adminOrgs = adminOrgs;
267     }
268 
269     @Override
270     public CluInstructorInfo getPrimaryInstructor() {
271         return primaryInstructor;
272     }
273 
274     public void setPrimaryInstructor(CluInstructorInfo primaryInstructor) {
275         this.primaryInstructor = primaryInstructor;
276     }
277 
278     @Override
279     public List<CluInstructorInfo> getInstructors() {
280         if (instructors == null) {
281             instructors = new ArrayList<CluInstructorInfo>();
282         }
283         return instructors;
284     }
285 
286     public void setInstructors(List<CluInstructorInfo> instructors) {
287         this.instructors = instructors;
288     }
289 
290     @Override
291     public AmountInfo getIntensity() {
292         return intensity;
293     }
294 
295     public void setIntensity(AmountInfo intensity) {
296         this.intensity = intensity;
297     }
298 
299     @Override
300     public TimeAmountInfo getStdDuration() {
301         return stdDuration;
302     }
303 
304     public void setStdDuration(TimeAmountInfo stdDuration) {
305         this.stdDuration = stdDuration;
306     }
307 
308     @Override
309     public Boolean getCanCreateLui() {
310         return canCreateLui;
311     }
312 
313     public void setCanCreateLui(Boolean canCreateLui) {
314         this.canCreateLui = canCreateLui;
315     }
316 
317     @Override
318     public String getReferenceURL() {
319         return referenceURL;
320     }
321 
322     public void setReferenceURL(String referenceURL) {
323         this.referenceURL = referenceURL;
324     }
325 
326     @Override
327     public List<LuCodeInfo> getLuCodes() {
328         if (luCodes == null) {
329             luCodes = new ArrayList<LuCodeInfo>();
330         }
331         return luCodes;
332     }
333 
334     public void setLuCodes(List<LuCodeInfo> luCodes) {
335         this.luCodes = luCodes;
336     }
337 
338     @Override
339     public String getNextReviewPeriod() {
340         return nextReviewPeriod;
341     }
342 
343     public void setNextReviewPeriod(String nextReviewPeriod) {
344         this.nextReviewPeriod = nextReviewPeriod;
345     }
346 
347     @Override
348     public Boolean getIsEnrollable() {
349         return isEnrollable;
350     }
351 
352     public void setIsEnrollable(Boolean isEnrollable) {
353         this.isEnrollable = isEnrollable;
354     }
355 
356     @Override
357     public List<String> getOfferedAtpTypes() {
358         if (offeredAtpTypes == null) {
359             offeredAtpTypes = new ArrayList<String>();
360         }
361         return offeredAtpTypes;
362     }
363 
364     public void setOfferedAtpTypes(List<String> offeredAtpTypes) {
365         this.offeredAtpTypes = offeredAtpTypes;
366     }
367 
368     @Override
369     public Boolean getIsHasEarlyDropDeadline() {
370         return isHasEarlyDropDeadline;
371     }
372 
373     public void setIsHasEarlyDropDeadline(Boolean hasEarlyDropDeadline) {
374         this.isHasEarlyDropDeadline = hasEarlyDropDeadline;
375     }
376 
377     @Override
378     public int getDefaultEnrollmentEstimate() {
379         return defaultEnrollmentEstimate;
380     }
381 
382     public void setDefaultEnrollmentEstimate(int defaultEnrollmentEstimate) {
383         this.defaultEnrollmentEstimate = defaultEnrollmentEstimate;
384     }
385 
386     @Override
387     public int getDefaultMaximumEnrollment() {
388         return defaultMaximumEnrollment;
389     }
390 
391     public void setDefaultMaximumEnrollment(int defaultMaximumEnrollment) {
392         this.defaultMaximumEnrollment = defaultMaximumEnrollment;
393     }
394 
395     @Override
396     public Boolean getIsHazardousForDisabledStudents() {
397         return isHazardousForDisabledStudents;
398     }
399 
400     public void setIsHazardousForDisabledStudents(Boolean isHazardousForDisabledStudents) {
401         this.isHazardousForDisabledStudents = isHazardousForDisabledStudents;
402     }
403 
404     @Override
405     public CluFeeInfo getFeeInfo() {
406         return feeInfo;
407     }
408 
409     public void setFeeInfo(CluFeeInfo feeInfo) {
410         this.feeInfo = feeInfo;
411     }
412 
413     @Override
414     public CluAccountingInfo getAccountingInfo() {
415         return accountingInfo;
416     }
417 
418     public void setAccountingInfo(CluAccountingInfo accountingInfo) {
419         this.accountingInfo = accountingInfo;
420     }
421 
422     @Override
423     public VersionInfo getVersion() {
424         return version;
425     }
426 
427     public void setVersion(VersionInfo version) {
428         this.version = version;
429     }
430 
431     @Override
432     public String getExpectedFirstAtp() {
433         return expectedFirstAtp;
434     }
435 
436     public void setExpectedFirstAtp(String expectedFirstAtp) {
437         this.expectedFirstAtp = expectedFirstAtp;
438     }
439 
440     @Override
441     public String getLastAtp() {
442         return lastAtp;
443     }
444 
445     public void setLastAtp(String lastAtp) {
446         this.lastAtp = lastAtp;
447     }
448 
449     @Override
450     public String getLastAdmitAtp() {
451         return lastAdmitAtp;
452     }
453 
454     public void setLastAdmitAtp(String lastAdmitAtp) {
455         this.lastAdmitAtp = lastAdmitAtp;
456     }
457 
458     @Override
459     public Date getEffectiveDate() {
460         return effectiveDate;
461     }
462 
463     public void setEffectiveDate(Date effectiveDate) {
464         this.effectiveDate = effectiveDate;
465     }
466 
467     @Override
468     public Date getExpirationDate() {
469         return expirationDate;
470     }
471 
472     public void setExpirationDate(Date expirationDate) {
473         this.expirationDate = expirationDate;
474     }
475 
476     @Override
477     public String toString() {
478         return "CluInfo[id=" + this.getId() + ", type=" + this.getTypeKey() + "]";
479     }
480 
481 }