1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.r2.core.document.dto; |
17 | |
|
18 | |
import org.kuali.student.r2.common.dto.IdEntityInfo; |
19 | |
import org.kuali.student.r2.core.document.infc.Document; |
20 | |
import org.w3c.dom.Element; |
21 | |
|
22 | |
import javax.xml.bind.annotation.*; |
23 | |
import java.io.Serializable; |
24 | |
import java.util.Date; |
25 | |
import java.util.List; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
@XmlAccessorType(XmlAccessType.FIELD) |
37 | |
@XmlType(name = "DocumentInfo", propOrder = { "id", "typeKey", "stateKey", |
38 | |
"name", "descr", "fileName", "documentBinary", "effectiveDate", "expirationDate", |
39 | |
"meta", "attributes", "_futureElements" }) |
40 | |
public class DocumentInfo extends IdEntityInfo implements Document, Serializable { |
41 | |
|
42 | |
private static final long serialVersionUID = 1L; |
43 | |
|
44 | |
@XmlElement |
45 | |
private String fileName; |
46 | |
|
47 | |
@XmlElement |
48 | |
private DocumentBinaryInfo documentBinary; |
49 | |
|
50 | |
@XmlElement |
51 | |
private Date effectiveDate; |
52 | |
|
53 | |
@XmlElement |
54 | |
private Date expirationDate; |
55 | |
|
56 | |
@XmlAnyElement |
57 | |
private List<Element> _futureElements; |
58 | |
|
59 | |
@Override |
60 | |
public String getFileName() { |
61 | 0 | return fileName; |
62 | |
} |
63 | |
|
64 | |
public void setFileName(String fileName) { |
65 | 0 | this.fileName = fileName; |
66 | 0 | } |
67 | |
|
68 | 0 | public DocumentInfo() { |
69 | 0 | } |
70 | |
|
71 | |
public DocumentInfo(Document document) { |
72 | 0 | super(document); |
73 | 0 | if (null != document) { |
74 | 0 | this.fileName = document.getFileName(); |
75 | 0 | this.documentBinary = (null != document.getDocumentBinary()) ? new DocumentBinaryInfo(document.getDocumentBinary()) : null; |
76 | 0 | this.effectiveDate = (null != document.getEffectiveDate()) ? new Date(document.getEffectiveDate().getTime()) : null; |
77 | 0 | this.expirationDate = (null != document.getExpirationDate()) ? new Date(document.getExpirationDate().getTime()) : null; |
78 | |
} |
79 | 0 | } |
80 | |
|
81 | |
@Override |
82 | |
public DocumentBinaryInfo getDocumentBinary() { |
83 | 0 | return documentBinary; |
84 | |
} |
85 | |
|
86 | |
public void setDocumentBinary(DocumentBinaryInfo documentBinary) { |
87 | 0 | this.documentBinary = documentBinary; |
88 | 0 | } |
89 | |
|
90 | |
@Override |
91 | |
public Date getEffectiveDate() { |
92 | 0 | return effectiveDate; |
93 | |
} |
94 | |
|
95 | |
public void setEffectiveDate(Date effectiveDate) { |
96 | 0 | this.effectiveDate = effectiveDate; |
97 | 0 | } |
98 | |
|
99 | |
@Override |
100 | |
public Date getExpirationDate() { |
101 | 0 | return expirationDate; |
102 | |
} |
103 | |
|
104 | |
public void setExpirationDate(Date expirationDate) { |
105 | 0 | this.expirationDate = expirationDate; |
106 | 0 | } |
107 | |
|
108 | |
} |