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