1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.paygrade.service;
17
18 import java.util.List;
19 import java.util.Map;
20 import java.util.Properties;
21
22 import org.kuali.hr.paygrade.PayGrade;
23 import org.kuali.hr.time.HrEffectiveDateActiveLookupableHelper;
24 import org.kuali.hr.time.service.base.TkServiceLocator;
25 import org.kuali.rice.kns.lookup.HtmlData;
26 import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
27 import org.kuali.rice.krad.bo.BusinessObject;
28 import org.kuali.rice.krad.util.KRADConstants;
29 import org.kuali.rice.krad.util.UrlFactory;
30
31 public class PayGradeLookupableHelper extends HrEffectiveDateActiveLookupableHelper {
32
33 private static final long serialVersionUID = 5424446452538063763L;
34
35 @Override
36 public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) {
37 List<HtmlData> customActionUrls = super.getCustomActionUrls(businessObject, pkNames);
38
39 PayGrade payGrade = (PayGrade) businessObject;
40 String hrPayGradeId = payGrade.getHrPayGradeId();
41
42 Properties params = new Properties();
43 params.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, getBusinessObjectClass().getName());
44 params.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.MAINTENANCE_NEW_METHOD_TO_CALL);
45 params.put("hrPayGradeId", hrPayGradeId);
46 params.put("payGrade", payGrade.getPayGrade());
47 AnchorHtmlData viewUrl = new AnchorHtmlData(UrlFactory.parameterizeUrl(KRADConstants.INQUIRY_ACTION, params), "view");
48 viewUrl.setDisplayText("view");
49 viewUrl.setTarget(AnchorHtmlData.TARGET_BLANK);
50 customActionUrls.add(viewUrl);
51
52 return customActionUrls;
53 }
54
55 @SuppressWarnings({"unchecked"})
56 @Override
57 public List<? extends BusinessObject> getSearchResults(Map<String, String> fieldValues) {
58
59 String payGrade = fieldValues.get("payGrade");
60 String descr = fieldValues.get("description");
61 String active = fieldValues.get("active");
62 String showHistory = fieldValues.get("history");
63
64 List<PayGrade> payGrades = TkServiceLocator.getPayGradeService().getPayGrades(payGrade, descr, active, showHistory);
65
66 return payGrades;
67 }
68 }