1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.r2.core.organization.dto; |
17 | |
|
18 | |
import java.io.Serializable; |
19 | |
import java.util.ArrayList; |
20 | |
import java.util.Date; |
21 | |
import java.util.List; |
22 | |
|
23 | |
import javax.xml.bind.annotation.XmlAccessType; |
24 | |
import javax.xml.bind.annotation.XmlAccessorType; |
25 | |
import javax.xml.bind.annotation.XmlAnyElement; |
26 | |
import javax.xml.bind.annotation.XmlElement; |
27 | |
import javax.xml.bind.annotation.XmlType; |
28 | |
|
29 | |
import org.kuali.student.r2.common.dto.IdNamelessEntityInfo; |
30 | |
import org.kuali.student.r2.common.dto.RichTextInfo; |
31 | |
import org.kuali.student.r2.core.organization.infc.Org; |
32 | |
import org.kuali.student.r2.core.organization.infc.OrgCode; |
33 | |
import org.w3c.dom.Element; |
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | 0 | @XmlAccessorType(XmlAccessType.FIELD) |
41 | |
@XmlType(name = "OrgInfo", propOrder = { |
42 | |
"id", "typeKey", "stateKey", "longName", "longDescr", |
43 | |
"shortName", "sortName", "shortDescr", "orgCodes", |
44 | |
"effectiveDate", "expirationDate", |
45 | |
"meta", "attributes", "_futureElements"}) |
46 | |
public class OrgInfo |
47 | |
extends IdNamelessEntityInfo |
48 | |
implements Org, Serializable { |
49 | |
|
50 | |
private static final long serialVersionUID = 1L; |
51 | |
@XmlElement |
52 | |
private String shortName; |
53 | |
@XmlElement |
54 | |
private String longName; |
55 | |
@XmlElement |
56 | |
private String sortName; |
57 | |
@XmlElement |
58 | |
private RichTextInfo longDescr; |
59 | |
@XmlElement |
60 | |
private RichTextInfo shortDescr; |
61 | |
@XmlElement |
62 | |
private Date effectiveDate; |
63 | |
@XmlElement |
64 | |
private Date expirationDate; |
65 | |
@XmlElement |
66 | |
private List<OrgCodeInfo> orgCodes; |
67 | |
@XmlAnyElement |
68 | |
private List<Element> _futureElements; |
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | 0 | public OrgInfo() { |
74 | 0 | } |
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
public OrgInfo(Org org) { |
82 | 0 | super(org); |
83 | |
|
84 | 0 | if (org != null) { |
85 | 0 | this.shortName = org.getShortName(); |
86 | 0 | this.sortName = org.getSortName(); |
87 | 0 | this.longName = org.getLongName(); |
88 | 0 | if (org.getShortDescr() != null) { |
89 | 0 | this.shortDescr = new RichTextInfo(org.getShortDescr()); |
90 | |
} |
91 | 0 | if (org.getLongDescr() != null) { |
92 | 0 | this.longDescr = new RichTextInfo(org.getLongDescr()); |
93 | |
} |
94 | 0 | if (org.getEffectiveDate() != null) { |
95 | 0 | this.effectiveDate = new Date(org.getEffectiveDate().getTime()); |
96 | |
} |
97 | |
|
98 | 0 | if (org.getExpirationDate() != null) { |
99 | 0 | this.expirationDate = new Date(org.getExpirationDate().getTime()); |
100 | |
} |
101 | |
|
102 | 0 | if (org.getOrgCodes() != null) { |
103 | 0 | this.orgCodes = new ArrayList<OrgCodeInfo>(); |
104 | 0 | for (OrgCode code : org.getOrgCodes()) { |
105 | 0 | this.orgCodes.add(new OrgCodeInfo(code)); |
106 | |
} |
107 | |
} |
108 | |
} |
109 | 0 | } |
110 | |
|
111 | |
@Override |
112 | |
public String getShortName() { |
113 | 0 | return shortName; |
114 | |
} |
115 | |
|
116 | |
public void setShortName(String shortName) { |
117 | 0 | this.shortName = shortName; |
118 | 0 | } |
119 | |
|
120 | |
@Override |
121 | |
public String getLongName() { |
122 | 0 | return longName; |
123 | |
} |
124 | |
|
125 | |
public void setLongName(String longName) { |
126 | 0 | this.longName = longName; |
127 | 0 | } |
128 | |
|
129 | |
@Override |
130 | |
public String getSortName() { |
131 | 0 | return sortName; |
132 | |
} |
133 | |
|
134 | |
public void setSortName(String sortName) { |
135 | 0 | this.sortName = sortName; |
136 | 0 | } |
137 | |
|
138 | |
@Override |
139 | |
public RichTextInfo getShortDescr() { |
140 | 0 | return shortDescr; |
141 | |
} |
142 | |
|
143 | |
public void setShortDescr(RichTextInfo shortDescr) { |
144 | 0 | this.shortDescr = shortDescr; |
145 | 0 | } |
146 | |
|
147 | |
@Override |
148 | |
public RichTextInfo getLongDescr() { |
149 | 0 | return longDescr; |
150 | |
} |
151 | |
|
152 | |
public void setLongDescr(RichTextInfo longDescr) { |
153 | 0 | this.longDescr = longDescr; |
154 | 0 | } |
155 | |
|
156 | |
@Override |
157 | |
public Date getEffectiveDate() { |
158 | 0 | return effectiveDate; |
159 | |
} |
160 | |
|
161 | |
public void setEffectiveDate(Date effectiveDate) { |
162 | 0 | this.effectiveDate = effectiveDate; |
163 | 0 | } |
164 | |
|
165 | |
@Override |
166 | |
public Date getExpirationDate() { |
167 | 0 | return expirationDate; |
168 | |
} |
169 | |
|
170 | |
public void setExpirationDate(Date expirationDate) { |
171 | 0 | this.expirationDate = expirationDate; |
172 | 0 | } |
173 | |
|
174 | |
@Override |
175 | |
public List<OrgCodeInfo> getOrgCodes() { |
176 | 0 | if (orgCodes == null) { |
177 | 0 | orgCodes = new ArrayList<OrgCodeInfo>(); |
178 | |
} |
179 | 0 | return orgCodes; |
180 | |
} |
181 | |
|
182 | |
public void setOrgCodes(List<OrgCodeInfo> orgCodes) { |
183 | 0 | this.orgCodes = orgCodes; |
184 | 0 | } |
185 | |
} |