View Javadoc

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.krad.bo;
17  
18  import org.kuali.rice.core.api.exception.RiceRuntimeException;
19  
20  import javax.persistence.Column;
21  import javax.persistence.Entity;
22  import javax.persistence.Id;
23  import javax.persistence.Table;
24  import javax.persistence.Transient;
25  
26  import org.kuali.rice.core.api.exception.RiceRuntimeException;
27  import org.kuali.rice.kew.api.WorkflowDocument;
28  
29  /**
30   * Interface for {@link DocumentHeaderBase} 
31   * 
32   * @author Kuali Rice Team (rice.collab@kuali.org)
33   */
34  @Entity
35  @Table(name="KRNS_DOC_HDR_T")
36  public class DocumentHeader extends PersistableBusinessObjectBase {
37  
38      @Id
39  	@Column(name="DOC_HDR_ID")
40  	private String documentNumber;
41      @Column(name="FDOC_DESC")
42  	private String documentDescription;
43      @Column(name="ORG_DOC_HDR_ID")
44  	private String organizationDocumentNumber;
45      @Column(name="TMPL_DOC_HDR_ID")
46  	private String documentTemplateNumber;
47      @Column(name="EXPLANATION")
48  	private String explanation;
49      
50      @Transient
51      private WorkflowDocument workflowDocument;
52  
53      /**
54       * Constructor - creates empty instances of dependent objects
55       * 
56       */
57      public DocumentHeader() {
58          super();
59      }
60  
61      /**
62       * 
63       * @return workflowDocument
64       */
65      public WorkflowDocument getWorkflowDocument() {
66          if (workflowDocument == null) {
67              throw new RiceRuntimeException("The workflow document is null.  This indicates that the DocumentHeader has not been initialized properly.  This can be caused by not retrieving a document using the DocumentService.");
68          }
69  
70          return workflowDocument;
71      }
72  
73      /**
74       * @return true if the workflowDocument is not null
75       */
76      public boolean hasWorkflowDocument() {
77          return (workflowDocument != null);
78      }
79  
80  
81      /**
82       * 
83       * @param workflowDocument
84       */
85      public void setWorkflowDocument(WorkflowDocument workflowDocument) {
86          this.workflowDocument = workflowDocument;
87      }
88  
89      /**
90       * @return the documentNumber
91       */
92      public String getDocumentNumber() {
93          return this.documentNumber;
94      }
95  
96      /**
97       * @param documentNumber the documentNumber to set
98       */
99      public void setDocumentNumber(String documentNumber) {
100         this.documentNumber = documentNumber;
101     }
102 
103     /**
104      * @return the documentDescription
105      */
106     public String getDocumentDescription() {
107         return this.documentDescription;
108     }
109 
110     /**
111      * @param documentDescription the documentDescription to set
112      */
113     public void setDocumentDescription(String documentDescription) {
114         this.documentDescription = documentDescription;
115     }
116 
117     /**
118      * @return the organizationDocumentNumber
119      */
120     public String getOrganizationDocumentNumber() {
121         return this.organizationDocumentNumber;
122     }
123 
124     /**
125      * @param organizationDocumentNumber the organizationDocumentNumber to set
126      */
127     public void setOrganizationDocumentNumber(String organizationDocumentNumber) {
128         this.organizationDocumentNumber = organizationDocumentNumber;
129     }
130 
131     /**
132      * @return the documentTemplateNumber
133      */
134     public String getDocumentTemplateNumber() {
135         return this.documentTemplateNumber;
136     }
137 
138     /**
139      * @param documentTemplateNumber the documentTemplateNumber to set
140      */
141     public void setDocumentTemplateNumber(String documentTemplateNumber) {
142         this.documentTemplateNumber = documentTemplateNumber;
143     }
144 
145     /**
146      * Gets the explanation attribute. 
147      * @return Returns the explanation.
148      */
149     public String getExplanation() {
150         return explanation;
151     }
152 
153     /**
154      * Sets the explanation attribute value.
155      * @param explanation The explanation to set.
156      */
157     public void setExplanation(String explanation) {
158         this.explanation = explanation;
159     }
160 
161 }