1 16 17 package org.apache.jetspeed.modules.actions.controllers; 18 19 import org.apache.jetspeed.portal.Portlet; 20 import org.apache.jetspeed.portal.PortletSet; 21 import org.apache.jetspeed.portal.PortletController; 22 import org.apache.jetspeed.portal.PortletControllerConfig; 23 import org.apache.jetspeed.portal.PanedPortletController; 24 import org.apache.jetspeed.services.resources.JetspeedResources; 25 26 import org.apache.turbine.util.RunData; 28 29 import org.apache.velocity.context.Context; 31 32 44 public class PanedControllerAction extends RowColumnControllerAction 45 { 46 50 protected void buildNormalContext( PortletController controller, 51 Context context, 52 RunData rundata ) 53 { 54 PanedPortletController cont = (PanedPortletController)controller; 55 56 PortletSet myPortlets = cont.getPortlets(); 57 PortletControllerConfig conf = cont.getConfig(); 58 59 Portlet portlet = null; 60 String paneID = null; 61 String paneName = rundata.getParameters().getString( JetspeedResources.PATH_PANENAME_KEY ); 62 63 if (null != paneName) 64 { 65 portlet = myPortlets.getPortletByName(paneName); 66 if (portlet != null) 67 { 68 paneID = portlet.getID(); 69 rundata.getParameters().setString(JetspeedResources.PATH_PANEID_KEY, paneID); 70 } 71 } 72 73 if (null == portlet) 74 { 75 paneID = cont.retrievePaneID(rundata, true); 76 portlet = myPortlets.getPortletByID(paneID); 77 if (null == portlet) 78 { 79 paneID = cont.retrievePaneID(rundata, false); 80 portlet = myPortlets.getPortletByID(paneID); 81 } 82 } 83 84 if (portlet != null) 85 { 86 context.put("pane", portlet); 87 String state = portlet.getAttribute("_menustate", "open", rundata); 88 { 91 cont.savePaneID(rundata, paneID); 92 } 93 } 94 } 95 96 } 97 | Popular Tags |