Coverage Report - org.apache.tapestry.portlet.PortletAssetLinkFactoryImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
PortletAssetLinkFactoryImpl
0%
0/9
0%
0/2
2
 
 1  
 // Copyright Jul 10, 2006 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  
 package org.apache.tapestry.portlet;
 15  
 
 16  
 import org.apache.tapestry.IEngine;
 17  
 import org.apache.tapestry.IRequestCycle;
 18  
 import org.apache.tapestry.engine.EngineServiceLink;
 19  
 import org.apache.tapestry.engine.IEngineService;
 20  
 import org.apache.tapestry.engine.ILink;
 21  
 import org.apache.tapestry.engine.ServiceEncoding;
 22  
 import org.apache.tapestry.services.impl.LinkFactoryImpl;
 23  
 import org.apache.tapestry.util.QueryParameterMap;
 24  
 
 25  
 import java.util.Map;
 26  
 
 27  
 
 28  
 /**
 29  
  * Creates {@link EngineServiceLink}s that will re-encode asset URL's
 30  
  * using {@link IRequestCycle#encodeURL(String)}.
 31  
  * 
 32  
  */
 33  0
 public class PortletAssetLinkFactoryImpl extends LinkFactoryImpl
 34  
 {
 35  
     
 36  
     public ILink constructLink(IEngineService service, boolean post, Map parameters,
 37  
             boolean stateful)
 38  
     {
 39  0
         finalizeParameters(service, parameters);
 40  
         
 41  0
         IEngine engine = _requestCycle.getEngine();
 42  
 
 43  0
         QueryParameterMap qmap = new QueryParameterMap(parameters);
 44  
 
 45  0
         ServiceEncoding serviceEncoding = createServiceEncoding(qmap);
 46  
         
 47  
         // Give persistent property strategies a chance to store extra data
 48  
         // into the link.
 49  
         
 50  0
         if (stateful)
 51  0
             _persistenceStrategySource.addParametersForPersistentProperties(serviceEncoding, post);
 52  
         
 53  0
         String fullServletPath = _request.getContextPath() + serviceEncoding.getServletPath();
 54  
         
 55  0
         return new EngineServiceLink(_requestCycle, fullServletPath, engine.getOutputEncoding(),
 56  
                 _codec, _request, qmap, stateful);
 57  
     }
 58  
 }