View Javadoc

1   /*
2    * Copyright 2007-2008 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.rice.kim.inquiry;
17  
18  import java.util.Map;
19  
20  import org.kuali.rice.kim.bo.Person;
21  import org.kuali.rice.kim.service.KIMServiceLocator;
22  import org.kuali.rice.kim.service.PersonService;
23  import org.kuali.rice.kns.bo.BusinessObject;
24  import org.kuali.rice.kns.inquiry.KualiInquirableImpl;
25  
26  /**
27   * This is a description of what this class does - kellerj don't forget to fill this in. 
28   * 
29   * @author Kuali Rice Team (rice.collab@kuali.org)
30   *
31   */
32  public class PersonInquirableImpl extends KualiInquirableImpl {
33  
34  	PersonService<Person> personService; 
35  	
36  	/**
37  	 * This overridden method ...
38  	 * 
39  	 * @see org.kuali.rice.kns.inquiry.KualiInquirableImpl#getBusinessObject(java.util.Map)
40  	 */
41  	@SuppressWarnings("unchecked")
42  	@Override
43  	public BusinessObject getBusinessObject(Map fieldValues) {
44  		return getPersonService().getPerson( fieldValues.get( "principalId" ).toString() );
45  	}
46  
47  	public PersonService<Person> getPersonService() {
48  		if ( personService == null ) {
49  			personService = KIMServiceLocator.getPersonService();
50  		}
51  		return personService;
52  	}
53  }