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.kew.util.KEWConstants; |
21 | |
import org.kuali.rice.kim.service.KIMServiceLocator; |
22 | |
import org.kuali.rice.kim.service.UiDocumentService; |
23 | |
import org.kuali.rice.kim.util.KimCommonUtils; |
24 | |
import org.kuali.rice.kim.util.KimConstants; |
25 | |
import org.kuali.rice.kns.lookup.KualiLookupableImpl; |
26 | |
import org.kuali.rice.kns.util.GlobalVariables; |
27 | |
import org.kuali.rice.kns.util.KNSConstants; |
28 | |
import org.kuali.rice.kns.util.UrlFactory; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | 0 | public class PersonLookupableImpl extends KualiLookupableImpl { |
37 | |
|
38 | |
private UiDocumentService uiDocumentService; |
39 | |
private static final long serialVersionUID = 1707861010746829601L; |
40 | |
|
41 | |
@Override |
42 | |
public String getCreateNewUrl() { |
43 | 0 | String url = ""; |
44 | 0 | if((getLookupableHelperService()).allowsNewOrCopyAction(KimConstants.KimUIConstants.KIM_PERSON_DOCUMENT_TYPE_NAME) |
45 | |
&& getUiDocumentService().canModifyEntity(GlobalVariables.getUserSession().getPrincipalId(), null)){ |
46 | 0 | Properties parameters = new Properties(); |
47 | 0 | parameters.put(KNSConstants.DISPATCH_REQUEST_PARAMETER, KNSConstants.DOC_HANDLER_METHOD); |
48 | 0 | parameters.put(KNSConstants.PARAMETER_COMMAND, KEWConstants.INITIATE_COMMAND); |
49 | 0 | parameters.put(KNSConstants.DOCUMENT_TYPE_NAME, KimConstants.KimUIConstants.KIM_PERSON_DOCUMENT_TYPE_NAME); |
50 | 0 | url = getCreateNewUrl(UrlFactory.parameterizeUrl( |
51 | |
KimCommonUtils.getKimBasePath()+KimConstants.KimUIConstants.KIM_PERSON_DOCUMENT_ACTION, parameters)); |
52 | |
|
53 | |
|
54 | |
|
55 | |
} |
56 | 0 | return url; |
57 | |
} |
58 | |
|
59 | |
public UiDocumentService getUiDocumentService() { |
60 | 0 | if ( uiDocumentService == null ) { |
61 | 0 | uiDocumentService = KIMServiceLocator.getUiDocumentService(); |
62 | |
} |
63 | 0 | return uiDocumentService; |
64 | |
} |
65 | |
|
66 | |
} |