Coverage report

  %line %branch
org.apache.turbine.services.jsp.util.JspNavigation
0% 
0% 

 1  
 package org.apache.turbine.services.jsp.util;
 2  
 
 3  
 /*
 4  
  * Copyright 2001-2005 The Apache Software Foundation.
 5  
  *
 6  
  * Licensed under the Apache License, Version 2.0 (the "License")
 7  
  * you may not use this file except in compliance with the License.
 8  
  * You may obtain a copy of the License at
 9  
  *
 10  
  *     http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15  
  * See the License for the specific language governing permissions and
 16  
  * limitations under the License.
 17  
  */
 18  
 
 19  
 import org.apache.commons.logging.Log;
 20  
 import org.apache.commons.logging.LogFactory;
 21  
 
 22  
 import org.apache.turbine.modules.NavigationLoader;
 23  
 import org.apache.turbine.services.template.TurbineTemplate;
 24  
 import org.apache.turbine.util.RunData;
 25  
 
 26  
 /**
 27  
  * Returns output of a Navigation module. An instance of this is placed in the
 28  
  * request by the JspLayout. This allows template authors to
 29  
  * set the navigation template they'd like to place in their templates.<br>
 30  
  * Here's how it's used in a JSP template:<br>
 31  
  * <code>
 32  
  * <%useBean id="navigation" class="JspNavigation" scope="request"/%>
 33  
  * ...
 34  
  * <%= navigation.setTemplate("admin_navigation.jsp") %>
 35  
  * </code>
 36  
  * @author <a href="john.mcnally@clearink.com">John D. McNally</a>
 37  
  * @author <a href="mbryson@mont.mindspring.com">Dave Bryson</a>
 38  
  * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
 39  
  * @version $Id: JspNavigation.java 264148 2005-08-29 14:21:04Z henning $
 40  
  */
 41  
 public class JspNavigation
 42  
 {
 43  
     /** Logging */
 44  0
     private static Log log = LogFactory.getLog(JspNavigation.class);
 45  
 
 46  
     /* The RunData object */
 47  
     private RunData data;
 48  
 
 49  
     /**
 50  
      * Constructor
 51  
      *
 52  
      * @param data
 53  
      */
 54  
     public JspNavigation(RunData data)
 55  0
     {
 56  0
         this.data = data;
 57  0
     }
 58  
 
 59  
     /**
 60  
      * builds the output of the navigation template
 61  
      * @param template the name of the navigation template
 62  
      */
 63  
     public void setTemplate(String template)
 64  
     {
 65  0
         data.getTemplateInfo().setNavigationTemplate(template);
 66  0
         String module = null;
 67  
         try
 68  
         {
 69  0
             module = TurbineTemplate.getNavigationName(template);
 70  0
             NavigationLoader.getInstance().exec(data, module);
 71  
         }
 72  0
         catch (Exception e)
 73  
         {
 74  0
             String message = "Error processing navigation template:" +
 75  
                     template + " using module: " + module;
 76  0
             log.error(message, e);
 77  
             try
 78  
             {
 79  0
                 data.getOut().print("Error processing navigation template: "
 80  
                         + template + " using module: " + module);
 81  
             }
 82  0
             catch (java.io.IOException ioe)
 83  
             {
 84  0
             }
 85  0
         }
 86  0
     }
 87  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.