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 java.util.ArrayList;
019    import java.util.List;
020    
021    import org.kuali.rice.kim.api.identity.Person;
022    import org.kuali.rice.kim.api.services.KimApiServiceLocator;
023    
024    public class LeaveRequestApprovalEmployeeRow implements Comparable<LeaveRequestApprovalEmployeeRow> {
025            
026            private String employeeName;
027            private String principalId;     
028            private List<LeaveRequestApprovalRow> leaveRequestList = new ArrayList<LeaveRequestApprovalRow>();
029            
030            public int compareTo(LeaveRequestApprovalEmployeeRow row) {
031            return employeeName.compareToIgnoreCase(row.getEmployeeName());
032        }
033    
034             public String getUserTargetURLParams() {
035            StringBuffer link = new StringBuffer();
036            link.append("methodToCall=changeTargetPerson");
037            Person person = KimApiServiceLocator.getPersonService().getPerson(this.getPrincipalId());
038            link.append("&principalName=").append(person.getPrincipalName());
039            
040            return link.toString();
041        }
042            
043            public String getEmployeeName() {
044                    return employeeName;
045            }
046    
047            public void setEmployeeName(String employeeName) {
048                    this.employeeName = employeeName;
049            }
050    
051            public String getPrincipalId() {
052                    return principalId;
053            }
054    
055            public void setPrincipalId(String principalId) {
056                    this.principalId = principalId;
057            }
058    
059            public List<LeaveRequestApprovalRow> getLeaveRequestList() {
060                    return leaveRequestList;
061            }
062    
063            public void setLeaveRequestList(List<LeaveRequestApprovalRow> leaveRequestList) {
064                    this.leaveRequestList = leaveRequestList;
065            }
066    
067    }