View Javadoc
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.program.dto;
12  
13  import java.io.Serializable;
14  import java.util.ArrayList;
15  import java.util.List;
16  
17  import javax.xml.bind.annotation.XmlAccessType;
18  import javax.xml.bind.annotation.XmlAccessorType;
19  import javax.xml.bind.annotation.XmlAnyElement;
20  import javax.xml.bind.annotation.XmlElement;
21  import javax.xml.bind.annotation.XmlType;
22  
23  import org.kuali.student.r1.core.statement.dto.StatementTreeViewInfo;
24  import org.kuali.student.r2.common.dto.IdNamelessEntityInfo;
25  import org.kuali.student.r2.common.dto.RichTextInfo;
26  import org.kuali.student.r2.lum.course.dto.LoDisplayInfo;
27  import org.kuali.student.r2.lum.program.infc.ProgramRequirement;
28  
29  /**
30   * Detailed information about a program requirement
31   * 
32   * @author Kuali Student Team (sambitpa@kuali.org)
33   */
34  @XmlType(name = "ProgramRequirementInfo", propOrder = {"id",
35      "typeKey",
36      "stateKey",
37      "descr",
38      "shortTitle",
39      "longTitle",
40      "learningObjectives",
41      "statement",
42      "minCredits",
43      "maxCredits",
44      "meta",
45      "attributes", "_futureElements" }) 
46      
47  @XmlAccessorType(XmlAccessType.FIELD)
48  public class ProgramRequirementInfo extends IdNamelessEntityInfo implements ProgramRequirement, Serializable {
49  
50      private static final long serialVersionUID = 1L;
51      @XmlElement
52      private RichTextInfo descr;
53      @XmlElement
54      private String shortTitle;
55      @XmlElement
56      private String longTitle;
57      @XmlElement
58      private List<LoDisplayInfo> learningObjectives;
59      @XmlElement
60      private StatementTreeViewInfo statement;
61      @XmlElement
62      private Integer minCredits;
63      @XmlElement
64      private Integer maxCredits;
65  
66      @XmlAnyElement
67      private List<Object> _futureElements;  
68  
69      public ProgramRequirementInfo() {
70      }
71  
72      public ProgramRequirementInfo(ProgramRequirement programRequirement) {
73          super(programRequirement);
74          if (programRequirement != null) {
75              if (programRequirement.getDescr() != null) {
76                  this.descr = new RichTextInfo (programRequirement.getDescr());
77              }
78              this.shortTitle = programRequirement.getShortTitle();
79              this.longTitle = programRequirement.getLongTitle();
80              this.statement = programRequirement.getStatement();
81              this.minCredits = programRequirement.getMinCredits();
82              this.maxCredits = programRequirement.getMaxCredits();
83              List<LoDisplayInfo> los = new ArrayList<LoDisplayInfo>();
84              if (programRequirement.getLearningObjectives() != null) {
85                  for (LoDisplayInfo loDisplay : programRequirement.getLearningObjectives()) {
86                      los.add(new LoDisplayInfo(loDisplay));
87                  }
88              }
89          }
90      }
91  
92      @Override
93      public RichTextInfo getDescr() {
94          return descr;
95      }
96  
97      public void setDescr(RichTextInfo descr) {
98          this.descr = descr;
99      }
100 
101     @Override
102     public String getShortTitle() {
103         return shortTitle;
104     }
105 
106     public void setShortTitle(String shortTitle) {
107         this.shortTitle = shortTitle;
108     }
109 
110     @Override
111     public String getLongTitle() {
112         return longTitle;
113     }
114 
115     public void setLongTitle(String longTitle) {
116         this.longTitle = longTitle;
117     }
118 
119     @Override
120     public List<LoDisplayInfo> getLearningObjectives() {
121         if (null == learningObjectives) {
122             learningObjectives = new ArrayList<LoDisplayInfo>(0);
123         }
124         return learningObjectives;
125     }
126 
127     public void setLearningObjectives(List<LoDisplayInfo> learningObjectives) {
128         this.learningObjectives = learningObjectives;
129     }
130 
131     @Override
132     public StatementTreeViewInfo getStatement() {
133         return statement;
134     }
135 
136     public void setStatement(StatementTreeViewInfo statement) {
137         this.statement = statement;
138     }
139 
140     @Override
141     public Integer getMinCredits() {
142         return minCredits;
143     }
144 
145     public void setMinCredits(Integer minCredits) {
146         this.minCredits = minCredits;
147     }
148 
149     @Override
150     public Integer getMaxCredits() {
151         return maxCredits;
152     }
153 
154     public void setMaxCredits(Integer maxCredits) {
155         this.maxCredits = maxCredits;
156     }
157 
158 
159 
160 }