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
016package org.kuali.student.r2.lum.clu.dto;
017
018import org.kuali.student.r2.common.dto.IdEntityInfo;
019import org.kuali.student.r2.lum.clu.infc.Clu;
020import org.kuali.student.r2.lum.clu.infc.CluSetTreeView;
021
022import javax.xml.bind.annotation.XmlAccessType;
023import javax.xml.bind.annotation.XmlAccessorType;
024import javax.xml.bind.annotation.XmlAnyElement;
025import javax.xml.bind.annotation.XmlElement;
026import javax.xml.bind.annotation.XmlType;
027import java.io.Serializable;
028import java.util.ArrayList;
029import java.util.Date;
030import java.util.List;
031
032@XmlAccessorType(XmlAccessType.FIELD)
033@XmlType(name = "CluSetTreeViewInfo", propOrder = {"id", "descr", "stateKey", "typeKey", "name", "adminOrg", "isReusable", "isReferenceable", "cluSets", "clus",
034        "effectiveDate", "expirationDate", "meta", "attributes" , "_futureElements" }) 
035public class CluSetTreeViewInfo extends IdEntityInfo implements CluSetTreeView, Serializable {
036
037    private static final long serialVersionUID = 1L;
038
039    @XmlElement
040    private String adminOrg;
041
042    @XmlElement
043    private Boolean isReusable;
044
045    @XmlElement
046    private Boolean isReferenceable;
047
048    @XmlElement
049    private List<CluSetTreeViewInfo> cluSets;
050
051    @XmlElement
052    private List<CluInfo> clus;
053
054    @XmlElement
055    private Date effectiveDate;
056
057    @XmlElement
058    private Date expirationDate;
059
060    @XmlAnyElement
061    private List<Object> _futureElements;  
062
063    public CluSetTreeViewInfo() {
064
065    }
066
067    public CluSetTreeViewInfo(CluSetTreeView cluSetTreeView) {
068        super(cluSetTreeView);
069        if (null != cluSetTreeView) {
070            this.adminOrg = cluSetTreeView.getAdminOrg();
071            this.isReusable = cluSetTreeView.getIsReusable();
072            this.isReferenceable = cluSetTreeView.getIsReferenceable();
073            this.cluSets = new ArrayList<CluSetTreeViewInfo>();
074            for (CluSetTreeView cluSetTreeView1 : cluSetTreeView.getCluSets()) {
075                this.cluSets.add(new CluSetTreeViewInfo(cluSetTreeView1));
076            }
077            this.clus = new ArrayList<CluInfo>();
078            for (Clu clu : cluSetTreeView.getClus()) {
079                this.clus.add(new CluInfo(clu));
080            }
081            this.effectiveDate = (null != cluSetTreeView.getEffectiveDate()) ? new Date(cluSetTreeView.getEffectiveDate().getTime()) : null;
082            this.expirationDate = (null != cluSetTreeView.getExpirationDate()) ? new Date(cluSetTreeView.getExpirationDate().getTime()) : null;
083        }
084    }
085
086    @Override
087    public String getAdminOrg() {
088        return adminOrg;
089    }
090
091    public void setAdminOrg(String adminOrg) {
092        this.adminOrg = adminOrg;
093    }
094
095    @Override
096    public Boolean getIsReusable() {
097        return isReusable;
098    }
099
100    public void setIsReusable(Boolean isReusable) {
101        this.isReusable = isReusable;
102    }
103
104    @Override
105    public Boolean getIsReferenceable() {
106        return isReferenceable;
107    }
108
109    public void setIsReferenceable(Boolean isReferenceable) {
110        this.isReferenceable = isReferenceable;
111    }
112
113    @Override
114    public List<CluSetTreeViewInfo> getCluSets() {
115        return cluSets;
116    }
117
118    public void setCluSets(List<CluSetTreeViewInfo> cluSets) {
119        this.cluSets = cluSets;
120    }
121
122    @Override
123    public List<CluInfo> getClus() {
124        return clus;
125    }
126
127    public void setClus(List<CluInfo> clus) {
128        this.clus = clus;
129    }
130
131    @Override
132    public Date getEffectiveDate() {
133        return effectiveDate;
134    }
135
136    public void setEffectiveDate(Date effectiveDate) {
137        this.effectiveDate = effectiveDate;
138    }
139
140    @Override
141    public Date getExpirationDate() {
142        return expirationDate;
143    }
144
145    public void setExpirationDate(Date expirationDate) {
146        this.expirationDate = expirationDate;
147    }
148}