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.coa.businessobject;
18  
19  import java.util.ArrayList;
20  import java.util.LinkedHashMap;
21  import java.util.List;
22  
23  import org.apache.log4j.Logger;
24  import org.kuali.ole.sys.context.SpringContext;
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.BusinessObjectService;
28  
29  /**
30   * 
31   */
32  public class AccountDelegateModel extends PersistableBusinessObjectBase implements MutableInactivatable {
33      private static final Logger LOG = Logger.getLogger(AccountDelegateModel.class);
34  
35      private String chartOfAccountsCode;
36      private String organizationCode;
37      private String accountDelegateModelName;
38      private boolean active;
39      private List<AccountDelegateModelDetail> accountDelegateModelDetails;
40  
41      private Organization organization;
42      private Chart chartOfAccounts;
43  
44      /**
45       * Default constructor.
46       */
47      public AccountDelegateModel() {
48          accountDelegateModelDetails = new ArrayList<AccountDelegateModelDetail>();
49      }
50  
51      /**
52       * Gets the chartOfAccountsCode attribute.
53       * 
54       * @return Returns the chartOfAccountsCode
55       */
56      public String getChartOfAccountsCode() {
57          return chartOfAccountsCode;
58      }
59  
60      /**
61       * Sets the chartOfAccountsCode attribute.
62       * 
63       * @param chartOfAccountsCode The chartOfAccountsCode to set.
64       */
65      public void setChartOfAccountsCode(String chartOfAccountsCode) {
66          this.chartOfAccountsCode = chartOfAccountsCode;
67      }
68  
69  
70      /**
71       * Gets the organizationCode attribute.
72       * 
73       * @return Returns the organizationCode
74       */
75      public String getOrganizationCode() {
76          return organizationCode;
77      }
78  
79      /**
80       * Sets the organizationCode attribute.
81       * 
82       * @param organizationCode The organizationCode to set.
83       */
84      public void setOrganizationCode(String organizationCode) {
85          this.organizationCode = organizationCode;
86      }
87  
88  
89      /**
90       * Gets the accountDelegateModelName attribute.
91       * 
92       * @return Returns the accountDelegateModelName
93       */
94      public String getAccountDelegateModelName() {
95          return accountDelegateModelName;
96      }
97  
98      /**
99       * Sets the accountDelegateModelName attribute.
100      * 
101      * @param accountDelegateModelName The accountDelegateModelName to set.
102      */
103     public void setAccountDelegateModelName(String organizationRoutingModelName) {
104         this.accountDelegateModelName = organizationRoutingModelName;
105     }
106 
107 
108     /**
109      * Gets the organization attribute.
110      * 
111      * @return Returns the organization
112      */
113     public Organization getOrganization() {
114         return organization;
115     }
116 
117     /**
118      * Sets the organization attribute.
119      * 
120      * @param organization The organization to set.
121      * @deprecated
122      */
123     public void setOrganization(Organization organization) {
124         this.organization = organization;
125     }
126 
127     /**
128      * Gets the chartOfAccounts attribute.
129      * 
130      * @return Returns the chartOfAccounts
131      */
132     public Chart getChartOfAccounts() {
133         return chartOfAccounts;
134     }
135 
136     /**
137      * Sets the chartOfAccounts attribute.
138      * 
139      * @param chartOfAccounts The chartOfAccounts to set.
140      * @deprecated
141      */
142     public void setChartOfAccounts(Chart chartOfAccounts) {
143         this.chartOfAccounts = chartOfAccounts;
144     }
145 
146     /**
147      * Gets the accountDelegateModelDetails attribute.
148      * 
149      * @return Returns the accountDelegateModelDetails.
150      */
151     public List<AccountDelegateModelDetail> getAccountDelegateModelDetails() {
152         return accountDelegateModelDetails;
153     }
154 
155     /**
156      * Sets the accountDelegateModelDetails attribute value.
157      * 
158      * @param accountDelegateModelDetails The accountDelegateModelDetails to set.
159      */
160     public void setAccountDelegateModelDetails(List<AccountDelegateModelDetail> organizationRoutingModel) {
161         this.accountDelegateModelDetails = organizationRoutingModel;
162     }
163 
164     /**
165      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
166      */
167     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
168         LinkedHashMap m = new LinkedHashMap();
169         m.put("chartOfAccountsCode", this.chartOfAccountsCode);
170         m.put("organizationCode", this.organizationCode);
171         m.put("accountDelegateModelName", this.accountDelegateModelName);
172         return m;
173     }
174 
175     /**
176      * @see org.kuali.rice.krad.bo.PersistableBusinessObjectBase#linkEditableUserFields()
177      */
178     @Override
179     public void linkEditableUserFields() {
180         super.linkEditableUserFields();
181         if (this == null) {
182             throw new IllegalArgumentException("parameter passed in was null");
183         }
184         List bos = new ArrayList();
185         bos.addAll(getAccountDelegateModelDetails());
186         SpringContext.getBean(BusinessObjectService.class).linkUserFields(bos);
187     }
188 
189     /**
190      * Gets the active attribute. 
191      * @return Returns the active.
192      */
193     public boolean isActive() {
194         return active;
195     }
196 
197     /**
198      * Sets the active attribute value.
199      * @param active The active to set.
200      */
201     public void setActive(boolean active) {
202         this.active = active;
203     }
204 }