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.kew.api.KewApiConstants;
20 import org.kuali.rice.kim.api.KimConstants;
21 import org.kuali.rice.kim.impl.type.KimTypeBo;
22 import org.kuali.rice.kns.lookup.KualiLookupableImpl;
23 import org.kuali.rice.krad.util.KRADConstants;
24 import org.kuali.rice.krad.util.UrlFactory;
25
26 import java.util.Properties;
27
28
29
30
31
32
33
34 public class RoleLookupableImpl extends KualiLookupableImpl {
35
36 private static final long serialVersionUID = -543816772634893348L;
37
38 @Override
39 public String getCreateNewUrl() {
40 String url = "";
41 if((getLookupableHelperService()).allowsNewOrCopyAction(KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_TYPE_NAME)){
42 Properties parameters = new Properties();
43 parameters.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, KimTypeBo.class.getName());
44
45 parameters.put(KRADConstants.PARAMETER_COMMAND, KewApiConstants.INITIATE_COMMAND);
46 parameters.put(KRADConstants.DOC_FORM_KEY, KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_SHORT_KEY);
47 if (StringUtils.isNotBlank(getReturnLocation())) {
48 parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, getReturnLocation());
49 }
50 url = getCreateNewUrl(UrlFactory.parameterizeUrl(KRADConstants.LOOKUP_ACTION, parameters));
51
52 }
53 return url;
54 }
55
56 }