Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
CluPublicationInfo |
|
| 1.0869565217391304;1.087 |
1 | /** | |
2 | * Copyright 2010 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the | |
5 | * "License"); you may not use this file except in compliance with the | |
6 | * License. You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl1.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, | |
11 | * software distributed under the License is distributed on an "AS IS" | |
12 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | |
13 | * or implied. See the License for the specific language governing | |
14 | * permissions and limitations under the License. | |
15 | */ | |
16 | ||
17 | package org.kuali.student.lum.lu.dto; | |
18 | ||
19 | import org.kuali.student.core.dto.HasAttributes; | |
20 | import org.kuali.student.core.dto.HasTypeState; | |
21 | import org.kuali.student.core.dto.Idable; | |
22 | import org.kuali.student.core.dto.MetaInfo; | |
23 | import org.kuali.student.core.ws.binding.JaxbAttributeMapListAdapter; | |
24 | ||
25 | import javax.xml.bind.annotation.XmlAccessType; | |
26 | import javax.xml.bind.annotation.XmlAccessorType; | |
27 | import javax.xml.bind.annotation.XmlAttribute; | |
28 | import javax.xml.bind.annotation.XmlElement; | |
29 | import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; | |
30 | import java.io.Serializable; | |
31 | import java.util.*; | |
32 | ||
33 | ||
34 | /** | |
35 | * Detailed information about publishing a clu. | |
36 | * | |
37 | * @Author Kamal | |
38 | * @Since Mon Jan 11 15:21:19 PST 2010 | |
39 | */ | |
40 | ||
41 | @XmlAccessorType(XmlAccessType.FIELD) | |
42 | 0 | public class CluPublicationInfo implements Serializable, Idable, HasTypeState, HasAttributes { |
43 | ||
44 | private static final long serialVersionUID = 1L; | |
45 | ||
46 | @XmlElement | |
47 | private String cluId; | |
48 | ||
49 | @XmlElement | |
50 | private List<FieldInfo> variants; | |
51 | ||
52 | @XmlElement | |
53 | private String startCycle; | |
54 | ||
55 | @XmlElement | |
56 | private String endCycle; | |
57 | ||
58 | @XmlElement | |
59 | private Date effectiveDate; | |
60 | ||
61 | @XmlElement | |
62 | private Date expirationDate; | |
63 | ||
64 | @XmlElement | |
65 | @XmlJavaTypeAdapter(JaxbAttributeMapListAdapter.class) | |
66 | private Map<String, String> attributes; | |
67 | ||
68 | @XmlElement | |
69 | private MetaInfo metaInfo; | |
70 | ||
71 | @XmlAttribute | |
72 | private String type; | |
73 | ||
74 | @XmlAttribute | |
75 | private String state; | |
76 | ||
77 | @XmlAttribute | |
78 | private String id; | |
79 | ||
80 | ||
81 | /** | |
82 | * The identifier for the canonical learning unit which is | |
83 | * described by this publication information. | |
84 | */ | |
85 | ||
86 | public String getCluId() { | |
87 | 0 | return cluId; |
88 | } | |
89 | ||
90 | public void setCluId(String cluId) { | |
91 | 0 | this.cluId = cluId; |
92 | 0 | } |
93 | ||
94 | ||
95 | /** | |
96 | * Fields in cluInfo whose values are overridden as part of this | |
97 | * publication. | |
98 | */ | |
99 | ||
100 | public List<FieldInfo> getVariants() { | |
101 | 0 | if (variants == null) { |
102 | 0 | variants = new ArrayList<FieldInfo>(0); |
103 | } | |
104 | ||
105 | 0 | return variants; |
106 | } | |
107 | ||
108 | public void setVariants(List<FieldInfo> variants) { | |
109 | 0 | this.variants = variants; |
110 | 0 | } |
111 | ||
112 | ||
113 | /** | |
114 | * The start academic time period for when the CLU should be | |
115 | * published in this type of usage. Should be less than or equal | |
116 | * to endCycle. | |
117 | */ | |
118 | ||
119 | public String getStartCycle() { | |
120 | 0 | return startCycle; |
121 | } | |
122 | ||
123 | public void setStartCycle(String startCycle) { | |
124 | 0 | this.startCycle = startCycle; |
125 | 0 | } |
126 | ||
127 | ||
128 | /** | |
129 | * The end academic time period for when the CLU should be | |
130 | * published in this type of usage. If specified, should be | |
131 | * greater than or equal to startCycle. | |
132 | */ | |
133 | ||
134 | public String getEndCycle() { | |
135 | 0 | return endCycle; |
136 | } | |
137 | ||
138 | public void setEndCycle(String endCycle) { | |
139 | 0 | this.endCycle = endCycle; |
140 | 0 | } |
141 | ||
142 | ||
143 | /** | |
144 | * Date and time that this LU publication type became | |
145 | * effective. This is a similar concept to the effective date on | |
146 | * enumerated values. When an expiration date has been specified, | |
147 | * this field must be less than or equal to the expiration date. | |
148 | */ | |
149 | ||
150 | public Date getEffectiveDate() { | |
151 | 0 | return effectiveDate; |
152 | } | |
153 | ||
154 | public void setEffectiveDate(Date effectiveDate) { | |
155 | 0 | this.effectiveDate = effectiveDate; |
156 | 0 | } |
157 | ||
158 | ||
159 | /** | |
160 | * Date and time that this LU publication type expires. This is a | |
161 | * similar concept to the expiration date on enumerated values. If | |
162 | * specified, this should be greater than or equal to the | |
163 | * effective date. If this field is not specified, then no | |
164 | * expiration date has been currently defined and should | |
165 | * automatically be considered greater than the effective date. | |
166 | */ | |
167 | ||
168 | public Date getExpirationDate() { | |
169 | 0 | return expirationDate; |
170 | } | |
171 | ||
172 | public void setExpirationDate(Date expirationDate) { | |
173 | 0 | this.expirationDate = expirationDate; |
174 | 0 | } |
175 | ||
176 | ||
177 | /** | |
178 | * List of key/value pairs, typically used for dynamic attributes. | |
179 | */ | |
180 | ||
181 | public Map<String, String> getAttributes() { | |
182 | 0 | if (attributes == null) { |
183 | 0 | attributes = new HashMap<String, String>(); |
184 | } | |
185 | ||
186 | 0 | return attributes; |
187 | } | |
188 | ||
189 | public void setAttributes(Map<String, String> attributes) { | |
190 | 0 | this.attributes = attributes; |
191 | 0 | } |
192 | ||
193 | ||
194 | /** | |
195 | * Create and last update info for the structure. This is optional | |
196 | * and treated as read only since the data is set by the internals | |
197 | * of the service during maintenance operations. | |
198 | */ | |
199 | ||
200 | public MetaInfo getMetaInfo() { | |
201 | 0 | return metaInfo; |
202 | } | |
203 | ||
204 | public void setMetaInfo(MetaInfo metaInfo) { | |
205 | 0 | this.metaInfo = metaInfo; |
206 | 0 | } |
207 | ||
208 | ||
209 | /** | |
210 | * Type of publication for which this information should be used. | |
211 | */ | |
212 | ||
213 | public String getType() { | |
214 | 0 | return type; |
215 | } | |
216 | ||
217 | public void setType(String type) { | |
218 | 0 | this.type = type; |
219 | 0 | } |
220 | ||
221 | ||
222 | /** | |
223 | * Current state of the information for this publication | |
224 | * type. This value should be constrained to those within the | |
225 | * cluPublishingState enumeration. In general, an "active" record | |
226 | * for a type indicates that the clu should be published within | |
227 | * that media, though that may be further constrained by the cycle | |
228 | * information included. | |
229 | */ | |
230 | ||
231 | public String getState() { | |
232 | 0 | return state; |
233 | } | |
234 | ||
235 | public void setState(String state) { | |
236 | 0 | this.state = state; |
237 | 0 | } |
238 | ||
239 | ||
240 | /** | |
241 | * Identifier for the publishing information. This is set by the | |
242 | * service to be able to determine changes and alterations to the | |
243 | * structure as well as provides a handle for searches. This | |
244 | * structure is not currently accessible through unique | |
245 | * operations, and it is strongly recommended that no external | |
246 | * references to this particular identifier be maintained. | |
247 | */ | |
248 | ||
249 | public String getId() { | |
250 | 0 | return id; |
251 | } | |
252 | ||
253 | public void setId(String id) { | |
254 | 0 | this.id = id; |
255 | 0 | } |
256 | ||
257 | @Override | |
258 | public String toString() { | |
259 | 0 | return "CluPublicationInfo[id=" + id + ", cluId=" + cluId + ", type=" + type + "]"; |
260 | } | |
261 | } |