1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.kew.routeheader; |
18 | |
|
19 | |
import java.io.Serializable; |
20 | |
|
21 | |
import javax.persistence.Basic; |
22 | |
import javax.persistence.Column; |
23 | |
import javax.persistence.Entity; |
24 | |
import javax.persistence.FetchType; |
25 | |
import javax.persistence.Id; |
26 | |
import javax.persistence.Lob; |
27 | |
import javax.persistence.NamedQuery; |
28 | |
import javax.persistence.Table; |
29 | |
|
30 | |
import org.kuali.rice.core.util.xml.XmlJotter; |
31 | |
|
32 | |
@Entity |
33 | |
@Table(name="KREW_DOC_HDR_CNTNT_T") |
34 | |
@NamedQuery(name="DocumentRouteHeaderValueContent.FindByDocumentId", query="select d from DocumentRouteHeaderValueContent as d where d.documentId = :documentId") |
35 | |
public class DocumentRouteHeaderValueContent implements Serializable { |
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
private static final long serialVersionUID = 1L; |
41 | |
@Id |
42 | |
@Column(name="DOC_HDR_ID") |
43 | |
private String documentId; |
44 | |
@Lob |
45 | |
@Basic(fetch=FetchType.LAZY) |
46 | |
@Column(name="DOC_CNTNT_TXT") |
47 | |
private String documentContent; |
48 | |
|
49 | 0 | public DocumentRouteHeaderValueContent() {} |
50 | |
|
51 | 0 | public DocumentRouteHeaderValueContent(String documentId) { |
52 | 0 | this.documentId = documentId; |
53 | 0 | } |
54 | |
|
55 | |
public String getDocumentContent() { |
56 | 0 | return documentContent; |
57 | |
} |
58 | |
public void setDocumentContent(String documentContent) { |
59 | 0 | this.documentContent = documentContent; |
60 | 0 | } |
61 | |
public String getDocumentId() { |
62 | 0 | return documentId; |
63 | |
} |
64 | |
public void setDocumentId(String documentId) { |
65 | 0 | this.documentId = documentId; |
66 | 0 | } |
67 | |
|
68 | |
public static org.kuali.rice.kew.api.document.DocumentContent to(DocumentRouteHeaderValueContent content) { |
69 | 0 | if (content == null) { |
70 | 0 | return null; |
71 | |
} |
72 | 0 | org.kuali.rice.kew.api.document.DocumentContent.Builder builder = org.kuali.rice.kew.api.document.DocumentContent.Builder.create(content.getDocumentId()); |
73 | |
|
74 | 0 | builder.setApplicationContent(""); |
75 | 0 | builder.setAttributeContent(""); |
76 | 0 | builder.setSearchableContent(""); |
77 | 0 | DocumentContent documentContent = new StandardDocumentContent(content.getDocumentContent()); |
78 | 0 | if (documentContent.getApplicationContent() != null) { |
79 | 0 | builder.setApplicationContent(XmlJotter.jotNode(documentContent.getApplicationContent())); |
80 | |
} |
81 | 0 | if (documentContent.getAttributeContent() != null) { |
82 | 0 | builder.setAttributeContent(XmlJotter.jotNode(documentContent.getAttributeContent())); |
83 | |
} |
84 | 0 | if (documentContent.getSearchableContent() != null) { |
85 | 0 | builder.setSearchableContent(XmlJotter.jotNode(documentContent.getSearchableContent())); |
86 | |
} |
87 | 0 | return builder.build(); |
88 | |
} |
89 | |
|
90 | |
} |
91 | |
|