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