1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.lm.leavepayout.service;
17
18
19 import java.util.ArrayList;
20 import java.util.List;
21 import java.util.Map;
22 import java.util.Properties;
23
24 import org.kuali.hr.lm.balancetransfer.BalanceTransfer;
25 import org.kuali.hr.lm.leavepayout.LeavePayout;
26 import org.kuali.hr.time.HrEffectiveDateActiveLookupableHelper;
27 import org.kuali.rice.kns.lookup.HtmlData;
28 import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
29 import org.kuali.rice.krad.bo.BusinessObject;
30 import org.kuali.rice.krad.util.KRADConstants;
31 import org.kuali.rice.krad.util.UrlFactory;
32
33 public class LeavePayoutLookupableHelper extends
34 HrEffectiveDateActiveLookupableHelper {
35
36 private static final long serialVersionUID = 1L;
37
38 @SuppressWarnings("deprecation")
39 @Override
40 public List<HtmlData> getCustomActionUrls(BusinessObject businessObject,
41 List pkNames) {
42 List<HtmlData> customActionUrls = super.getCustomActionUrls(businessObject, pkNames);
43
44 List<HtmlData> copyOfUrls = new ArrayList<HtmlData>();
45 copyOfUrls.addAll(customActionUrls);
46 for(HtmlData aData : copyOfUrls) {
47 if(aData.getMethodToCall().equals(KRADConstants.MAINTENANCE_EDIT_METHOD_TO_CALL)) {
48 customActionUrls.remove(aData);
49 }
50 }
51 LeavePayout lp = (LeavePayout) businessObject;
52 String lpId = lp.getLmLeavePayoutId();
53
54 Properties params = new Properties();
55 params.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, getBusinessObjectClass().getName());
56 params.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.MAINTENANCE_NEW_METHOD_TO_CALL);
57 params.put("lmLeavePayoutId", lpId);
58 AnchorHtmlData viewUrl = new AnchorHtmlData(UrlFactory.parameterizeUrl(KRADConstants.INQUIRY_ACTION, params), "view");
59 viewUrl.setDisplayText("view");
60 viewUrl.setTarget(AnchorHtmlData.TARGET_BLANK);
61 customActionUrls.add(viewUrl);
62
63 return customActionUrls;
64 }
65
66 @Override
67 public List<? extends BusinessObject> getSearchResults(
68 Map<String, String> fieldValues) {
69
70 return super.getSearchResults(fieldValues);
71 }
72
73 }