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.ArrayList;
020    import java.util.Date;
021    import java.util.HashMap;
022    import java.util.List;
023    import java.util.Map;
024    
025    import javax.xml.bind.annotation.XmlAccessType;
026    import javax.xml.bind.annotation.XmlAccessorType;
027    import javax.xml.bind.annotation.XmlAttribute;
028    import javax.xml.bind.annotation.XmlElement;
029    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
030    
031    import org.kuali.student.common.dto.HasAttributes;
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.ws.binding.JaxbAttributeMapListAdapter;
036    
037    /**
038     *Detailed information about a single CLU Set.
039     */ 
040    @XmlAccessorType(XmlAccessType.FIELD)
041    public class CluSetInfo implements Serializable, Idable, HasAttributes {
042    
043        private static final long serialVersionUID = 1L;
044    
045        @XmlElement
046        private String name;
047    
048        @XmlElement
049        private RichTextInfo descr;
050    
051        @XmlElement
052        private Date effectiveDate;
053    
054        @XmlElement
055        private Date expirationDate;
056    
057        @XmlElement
058        private MembershipQueryInfo membershipQuery;
059        
060        @XmlElement
061        private String adminOrg;
062    
063        @XmlElement
064        private Boolean isReusable;
065    
066        @XmlElement
067        private Boolean isReferenceable;
068        
069        @XmlElement
070        private List<String> cluSetIds;
071    
072        @XmlElement
073        private List<String> cluIds;
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        /**
092         * Friendly name of the CLU Set.
093         */
094        public String getName() {
095            return name;
096        }
097    
098        public void setName(String name) {
099            this.name = name;
100        }
101    
102        /**
103         * Narrative description of the CLU Set.
104         */
105        public RichTextInfo getDescr() {
106            return descr;
107        }
108    
109        public void setDescr(RichTextInfo descr) {
110            this.descr = descr;
111        }
112    
113        /**
114         * Date and time that this CLU Set 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.
115         */
116        public Date getEffectiveDate() {
117            return effectiveDate;
118        }
119    
120        public void setEffectiveDate(Date effectiveDate) {
121            this.effectiveDate = effectiveDate;
122        }
123    
124        /**
125         * Date and time that this CLU Set 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.
126         */
127        public Date getExpirationDate() {
128            return expirationDate;
129        }
130    
131        public void setExpirationDate(Date expirationDate) {
132            this.expirationDate = expirationDate;
133        }
134    
135    //    /**
136    //     * Specifies a search for CLU identifiers. Present for dynamic CLU Sets
137    //     */
138    //    public CluCriteriaInfo getCluCriteria() {
139    //        return cluCriteria;
140    //    }
141    //
142    //    public void setCluCriteria(CluCriteriaInfo cluCriteria) {
143    //        this.cluCriteria = cluCriteria;
144    //    }
145    
146        /**
147         * List of identifiers of directly contained CLU Sets. Present for enumerated CLU Sets.
148         */
149        public List<String> getCluSetIds() {
150            if (cluSetIds == null) {
151                cluSetIds = new ArrayList<String>();
152            }
153            return cluSetIds;
154        }
155    
156        public void setCluSetIds(List<String> cluSetIds) {
157            this.cluSetIds = cluSetIds;
158        }
159    
160        /**
161         * List of identifiers of directly contained CLUs. Present for enumerated CLU Sets.
162         */
163        public List<String> getCluIds() {
164            if (cluIds == null) {
165                cluIds = new ArrayList<String>();
166            }
167            return cluIds;
168        }
169    
170        public void setCluIds(List<String> cluIds) {
171            this.cluIds = cluIds;
172        }
173    
174        /**
175         * List of key/value pairs, typically used for dynamic attributes.
176         */
177        public Map<String, String> getAttributes() {
178            if (attributes == null) {
179                attributes = new HashMap<String, String>();
180            }
181            return attributes;
182        }
183    
184        public void setAttributes(Map<String, String> attributes) {
185            this.attributes = attributes;
186        }
187    
188        /**
189         * 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.
190         */
191        public MetaInfo getMetaInfo() {
192            return metaInfo;
193        }
194    
195        public void setMetaInfo(MetaInfo metaInfo) {
196            this.metaInfo = metaInfo;
197        }
198    
199        /**
200         * Unique identifier for a CLU Set. This is optional, due to the identifier being set at the time of creation. Once the CLU Set has been created, this should be seen as required.
201         */
202        public String getId() {
203            return id;
204        }
205    
206        public void setId(String id) {
207            this.id = id;
208        }
209    
210            public MembershipQueryInfo getMembershipQuery() {
211                    return membershipQuery;
212            }
213    
214            public void setMembershipQuery(MembershipQueryInfo membershipQuery) {
215                    this.membershipQuery = membershipQuery;
216            }
217    
218            /**
219             * Gets the clu set type. 
220             * Once set at create time, this field may not be updated.
221             * 
222             * @return Clu set type
223             */
224            public String getType() {
225                    return type;
226            }
227    
228            /**
229             * Sets the clu set type. 
230             * Once set at create time, this field may not be updated.
231             * 
232             * @param type Clu set type
233             */
234            public void setType(String type) {
235                    this.type = type;
236            }
237    
238            public String getState() {
239                    return state;
240            }
241    
242            public void setState(String state) {
243                    this.state = state;
244            }
245    
246            public String getAdminOrg() {
247                    return adminOrg;
248            }
249    
250            public void setAdminOrg(String adminOrg) {
251                    this.adminOrg = adminOrg;
252            }
253    
254            public Boolean getIsReusable() {
255                    return isReusable;
256            }
257    
258            public void setIsReusable(Boolean isReusable) {
259                    this.isReusable = isReusable;
260            }
261    
262            public Boolean getIsReferenceable() {
263                    return isReferenceable;
264            }
265    
266            public void setIsReferenceable(Boolean isReferenceable) {
267                    this.isReferenceable = isReferenceable;
268            }               
269    }