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 java.util.ArrayList;
19  import java.util.List;
20  
21  import org.kuali.rice.kim.api.identity.Person;
22  import org.kuali.rice.kim.api.services.KimApiServiceLocator;
23  
24  public class LeaveRequestApprovalEmployeeRow implements Comparable<LeaveRequestApprovalEmployeeRow> {
25  	
26  	private String employeeName;
27  	private String principalId;	
28  	private List<LeaveRequestApprovalRow> leaveRequestList = new ArrayList<LeaveRequestApprovalRow>();
29  	
30  	public int compareTo(LeaveRequestApprovalEmployeeRow row) {
31          return employeeName.compareToIgnoreCase(row.getEmployeeName());
32      }
33  
34  	 public String getUserTargetURLParams() {
35          StringBuffer link = new StringBuffer();
36          link.append("methodToCall=changeTargetPerson");
37          Person person = KimApiServiceLocator.getPersonService().getPerson(this.getPrincipalId());
38          link.append("&principalName=").append(person.getPrincipalName());
39          
40          return link.toString();
41      }
42  	
43  	public String getEmployeeName() {
44  		return employeeName;
45  	}
46  
47  	public void setEmployeeName(String employeeName) {
48  		this.employeeName = employeeName;
49  	}
50  
51  	public String getPrincipalId() {
52  		return principalId;
53  	}
54  
55  	public void setPrincipalId(String principalId) {
56  		this.principalId = principalId;
57  	}
58  
59  	public List<LeaveRequestApprovalRow> getLeaveRequestList() {
60  		return leaveRequestList;
61  	}
62  
63  	public void setLeaveRequestList(List<LeaveRequestApprovalRow> leaveRequestList) {
64  		this.leaveRequestList = leaveRequestList;
65  	}
66  
67  }