Coverage report

  %line %branch
org.apache.jetspeed.aggregator.impl.PortletHeaderRequestImpl
0% 
0% 

 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one or more
 3  
  * contributor license agreements.  See the NOTICE file distributed with
 4  
  * this work for additional information regarding copyright ownership.
 5  
  * The ASF licenses this file to You under the Apache License, Version 2.0
 6  
  * (the "License"); you may not use this file except in compliance with
 7  
  * the License.  You may obtain a copy of the License at
 8  
  * 
 9  
  *      http://www.apache.org/licenses/LICENSE-2.0
 10  
  * 
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.apache.jetspeed.aggregator.impl;
 18  
 
 19  
 import javax.portlet.PortletPreferences;
 20  
 
 21  
 import org.apache.jetspeed.portlet.PortletHeaderRequest;
 22  
 import org.apache.jetspeed.request.RequestContext;
 23  
 import org.apache.pluto.core.impl.PortletPreferencesImpl;
 24  
 import org.apache.pluto.om.common.ParameterSet;
 25  
 import org.apache.pluto.om.common.Parameter;
 26  
 import org.apache.pluto.om.window.PortletWindow;
 27  
 
 28  
 
 29  
 public class PortletHeaderRequestImpl implements PortletHeaderRequest
 30  
 {
 31  
     private RequestContext requestContext;
 32  
     private String portletApplicationContextPath;
 33  
     private PortletWindow portletWindow;
 34  
     private ParameterSet initParamSet;
 35  
     
 36  
     public PortletHeaderRequestImpl( RequestContext requestContext, PortletWindow portletWindow, String portletApplicationContextPath )
 37  0
     {
 38  0
         this.requestContext = requestContext;
 39  0
         this.portletApplicationContextPath = portletApplicationContextPath;
 40  0
         this.portletWindow = portletWindow;
 41  0
     }
 42  
     
 43  
     public String getPortalContextPath()
 44  
     {
 45  0
         return requestContext.getRequest().getContextPath();
 46  
     }    
 47  
     
 48  
     public PortletPreferences getPreferences()
 49  
     {
 50  0
         return new PortletPreferencesImpl(org.apache.pluto.Constants.METHOD_NOOP, this.portletWindow.getPortletEntity());
 51  
     }
 52  
     
 53  
     public String getInitParameter( String name )
 54  
     {
 55  0
         ParameterSet iParamSet = this.initParamSet;
 56  0
         if ( iParamSet == null )
 57  
         {
 58  0
             iParamSet = this.portletWindow.getPortletEntity().getPortletDefinition().getInitParameterSet();
 59  0
             this.initParamSet = iParamSet;
 60  
         }
 61  0
         if ( iParamSet != null )
 62  
         {
 63  0
             Parameter initParam = iParamSet.get( name );
 64  0
             if ( initParam != null )
 65  
             {
 66  0
                 return initParam.getValue();
 67  
             }
 68  
         }
 69  0
         return null;
 70  
     }
 71  
     
 72  
     /**
 73  
      * @return Returns the portletApplicationContextPath.
 74  
      */
 75  
     public String getPortletApplicationContextPath()
 76  
     {
 77  0
         return portletApplicationContextPath;
 78  
     }
 79  
     
 80  
 }

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