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.util.KimCommonUtilsInternal;
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 GroupLookupableImpl extends KualiLookupableImpl {
35
36 private static final long serialVersionUID = -7862240710174441633L;
37
38 public String getCreateNewUrl() {
39 String url = "";
40 if((getLookupableHelperService()).allowsNewOrCopyAction(KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_TYPE_NAME)){
41 Properties parameters = new Properties();
42 parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.DOC_HANDLER_METHOD);
43 parameters.put(KRADConstants.PARAMETER_COMMAND, KewApiConstants.INITIATE_COMMAND);
44 parameters.put(KRADConstants.DOCUMENT_TYPE_NAME, KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_TYPE_NAME);
45 if (StringUtils.isNotBlank(getReturnLocation())) {
46 parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, getReturnLocation());
47 }
48 url = getCreateNewUrl(UrlFactory.parameterizeUrl(
49 KimCommonUtilsInternal.getKimBasePath()+ KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_ACTION, parameters));
50 }
51 return url;
52 }
53
54 }