Coverage Report - org.kuali.rice.kew.routeheader.DocumentRouteHeaderValueContent
 
Classes in this File Line Coverage Branch Coverage Complexity
DocumentRouteHeaderValueContent
0%
0/24
0%
0/8
1.714
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 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  
                 // initialize the content fields
 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