Coverage Report - org.kuali.student.r2.lum.course.dto.CourseInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
CourseInfo
0%
0/183
0%
0/46
1.354
 
 1  
 /*
 2  
  * Copyright 2009 The Kuali Foundation Licensed under the Educational Community
 3  
  * License, Version 1.0 (the "License"); you may not use this file except in
 4  
  * compliance with the License. You may obtain a copy of the License at
 5  
  * http://www.opensource.org/licenses/ecl1.php Unless required by applicable law
 6  
  * or agreed to in writing, software distributed under the License is
 7  
  * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 8  
  * KIND, either express or implied. See the License for the specific language
 9  
  * governing permissions and limitations under the License.
 10  
  */
 11  
 package org.kuali.student.r2.lum.course.dto;
 12  
 
 13  
 import java.io.Serializable;
 14  
 import java.util.ArrayList;
 15  
 import java.util.Date;
 16  
 import java.util.List;
 17  
 
 18  
 import javax.xml.bind.annotation.XmlAccessType;
 19  
 import javax.xml.bind.annotation.XmlAccessorType;
 20  
 import javax.xml.bind.annotation.XmlAnyElement;
 21  
 import javax.xml.bind.annotation.XmlElement;
 22  
 import javax.xml.bind.annotation.XmlType;
 23  
 
 24  
 import org.kuali.student.r2.common.dto.AmountInfo;
 25  
 import org.kuali.student.r2.common.dto.IdEntityInfo;
 26  
 import org.kuali.student.r2.common.dto.RichTextInfo;
 27  
 import org.kuali.student.r2.common.dto.TimeAmountInfo;
 28  
 import org.kuali.student.r2.core.versionmanagement.dto.VersionInfo;
 29  
 import org.kuali.student.r2.lum.course.infc.Course;
 30  
 import org.kuali.student.r2.lum.course.infc.CourseCrossListing;
 31  
 import org.kuali.student.r2.lum.course.infc.CourseFee;
 32  
 import org.kuali.student.r2.lum.course.infc.CourseJoint;
 33  
 import org.kuali.student.r2.lum.course.infc.CourseRevenue;
 34  
 import org.kuali.student.r2.lum.course.infc.Format;
 35  
 import org.kuali.student.r2.lum.course.infc.LoDisplay;
 36  
 import org.kuali.student.r2.lum.clu.dto.CluInstructorInfo;
 37  
 import org.kuali.student.r2.lum.clu.infc.CluInstructor;
 38  
 import org.w3c.dom.Element;
 39  
 
 40  
 /**
 41  
  * This is a description of what this class does - sambit don't forget to fill
 42  
  * this in.
 43  
  * 
 44  
  * @author Kuali Student Team (sambitpa@kuali.org)
 45  
  */
 46  0
 @XmlType(name = "CourseInfo", propOrder = {"id",
 47  
     "typeKey",
 48  
     "stateKey",
 49  
     "name",
 50  
     "descr",
 51  
     "code",
 52  
     "courseNumberSuffix",
 53  
     "level",
 54  
     "courseTitle",
 55  
     "transcriptTitle",
 56  
     "formats",
 57  
     "termsOffered",
 58  
     "duration",
 59  
     "joints",
 60  
     "crossListings",
 61  
     "variations",
 62  
     "subjectArea",
 63  
     "campusLocations",
 64  
     "outOfClassHours",
 65  
     "primaryInstructor",
 66  
     "instructors",
 67  
     "unitsDeployment",
 68  
     "feeJustification",
 69  
     "unitsContentOwner",
 70  
     "fees",
 71  
     "revenues",
 72  
     "expenditure",
 73  
     "courseSpecificLOs",
 74  
     "gradingOptions",
 75  
     "creditOptions",
 76  
     "specialTopicsCourse",
 77  
     "pilotCourse",
 78  
     "startTerm",
 79  
     "endTerm",
 80  
     "effectiveDate",
 81  
     "expirationDate",
 82  
     "versionInfo",
 83  
     "meta",
 84  
     "attributes",
 85  
     "versionInfo",
 86  
     "_futureElements"})
 87  
 @XmlAccessorType(XmlAccessType.FIELD)
 88  
 public class CourseInfo extends IdEntityInfo implements Course, Serializable {
 89  
 
 90  
     private static final long serialVersionUID = 1L;
 91  
     @XmlElement
 92  
     private String code;
 93  
     @XmlElement
 94  
     private String courseNumberSuffix;
 95  
     @XmlElement
 96  
     private String level;
 97  
     @XmlElement
 98  
     private String courseTitle;
 99  
     @XmlElement
 100  
     private String transcriptTitle;
 101  
     @XmlElement
 102  
     private List<FormatInfo> formats;
 103  
     @XmlElement
 104  
     private List<String> termsOffered;
 105  
     @XmlElement
 106  
     private TimeAmountInfo duration;
 107  
     @XmlElement
 108  
     private List<CourseJointInfo> joints;
 109  
     @XmlElement
 110  
     private List<CourseCrossListingInfo> crossListings;
 111  
     @XmlElement
 112  
     private List<CourseVariationInfo> variations;
 113  
     @XmlElement
 114  
     private String subjectArea;
 115  
     @XmlElement
 116  
     private List<String> campusLocations;
 117  
     @XmlElement
 118  
     private AmountInfo outOfClassHours;
 119  
     @XmlElement
 120  
     private CluInstructorInfo primaryInstructor;
 121  
     @XmlElement
 122  
     private List<CluInstructorInfo> instructors;
 123  
     @XmlElement
 124  
     private List<String> unitsDeployment;
 125  
     @XmlElement
 126  
     private RichTextInfo feeJustification;
 127  
     @XmlElement
 128  
     private List<String> unitsContentOwner;
 129  
     private List<CourseFeeInfo> fees;
 130  
     @XmlElement
 131  
     private List<CourseRevenueInfo> revenues;
 132  
     @XmlElement
 133  
     private CourseExpenditureInfo expenditure;
 134  
     @XmlElement
 135  
     private List<LoDisplayInfo> courseSpecificLOs;
 136  
     @XmlElement
 137  
     private List<String> gradingOptions;
 138  
     @XmlElement
 139  
     private List<String> creditOptions;
 140  
     @XmlElement
 141  
     private boolean specialTopicsCourse;
 142  
     @XmlElement
 143  
     private boolean pilotCourse;
 144  
     @XmlElement
 145  
     private String startTerm;
 146  
     @XmlElement
 147  
     private String endTerm;
 148  
     @XmlElement
 149  
     private Date effectiveDate;
 150  
     @XmlElement
 151  
     private Date expirationDate;
 152  
     @XmlElement
 153  
     private VersionInfo versionInfo;
 154  
     @XmlAnyElement
 155  
     private List<Element> _futureElements;
 156  
 
 157  
     public CourseInfo(Course courseInfo) {
 158  0
         super(courseInfo);
 159  0
         if (courseInfo != null) {
 160  0
             this.code = courseInfo.getCode();
 161  
 
 162  0
             this.courseNumberSuffix = courseInfo.getCourseNumberSuffix();
 163  
 
 164  0
             this.level = courseInfo.getLevel();
 165  
 
 166  0
             this.courseTitle = courseInfo.getCourseTitle();
 167  
 
 168  0
             this.transcriptTitle = courseInfo.getTranscriptTitle();
 169  
 
 170  0
             List<FormatInfo> formatList = new ArrayList<FormatInfo>();
 171  
 
 172  0
             for (Format format : courseInfo.getFormats()) {
 173  
 
 174  0
                 formatList.add(new FormatInfo(format));
 175  
             }
 176  
 
 177  0
             this.termsOffered = new ArrayList<String>(courseInfo.getTermsOffered());
 178  
 
 179  0
             this.duration = new TimeAmountInfo(courseInfo.getDuration());
 180  
 
 181  0
             List<CourseJointInfo> courseJointList = new ArrayList<CourseJointInfo>();
 182  
 
 183  0
             for (CourseJoint courseJoint : courseInfo.getJoints()) {
 184  
 
 185  0
                 courseJointList.add(new CourseJointInfo(courseJoint));
 186  
             }
 187  
 
 188  0
             this.joints = courseJointList;
 189  
 
 190  0
             this.crossListings = new ArrayList<CourseCrossListingInfo>();
 191  
 
 192  0
             List<CourseCrossListingInfo> courseCrossListingList = new ArrayList<CourseCrossListingInfo>();
 193  
 
 194  0
             for (CourseCrossListing courseCrossListing : courseInfo.getCrossListings()) {
 195  
 
 196  0
                 courseCrossListingList.add(new CourseCrossListingInfo(courseCrossListing));
 197  
             }
 198  
 
 199  0
             this.variations = new ArrayList<CourseVariationInfo>();
 200  
 
 201  0
             this.subjectArea = courseInfo.getSubjectArea();
 202  0
             this.campusLocations = new ArrayList<String>(courseInfo.getCampusLocations());
 203  
 
 204  0
             this.outOfClassHours = new AmountInfo(courseInfo.getOutOfClassHours());
 205  
 
 206  0
             this.primaryInstructor = new CluInstructorInfo(courseInfo.getPrimaryInstructor());
 207  
 
 208  0
             List<CluInstructorInfo> instructorList = new ArrayList<CluInstructorInfo>();
 209  
 
 210  0
             for (CluInstructor cluInstructor : courseInfo.getInstructors()) {
 211  
 
 212  0
                 instructorList.add(new CluInstructorInfo(cluInstructor));
 213  
             }
 214  
 
 215  0
             this.instructors = instructorList;
 216  
 
 217  0
             this.unitsDeployment = new ArrayList<String>(courseInfo.getUnitsDeployment());
 218  
 
 219  0
             this.feeJustification = new RichTextInfo(courseInfo.getFeeJustification());
 220  
 
 221  0
             this.unitsContentOwner = new ArrayList<String>(courseInfo.getUnitsContentOwner());
 222  
 
 223  0
             List<CourseFeeInfo> courseFeeList = new ArrayList<CourseFeeInfo>();
 224  0
             for (CourseFee courseFee : courseInfo.getFees()) {
 225  
 
 226  0
                 courseFeeList.add(new CourseFeeInfo(courseFee));
 227  
             }
 228  
 
 229  0
             this.fees = courseFeeList;
 230  
 
 231  0
             List<CourseRevenueInfo> courseRevList = new ArrayList<CourseRevenueInfo>();
 232  0
             for (CourseRevenue courseRevenue : courseInfo.getRevenues()) {
 233  
 
 234  0
                 courseRevList.add(new CourseRevenueInfo(courseRevenue));
 235  
             }
 236  
 
 237  0
             this.revenues = courseRevList;
 238  
 
 239  0
             this.expenditure = new CourseExpenditureInfo(courseInfo.getExpenditure());
 240  
 
 241  0
             List<LoDisplayInfo> courseLos = new ArrayList<LoDisplayInfo>();
 242  
 
 243  0
             for (LoDisplay courseRevenue : courseInfo.getCourseSpecificLOs()) {
 244  
 
 245  0
                 courseLos.add(new LoDisplayInfo(courseRevenue));
 246  
             }
 247  
 
 248  0
             this.courseSpecificLOs = courseLos;
 249  
 
 250  0
             this.gradingOptions = new ArrayList<String>(courseInfo.getGradingOptions());
 251  
 
 252  0
             this.creditOptions = new ArrayList<String>(courseInfo.getCreditOptions());
 253  
 
 254  0
             this.specialTopicsCourse = courseInfo.isSpecialTopicsCourse();
 255  
 
 256  0
             this.pilotCourse = courseInfo.isPilotCourse();
 257  0
             this.startTerm = courseInfo.getStartTerm();
 258  
 
 259  0
             this.endTerm = courseInfo.getEndTerm();
 260  
 
 261  0
             this.effectiveDate = new Date(courseInfo.getEffectiveDate().getTime());
 262  
 
 263  0
             this.expirationDate = new Date(courseInfo.getExpirationDate().getTime());
 264  0
             this.transcriptTitle = courseInfo.getTranscriptTitle();
 265  0
             this.code = courseInfo.getCode();
 266  
 
 267  0
             this.unitsContentOwner = courseInfo.getUnitsContentOwner() != null
 268  
                     ? new ArrayList<String>(courseInfo.getUnitsContentOwner())
 269  
                     : new ArrayList<String>();
 270  
 
 271  0
             this.versionInfo = new VersionInfo(courseInfo.getVersionInfo());
 272  
 
 273  
         }
 274  0
     }
 275  
 
 276  
    
 277  
     @Override
 278  
     public String getCode() {
 279  0
         return code;
 280  
     }
 281  
 
 282  
     public void setCode(String code) {
 283  0
         this.code = code;
 284  0
     }
 285  
 
 286  
 
 287  
     @Override
 288  
     public String getCourseNumberSuffix() {
 289  0
         return courseNumberSuffix;
 290  
     }
 291  
 
 292  
     public void setCourseNumberSuffix(String courseNumberSuffix) {
 293  0
         this.courseNumberSuffix = courseNumberSuffix;
 294  0
     }
 295  
 
 296  
     /**
 297  
      * A code that indicates what level 100, 200 or upper division, lower
 298  
      * division etc
 299  
      * 
 300  
      * @return
 301  
      */
 302  
     @Override
 303  
     public String getLevel() {
 304  0
         return level;
 305  
     }
 306  
 
 307  
     public void setLevel(String level) {
 308  0
         this.level = level;
 309  0
     }
 310  
 
 311  
     @Override
 312  
     public String getCourseTitle() {
 313  0
         return courseTitle;
 314  
     }
 315  
 
 316  
     public void setCourseTitle(String courseTitle) {
 317  0
         this.courseTitle = courseTitle;
 318  0
     }
 319  
 
 320  
     @Override
 321  
     public String getTranscriptTitle() {
 322  0
         return transcriptTitle;
 323  
     }
 324  
 
 325  
     public void setTranscriptTitle(String transcriptTitle) {
 326  0
         this.transcriptTitle = transcriptTitle;
 327  0
     }
 328  
 
 329  
     @Override
 330  
     public List<FormatInfo> getFormats() {
 331  0
         if (formats == null) {
 332  0
             formats = new ArrayList<FormatInfo>(0);
 333  
         }
 334  0
         return formats;
 335  
     }
 336  
 
 337  
     public void setFormats(List<FormatInfo> formats) {
 338  0
         this.formats = formats;
 339  0
     }
 340  
 
 341  
     @Override
 342  
     public List<String> getTermsOffered() {
 343  0
         if (termsOffered == null) {
 344  0
             termsOffered = new ArrayList<String>(0);
 345  
         }
 346  0
         return termsOffered;
 347  
     }
 348  
 
 349  
     public void setTermsOffered(List<String> termsOffered) {
 350  0
         this.termsOffered = termsOffered;
 351  0
     }
 352  
 
 353  
     @Override
 354  
     public TimeAmountInfo getDuration() {
 355  0
         return duration;
 356  
     }
 357  
 
 358  
     public void setDuration(TimeAmountInfo duration) {
 359  0
         this.duration = duration;
 360  0
     }
 361  
 
 362  
     @Override
 363  
     public List<CourseJointInfo> getJoints() {
 364  0
         if (joints == null) {
 365  0
             joints = new ArrayList<CourseJointInfo>(0);
 366  
         }
 367  0
         return joints;
 368  
     }
 369  
 
 370  
     public void setJoints(List<CourseJointInfo> joints) {
 371  0
         this.joints = joints;
 372  0
     }
 373  
 
 374  
     @Override
 375  
     public List<CourseCrossListingInfo> getCrossListings() {
 376  0
         if (crossListings == null) {
 377  0
             crossListings = new ArrayList<CourseCrossListingInfo>(0);
 378  
         }
 379  0
         return crossListings;
 380  
     }
 381  
 
 382  
     public void setCrossListings(List<CourseCrossListingInfo> crossListings) {
 383  0
         this.crossListings = crossListings;
 384  0
     }
 385  
 
 386  
     @Override
 387  
     public List<CourseVariationInfo> getVariations() {
 388  0
         if (variations == null) {
 389  0
             variations = new ArrayList<CourseVariationInfo>(0);
 390  
         }
 391  0
         return variations;
 392  
     }
 393  
 
 394  
     public void setVariations(List<CourseVariationInfo> variations) {
 395  0
         this.variations = variations;
 396  0
     }
 397  
 
 398  
     @Override
 399  
     public String getSubjectArea() {
 400  0
         return subjectArea;
 401  
     }
 402  
 
 403  
     public void setSubjectArea(String subjectArea) {
 404  0
         this.subjectArea = subjectArea;
 405  0
     }
 406  
 
 407  
     @Override
 408  
     public List<String> getCampusLocations() {
 409  0
         if (campusLocations == null) {
 410  0
             campusLocations = new ArrayList<String>(0);
 411  
         }
 412  0
         return campusLocations;
 413  
     }
 414  
 
 415  
     public void setCampusLocations(List<String> campusLocations) {
 416  0
         this.campusLocations = campusLocations;
 417  0
     }
 418  
 
 419  
     @Override
 420  
     public AmountInfo getOutOfClassHours() {
 421  0
         return outOfClassHours;
 422  
     }
 423  
 
 424  
     public void setOutOfClassHours(AmountInfo outOfClassHours) {
 425  0
         this.outOfClassHours = outOfClassHours;
 426  0
     }
 427  
 
 428  
     @Override
 429  
     public CluInstructorInfo getPrimaryInstructor() {
 430  0
         return primaryInstructor;
 431  
     }
 432  
 
 433  
     public void setPrimaryInstructor(CluInstructorInfo primaryInstructor) {
 434  0
         this.primaryInstructor = primaryInstructor;
 435  0
     }
 436  
 
 437  
     @Override
 438  
     public List<CluInstructorInfo> getInstructors() {
 439  0
         if (instructors == null) {
 440  0
             instructors = new ArrayList<CluInstructorInfo>(0);
 441  
         }
 442  0
         return instructors;
 443  
     }
 444  
 
 445  
     public void setInstructors(List<CluInstructorInfo> instructors) {
 446  0
         this.instructors = instructors;
 447  0
     }
 448  
 
 449  
     @Override
 450  
     public List<String> getUnitsDeployment() {
 451  0
         if (unitsDeployment == null) {
 452  0
             unitsDeployment = new ArrayList<String>(0);
 453  
         }
 454  0
         return unitsDeployment;
 455  
     }
 456  
 
 457  
     @Override
 458  
     public RichTextInfo getFeeJustification() {
 459  0
         return feeJustification;
 460  
 
 461  
     }
 462  
 
 463  
     public void setUnitsDeployment(List<String> unitsDeployment) {
 464  0
         this.unitsDeployment = unitsDeployment;
 465  0
     }
 466  
 
 467  
     public void setFeeJustification(RichTextInfo feeJustification) {
 468  0
         this.feeJustification = feeJustification;
 469  
 
 470  0
     }
 471  
 
 472  
     @Override
 473  
     public List<String> getUnitsContentOwner() {
 474  0
         if (unitsContentOwner == null) {
 475  0
             unitsContentOwner = new ArrayList<String>(0);
 476  
         }
 477  0
         return unitsContentOwner;
 478  
     }
 479  
 
 480  
     @Override
 481  
     public List<CourseFeeInfo> getFees() {
 482  0
         if (fees == null) {
 483  0
             fees = new ArrayList<CourseFeeInfo>(0);
 484  
         }
 485  0
         return fees;
 486  
     }
 487  
 
 488  
     public void setUnitsContentOwner(List<String> unitsContentOwner) {
 489  0
         this.unitsContentOwner = unitsContentOwner;
 490  0
     }
 491  
 
 492  
     public void setFees(List<CourseFeeInfo> fees) {
 493  0
         this.fees = fees;
 494  0
     }
 495  
 
 496  
     @Override
 497  
     public List<CourseRevenueInfo> getRevenues() {
 498  0
         if (revenues == null) {
 499  0
             revenues = new ArrayList<CourseRevenueInfo>(0);
 500  
         }
 501  0
         return revenues;
 502  
     }
 503  
 
 504  
     public void setRevenues(List<CourseRevenueInfo> revenues) {
 505  0
         this.revenues = revenues;
 506  0
     }
 507  
 
 508  
     @Override
 509  
     public CourseExpenditureInfo getExpenditure() {
 510  0
         return expenditure;
 511  
     }
 512  
 
 513  
     public void setExpenditure(CourseExpenditureInfo expenditure) {
 514  0
         this.expenditure = expenditure;
 515  0
     }
 516  
 
 517  
     @Override
 518  
     public List<LoDisplayInfo> getCourseSpecificLOs() {
 519  0
         if (courseSpecificLOs == null) {
 520  0
             courseSpecificLOs = new ArrayList<LoDisplayInfo>(0);
 521  
         }
 522  0
         return courseSpecificLOs;
 523  
     }
 524  
 
 525  
     public void setCourseSpecificLOs(List<LoDisplayInfo> courseSpecificLOs) {
 526  0
         this.courseSpecificLOs = courseSpecificLOs;
 527  0
     }
 528  
 
 529  
     @Override
 530  
     public List<String> getGradingOptions() {
 531  0
         if (gradingOptions == null) {
 532  0
             gradingOptions = new ArrayList<String>(0);
 533  
         }
 534  0
         return gradingOptions;
 535  
     }
 536  
 
 537  
     public void setGradingOptions(List<String> gradingOptions) {
 538  0
         this.gradingOptions = gradingOptions;
 539  0
     }
 540  
 
 541  
     @Override
 542  
     public List<String> getCreditOptions() {
 543  0
         if (creditOptions == null) {
 544  0
             creditOptions = new ArrayList<String>(0);
 545  
         }
 546  0
         return creditOptions;
 547  
     }
 548  
 
 549  
     public void setCreditOptions(List<String> creditOptions) {
 550  0
         this.creditOptions = creditOptions;
 551  0
     }
 552  
 
 553  
     @Override
 554  
     public Boolean isSpecialTopicsCourse() {
 555  0
         return specialTopicsCourse;
 556  
     }
 557  
 
 558  
     public void setSpecialTopicsCourse(boolean specialTopicsCourse) {
 559  0
         this.specialTopicsCourse = specialTopicsCourse;
 560  0
     }
 561  
 
 562  
     @Override
 563  
     public Boolean isPilotCourse() {
 564  0
         return pilotCourse;
 565  
     }
 566  
 
 567  
     public void setPilotCourse(boolean pilotCourse) {
 568  0
         this.pilotCourse = pilotCourse;
 569  0
     }
 570  
 
 571  
     @Override
 572  
     public String getStartTerm() {
 573  0
         return startTerm;
 574  
     }
 575  
 
 576  
     public void setStartTerm(String startTerm) {
 577  0
         this.startTerm = startTerm;
 578  0
     }
 579  
 
 580  
     @Override
 581  
     public String getEndTerm() {
 582  0
         return endTerm;
 583  
     }
 584  
 
 585  
     public void setEndTerm(String endTerm) {
 586  0
         this.endTerm = endTerm;
 587  0
     }
 588  
 
 589  
     @Override
 590  
     public Date getEffectiveDate() {
 591  0
         return effectiveDate;
 592  
     }
 593  
 
 594  
     public void setEffectiveDate(Date effectiveDate) {
 595  0
         this.effectiveDate = effectiveDate;
 596  0
     }
 597  
 
 598  
     @Override
 599  
     public Date getExpirationDate() {
 600  0
         return expirationDate;
 601  
     }
 602  
 
 603  
     public void setExpirationDate(Date expirationDate) {
 604  0
         this.expirationDate = expirationDate;
 605  0
     }
 606  
 
 607  
     @Override
 608  
     public VersionInfo getVersionInfo() {
 609  0
         return versionInfo;
 610  
     }
 611  
 
 612  
     public void setVersionInfo(VersionInfo versionInfo) {
 613  0
         this.versionInfo = versionInfo;
 614  0
     }
 615  
 }