View Javadoc

1   /**
2    * Copyright 2004-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.hr.lm.request.approval.web;
17  
18  import org.kuali.rice.kim.api.identity.principal.Principal;
19  import org.kuali.rice.kim.api.services.KimApiServiceLocator;
20  
21  import java.io.Serializable;
22  import java.util.ArrayList;
23  import java.util.List;
24  
25  public class LeaveRequestApprovalEmployeeRow implements Comparable<LeaveRequestApprovalEmployeeRow>, Serializable {
26  	
27  	private String employeeName;
28  	private String principalId;	
29  	private List<LeaveRequestApprovalRow> leaveRequestList = new ArrayList<LeaveRequestApprovalRow>();
30  	
31  	public int compareTo(LeaveRequestApprovalEmployeeRow row) {
32          return employeeName.compareToIgnoreCase(row.getEmployeeName());
33      }
34  
35  	 public String getUserTargetURLParams() {
36          StringBuffer link = new StringBuffer();
37          link.append("methodToCall=changeTargetPerson");
38          Principal principal = KimApiServiceLocator.getIdentityService().getPrincipal(this.getPrincipalId());
39          link.append("&principalName=").append(principal.getPrincipalName());
40          
41          return link.toString();
42      }
43  	
44  	public String getEmployeeName() {
45  		return employeeName;
46  	}
47  
48  	public void setEmployeeName(String employeeName) {
49  		this.employeeName = employeeName;
50  	}
51  
52  	public String getPrincipalId() {
53  		return principalId;
54  	}
55  
56  	public void setPrincipalId(String principalId) {
57  		this.principalId = principalId;
58  	}
59  
60  	public List<LeaveRequestApprovalRow> getLeaveRequestList() {
61  		return leaveRequestList;
62  	}
63  
64  	public void setLeaveRequestList(List<LeaveRequestApprovalRow> leaveRequestList) {
65  		this.leaveRequestList = leaveRequestList;
66  	}
67  
68  }