1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.kuali.ole.pdp.businessobject;
21
22 import java.sql.Timestamp;
23 import java.util.HashMap;
24 import java.util.Map;
25
26 import org.apache.commons.lang.StringUtils;
27 import org.kuali.ole.sys.businessobject.TimestampedBusinessObjectBase;
28 import org.kuali.ole.sys.context.SpringContext;
29 import org.kuali.rice.core.api.util.type.KualiInteger;
30 import org.kuali.rice.kim.api.identity.Person;
31 import org.kuali.rice.krad.service.KualiModuleService;
32 import org.kuali.rice.krad.service.ModuleService;
33 import org.kuali.rice.location.api.LocationConstants;
34 import org.kuali.rice.location.framework.campus.CampusEbo;
35
36
37
38
39
40 public class PaymentProcess extends TimestampedBusinessObjectBase {
41 protected KualiInteger id;
42 protected Timestamp processTimestamp;
43 protected String campusCode;
44 protected String processUserId;
45 protected Person processUser;
46 protected boolean extractedInd;
47 protected boolean formattedIndicator;
48
49 protected CampusEbo campus;
50
51
52
53
54 public PaymentProcess() {
55 super();
56 this.setExtractedInd(false);
57 this.setFormattedIndicator(false);
58 }
59
60
61
62
63
64
65 public void updateUser(org.kuali.rice.kim.api.identity.PersonService userService) {
66 Person u = userService.getPerson(processUserId);
67 setProcessUser(u);
68 }
69
70
71
72
73
74
75 public String getCampusCode() {
76 return campusCode;
77 }
78
79
80
81
82
83
84 public void setCampusCode(String campusCode) {
85 this.campusCode = campusCode;
86 }
87
88
89
90
91
92
93 public KualiInteger getId() {
94 return id;
95 }
96
97
98
99
100
101
102 public void setId(KualiInteger id) {
103 this.id = id;
104 }
105
106
107
108
109
110
111 public Timestamp getProcessTimestamp() {
112 return processTimestamp;
113 }
114
115
116
117
118
119
120 public void setProcessTimestamp(Timestamp processTimestamp) {
121 this.processTimestamp = processTimestamp;
122 }
123
124
125
126
127
128
129 public Person getProcessUser() {
130 processUser = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(processUserId, processUser);
131 return processUser;
132 }
133
134
135
136
137
138
139 public void setProcessUser(Person processUser) {
140 if (processUser != null) {
141 processUserId = processUser.getPrincipalId();
142 }
143 this.processUser = processUser;
144 }
145
146
147
148
149
150
151 public String getProcessUserId() {
152 return processUserId;
153 }
154
155
156
157
158
159
160 public void setProcessUserId(String processUserId) {
161 this.processUserId = processUserId;
162 }
163
164
165
166
167
168
169
170 public boolean isExtractedInd() {
171 return extractedInd;
172 }
173
174
175
176
177
178
179
180 public void setExtractedInd(boolean extractedInd) {
181 this.extractedInd = extractedInd;
182 }
183
184
185
186
187
188
189 public boolean isFormattedIndicator() {
190 return formattedIndicator;
191 }
192
193
194
195
196
197
198 public void setFormattedIndicator(boolean formattedIndicator) {
199 this.formattedIndicator = formattedIndicator;
200 }
201
202
203
204
205
206
207 public CampusEbo getCampus() {
208 if ( StringUtils.isBlank(campusCode) ) {
209 campus = null;
210 } else {
211 if ( campus == null || !StringUtils.equals( campus.getCode(),campusCode) ) {
212 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CampusEbo.class);
213 if ( moduleService != null ) {
214 Map<String,Object> keys = new HashMap<String, Object>(1);
215 keys.put(LocationConstants.PrimaryKeyConstants.CODE, campusCode);
216 campus = moduleService.getExternalizableBusinessObject(CampusEbo.class, keys);
217 } else {
218 throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed." );
219 }
220 }
221 }
222 return campus;
223 }
224
225
226
227
228
229
230 public void setCampus(CampusEbo campus) {
231 this.campus = campus;
232 }
233
234 }