1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.tklm.leave.request.approval.web;
17
18 import java.io.Serializable;
19 import java.util.ArrayList;
20 import java.util.List;
21
22 import org.kuali.kpme.tklm.api.leave.request.approval.web.LeaveRequestApprovalEmployeeRowContract;
23 import org.kuali.rice.kim.api.identity.principal.Principal;
24 import org.kuali.rice.kim.api.services.KimApiServiceLocator;
25
26 public class LeaveRequestApprovalEmployeeRow implements Comparable<LeaveRequestApprovalEmployeeRow>, Serializable, LeaveRequestApprovalEmployeeRowContract {
27
28 private static final long serialVersionUID = -2511572060850316312L;
29 private String employeeName;
30 private String principalId;
31 private List<LeaveRequestApprovalRow> leaveRequestList = new ArrayList<LeaveRequestApprovalRow>();
32
33 public int compareTo(LeaveRequestApprovalEmployeeRow row) {
34 return employeeName.compareToIgnoreCase(row.getEmployeeName());
35 }
36
37 public String getUserTargetURLParams() {
38 StringBuffer link = new StringBuffer();
39 link.append("methodToCall=changeTargetPerson");
40 Principal principal = KimApiServiceLocator.getIdentityService().getPrincipal(this.getPrincipalId());
41 link.append("&principalName=").append(principal.getPrincipalName());
42
43 return link.toString();
44 }
45
46 public String getEmployeeName() {
47 return employeeName;
48 }
49
50 public void setEmployeeName(String employeeName) {
51 this.employeeName = employeeName;
52 }
53
54 public String getPrincipalId() {
55 return principalId;
56 }
57
58 public void setPrincipalId(String principalId) {
59 this.principalId = principalId;
60 }
61
62 public List<LeaveRequestApprovalRow> getLeaveRequestList() {
63 return leaveRequestList;
64 }
65
66 public void setLeaveRequestList(List<LeaveRequestApprovalRow> leaveRequestList) {
67 this.leaveRequestList = leaveRequestList;
68 }
69
70 }