| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| ConfigViewerAction | 
  | 
  | 1.3333333333333333;1.333 | 
| 1 |  /* | |
| 2 |   * Copyright 2006-2011 The Kuali Foundation | |
| 3 |   * | |
| 4 |   * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
| 5 |   * you may not use this file except in compliance with the License. | |
| 6 |   * You may obtain a copy of the License at | |
| 7 |   * | |
| 8 |   * http://www.opensource.org/licenses/ecl2.php | |
| 9 |   * | |
| 10 |   * Unless required by applicable law or agreed to in writing, software | |
| 11 |   * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 |   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 |   * See the License for the specific language governing permissions and | |
| 14 |   * limitations under the License. | |
| 15 |   */ | |
| 16 | ||
| 17 |  package org.kuali.rice.ksb.messaging.web; | |
| 18 | ||
| 19 |  import org.apache.struts.action.ActionForm; | |
| 20 |  import org.apache.struts.action.ActionForward; | |
| 21 |  import org.apache.struts.action.ActionMapping; | |
| 22 |  import org.apache.struts.action.ActionMessages; | |
| 23 |  import org.kuali.rice.core.api.config.property.ConfigContext; | |
| 24 |  import org.kuali.rice.core.impl.config.property.ConfigLogger; | |
| 25 |  import org.kuali.rice.core.util.ConcreteKeyValue; | |
| 26 |  import org.kuali.rice.core.util.KeyValue; | |
| 27 | ||
| 28 |  import javax.servlet.http.HttpServletRequest; | |
| 29 |  import javax.servlet.http.HttpServletResponse; | |
| 30 |  import java.util.ArrayList; | |
| 31 |  import java.util.List; | |
| 32 |  import java.util.Properties; | |
| 33 |  /** | |
| 34 |   * This is a description of what this class does - g don't forget to fill this in.  | |
| 35 |   *  | |
| 36 |   * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 37 |   * | |
| 38 |   */ | |
| 39 | 0 |  public class ConfigViewerAction extends KSBAction{ | 
| 40 | ||
| 41 |          /** | |
| 42 |           * This overridden method ... | |
| 43 |           *  | |
| 44 |           * @see org.kuali.rice.ksb.messaging.web.KSBAction#establishRequiredState(javax.servlet.http.HttpServletRequest, org.apache.struts.action.ActionForm) | |
| 45 |           */ | |
| 46 | @Override  | |
| 47 |          public ActionMessages establishRequiredState(HttpServletRequest request, | |
| 48 |                          ActionForm actionForm) throws Exception { | |
| 49 | 0 |                  ConfigViewerForm  form = (ConfigViewerForm)actionForm; | 
| 50 | 0 |                  form.setProperties(this.getFilteredConfigList()); | 
| 51 | ||
| 52 | 0 |                  return null; | 
| 53 | }  | |
| 54 | ||
| 55 |          protected List<KeyValue> getFilteredConfigList(){ | |
| 56 | 0 |                  List<KeyValue> lRet = new ArrayList<KeyValue>(); | 
| 57 | 0 |                  Properties p = ConfigContext.getCurrentContextConfig().getProperties(); | 
| 58 | 0 |                  for(Object o: p.keySet()){ | 
| 59 | 0 |                          String key = (String)o;                         | 
| 60 | ||
| 61 | 0 |                          lRet.add(new ConcreteKeyValue(key,ConfigLogger.getDisplaySafeValue(key, p.getProperty(key))));                         | 
| 62 | 0 |                  } | 
| 63 | 0 |                  return lRet; | 
| 64 | }  | |
| 65 | ||
| 66 |          /** | |
| 67 |           * This overridden method ... | |
| 68 |           *  | |
| 69 |           * @see org.kuali.rice.ksb.messaging.web.KSBAction#start(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) | |
| 70 |           */ | |
| 71 | @Override  | |
| 72 |          public ActionForward start(ActionMapping mapping, ActionForm form, | |
| 73 | HttpServletRequest request, HttpServletResponse response)  | |
| 74 |                          throws Exception { | |
| 75 | 0 |                  return mapping.findForward("basic"); | 
| 76 | }  | |
| 77 | ||
| 78 | }  |