001    /*
002     * Copyright 2009 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 1.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl1.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.student.lum.program.dto;
017    
018    import java.io.Serializable;
019    import java.util.ArrayList;
020    import java.util.HashMap;
021    import java.util.List;
022    import java.util.Map;
023    
024    import javax.xml.bind.annotation.XmlAccessType;
025    import javax.xml.bind.annotation.XmlAccessorType;
026    import javax.xml.bind.annotation.XmlAttribute;
027    import javax.xml.bind.annotation.XmlElement;
028    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
029    
030    import org.kuali.student.common.dto.HasAttributes;
031    import org.kuali.student.common.dto.HasTypeState;
032    import org.kuali.student.common.dto.Idable;
033    import org.kuali.student.common.dto.MetaInfo;
034    import org.kuali.student.common.dto.RichTextInfo;
035    import org.kuali.student.core.statement.dto.StatementTreeViewInfo;
036    import org.kuali.student.core.ws.binding.JaxbAttributeMapListAdapter;
037    import org.kuali.student.lum.course.dto.LoDisplayInfo;
038    import org.kuali.student.lum.program.dto.assembly.ProgramCommonAssembly;
039    
040    /**
041     * Detailed information about a program requirement
042     *
043     * @Author KSContractMojo
044     * @Author Li Pan
045     * @Since Wed Jun 30 14:56:20 PDT 2010
046     * @See <a href="https://test.kuali.org/confluence/display/KULSTU/programRequirementInfo+Structure">ProgramRequirementInfo</>
047     *
048     */
049    @XmlAccessorType(XmlAccessType.FIELD)
050    public class ProgramRequirementInfo implements Serializable, Idable, HasTypeState, HasAttributes, ProgramCommonAssembly {
051    
052        private static final long serialVersionUID = 1L;
053    
054        @XmlElement
055        private String shortTitle;
056    
057        @XmlElement
058        private String longTitle;
059    
060        @XmlElement
061        private RichTextInfo descr;
062    
063        @XmlElement
064        private List<LoDisplayInfo> learningObjectives;
065    
066        @XmlElement
067        private StatementTreeViewInfo statement;
068    
069        @XmlElement
070        Integer minCredits;
071        
072        @XmlElement
073        Integer maxCredits;
074        
075        @XmlElement
076        @XmlJavaTypeAdapter(JaxbAttributeMapListAdapter.class)
077        private Map<String, String> attributes;
078    
079        @XmlElement
080        private MetaInfo metaInfo;
081    
082        @XmlAttribute
083        private String type;
084    
085        @XmlAttribute
086        private String state;
087    
088        @XmlAttribute
089        private String id;
090    
091        public String getShortTitle() {
092            return shortTitle;
093        }
094    
095        public void setShortTitle(String shortTitle) {
096            this.shortTitle = shortTitle;
097        }
098    
099        public String getLongTitle() {
100            return longTitle;
101        }
102    
103        public void setLongTitle(String longTitle) {
104            this.longTitle = longTitle;
105        }
106    
107        public RichTextInfo getDescr() {
108            return descr;
109        }
110    
111        public void setDescr(RichTextInfo descr) {
112            this.descr = descr;
113        }
114    
115        public List<LoDisplayInfo> getLearningObjectives() {
116            if(null == learningObjectives) {
117                learningObjectives = new ArrayList<LoDisplayInfo>(0);
118            }
119            return learningObjectives;
120        }
121    
122        public void setLearningObjectives(List<LoDisplayInfo> learningObjectives) {
123            this.learningObjectives = learningObjectives;
124        }
125    
126        public StatementTreeViewInfo getStatement() {
127            return statement;
128        }
129    
130        public void setStatement(StatementTreeViewInfo statement) {
131            this.statement = statement;
132        }
133        
134        public Integer getMinCredits() {
135            return minCredits;
136        }
137    
138        public void setMinCredits(Integer minCredits) {
139            this.minCredits = minCredits;
140        }
141    
142        public Integer getMaxCredits() {
143            return maxCredits;
144        }
145    
146        public void setMaxCredits(Integer maxCredits) {
147            this.maxCredits = maxCredits;
148        }
149    
150        /**
151         * List of key/value pairs, typically used for dynamic attributes.
152         */
153        @Override
154        public Map<String, String> getAttributes() {
155            if (attributes == null) {
156                attributes = new HashMap<String, String>();
157            }
158            return attributes;
159        }
160    
161        @Override
162        public void setAttributes(Map<String, String> attributes) {
163            this.attributes = attributes;
164        }
165    
166        /**
167         * Create and last update info for the structure. This is optional and treated as read only since the data is set by the internals of the service during maintenance operations.
168         */
169        public MetaInfo getMetaInfo() {
170            return metaInfo;
171        }
172    
173        public void setMetaInfo(MetaInfo metaInfo) {
174            this.metaInfo = metaInfo;
175        }
176    
177        /**
178         * Unique identifier for a learning unit type. Once set at create time, this field may not be updated.
179         */
180        @Override
181        public String getType() {
182            return type;
183        }
184    
185        @Override
186        public void setType(String type) {
187            this.type = type;
188        }
189    
190        /**
191         * The current status of the credential program. The values for this field are constrained to those in the luState enumeration. A separate setup operation does not exist for retrieval of the meta data around this value.
192         */
193        @Override
194        public String getState() {
195            return state;
196        }
197    
198        @Override
199        public void setState(String state) {
200            this.state = state;
201        }
202    
203        /**
204         * Unique identifier for a Program Requirement This is optional, due to the identifier being set at the time of creation. Once the Program has been created, this should be seen as required.
205         */
206        @Override
207        public String getId() {
208            return id;
209        }
210    
211        @Override
212        public void setId(String id) {
213            this.id = id;
214        }
215    }