001: /*
002: * Copyright 2006-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.kuali.module.purap.document;
018:
019: import java.util.List;
020:
021: import org.kuali.core.document.DocumentBase;
022: import org.kuali.kfs.bo.SourceAccountingLine;
023: import org.kuali.module.purap.bo.Status;
024:
025: /**
026: * Requisition Document subset containing fields needed for routing and searchable attributes for workflow,
027: * in order to reduce data transfer and improve performance.
028: */
029: public class WorkflowXmlRequisitionDocument extends DocumentBase {
030:
031: // fields from LedgerPostingDocumentBase
032: protected Integer postingYear;
033:
034: // fields from PurchasingAccountsPayableDocumentBase
035: private Integer purapDocumentIdentifier;
036: private Integer vendorHeaderGeneratedIdentifier;
037: private Integer vendorDetailAssignedIdentifier;
038: private String vendorName;
039: private List<SourceAccountingLine> accountsForRouting;
040: private String statusCode;
041:
042: //fields from PurchasingDocumentBase
043: private String chartOfAccountsCode;
044: private String organizationCode;
045: private String deliveryCampusCode;
046: private String deliveryToName;
047: private String requestorPersonName;
048:
049: // fields from RequisitionDocument
050: private String requisitionOrganizationReference1Text;
051: private String requisitionOrganizationReference2Text;
052: private String requisitionOrganizationReference3Text;
053:
054: // dummy reference objects, with same field names as the original reference objects,
055: // but only contain the fields that are actually used in workflow
056: private DummyStatus status;
057:
058: /**
059: * Dummy Reference Object for Status
060: */
061: public class DummyStatus {
062: private String statusDescription;
063:
064: /**
065: * Constructs a DummyStatus.
066: *
067: * @param statusDescription
068: */
069: public DummyStatus(String statusDescription) {
070: this .statusDescription = statusDescription;
071: }
072:
073: public String getStatusDescription() {
074: return this .statusDescription;
075: }
076:
077: public void setStatusDescription(String statusDescription) {
078: this .statusDescription = statusDescription;
079: }
080: }
081:
082: /**
083: * Default constructor.
084: */
085: public WorkflowXmlRequisitionDocument() {
086: super ();
087: }
088:
089: /**
090: * Constructor to populate from RequisitionDocument
091: *
092: * @param document A RequisitionDocument
093: */
094: public WorkflowXmlRequisitionDocument(RequisitionDocument document) {
095: super ();
096:
097: this .documentHeader = document.getDocumentHeader();
098: this .documentNumber = document.getDocumentNumber();
099: this .postingYear = document.getPostingYear();
100:
101: this .purapDocumentIdentifier = document
102: .getPurapDocumentIdentifier();
103: this .vendorHeaderGeneratedIdentifier = document
104: .getVendorHeaderGeneratedIdentifier();
105: this .vendorDetailAssignedIdentifier = document
106: .getVendorDetailAssignedIdentifier();
107: this .vendorName = document.getVendorName();
108: this .accountsForRouting = document.getAccountsForRouting();
109: this .statusCode = document.getStatusCode();
110:
111: this .chartOfAccountsCode = document.getChartOfAccountsCode();
112: this .organizationCode = document.getOrganizationCode();
113: this .deliveryCampusCode = document.getDeliveryCampusCode();
114: this .deliveryToName = document.getDeliveryToName();
115: this .requestorPersonName = document.getRequestorPersonName();
116:
117: this .requisitionOrganizationReference1Text = document
118: .getRequisitionOrganizationReference1Text();
119: this .requisitionOrganizationReference2Text = document
120: .getRequisitionOrganizationReference2Text();
121: this .requisitionOrganizationReference3Text = document
122: .getRequisitionOrganizationReference3Text();
123:
124: this .status = new DummyStatus(document.getStatus()
125: .getStatusDescription());
126: }
127:
128: public List<SourceAccountingLine> getAccountsForRouting() {
129: return accountsForRouting;
130: }
131:
132: public void setAccountsForRouting(
133: List<SourceAccountingLine> accountsForRouting) {
134: this .accountsForRouting = accountsForRouting;
135: }
136:
137: public String getChartOfAccountsCode() {
138: return chartOfAccountsCode;
139: }
140:
141: public void setChartOfAccountsCode(String chartOfAccountsCode) {
142: this .chartOfAccountsCode = chartOfAccountsCode;
143: }
144:
145: public String getDeliveryCampusCode() {
146: return deliveryCampusCode;
147: }
148:
149: public void setDeliveryCampusCode(String deliveryCampusCode) {
150: this .deliveryCampusCode = deliveryCampusCode;
151: }
152:
153: public String getDeliveryToName() {
154: return deliveryToName;
155: }
156:
157: public void setDeliveryToName(String deliveryToName) {
158: this .deliveryToName = deliveryToName;
159: }
160:
161: public String getOrganizationCode() {
162: return organizationCode;
163: }
164:
165: public void setOrganizationCode(String organizationCode) {
166: this .organizationCode = organizationCode;
167: }
168:
169: public Integer getPostingYear() {
170: return postingYear;
171: }
172:
173: public void setPostingYear(Integer postingYear) {
174: this .postingYear = postingYear;
175: }
176:
177: public Integer getPurapDocumentIdentifier() {
178: return purapDocumentIdentifier;
179: }
180:
181: public void setPurapDocumentIdentifier(
182: Integer purapDocumentIdentifier) {
183: this .purapDocumentIdentifier = purapDocumentIdentifier;
184: }
185:
186: public String getRequestorPersonName() {
187: return requestorPersonName;
188: }
189:
190: public void setRequestorPersonName(String requestorPersonName) {
191: this .requestorPersonName = requestorPersonName;
192: }
193:
194: public String getRequisitionOrganizationReference1Text() {
195: return requisitionOrganizationReference1Text;
196: }
197:
198: public void setRequisitionOrganizationReference1Text(
199: String requisitionOrganizationReference1Text) {
200: this .requisitionOrganizationReference1Text = requisitionOrganizationReference1Text;
201: }
202:
203: public String getRequisitionOrganizationReference2Text() {
204: return requisitionOrganizationReference2Text;
205: }
206:
207: public void setRequisitionOrganizationReference2Text(
208: String requisitionOrganizationReference2Text) {
209: this .requisitionOrganizationReference2Text = requisitionOrganizationReference2Text;
210: }
211:
212: public String getRequisitionOrganizationReference3Text() {
213: return requisitionOrganizationReference3Text;
214: }
215:
216: public void setRequisitionOrganizationReference3Text(
217: String requisitionOrganizationReference3Text) {
218: this .requisitionOrganizationReference3Text = requisitionOrganizationReference3Text;
219: }
220:
221: public DummyStatus getStatus() {
222: return status;
223: }
224:
225: public void setStatus(DummyStatus status) {
226: this .status = status;
227: }
228:
229: public String getStatusCode() {
230: return statusCode;
231: }
232:
233: public void setStatusCode(String statusCode) {
234: this .statusCode = statusCode;
235: }
236:
237: public Integer getVendorDetailAssignedIdentifier() {
238: return vendorDetailAssignedIdentifier;
239: }
240:
241: public void setVendorDetailAssignedIdentifier(
242: Integer vendorDetailAssignedIdentifier) {
243: this .vendorDetailAssignedIdentifier = vendorDetailAssignedIdentifier;
244: }
245:
246: public Integer getVendorHeaderGeneratedIdentifier() {
247: return vendorHeaderGeneratedIdentifier;
248: }
249:
250: public void setVendorHeaderGeneratedIdentifier(
251: Integer vendorHeaderGeneratedIdentifier) {
252: this .vendorHeaderGeneratedIdentifier = vendorHeaderGeneratedIdentifier;
253: }
254:
255: public String getVendorName() {
256: return vendorName;
257: }
258:
259: public void setVendorName(String vendorName) {
260: this.vendorName = vendorName;
261: }
262:
263: }
|