/** * @see * org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#getInquiryUrl(org.kuali.rice.krad.bo.BusinessObject, * java.lang.String) */ @Override public HtmlData getInquiryUrl(BusinessObject bo, String propertyName) { AnchorHtmlData inquiryUrl = (AnchorHtmlData) super.getInquiryUrl(bo, propertyName); Batch batch = (Batch) bo; if (propertyName.equalsIgnoreCase(PdpPropertyConstants.BatchConstants.BATCH_ID)) { Properties params = new Properties(); params.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.SEARCH_METHOD); params.put(KFSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, PaymentDetail.class.getName()); params.put(KRADConstants.DOC_FORM_KEY, "88888888"); params.put(KFSConstants.HIDE_LOOKUP_RETURN_LINK, "true"); params.put( KFSConstants.BACK_LOCATION, configurationService.getPropertyValueAsString(KRADConstants.APPLICATION_URL_KEY) + "/" + KFSConstants.MAPPING_PORTAL + ".do"); params.put( PdpPropertyConstants.PaymentDetail.PAYMENT_GROUP_BATCH_ID, UrlFactory.encode(String.valueOf(batch.getId()))); String url = UrlFactory.parameterizeUrl(KRADConstants.LOOKUP_ACTION, params); inquiryUrl.setHref(url); } return inquiryUrl; }
/** * @see * org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#getCustomActionUrls(org.kuali.rice.krad.bo.BusinessObject, * java.util.List) */ @Override public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) { if (businessObject instanceof Batch) { Person person = GlobalVariables.getUserSession().getPerson(); Batch batch = (Batch) businessObject; Integer batchId = batch.getId().intValue(); List<HtmlData> anchorHtmlDataList = new ArrayList<HtmlData>(); String linkText = KFSConstants.EMPTY_STRING; String url = KFSConstants.EMPTY_STRING; String basePath = configurationService.getPropertyValueAsString(KFSConstants.APPLICATION_URL_KEY) + "/" + PdpConstants.Actions.BATCH_SEARCH_DETAIL_ACTION; if (pdpAuthorizationService.hasCancelPaymentPermission(person.getPrincipalId()) && batchMaintenanceService.doBatchPaymentsHaveOpenOrHeldStatus(batchId)) { Properties params = new Properties(); params.put( KFSConstants.DISPATCH_REQUEST_PARAMETER, PdpConstants.ActionMethods.CONFIRM_CANCEL_ACTION); params.put( PdpParameterConstants.BatchConstants.BATCH_ID_PARAM, UrlFactory.encode(String.valueOf(batchId))); url = UrlFactory.parameterizeUrl(basePath, params); linkText = configurationService.getPropertyValueAsString( PdpKeyConstants.BatchConstants.LinkText.CANCEL_BATCH); AnchorHtmlData anchorHtmlData = new AnchorHtmlData(url, PdpConstants.ActionMethods.CONFIRM_CANCEL_ACTION, linkText); anchorHtmlDataList.add(anchorHtmlData); } if (pdpAuthorizationService.hasHoldPaymentPermission(person.getPrincipalId())) { if (batchMaintenanceService.doBatchPaymentsHaveHeldStatus(batchId)) { Properties params = new Properties(); params.put( KFSConstants.DISPATCH_REQUEST_PARAMETER, PdpConstants.ActionMethods.CONFIRM_REMOVE_HOLD_ACTION); params.put( PdpParameterConstants.BatchConstants.BATCH_ID_PARAM, UrlFactory.encode(String.valueOf(batchId))); url = UrlFactory.parameterizeUrl(basePath, params); linkText = configurationService.getPropertyValueAsString( PdpKeyConstants.BatchConstants.LinkText.REMOVE_BATCH_HOLD); AnchorHtmlData anchorHtmlData = new AnchorHtmlData( url, PdpConstants.ActionMethods.CONFIRM_REMOVE_HOLD_ACTION, linkText); anchorHtmlDataList.add(anchorHtmlData); } else if (batchMaintenanceService.doBatchPaymentsHaveOpenStatus(batchId)) { Properties params = new Properties(); params.put( KFSConstants.DISPATCH_REQUEST_PARAMETER, PdpConstants.ActionMethods.CONFIRM_HOLD_ACTION); params.put( PdpParameterConstants.BatchConstants.BATCH_ID_PARAM, UrlFactory.encode(String.valueOf(batchId))); url = UrlFactory.parameterizeUrl(basePath, params); linkText = configurationService.getPropertyValueAsString( PdpKeyConstants.BatchConstants.LinkText.HOLD_BATCH); AnchorHtmlData anchorHtmlData = new AnchorHtmlData(url, PdpConstants.ActionMethods.CONFIRM_HOLD_ACTION, linkText); anchorHtmlDataList.add(anchorHtmlData); } } if (anchorHtmlDataList.isEmpty()) { AnchorHtmlData anchorHtmlData = new AnchorHtmlData(url, " ", " "); anchorHtmlDataList.add(anchorHtmlData); } return anchorHtmlDataList; } return super.getEmptyActionUrls(); }