001 /**
002 * Copyright 2010 The Kuali Foundation Licensed under the
003 * Educational Community License, Version 2.0 (the "License"); you may
004 * not use this file except in compliance with the License. You may
005 * obtain a copy of the License at
006 *
007 * http://www.osedu.org/licenses/ECL-2.0
008 *
009 * Unless required by applicable law or agreed to in writing,
010 * software distributed under the License is distributed on an "AS IS"
011 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
012 * or implied. See the License for the specific language governing
013 * permissions and limitations under the License.
014 */
015
016 package org.kuali.student.lum.lu.dto;
017
018 import java.io.Serializable;
019 import java.util.Date;
020 import java.util.HashMap;
021 import java.util.Map;
022
023 import javax.xml.bind.annotation.XmlAccessType;
024 import javax.xml.bind.annotation.XmlAccessorType;
025 import javax.xml.bind.annotation.XmlAttribute;
026 import javax.xml.bind.annotation.XmlElement;
027 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
028
029 import org.kuali.student.common.dto.HasAttributes;
030 import org.kuali.student.common.dto.HasTypeState;
031 import org.kuali.student.common.dto.Idable;
032 import org.kuali.student.common.dto.MetaInfo;
033 import org.kuali.student.common.dto.RichTextInfo;
034 import org.kuali.student.core.ws.binding.JaxbAttributeMapListAdapter;
035
036 /**
037 *Information about the LU to document relation.
038 */
039 @XmlAccessorType(XmlAccessType.FIELD)
040 public class LuDocRelationInfo implements Serializable, Idable, HasTypeState, HasAttributes {
041
042 private static final long serialVersionUID = 1L;
043
044 @XmlElement
045 private String cluId;
046
047 @XmlElement
048 private String documentId;
049
050 @XmlElement
051 private String title;
052
053 @XmlElement
054 private RichTextInfo desc;
055
056 @XmlElement
057 private Date effectiveDate;
058
059 @XmlElement
060 private Date expirationDate;
061
062 @XmlElement
063 @XmlJavaTypeAdapter(JaxbAttributeMapListAdapter.class)
064 private Map<String, String> attributes;
065
066 @XmlElement
067 private MetaInfo metaInfo;
068
069 @XmlAttribute
070 private String type;
071
072 @XmlAttribute
073 private String state;
074
075 @XmlAttribute
076 private String id;
077
078 /**
079 * Unique identifier for a Canonical Learning Unit (CLU).
080 */
081 public String getCluId() {
082 return cluId;
083 }
084
085 public void setCluId(String cluId) {
086 this.cluId = cluId;
087 }
088
089 /**
090 * Unique identifier for a document.
091 */
092 public String getDocumentId() {
093 return documentId;
094 }
095
096 public void setDocumentId(String documentId) {
097 this.documentId = documentId;
098 }
099
100 /**
101 * The title of the document usage in the context of the CLU.
102 */
103 public String getTitle() {
104 return title;
105 }
106
107 public void setTitle(String title) {
108 this.title = title;
109 }
110
111 /**
112 * The description of the document usage in the context of the CLU.
113 */
114 public RichTextInfo getDesc() {
115 return desc;
116 }
117
118 public void setDesc(RichTextInfo desc) {
119 this.desc = desc;
120 }
121
122 /**
123 * Date and time that this LU Doc Relation became effective. This is a similar concept to the effective date on enumerated values. When an expiration date has been specified, this field must be less than or equal to the expiration date.
124 */
125 public Date getEffectiveDate() {
126 return effectiveDate;
127 }
128
129 public void setEffectiveDate(Date effectiveDate) {
130 this.effectiveDate = effectiveDate;
131 }
132
133 /**
134 * Date and time that this LU Doc Relation expires. This is a similar concept to the expiration date on enumerated values. If specified, this should be greater than or equal to the effective date. If this field is not specified, then no expiration date has been currently defined and should automatically be considered greater than the effective date.
135 */
136 public Date getExpirationDate() {
137 return expirationDate;
138 }
139
140 public void setExpirationDate(Date expirationDate) {
141 this.expirationDate = expirationDate;
142 }
143
144 /**
145 * List of key/value pairs, typically used for dynamic attributes.
146 */
147 public Map<String, String> getAttributes() {
148 if (attributes == null) {
149 attributes = new HashMap<String, String>();
150 }
151 return attributes;
152 }
153
154 public void setAttributes(Map<String, String> attributes) {
155 this.attributes = attributes;
156 }
157
158 /**
159 * 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.
160 */
161 public MetaInfo getMetaInfo() {
162 return metaInfo;
163 }
164
165 public void setMetaInfo(MetaInfo metaInfo) {
166 this.metaInfo = metaInfo;
167 }
168
169 /**
170 * Unique identifier for an LU document relationship type. Describes the type of usage of the document.
171 */
172 public String getType() {
173 return type;
174 }
175
176 public void setType(String type) {
177 this.type = type;
178 }
179
180 /**
181 * The current status of the LU to document relationship. The values for this field are constrained to those in the luDocRelationState enumeration. A separate setup operation does not exist for retrieval of the meta data around this value.
182 */
183 public String getState() {
184 return state;
185 }
186
187 public void setState(String state) {
188 this.state = state;
189 }
190
191 /**
192 * Unique identifier for a LU to document relation. This is optional, due to the identifier being set at the time of creation. Once the connection has been created, this should be seen as required.
193 */
194 public String getId() {
195 return id;
196 }
197
198 public void setId(String id) {
199 this.id = id;
200 }
201 }