Clover coverage report - Code Coverage for tapestry-portlet release 4.0-beta-6
Coverage timestamp: Wed Sep 7 2005 18:46:01 EDT
file stats: LOC: 55   Methods: 2
NCLOC: 24   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
PortletLinkFactoryImpl.java - 0% 0% 0%
coverage
 1    // Copyright 2005 The Apache Software Foundation
 2    //
 3    // Licensed under the Apache License, Version 2.0 (the "License");
 4    // you may not use this file except in compliance with the License.
 5    // You may obtain a copy of the License at
 6    //
 7    // http://www.apache.org/licenses/LICENSE-2.0
 8    //
 9    // Unless required by applicable law or agreed to in writing, software
 10    // distributed under the License is distributed on an "AS IS" BASIS,
 11    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12    // See the License for the specific language governing permissions and
 13    // limitations under the License.
 14   
 15    package org.apache.tapestry.portlet;
 16   
 17    import java.util.Map;
 18   
 19    import javax.portlet.PortletURL;
 20    import javax.portlet.RenderResponse;
 21   
 22    import org.apache.hivemind.util.Defense;
 23    import org.apache.tapestry.IRequestCycle;
 24    import org.apache.tapestry.engine.ILink;
 25    import org.apache.tapestry.services.impl.LinkFactoryImpl;
 26    import org.apache.tapestry.util.QueryParameterMap;
 27   
 28    /**
 29    * Extended version of {@link org.apache.tapestry.services.impl.LinkFactoryImpl} that can
 30    * create generate Portlet URLs.
 31    *
 32    * @author Howard M. Lewis Ship
 33    * @since 4.0
 34    */
 35    public class PortletLinkFactoryImpl extends LinkFactoryImpl
 36    {
 37    private RenderResponse _renderResponse;
 38   
 39  0 public void setRenderResponse(RenderResponse renderResponse)
 40    {
 41  0 _renderResponse = renderResponse;
 42    }
 43   
 44  0 public ILink constructLink(IRequestCycle cycle, boolean post, Map parameters, boolean stateful)
 45    {
 46  0 Defense.notNull(cycle, "cycle");
 47  0 Defense.notNull(parameters, "parameters");
 48   
 49  0 squeezeServiceParameters(parameters);
 50   
 51  0 PortletURL url = _renderResponse.createActionURL();
 52   
 53  0 return new PortletLink(cycle, url, new QueryParameterMap(parameters), stateful);
 54    }
 55    }