/* * The Kuali Financial System, a comprehensive financial management system for higher education. * * Copyright 2005-2014 The Kuali Foundation * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.kuali.kfs.module.tem.businessobject.lookup; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.log4j.Logger; import org.kuali.kfs.module.tem.businessobject.TemProfileAccount; import org.kuali.kfs.module.tem.service.TemProfileService; import org.kuali.kfs.module.tem.service.TravelService; import org.kuali.kfs.module.tem.service.TravelerService; import org.kuali.rice.kim.api.identity.PersonService; import org.kuali.rice.kns.lookup.HtmlData; import org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl; import org.kuali.rice.krad.bo.BusinessObject; import org.kuali.rice.krad.util.KRADConstants; @SuppressWarnings("deprecation") public class TemProfileAccountLookupableHelperServiceImpl extends KualiLookupableHelperServiceImpl { public static Logger LOG = Logger.getLogger(TemProfileAccountLookupableHelperServiceImpl.class); private TravelerService travelerService; private TravelService travelService; private PersonService personService; private TemProfileService temProfileService; @SuppressWarnings("rawtypes") @Override public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) { List<HtmlData> htmlDataList = new ArrayList<HtmlData>(); TemProfileAccount account = (TemProfileAccount) businessObject; List<String> primaryKeys = getBusinessObjectMetaDataService().listPrimaryKeyFieldNames(account.getProfile().getClass()); htmlDataList.add(getUrlData(account.getProfile(), KRADConstants.MAINTENANCE_EDIT_METHOD_TO_CALL, primaryKeys)); return htmlDataList; } /** * @see org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl#getSearchResults(java.util.Map) */ @Override public List<? extends BusinessObject> getSearchResults(Map<String, String> fieldValues) { String principalId = fieldValues.get("profile.principal.principalId"); fieldValues.remove("profile.principal.principalId"); fieldValues.put("profile.principalId", principalId); return super.getSearchResults(fieldValues); } /** * @see org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#allowsMaintenanceNewOrCopyAction() */ @Override public boolean allowsMaintenanceNewOrCopyAction() { return false; } /** * Gets the travelerService attribute. * * @return Returns the travelerService. */ public TravelerService getTravelerService() { return travelerService; } /** * Sets the travelerService attribute value. * * @param travelerService The travelerService to set. */ public void setTravelerService(TravelerService travelerService) { this.travelerService = travelerService; } /** * Sets the personService attribute value. * * @param personService The personService to set. */ public void setPersonService(PersonService personService) { this.personService = personService; } /** * Gets the personService attribute. * * @return Returns the personService. */ public PersonService getPersonService() { return personService; } /** * Gets the travelService attribute. * * @return Returns the travelService. */ public TravelService getTravelService() { return travelService; } /** * Sets the travelService attribute value. * * @param travelService The travelService to set. */ public void setTravelService(TravelService travelService) { this.travelService = travelService; } /** * Gets the temProfileService attribute. * * @return Returns the temProfileService. */ public TemProfileService getTemProfileService() { return temProfileService; } /** * Sets the temProfileService attribute value. * * @param temProfileService The temProfileService to set. */ public void setTemProfileService(TemProfileService temProfileService) { this.temProfileService = temProfileService; } }