Clover coverage report - Code Coverage for tapestry-portlet release 4.0-rc-2
Coverage timestamp: Sat Dec 17 2005 09:45:51 PST
file stats: LOC: 61   Methods: 3
NCLOC: 29   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.IEngineService;
 25    import org.apache.tapestry.engine.ILink;
 26    import org.apache.tapestry.services.impl.LinkFactoryImpl;
 27    import org.apache.tapestry.util.QueryParameterMap;
 28   
 29    /**
 30    * Extended version of {@link org.apache.tapestry.services.impl.LinkFactoryImpl} that can
 31    * create generate Portlet URLs.
 32    *
 33    * @author Howard M. Lewis Ship
 34    * @since 4.0
 35    */
 36    public class PortletLinkFactoryImpl extends LinkFactoryImpl
 37    {
 38    private RenderResponse _renderResponse;
 39   
 40    private IRequestCycle _requestCycle;
 41   
 42  0 public void setRenderResponse(RenderResponse renderResponse)
 43    {
 44  0 _renderResponse = renderResponse;
 45    }
 46   
 47  0 public ILink constructLink(IEngineService service, boolean post, Map parameters,
 48    boolean stateful)
 49    {
 50  0 finalizeParameters(service, parameters);
 51   
 52  0 PortletURL url = _renderResponse.createActionURL();
 53   
 54  0 return new PortletLink(_requestCycle, url, new QueryParameterMap(parameters), stateful);
 55    }
 56   
 57  0 public void setRequestCycle(IRequestCycle requestCycle)
 58    {
 59  0 _requestCycle = requestCycle;
 60    }
 61    }