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.course.dto;
12  
13  import org.kuali.student.r2.common.dto.IdEntityInfo;
14  import org.kuali.student.r2.lum.course.infc.LoDisplay;
15  import org.kuali.student.r2.lum.lo.dto.LoCategoryInfo;
16  import org.kuali.student.r2.lum.lo.dto.LoInfo;
17  //import org.w3c.dom.Element;
18  
19  import javax.xml.bind.annotation.XmlAccessType;
20  import javax.xml.bind.annotation.XmlAccessorType;
21  import javax.xml.bind.annotation.XmlAnyElement;
22  import javax.xml.bind.annotation.XmlElement;
23  import javax.xml.bind.annotation.XmlType;
24  
25  import java.io.Serializable;
26  import java.util.ArrayList;
27  import java.util.List;
28  
29  /**
30   * Detailed information about an LO and all it's children for application use.
31   * 
32   * @Author KSContractMojo
33   * @Author Kamal
34   * @Since Tue May 18 13:27:38 PDT 2010
35   * @See <a href=
36   *      "https://test.kuali.org/confluence/display/KULSTU/loDisplayInfo+Structure"
37   *      >LoDisplayInfo</>
38   */
39  @XmlType(name = "LoDisplayInfo", propOrder = {"id", "typeKey", "stateKey", "name", "descr", "loInfo", "loDisplayInfoList", "parentRelType", "parentLoRelationid", "loCategoryInfoList", "meta",
40          "attributes", "_futureElements" }) 
41  @XmlAccessorType(XmlAccessType.FIELD)
42  public class LoDisplayInfo extends IdEntityInfo implements LoDisplay, Serializable {
43  
44      private static final long serialVersionUID = 1L;
45  
46      @XmlElement
47      private LoInfo loInfo;
48  
49      @XmlElement
50      private List<LoDisplayInfo> loDisplayInfoList;
51  
52      @XmlElement
53      private String parentRelType;
54  
55      @XmlElement
56      private String parentLoRelationid;
57  
58      @XmlElement
59      private List<LoCategoryInfo> loCategoryInfoList;
60  
61      @XmlAnyElement
62      private List<Object> _futureElements;  
63  
64      public LoDisplayInfo() {
65  
66      }
67  
68      public LoDisplayInfo(LoDisplay loDisplay) {
69          super(loDisplay);
70          if (loDisplay != null) {
71              this.loInfo = new LoInfo(loDisplay.getLoInfo());
72              List<LoDisplayInfo> loDisplayInfoList = new ArrayList<LoDisplayInfo>();
73              for (LoDisplay containedLoDisplay : loDisplay.getLoDisplayInfoList()) {
74                  loDisplayInfoList.add(new LoDisplayInfo(containedLoDisplay));
75              }
76          }
77  
78      }
79  
80      /**
81       * Detailed information about a learning objective
82       */
83      @Override
84      public LoInfo getLoInfo() {
85          return loInfo;
86      }
87  
88      public void setLoInfo(LoInfo loInfo) {
89          this.loInfo = loInfo;
90      }
91  
92      /**
93       * List of Lo Display information. (info and child relations
94       */
95      @Override
96      public List<LoDisplayInfo> getLoDisplayInfoList() {
97          if (loDisplayInfoList == null) {
98              loDisplayInfoList = new ArrayList<LoDisplayInfo>(0);
99          }
100         return loDisplayInfoList;
101     }
102 
103     public void setLoDisplayInfoList(List<LoDisplayInfo> loDisplayInfoList) {
104         this.loDisplayInfoList = loDisplayInfoList;
105     }
106 
107     /**
108      * Unique identifier for the LO to LO relation type.
109      */
110     @Override
111     public String getParentRelType() {
112         return parentRelType;
113     }
114 
115     public void setParentRelType(String parentRelType) {
116         this.parentRelType = parentRelType;
117     }
118 
119     /**
120      * Unique identifier for a LO to LO relationship.
121      */
122     @Override
123     public String getParentLoRelationid() {
124         return parentLoRelationid;
125     }
126 
127     public void setParentLoRelationid(String parentLoRelationid) {
128         this.parentLoRelationid = parentLoRelationid;
129     }
130 
131     /**
132      * List of learning objective category information.
133      */
134     @Override
135     public List<LoCategoryInfo> getLoCategoryInfoList() {
136         if (loCategoryInfoList == null) {
137             loCategoryInfoList = new ArrayList<LoCategoryInfo>(0);
138         }
139         return loCategoryInfoList;
140     }
141 
142     public void setLoCategoryInfoList(List<LoCategoryInfo> loCategoryInfoList) {
143         this.loCategoryInfoList = loCategoryInfoList;
144     }
145 }