View Javadoc
1   /*
2    * Copyright 2008 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.ole.vnd.businessobject;
17  
18  import java.util.ArrayList;
19  import java.util.LinkedHashMap;
20  import java.util.List;
21  
22  import org.kuali.ole.integration.purap.PurchasingAccountsPayableSensitiveData;
23  import org.kuali.ole.sys.context.SpringContext;
24  import org.kuali.ole.vnd.VendorPropertyConstants;
25  import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
26  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
27  import org.kuali.rice.krad.service.KualiModuleService;
28  
29  /**
30   * CommodityCode Business Object
31   */
32  public class CommodityCode extends PersistableBusinessObjectBase implements MutableInactivatable  {
33      
34      private String purchasingCommodityCode;
35      private String commodityDescription;
36      private boolean salesTaxIndicator;
37      private boolean restrictedItemsIndicator;
38      private String sensitiveDataCode;
39      private boolean active;
40      
41      private PurchasingAccountsPayableSensitiveData sensitiveData;
42      
43      private List<CommodityContractManager> commodityContractManagers;
44      
45      public CommodityCode() {
46          commodityContractManagers = new ArrayList<CommodityContractManager>();
47      }
48      
49      public boolean isActive() {
50          return active;
51      }
52  
53      public void setActive(boolean active) {
54          this.active = active;
55      }
56  
57      public String getPurchasingCommodityCode() {
58          return purchasingCommodityCode;
59      }
60  
61      public void setPurchasingCommodityCode(String purchasingCommodityCode) {
62          this.purchasingCommodityCode = purchasingCommodityCode;
63      }
64  
65      public String getCommodityDescription() {
66          return commodityDescription;
67      }
68  
69      public void setCommodityDescription(String commodityDescription) {
70          this.commodityDescription = commodityDescription;
71      }
72  
73      public boolean isRestrictedItemsIndicator() {
74          return restrictedItemsIndicator;
75      }
76  
77      public void setRestrictedItemsIndicator(boolean restrictedItemsIndicator) {
78          this.restrictedItemsIndicator = restrictedItemsIndicator;
79      }
80      
81      public String getSensitiveDataCode() {
82          return sensitiveDataCode;
83      }
84  
85      public void setSensitiveDataCode(String sensitiveDataCode) {
86          this.sensitiveDataCode = sensitiveDataCode;
87      }
88  
89      public PurchasingAccountsPayableSensitiveData getSensitiveData() {
90          /*if (StringUtils.isBlank(sensitiveDataCode)) {
91              if (sensitiveData != null) {
92                  sensitiveData = null;
93              }
94          } else {
95              if (sensitiveData == null || !sensitiveData.getSensitiveDataCode().equals(this.sensitiveDataCode)) {
96                  sensitiveData = SpringContext.getBean(PurchasingAccountsPayableModuleService.class).getSensitiveDataByCode(this.sensitiveDataCode);
97              }
98          }
99          return sensitiveData;*/
100         return sensitiveData = (PurchasingAccountsPayableSensitiveData)SpringContext.getBean(KualiModuleService.class)
101                                 .getResponsibleModuleService(PurchasingAccountsPayableSensitiveData.class)
102                                 .retrieveExternalizableBusinessObjectIfNecessary(this, sensitiveData, "sensitiveData");
103     }
104 
105     public boolean isSalesTaxIndicator() {
106         return salesTaxIndicator;
107     }
108 
109     public void setSalesTaxIndicator(boolean salesTaxIndicator) {
110         this.salesTaxIndicator = salesTaxIndicator;
111     }
112     
113     public List<CommodityContractManager> getCommodityContractManagers() {
114         return commodityContractManagers;
115     }
116 
117     public void setCommodityContractManagers(List<CommodityContractManager> commodityContractManagers) {
118         this.commodityContractManagers = commodityContractManagers;
119     }    
120 
121     /**
122      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
123      */
124     
125     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
126         LinkedHashMap m = new LinkedHashMap();
127         m.put(VendorPropertyConstants.PURCHASING_COMMODITY_CODE, this.purchasingCommodityCode);
128         m.put(VendorPropertyConstants.COMMODITY_DESCRIPTION, this.commodityDescription);
129         return null;
130     }
131 
132 }