1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.edo.candidate.maintenance;
17
18 import org.kuali.kpme.core.bo.HrBusinessObject;
19 import org.kuali.kpme.core.bo.HrBusinessObjectMaintainableImpl;
20 import org.kuali.kpme.edo.candidate.EdoCandidateBo;
21 import org.kuali.kpme.edo.service.EdoServiceLocator;
22 import org.kuali.rice.kim.api.identity.Person;
23 import org.kuali.rice.kim.api.services.KimApiServiceLocator;
24
25 public class EdoCandidateMaintainableImpl extends HrBusinessObjectMaintainableImpl {
26
27 private static final long serialVersionUID = 1L;
28
29 @Override
30 public HrBusinessObject getObjectById(String id) {
31 return EdoCandidateBo.from(EdoServiceLocator.getCandidateService().getCandidate(id));
32 }
33
34
35 public EdoCandidateBo getEdoCandidateInfo(String principalName) {
36 EdoCandidateBo aNewEdoCandidateBo = new EdoCandidateBo();
37
38 Person person = KimApiServiceLocator.getPersonService().getPersonByPrincipalName(principalName);
39
40 if (person != null && person.getFirstName() != null) {
41 aNewEdoCandidateBo.setFirstName(person.getFirstName());
42 }else{
43 aNewEdoCandidateBo.setFirstName("");
44 }
45
46 if (person != null && person.getLastName() != null) {
47 aNewEdoCandidateBo.setLastName(person.getLastName());
48 }else{
49 aNewEdoCandidateBo.setLastName("");
50 }
51
52 if (person != null && person.getPrimaryDepartmentCode() != null) {
53 aNewEdoCandidateBo.setPrimaryDeptId(person.getPrimaryDepartmentCode());
54 }else{
55 aNewEdoCandidateBo.setPrimaryDeptId("");
56 }
57
58 if (person != null && person.getPrimaryDepartmentCode() != null) {
59 aNewEdoCandidateBo.setTnpDeptId(person.getPrimaryDepartmentCode());
60 }else{
61 aNewEdoCandidateBo.setTnpDeptId("");
62 }
63
64 return aNewEdoCandidateBo;
65 }
66
67 }