1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.ole.module.cg.businessobject;
18
19 import java.util.LinkedHashMap;
20
21 import org.kuali.ole.coa.businessobject.Account;
22 import org.kuali.ole.coa.businessobject.Chart;
23 import org.kuali.ole.integration.cg.ContractsAndGrantsAccountAwardInformation;
24 import org.kuali.ole.sys.context.SpringContext;
25 import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
26 import org.kuali.rice.kim.api.identity.Person;
27 import org.kuali.rice.kim.api.identity.PersonService;
28 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
29 import org.kuali.rice.krad.util.ObjectUtils;
30
31
32
33
34
35 public class AwardAccount extends PersistableBusinessObjectBase implements CGProjectDirector, MutableInactivatable, ContractsAndGrantsAccountAwardInformation {
36 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(AwardAccount.class);
37
38 protected Long proposalNumber;
39 protected String chartOfAccountsCode;
40 protected String accountNumber;
41 protected String principalId;
42 protected boolean active = true;
43
44 protected Account account;
45 protected Chart chartOfAccounts;
46 protected Person projectDirector;
47 protected Award award;
48
49
50
51
52 public AwardAccount() {
53
54 if ( SpringContext.isInitialized() ) {
55 try {
56 projectDirector = (Person)SpringContext.getBean(PersonService.class).getPersonImplementationClass().newInstance();
57 }
58 catch (Exception ex) {
59 LOG.error( "Unable to create a template person object.", ex );
60 }
61 }
62 }
63
64
65
66
67 public Long getProposalNumber() {
68 return proposalNumber;
69 }
70
71
72
73
74
75
76 public void setProposalNumber(Long proposalNumber) {
77 this.proposalNumber = proposalNumber;
78 }
79
80
81
82
83
84 public String getChartOfAccountsCode() {
85 return chartOfAccountsCode;
86 }
87
88
89
90
91
92
93 public void setChartOfAccountsCode(String chartOfAccountsCode) {
94 this.chartOfAccountsCode = chartOfAccountsCode;
95 }
96
97
98
99
100
101 public String getAccountNumber() {
102 return accountNumber;
103 }
104
105
106
107
108
109
110 public void setAccountNumber(String accountNumber) {
111 this.accountNumber = accountNumber;
112 }
113
114
115
116
117 public String getPrincipalId() {
118 return principalId;
119 }
120
121
122
123
124
125
126 public void setPrincipalId(String principalId) {
127 this.principalId = principalId;
128 }
129
130
131
132
133 public Account getAccount() {
134 return account;
135 }
136
137
138
139
140
141
142
143
144 @Deprecated
145 public void setAccount(Account account) {
146 this.account = account;
147 }
148
149
150
151
152 public Chart getChartOfAccounts() {
153 return chartOfAccounts;
154 }
155
156
157
158
159
160
161
162
163 @Deprecated
164 public void setChartOfAccounts(Chart chartOfAccounts) {
165 this.chartOfAccounts = chartOfAccounts;
166 }
167
168
169
170
171 public Person getProjectDirector() {
172 projectDirector = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(principalId, projectDirector);
173 return projectDirector;
174 }
175
176
177
178
179
180
181
182
183 @Deprecated
184 public void setProjectDirector(Person projectDirector) {
185 this.projectDirector = projectDirector;
186 }
187
188
189
190
191 @SuppressWarnings("unchecked")
192
193 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
194 LinkedHashMap m = new LinkedHashMap();
195 if (this.proposalNumber != null) {
196 m.put("proposalNumber", this.proposalNumber.toString());
197 }
198 m.put("chartOfAccountsCode", this.chartOfAccountsCode);
199 m.put("accountNumber", this.accountNumber);
200 return m;
201 }
202
203
204
205
206 public Award getAward() {
207 return award;
208 }
209
210
211
212
213
214
215 public void setAward(Award award) {
216 this.award = award;
217 }
218
219
220
221
222 public boolean isActive() {
223 return active;
224 }
225
226
227
228
229 public void setActive(boolean active) {
230 this.active = active;
231 }
232
233
234
235
236 public String getProjectDirectorName() {
237 if (!ObjectUtils.isNull(projectDirector)) {
238 return projectDirector.getName();
239 }
240 return null;
241 }
242 }
243