1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.lookup;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.kns.lookup.KualiLookupableImpl;
20 import org.kuali.rice.krad.util.KRADConstants;
21 import org.kuali.rice.krad.util.UrlFactory;
22
23 import java.util.Properties;
24
25
26 public class KPMELookupableImpl extends KualiLookupableImpl {
27
28
29
30
31 @Override
32 public String getCreateNewUrl() {
33 String url = "";
34
35 if (getLookupableHelperService().allowsMaintenanceNewOrCopyAction()) {
36 Properties parameters = new Properties();
37 parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.MAINTENANCE_NEW_METHOD_TO_CALL);
38 parameters.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, this.businessObjectClass.getName());
39 if (StringUtils.isNotBlank(getReturnLocation())) {
40 parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, getReturnLocation());
41 }
42 url = UrlFactory.parameterizeUrl(KRADConstants.MAINTENANCE_ACTION, parameters);
43 url = "<a title=\"Create a new record\" href=\"" + url + "\"><img src=\"images/tinybutton-createnew.gif\" alt=\"create new\" width=\"70\" height=\"15\"/></a>";
44 }
45
46 return url;
47 }
48 }