View Javadoc
1   /*
2    * Copyright 2008 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.ole.pdp.businessobject.lookup;
17  
18  import java.util.Properties;
19  
20  import org.kuali.ole.pdp.PdpPropertyConstants;
21  import org.kuali.ole.pdp.businessobject.PaymentProcess;
22  import org.kuali.ole.pdp.businessobject.ProcessSummary;
23  import org.kuali.ole.sys.OLEConstants;
24  import org.kuali.rice.kns.lookup.HtmlData;
25  import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
26  import org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl;
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 PaymentProcessLookupableHelperService extends KualiLookupableHelperServiceImpl {
32      
33      /**
34       * @see org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#getInquiryUrl(org.kuali.rice.krad.bo.BusinessObject,
35       *      java.lang.String)
36       */
37      @Override
38      public HtmlData getInquiryUrl(BusinessObject bo, String propertyName) {
39          AnchorHtmlData inquiryUrl = (AnchorHtmlData) super.getInquiryUrl(bo, propertyName);
40          PaymentProcess paymentProcess = (PaymentProcess) bo;
41          if (propertyName.equalsIgnoreCase(PdpPropertyConstants.PaymentProcess.PAYMENT_PROCESS_ID)) {
42              Properties params = new Properties();
43              params.put(OLEConstants.DISPATCH_REQUEST_PARAMETER, OLEConstants.SEARCH_METHOD);
44              params.put(OLEConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, ProcessSummary.class.getName());
45              params.put(KRADConstants.DOC_FORM_KEY, "88888888");
46              params.put(OLEConstants.HIDE_LOOKUP_RETURN_LINK, "true");
47              params.put(OLEConstants.RETURN_LOCATION_PARAMETER, OLEConstants.MAPPING_PORTAL + ".do");
48              params.put(PdpPropertyConstants.ProcessSummary.PROCESS_SUMMARY_PROCESS_ID, UrlFactory.encode(String.valueOf(paymentProcess.getId())));
49              String url = UrlFactory.parameterizeUrl(KRADConstants.LOOKUP_ACTION, params);
50              inquiryUrl.setHref(url);
51          }
52          return inquiryUrl;
53      }
54  
55  }