001 /** 002 * Copyright 2004-2013 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.hr.lm.request.approval.web; 017 018 import org.kuali.rice.kim.api.identity.principal.Principal; 019 import org.kuali.rice.kim.api.services.KimApiServiceLocator; 020 021 import java.io.Serializable; 022 import java.util.ArrayList; 023 import java.util.List; 024 025 public class LeaveRequestApprovalEmployeeRow implements Comparable<LeaveRequestApprovalEmployeeRow>, Serializable { 026 027 private String employeeName; 028 private String principalId; 029 private List<LeaveRequestApprovalRow> leaveRequestList = new ArrayList<LeaveRequestApprovalRow>(); 030 031 public int compareTo(LeaveRequestApprovalEmployeeRow row) { 032 return employeeName.compareToIgnoreCase(row.getEmployeeName()); 033 } 034 035 public String getUserTargetURLParams() { 036 StringBuffer link = new StringBuffer(); 037 link.append("methodToCall=changeTargetPerson"); 038 Principal principal = KimApiServiceLocator.getIdentityService().getPrincipal(this.getPrincipalId()); 039 link.append("&principalName=").append(principal.getPrincipalName()); 040 041 return link.toString(); 042 } 043 044 public String getEmployeeName() { 045 return employeeName; 046 } 047 048 public void setEmployeeName(String employeeName) { 049 this.employeeName = employeeName; 050 } 051 052 public String getPrincipalId() { 053 return principalId; 054 } 055 056 public void setPrincipalId(String principalId) { 057 this.principalId = principalId; 058 } 059 060 public List<LeaveRequestApprovalRow> getLeaveRequestList() { 061 return leaveRequestList; 062 } 063 064 public void setLeaveRequestList(List<LeaveRequestApprovalRow> leaveRequestList) { 065 this.leaveRequestList = leaveRequestList; 066 } 067 068 }