1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.core.personsearch.service.impl; |
17 | |
|
18 | |
import java.util.List; |
19 | |
import java.util.Map; |
20 | |
|
21 | |
import org.kuali.rice.kim.bo.Person; |
22 | |
import org.kuali.rice.kim.bo.entity.KimEntityName; |
23 | |
import org.kuali.rice.kim.bo.entity.KimPrincipal; |
24 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityDefaultInfo; |
25 | |
import org.kuali.rice.kns.util.KualiDecimal; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
public class KsPerson implements Person { |
40 | |
|
41 | |
private String principalId; |
42 | |
private String entityId; |
43 | |
private String name; |
44 | |
private String firstName; |
45 | |
private String middleName; |
46 | |
private String lastName; |
47 | |
private String principalName; |
48 | |
|
49 | 0 | public KsPerson(KimEntityDefaultInfo entity, KimPrincipal principal) { |
50 | 0 | this.principalId = principal.getPrincipalId(); |
51 | 0 | this.entityId = entity.getEntityId(); |
52 | 0 | populateNameInfo(entity, principal); |
53 | 0 | } |
54 | |
|
55 | |
@Override |
56 | |
public String getAddressCityName() { |
57 | |
|
58 | 0 | return null; |
59 | |
} |
60 | |
|
61 | |
@Override |
62 | |
public String getAddressCityNameUnmasked() { |
63 | |
|
64 | 0 | return null; |
65 | |
} |
66 | |
|
67 | |
@Override |
68 | |
public String getAddressCountryCode() { |
69 | |
|
70 | 0 | return null; |
71 | |
} |
72 | |
|
73 | |
@Override |
74 | |
public String getAddressCountryCodeUnmasked() { |
75 | |
|
76 | 0 | return null; |
77 | |
} |
78 | |
|
79 | |
@Override |
80 | |
public String getAddressLine1() { |
81 | |
|
82 | 0 | return null; |
83 | |
} |
84 | |
|
85 | |
@Override |
86 | |
public String getAddressLine1Unmasked() { |
87 | |
|
88 | 0 | return null; |
89 | |
} |
90 | |
|
91 | |
@Override |
92 | |
public String getAddressLine2() { |
93 | |
|
94 | 0 | return null; |
95 | |
} |
96 | |
|
97 | |
@Override |
98 | |
public String getAddressLine2Unmasked() { |
99 | |
|
100 | 0 | return null; |
101 | |
} |
102 | |
|
103 | |
@Override |
104 | |
public String getAddressLine3() { |
105 | |
|
106 | 0 | return null; |
107 | |
} |
108 | |
|
109 | |
@Override |
110 | |
public String getAddressLine3Unmasked() { |
111 | |
|
112 | 0 | return null; |
113 | |
} |
114 | |
|
115 | |
@Override |
116 | |
public String getAddressPostalCode() { |
117 | |
|
118 | 0 | return null; |
119 | |
} |
120 | |
|
121 | |
@Override |
122 | |
public String getAddressPostalCodeUnmasked() { |
123 | |
|
124 | 0 | return null; |
125 | |
} |
126 | |
|
127 | |
@Override |
128 | |
public String getAddressStateCode() { |
129 | |
|
130 | 0 | return null; |
131 | |
} |
132 | |
|
133 | |
@Override |
134 | |
public String getAddressStateCodeUnmasked() { |
135 | |
|
136 | 0 | return null; |
137 | |
} |
138 | |
|
139 | |
@Override |
140 | |
public KualiDecimal getBaseSalaryAmount() { |
141 | |
|
142 | 0 | return null; |
143 | |
} |
144 | |
|
145 | |
@Override |
146 | |
public String getCampusCode() { |
147 | |
|
148 | 0 | return null; |
149 | |
} |
150 | |
|
151 | |
@Override |
152 | |
public List<String> getCampusCodesForAffiliationOfType(String paramString) { |
153 | |
|
154 | 0 | return null; |
155 | |
} |
156 | |
|
157 | |
@Override |
158 | |
public String getEmailAddress() { |
159 | |
|
160 | 0 | return null; |
161 | |
} |
162 | |
|
163 | |
@Override |
164 | |
public String getEmailAddressUnmasked() { |
165 | |
|
166 | 0 | return null; |
167 | |
} |
168 | |
|
169 | |
@Override |
170 | |
public String getEmployeeId() { |
171 | |
|
172 | 0 | return null; |
173 | |
} |
174 | |
|
175 | |
@Override |
176 | |
public String getEmployeeStatusCode() { |
177 | |
|
178 | 0 | return null; |
179 | |
} |
180 | |
|
181 | |
@Override |
182 | |
public String getEmployeeTypeCode() { |
183 | |
|
184 | 0 | return null; |
185 | |
} |
186 | |
|
187 | |
@Override |
188 | |
public String getEntityId() { |
189 | |
|
190 | 0 | return this.entityId; |
191 | |
} |
192 | |
|
193 | |
@Override |
194 | |
public String getEntityTypeCode() { |
195 | |
|
196 | 0 | return null; |
197 | |
} |
198 | |
|
199 | |
@Override |
200 | |
public String getExternalId(String paramString) { |
201 | |
|
202 | 0 | return null; |
203 | |
} |
204 | |
|
205 | |
@Override |
206 | |
public Map<String, String> getExternalIdentifiers() { |
207 | |
|
208 | 0 | return null; |
209 | |
} |
210 | |
|
211 | |
@Override |
212 | |
public String getFirstName() { |
213 | |
|
214 | 0 | return this.firstName; |
215 | |
} |
216 | |
|
217 | |
@Override |
218 | |
public String getFirstNameUnmasked() { |
219 | |
|
220 | 0 | return null; |
221 | |
} |
222 | |
|
223 | |
@Override |
224 | |
public String getLastName() { |
225 | |
|
226 | 0 | return this.lastName; |
227 | |
} |
228 | |
|
229 | |
@Override |
230 | |
public String getLastNameUnmasked() { |
231 | |
|
232 | 0 | return null; |
233 | |
} |
234 | |
|
235 | |
@Override |
236 | |
public String getMiddleName() { |
237 | |
|
238 | 0 | return this.middleName; |
239 | |
} |
240 | |
|
241 | |
@Override |
242 | |
public String getMiddleNameUnmasked() { |
243 | |
|
244 | 0 | return null; |
245 | |
} |
246 | |
|
247 | |
@Override |
248 | |
public String getName() { |
249 | |
|
250 | 0 | return name; |
251 | |
} |
252 | |
|
253 | |
@Override |
254 | |
public String getNameUnmasked() { |
255 | |
|
256 | 0 | return null; |
257 | |
} |
258 | |
|
259 | |
@Override |
260 | |
public String getPhoneNumber() { |
261 | |
|
262 | 0 | return null; |
263 | |
} |
264 | |
|
265 | |
@Override |
266 | |
public String getPhoneNumberUnmasked() { |
267 | |
|
268 | 0 | return null; |
269 | |
} |
270 | |
|
271 | |
@Override |
272 | |
public String getPrimaryDepartmentCode() { |
273 | |
|
274 | 0 | return null; |
275 | |
} |
276 | |
|
277 | |
@Override |
278 | |
public String getPrincipalId() { |
279 | |
|
280 | 0 | return principalId; |
281 | |
} |
282 | |
|
283 | |
@Override |
284 | |
public String getPrincipalName() { |
285 | |
|
286 | 0 | return principalName; |
287 | |
} |
288 | |
|
289 | |
@Override |
290 | |
public boolean hasAffiliationOfType(String paramString) { |
291 | |
|
292 | 0 | return false; |
293 | |
} |
294 | |
|
295 | |
@Override |
296 | |
public boolean isActive() { |
297 | |
|
298 | 0 | return false; |
299 | |
} |
300 | |
|
301 | |
@Override |
302 | |
public void prepareForWorkflow() { |
303 | |
|
304 | 0 | } |
305 | |
|
306 | |
@Override |
307 | |
public void refresh() { |
308 | |
|
309 | 0 | } |
310 | |
|
311 | |
protected void populateNameInfo(KimEntityDefaultInfo entity, KimPrincipal principal) { |
312 | 0 | this.principalName = principal.getPrincipalName(); |
313 | 0 | if (entity != null) { |
314 | 0 | KimEntityName entityName = entity.getDefaultName(); |
315 | 0 | if (entityName != null) { |
316 | 0 | firstName = unNullify(entityName.getFirstNameUnmasked()); |
317 | 0 | middleName = unNullify(entityName.getMiddleNameUnmasked()); |
318 | 0 | lastName = unNullify(entityName.getLastNameUnmasked()); |
319 | 0 | name = unNullify(entityName.getFormattedNameUnmasked()); |
320 | |
} else { |
321 | 0 | firstName = ""; |
322 | 0 | middleName = ""; |
323 | 0 | name = ""; |
324 | 0 | lastName = ""; |
325 | |
} |
326 | |
} |
327 | 0 | } |
328 | |
|
329 | |
private String unNullify( String str ) { |
330 | 0 | if ( str == null ) { |
331 | 0 | return ""; |
332 | |
} |
333 | 0 | return str; |
334 | |
} |
335 | |
|
336 | |
|
337 | |
} |