1 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 35 public class PortletLinkFactoryImpl extends LinkFactoryImpl 36 { 37 private RenderResponse _renderResponse; 38 39 public void setRenderResponse(RenderResponse renderResponse) 40 { 41 _renderResponse = renderResponse; 42 } 43 44 public ILink constructLink(IRequestCycle cycle, Map parameters, boolean stateful) 45 { 46 Defense.notNull(cycle, "cycle"); 47 Defense.notNull(parameters, "parameters"); 48 49 squeezeServiceParameters(parameters); 50 51 PortletURL url = _renderResponse.createActionURL(); 52 53 return new PortletLink(cycle, url, new QueryParameterMap(parameters), stateful); 54 } 55 } | Popular Tags |