1 package org.kuali.ole.deliver.service;
2
3 import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator;
4 import org.kuali.rice.coreservice.api.parameter.Parameter;
5 import org.kuali.rice.coreservice.api.parameter.ParameterKey;
6
7
8
9
10 public class ParameterValueResolver {
11
12 private static ParameterValueResolver parameterValueResolver;
13
14 private ParameterValueResolver(){
15
16 }
17
18 public static ParameterValueResolver getInstance(){
19 if(null == parameterValueResolver){
20 parameterValueResolver = new ParameterValueResolver();
21 }
22 return parameterValueResolver;
23 }
24
25 public String getParameter(String applicationId, String namespace, String componentId, String parameterName) {
26 ParameterKey parameterKey = ParameterKey.create(applicationId, namespace, componentId,parameterName);
27 Parameter parameter = CoreServiceApiServiceLocator.getParameterRepositoryService().getParameter(parameterKey);
28
29 return parameter!=null?parameter.getValue():null;
30 }
31
32 public Boolean getParameterAsBoolean(String applicationId, String namespace, String componentId, String
33 parameterName) {
34 ParameterKey parameterKey = ParameterKey.create(applicationId, namespace, componentId, parameterName);
35 Boolean parameterValueAsBoolean = CoreServiceApiServiceLocator.getParameterRepositoryService().getParameterValueAsBoolean(parameterKey);
36 return parameterValueAsBoolean != null ? parameterValueAsBoolean : false;
37 }
38
39 }