1 16 17 package org.apache.jetspeed.util.template; 18 19 import org.apache.turbine.util.RunData; 20 import org.apache.turbine.util.DynamicURI; 21 22 import org.apache.jetspeed.portal.Portlet; 23 import org.apache.jetspeed.portal.PortletController; 24 import org.apache.jetspeed.portal.PanedPortletController; 25 import org.apache.jetspeed.services.rundata.JetspeedRunData; 26 27 28 38 public class PortletTemplateLink extends JetspeedTemplateLink 39 { 40 41 private Portlet portlet = null; 42 private JetspeedRunData data = null; 43 44 47 public PortletTemplateLink() 48 { 49 } 50 51 56 public PortletTemplateLink(RunData data, Portlet portlet) 57 { 58 super(data); 59 this.portlet = portlet; 60 } 61 62 68 public DynamicURI setPanel(String panel) 69 { 70 removePathInfo(getPanelKey()); 71 removeQueryData(getPanelKey()); 72 return addPathInfo(getPanelKey(), panel); 73 } 74 75 78 public String getPanelKey() 79 { 80 String panelName = PANEL_KEY; 81 try 82 { 83 PortletController controller = portlet.getPortletConfig() 84 .getPortletSet() 85 .getController(); 86 87 if (controller instanceof PanedPortletController) 88 { 89 panelName=((PanedPortletController)controller).getParameterName(); 90 } 91 92 } 93 catch (Exception e) 94 { 95 panelName = PANEL_KEY; 96 } 97 98 return panelName; 99 } 100 } 101 | Popular Tags |