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(HttpServletRequest request) {
43 return new UifFormBase();
44 }
45
46
47
48
49 @RequestMapping(value = "/module-locked")
50 public ModelAndView moduleLocked(@ModelAttribute("KualiForm") UifFormBase form,
51 @RequestParam(value = MODULE_PARAMETER, required = true) String moduleNamespaceCode) {
52 ParameterService parameterSerivce = CoreFrameworkServiceLocator.getParameterService();
53
54 String messageParamComponentCode = KRADConstants.DetailTypes.ALL_DETAIL_TYPE;
55 String messageParamName = KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_MESSAGE_PARM;
56 String lockoutMessage = parameterSerivce.getParameterValueAsString(moduleNamespaceCode,
57 messageParamComponentCode, messageParamName);
58
59 if (StringUtils.isBlank(lockoutMessage)) {
60 String defaultMessageParamName = KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_DEFAULT_MESSAGE;
61 lockoutMessage = parameterSerivce.getParameterValueAsString(KRADConstants.KNS_NAMESPACE,
62 messageParamComponentCode, defaultMessageParamName);
63 }
64
65 return getMessageView(form, "Module Locked", lockoutMessage);
66 }
67
68 }