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.core.framework.parameter.ParameterService; |
20 | |
import org.kuali.rice.core.framework.services.CoreFrameworkServiceLocator; |
21 | |
import org.kuali.rice.krad.util.KRADConstants; |
22 | |
import org.springframework.stereotype.Controller; |
23 | |
import org.springframework.web.bind.annotation.RequestMapping; |
24 | |
import org.springframework.web.bind.annotation.RequestParam; |
25 | |
import org.springframework.web.servlet.ModelAndView; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
@Controller |
34 | 0 | public class ModuleLockedController { |
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
public static final String MODULE_LOCKED_MESSAGE = "moduleLockedMessage"; |
41 | |
public static final String MODULE_PARAMETER = "moduleNamespace"; |
42 | |
|
43 | |
@RequestMapping(value = "/module-locked") |
44 | |
public ModelAndView moduleLocked(@RequestParam(value = MODULE_PARAMETER, required = true) String moduleNamespaceCode) { |
45 | 0 | ModelAndView modelAndView = new ModelAndView("moduleLocked"); |
46 | 0 | ParameterService parameterSerivce = CoreFrameworkServiceLocator.getParameterService(); |
47 | 0 | String messageParamComponentCode = KRADConstants.DetailTypes.OLTP_LOCKOUT_DETAIL_TYPE; |
48 | 0 | String messageParamName = KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_MESSAGE_PARM; |
49 | 0 | String lockoutMessage = parameterSerivce.getParameterValueAsString(moduleNamespaceCode, messageParamComponentCode, messageParamName); |
50 | |
|
51 | 0 | if(StringUtils.isBlank(lockoutMessage)) { |
52 | 0 | String defaultMessageParamName = KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_DEFAULT_MESSAGE; |
53 | 0 | lockoutMessage = parameterSerivce.getParameterValueAsString(KRADConstants.KRAD_NAMESPACE, messageParamComponentCode, defaultMessageParamName); |
54 | |
} |
55 | 0 | modelAndView.addObject(MODULE_LOCKED_MESSAGE, lockoutMessage); |
56 | 0 | return modelAndView; |
57 | |
} |
58 | |
} |