Clover coverage report - Code Coverage for tapestry-portlet release 4.0-beta-12
Coverage timestamp: Sun Oct 30 2005 16:27:32 EST
file stats: LOC: 55   Methods: 2
NCLOC: 26   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
PortletStaleLinkExceptionPresenter.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.io.IOException;
 18   
 19    import javax.portlet.ActionRequest;
 20    import javax.portlet.ActionResponse;
 21   
 22    import org.apache.tapestry.IRequestCycle;
 23    import org.apache.tapestry.StaleLinkException;
 24    import org.apache.tapestry.error.StaleLinkExceptionPresenter;
 25    import org.apache.tapestry.services.ServiceConstants;
 26   
 27    /**
 28    * Implementation of {@link org.apache.tapestry.error.StaleLinkExceptionPresenter} for Portlets.
 29    *
 30    * @author Howard M. Lewis Ship
 31    * @since 4.0
 32    */
 33    public class PortletStaleLinkExceptionPresenter implements StaleLinkExceptionPresenter
 34    {
 35    private PortletRequestGlobals _globals;
 36   
 37  0 public void presentStaleLinkException(IRequestCycle cycle, StaleLinkException cause)
 38    throws IOException
 39    {
 40  0 ActionRequest request = _globals.getActionRequest();
 41   
 42  0 request.getPortletSession(true).setAttribute(
 43    PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE,
 44    cause.getMessage());
 45   
 46  0 ActionResponse response = _globals.getActionResponse();
 47   
 48  0 response.setRenderParameter(ServiceConstants.SERVICE, PortletConstants.EXCEPTION_SERVICE);
 49    }
 50   
 51  0 public void setGlobals(PortletRequestGlobals globals)
 52    {
 53  0 _globals = globals;
 54    }
 55    }