View Javadoc

1   /**
2    * Copyright 2004-2012 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.time;
17  
18  import java.util.List;
19  import java.util.Map;
20  
21  import org.apache.commons.lang.StringUtils;
22  import org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl;
23  import org.kuali.rice.krad.bo.BusinessObject;
24  
25  public class TkLookupableHelper extends KualiLookupableHelperServiceImpl {
26  
27  	/**
28  	 * 
29  	 */
30  	private static final long serialVersionUID = 1L;
31  
32  	@Override
33  	public List<? extends BusinessObject> getSearchResults(
34  			Map<String, String> fieldValues) {
35  		if (fieldValues.containsKey("workArea")
36  				&& StringUtils.equals(fieldValues.get("workArea"), "%")) {
37  			fieldValues.put("workArea", "");
38  		}
39  		if (fieldValues.containsKey("jobNumber")
40  				&& StringUtils.equals(fieldValues.get("jobNumber"), "%")) {
41  			fieldValues.put("jobNumber", "");
42  		}
43  		return super.getSearchResults(fieldValues);
44  	}
45  
46  	@Override
47  	protected void validateSearchParameterWildcardAndOperators(
48  			String attributeName, String attributeValue) {
49  		if (!StringUtils.equals(attributeValue, "%")) {
50  			super.validateSearchParameterWildcardAndOperators(attributeName,
51  					attributeValue);
52  		}
53  	}
54  
55  }