1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.ksb.messaging.web;
17
18 import org.apache.struts.action.ActionForm;
19 import org.apache.struts.action.ActionForward;
20 import org.apache.struts.action.ActionMapping;
21 import org.apache.struts.action.ActionMessages;
22 import org.kuali.rice.core.api.config.property.ConfigContext;
23 import org.kuali.rice.core.api.util.ConcreteKeyValue;
24 import org.kuali.rice.core.api.util.KeyValue;
25 import org.kuali.rice.core.impl.config.property.ConfigLogger;
26
27 import javax.servlet.http.HttpServletRequest;
28 import javax.servlet.http.HttpServletResponse;
29 import java.util.ArrayList;
30 import java.util.List;
31 import java.util.Properties;
32
33
34
35
36
37
38 public class ConfigViewerAction extends KSBAction{
39
40
41
42
43
44
45 @Override
46 public ActionMessages establishRequiredState(HttpServletRequest request,
47 ActionForm actionForm) throws Exception {
48 ConfigViewerForm form = (ConfigViewerForm)actionForm;
49 form.setProperties(this.getFilteredConfigList());
50
51 return null;
52 }
53
54 protected List<KeyValue> getFilteredConfigList(){
55 List<KeyValue> lRet = new ArrayList<KeyValue>();
56 Properties p = ConfigContext.getCurrentContextConfig().getProperties();
57 for(Object o: p.keySet()){
58 String key = (String)o;
59
60 lRet.add(new ConcreteKeyValue(key,ConfigLogger.getDisplaySafeValue(key, p.getProperty(key))));
61 }
62 return lRet;
63 }
64
65
66
67
68
69
70 @Override
71 public ActionForward start(ActionMapping mapping, ActionForm form,
72 HttpServletRequest request, HttpServletResponse response)
73 throws Exception {
74 return mapping.findForward("basic");
75 }
76
77 }