001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.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/ecl2.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    package org.kuali.kfs.module.bc.businessobject;
017    
018    import java.util.LinkedHashMap;
019    
020    import org.kuali.kfs.coa.businessobject.Account;
021    import org.kuali.kfs.coa.businessobject.Chart;
022    import org.kuali.kfs.coa.businessobject.SubAccount;
023    import org.kuali.kfs.sys.businessobject.SystemOptions;
024    import org.kuali.kfs.sys.context.SpringContext;
025    import org.kuali.rice.kim.bo.Person;
026    import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
027    
028    /**
029     * Holds information about a budget lock.
030     */
031    public class BudgetConstructionLockSummary extends PersistableBusinessObjectBase {
032        private String lockType;
033        private String lockUserId;
034        private String documentNumber;
035        private Integer universityFiscalYear;
036        private String chartOfAccountsCode;
037        private String accountNumber;
038        private String subAccountNumber;
039        private String positionNumber;
040        private String positionDescription;
041    
042        private Person lockUser;
043        private Chart chart;
044        private Account account;
045        private SubAccount subAccount;
046        private BudgetConstructionPosition budgetConstructionPosition;
047        private SystemOptions options;
048    
049        /**
050         * Default Constructor.
051         */
052        public BudgetConstructionLockSummary() {
053    
054        }
055    
056        /**
057         * Gets the lockType attribute.
058         * 
059         * @return Returns the lockType.
060         */
061        public String getLockType() {
062            return lockType;
063        }
064    
065        /**
066         * Sets the lockType attribute value.
067         * 
068         * @param lockType The lockType to set.
069         */
070        public void setLockType(String lockType) {
071            this.lockType = lockType;
072        }
073    
074        /**
075         * Gets the lockUserId attribute.
076         * 
077         * @return Returns the lockUserId.
078         */
079        public String getLockUserId() {
080            return lockUserId;
081        }
082    
083        /**
084         * Sets the lockUserId attribute value.
085         * 
086         * @param lockUserId The lockUserId to set.
087         */
088        public void setLockUserId(String lockUserId) {
089            this.lockUserId = lockUserId;
090        }
091    
092        /**
093         * Gets the accountNumber attribute.
094         * 
095         * @return Returns the accountNumber.
096         */
097        public String getAccountNumber() {
098            return accountNumber;
099        }
100    
101        /**
102         * Sets the accountNumber attribute value.
103         * 
104         * @param accountNumber The accountNumber to set.
105         */
106        public void setAccountNumber(String accountNumber) {
107            this.accountNumber = accountNumber;
108        }
109    
110        /**
111         * Gets the chartOfAccountsCode attribute.
112         * 
113         * @return Returns the chartOfAccountsCode.
114         */
115        public String getChartOfAccountsCode() {
116            return chartOfAccountsCode;
117        }
118    
119        /**
120         * Sets the chartOfAccountsCode attribute value.
121         * 
122         * @param chartOfAccountsCode The chartOfAccountsCode to set.
123         */
124        public void setChartOfAccountsCode(String chartOfAccountsCode) {
125            this.chartOfAccountsCode = chartOfAccountsCode;
126        }
127    
128        /**
129         * Gets the documentNumber attribute.
130         * 
131         * @return Returns the documentNumber.
132         */
133        public String getDocumentNumber() {
134            return documentNumber;
135        }
136    
137        /**
138         * Sets the documentNumber attribute value.
139         * 
140         * @param documentNumber The documentNumber to set.
141         */
142        public void setDocumentNumber(String documentNumber) {
143            this.documentNumber = documentNumber;
144        }
145    
146        /**
147         * Gets the positionDescription attribute.
148         * 
149         * @return Returns the positionDescription.
150         */
151        public String getPositionDescription() {
152            return positionDescription;
153        }
154    
155        /**
156         * Sets the positionDescription attribute value.
157         * 
158         * @param positionDescription The positionDescription to set.
159         */
160        public void setPositionDescription(String positionDescription) {
161            this.positionDescription = positionDescription;
162        }
163    
164        /**
165         * Gets the positionNumber attribute.
166         * 
167         * @return Returns the positionNumber.
168         */
169        public String getPositionNumber() {
170            return positionNumber;
171        }
172    
173        /**
174         * Sets the positionNumber attribute value.
175         * 
176         * @param positionNumber The positionNumber to set.
177         */
178        public void setPositionNumber(String positionNumber) {
179            this.positionNumber = positionNumber;
180        }
181    
182        /**
183         * Gets the subAccountNumber attribute.
184         * 
185         * @return Returns the subAccountNumber.
186         */
187        public String getSubAccountNumber() {
188            return subAccountNumber;
189        }
190    
191        /**
192         * Sets the subAccountNumber attribute value.
193         * 
194         * @param subAccountNumber The subAccountNumber to set.
195         */
196        public void setSubAccountNumber(String subAccountNumber) {
197            this.subAccountNumber = subAccountNumber;
198        }
199    
200        /**
201         * Gets the universityFiscalYear attribute.
202         * 
203         * @return Returns the universityFiscalYear.
204         */
205        public Integer getUniversityFiscalYear() {
206            return universityFiscalYear;
207        }
208    
209        /**
210         * Sets the universityFiscalYear attribute value.
211         * 
212         * @param universityFiscalYear The universityFiscalYear to set.
213         */
214        public void setUniversityFiscalYear(Integer universityFiscalYear) {
215            this.universityFiscalYear = universityFiscalYear;
216        }
217    
218        /**
219         * Gets the lockUser attribute.
220         * 
221         * @return Returns the lockUser.
222         */
223        public Person getLockUser() {
224            if (lockUserId != null) {
225                lockUser = SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).getPersonByPrincipalName(lockUserId);
226                if (lockUser == null) {
227                    throw new RuntimeException("Could not find lock user " + lockUserId);
228                }
229            }
230    
231            return lockUser;
232        }
233    
234        /**
235         * Sets the lockUser attribute value.
236         * 
237         * @param lockUser The lockUser to set.
238         */
239        public void setLockUser(Person lockUser) {
240            this.lockUser = lockUser;
241        }
242    
243        /**
244         * Gets the chart attribute.
245         * 
246         * @return Returns the chart.
247         */
248        public Chart getChart() {
249            return chart;
250        }
251    
252        /**
253         * Sets the chart attribute value.
254         * 
255         * @param chart The chart to set.
256         */
257        public void setChart(Chart chart) {
258            this.chart = chart;
259        }
260    
261        /**
262         * Gets the account attribute.
263         * 
264         * @return Returns the account.
265         */
266        public Account getAccount() {
267            return account;
268        }
269    
270        /**
271         * Sets the account attribute value.
272         * 
273         * @param account The account to set.
274         */
275        public void setAccount(Account account) {
276            this.account = account;
277        }
278    
279        /**
280         * Gets the subAccount attribute.
281         * 
282         * @return Returns the subAccount.
283         */
284        public SubAccount getSubAccount() {
285            return subAccount;
286        }
287    
288        /**
289         * Sets the subAccount attribute value.
290         * 
291         * @param subAccount The subAccount to set.
292         */
293        public void setSubAccount(SubAccount subAccount) {
294            this.subAccount = subAccount;
295        }
296    
297        /**
298         * Gets the budgetConstructionPosition attribute.
299         * 
300         * @return Returns the budgetConstructionPosition.
301         */
302        public BudgetConstructionPosition getBudgetConstructionPosition() {
303            return budgetConstructionPosition;
304        }
305    
306        /**
307         * Sets the budgetConstructionPosition attribute value.
308         * 
309         * @param budgetConstructionPosition The budgetConstructionPosition to set.
310         */
311        public void setBudgetConstructionPosition(BudgetConstructionPosition budgetConstructionPosition) {
312            this.budgetConstructionPosition = budgetConstructionPosition;
313        }
314    
315        /**
316         * Gets the options attribute.
317         * 
318         * @return Returns the options.
319         */
320        public SystemOptions getOptions() {
321            return options;
322        }
323    
324        /**
325         * Sets the options attribute value.
326         * 
327         * @param options The options to set.
328         */
329        public void setOptions(SystemOptions options) {
330            this.options = options;
331        }
332    
333        /**
334         * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
335         */
336        @Override
337        protected LinkedHashMap toStringMapper() {
338            LinkedHashMap m = new LinkedHashMap();
339            m.put("lockType", this.lockType);
340            m.put("lockUserId", this.lockUserId);
341    
342            return m;
343        }
344    
345    }
346