1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.web.controller;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.coreservice.framework.parameter.ParameterService;
20 import org.kuali.rice.coreservice.framework.CoreFrameworkServiceLocator;
21 import org.kuali.rice.krad.util.KRADConstants;
22 import org.kuali.rice.krad.web.form.UifFormBase;
23 import org.springframework.stereotype.Controller;
24 import org.springframework.web.bind.annotation.ModelAttribute;
25 import org.springframework.web.bind.annotation.RequestMapping;
26 import org.springframework.web.bind.annotation.RequestParam;
27 import org.springframework.web.servlet.ModelAndView;
28
29 import javax.servlet.http.HttpServletRequest;
30
31
32
33
34
35
36 @Controller
37 public class ModuleLockedController extends UifControllerBase {
38
39 public static final String MODULE_PARAMETER = "moduleNamespace";
40
41 @Override
42 protected UifFormBase createInitialForm() {
43 return new UifFormBase();
44 }
45
46
47
48
49 @MethodAccessible
50 @RequestMapping(value = "/module-locked")
51 public ModelAndView moduleLocked(@ModelAttribute("KualiForm") UifFormBase form,
52 @RequestParam(value = MODULE_PARAMETER, required = true) String moduleNamespaceCode) {
53 ParameterService parameterSerivce = CoreFrameworkServiceLocator.getParameterService();
54
55 String messageParamComponentCode = KRADConstants.DetailTypes.ALL_DETAIL_TYPE;
56 String messageParamName = KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_MESSAGE_PARM;
57 String lockoutMessage = parameterSerivce.getParameterValueAsString(moduleNamespaceCode,
58 messageParamComponentCode, messageParamName);
59
60 if (StringUtils.isBlank(lockoutMessage)) {
61 String defaultMessageParamName = KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_DEFAULT_MESSAGE;
62 lockoutMessage = parameterSerivce.getParameterValueAsString(KRADConstants.KNS_NAMESPACE,
63 messageParamComponentCode, defaultMessageParamName);
64 }
65
66 return getMessageView(form, "Module Locked", lockoutMessage);
67 }
68
69 }