1 /*
2 * The Kuali Financial System, a comprehensive financial management system for higher education.
3 *
4 * Copyright 2005-2014 The Kuali Foundation
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 package org.kuali.kfs.module.ar.web.struts;
20
21 import org.kuali.kfs.module.ar.ArConstants;
22 import org.kuali.kfs.sys.KFSConstants;
23 import org.kuali.kfs.sys.context.SpringContext;
24 import org.kuali.rice.kim.api.identity.Person;
25
26
27 /**
28 * This class is the action form for Collection Activity Report
29 */
30 public class CollectionActivityReportForm extends ContractsGrantsReportLookupForm {
31
32 private String principalId;
33
34 private final String userLookupRoleNamespaceCode = KFSConstants.OptionalModuleNamespaces.ACCOUNTS_RECEIVABLE;
35 private final String userLookupRoleName = KFSConstants.SysKimApiConstants.ACCOUNTS_RECEIVABLE_COLLECTOR;
36 private Person collector;
37
38 /**
39 * Default constructor.
40 */
41 public CollectionActivityReportForm() {
42 setHtmlFormAction(ArConstants.COLLECTION_ACTIVITY_REPORT_LOOKUP);
43 }
44
45 /**
46 * Gets the principal Id of collector.
47 *
48 * @return Returns the principal id of collector.
49 */
50 public String getPrincipalId() {
51 return principalId;
52 }
53
54 /**
55 * Sets the principal id of collector.
56 *
57 * @param principalId The principal id of collector to set.
58 */
59 public void setPrincipalId(String principalId) {
60 this.principalId = principalId;
61 }
62
63 /**
64 * Gets the lookup role namespace code of user.
65 *
66 * @return Returns lookup role namespace code.
67 */
68 public String getUserLookupRoleNamespaceCode() {
69 return userLookupRoleNamespaceCode;
70 }
71
72 /**
73 * Gets the lookup role name of user.
74 *
75 * @return Returns the lookup role name.
76 */
77 public String getUserLookupRoleName() {
78 return userLookupRoleName;
79 }
80
81 /**
82 * Gets the collector object for given principal id.
83 *
84 * @return Returns the collector object of principal id.
85 */
86 public Person getCollector() {
87 collector = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(principalId, collector);
88 return collector;
89 }
90
91 /**
92 * Sets the collector object.
93 *
94 * @param collector The collector object to set.
95 */
96 public void setCollector(Person collector) {
97 this.collector = collector;
98 }
99
100 }