View Javadoc
1   /*
2    * Copyright 2006 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  
17  package org.kuali.ole.module.purap.businessobject;
18  
19  import org.kuali.ole.sys.context.SpringContext;
20  import org.kuali.ole.vnd.businessobject.VendorDetail;
21  import org.kuali.ole.vnd.document.service.VendorService;
22  import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
23  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
24  
25  import java.util.LinkedHashMap;
26  
27  /**
28   * Purchase Order Quote List Vendor Business Object.
29   */
30  public class PurchaseOrderQuoteListVendor extends PersistableBusinessObjectBase implements MutableInactivatable {
31  
32      protected Integer purchaseOrderQuoteListIdentifier;
33      protected Integer vendorHeaderGeneratedIdentifier;
34      protected Integer vendorDetailAssignedIdentifier;
35      protected boolean active;
36  
37      protected PurchaseOrderQuoteList purchaseOrderQuoteList;
38      protected VendorDetail vendorDetail;
39  
40      /**
41       * Default constructor.
42       */
43      public PurchaseOrderQuoteListVendor() {
44  
45      }
46  
47      public Integer getPurchaseOrderQuoteListIdentifier() {
48          return purchaseOrderQuoteListIdentifier;
49      }
50  
51      public void setPurchaseOrderQuoteListIdentifier(Integer purchaseOrderQuoteListIdentifier) {
52          this.purchaseOrderQuoteListIdentifier = purchaseOrderQuoteListIdentifier;
53      }
54  
55      public Integer getVendorHeaderGeneratedIdentifier() {
56          return vendorHeaderGeneratedIdentifier;
57      }
58  
59      public void setVendorHeaderGeneratedIdentifier(Integer vendorHeaderGeneratedIdentifier) {
60          this.vendorHeaderGeneratedIdentifier = vendorHeaderGeneratedIdentifier;
61      }
62  
63      public Integer getVendorDetailAssignedIdentifier() {
64          return vendorDetailAssignedIdentifier;
65      }
66  
67      public void setVendorDetailAssignedIdentifier(Integer vendorDetailAssignedIdentifier) {
68          this.vendorDetailAssignedIdentifier = vendorDetailAssignedIdentifier;
69      }
70  
71      public PurchaseOrderQuoteList getPurchaseOrderQuoteList() {
72          return purchaseOrderQuoteList;
73      }
74  
75      /**
76       * Sets the purchaseOrderQuoteList attribute value.
77       *
78       * @param purchaseOrderQuoteList The purchaseOrderQuoteList to set.
79       * @deprecated
80       */
81      public void setPurchaseOrderQuoteList(PurchaseOrderQuoteList purchaseOrderQuoteList) {
82          this.purchaseOrderQuoteList = purchaseOrderQuoteList;
83      }
84  
85      public VendorDetail getVendorDetail() {
86          if (vendorHeaderGeneratedIdentifier != null && vendorDetailAssignedIdentifier != null && (vendorDetail == null || vendorDetail.getVendorHeaderGeneratedIdentifier() != vendorHeaderGeneratedIdentifier || vendorDetail.getVendorDetailAssignedIdentifier() != vendorDetailAssignedIdentifier)) {
87              vendorDetail = SpringContext.getBean(VendorService.class).getVendorDetail(vendorHeaderGeneratedIdentifier, vendorDetailAssignedIdentifier);
88          }
89          return vendorDetail;
90      }
91  
92      public void setVendorDetail(VendorDetail vendorDetail) {
93          this.vendorDetail = vendorDetail;
94      }
95  
96      /**
97       * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
98       */
99      protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
100         LinkedHashMap m = new LinkedHashMap();
101         if (this.purchaseOrderQuoteListIdentifier != null) {
102             m.put("purchaseOrderQuoteListIdentifier", this.purchaseOrderQuoteListIdentifier.toString());
103         }
104         if (this.vendorHeaderGeneratedIdentifier != null) {
105             m.put("vendorHeaderGeneratedIdentifier", this.vendorHeaderGeneratedIdentifier.toString());
106         }
107         if (this.vendorDetailAssignedIdentifier != null) {
108             m.put("vendorDetailAssignedIdentifier", this.vendorDetailAssignedIdentifier.toString());
109         }
110         return m;
111     }
112 
113     public boolean isActive() {
114         return active;
115     }
116 
117     public void setActive(boolean active) {
118         this.active = active;
119     }
120 
121 }