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 java.util.Properties;
19
20 import org.kuali.rice.kim.bo.impl.GenericPermission;
21 import org.kuali.rice.kim.util.KimConstants;
22 import org.kuali.rice.kns.lookup.KualiLookupableImpl;
23 import org.kuali.rice.kns.util.KNSConstants;
24 import org.kuali.rice.kns.util.UrlFactory;
25
26
27
28
29
30
31
32 public class PermissionLookupableImpl extends KualiLookupableImpl {
33
34
35
36
37
38
39
40 @Override
41 public String getCreateNewUrl() {
42 String url = "";
43
44 if (getLookupableHelperService().allowsNewOrCopyAction(KimConstants.KimUIConstants.KIM_PERMISSION_DOCUMENT_TYPE_NAME)) {
45 Properties parameters = new Properties();
46 parameters.put(KNSConstants.DISPATCH_REQUEST_PARAMETER, KNSConstants.MAINTENANCE_NEW_METHOD_TO_CALL);
47 parameters.put(KNSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, GenericPermission.class.getName());
48
49 url = UrlFactory.parameterizeUrl(KNSConstants.MAINTENANCE_ACTION, parameters);
50 url = "<a href=\"" + url + "\"><img src=\"images/tinybutton-createnew.gif\" alt=\"create new\" width=\"70\" height=\"15\"/></a>";
51 }
52
53 return url;
54 }
55 }