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