Coverage Report - org.kuali.rice.ksb.messaging.web.ConfigViewerAction
 
Classes in this File Line Coverage Branch Coverage Complexity
ConfigViewerAction
0%
0/12
0%
0/2
1.333
 
 1  
 /*
 2  
  * Copyright 2007-2010 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  
 package org.kuali.rice.ksb.messaging.web;
 17  
 
 18  
 import java.util.ArrayList;
 19  
 import java.util.List;
 20  
 import java.util.Properties;
 21  
 
 22  
 import javax.servlet.http.HttpServletRequest;
 23  
 import javax.servlet.http.HttpServletResponse;
 24  
 
 25  
 import org.apache.struts.action.ActionForm;
 26  
 import org.apache.struts.action.ActionForward;
 27  
 import org.apache.struts.action.ActionMapping;
 28  
 import org.apache.struts.action.ActionMessages;
 29  
 import org.kuali.rice.core.config.ConfigContext;
 30  
 import org.kuali.rice.core.config.ConfigLogger;
 31  
 import org.kuali.rice.kew.engine.node.KeyValuePair;
 32  
 
 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  
         public ActionMessages establishRequiredState(HttpServletRequest request,
 47  
                         ActionForm actionForm) throws Exception {
 48  0
                 ConfigViewerForm  form = (ConfigViewerForm)actionForm;
 49  0
                 form.setProperties(this.getFilteredConfigList());
 50  
                                 
 51  0
                 return null;
 52  
         }
 53  
         
 54  
         protected List<KeyValuePair> getFilteredConfigList(){
 55  0
                 List<KeyValuePair> lRet = new ArrayList<KeyValuePair>();
 56  0
                 Properties p = ConfigContext.getCurrentContextConfig().getProperties();
 57  0
                 for(Object o: p.keySet()){
 58  0
                         String key = (String)o;                        
 59  
                         
 60  0
                         lRet.add(new KeyValuePair(key,ConfigLogger.getDisplaySafeValue(key, p.getProperty(key))));                        
 61  0
                 }
 62  0
                 return lRet;
 63  
         }
 64  
 
 65  
         /**
 66  
          * This overridden method ...
 67  
          * 
 68  
          * @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)
 69  
          */
 70  
         public ActionForward start(ActionMapping mapping, ActionForm form,
 71  
                         HttpServletRequest request, HttpServletResponse response)
 72  
                         throws Exception {
 73  0
                 return mapping.findForward("basic");
 74  
         }
 75  
 
 76  
 }