1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.vnd.businessobject.inquiry;
17
18 import org.kuali.ole.sys.OLEConstants;
19 import org.kuali.ole.sys.businessobject.inquiry.KfsInquirableImpl;
20 import org.kuali.ole.vnd.businessobject.VendorDetail;
21 import org.kuali.rice.kns.lookup.HtmlData;
22 import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
23 import org.kuali.rice.krad.bo.BusinessObject;
24 import org.kuali.rice.krad.util.KRADConstants;
25 import org.kuali.rice.krad.util.ObjectUtils;
26
27
28
29
30 public class VendorInquirable extends KfsInquirableImpl {
31
32
33
34
35
36
37
38
39
40 public HtmlData getInquiryUrl(BusinessObject businessObject, String attributeName, boolean forceInquiry) {
41 if (businessObject instanceof VendorDetail && attributeName.equalsIgnoreCase("vendorUrlAddress")) {
42 Object objFieldValue = ObjectUtils.getPropertyValue(businessObject, attributeName);
43 String fieldValue = objFieldValue == null ? OLEConstants.EMPTY_STRING : objFieldValue.toString();
44 return new AnchorHtmlData("http://" + fieldValue, KRADConstants.EMPTY_STRING, ((VendorDetail)businessObject).getVendorName()+" ("+fieldValue+")");
45 }
46
47 return super.getInquiryUrl(businessObject, attributeName, forceInquiry);
48 }
49
50 }