1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.lm.balancetransfer.service;
17
18 import java.util.ArrayList;
19 import java.util.List;
20 import java.util.Map;
21 import java.util.Properties;
22
23 import org.kuali.hr.lm.balancetransfer.BalanceTransfer;
24 import org.kuali.hr.time.HrEffectiveDateActiveLookupableHelper;
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 BalanceTransferLookupableHelper extends
32 HrEffectiveDateActiveLookupableHelper {
33
34
35
36
37 private static final long serialVersionUID = -6910172165048825489L;
38
39 @SuppressWarnings("deprecation")
40 @Override
41 public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, 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 BalanceTransfer bt = (BalanceTransfer) businessObject;
52 String btId = bt.getBalanceTransferId();
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("balanceTransferId", btId);
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 }