1 package org.apache.jetspeed.modules.actions.portlets; 2 3 import org.apache.jetspeed.portal.portlets.AbstractVTLPortlet; 4 5 import org.apache.turbine.modules.Action; 7 import org.apache.turbine.util.RunData; 8 9 import org.apache.jetspeed.portal.Portlet; 11 import org.apache.jetspeed.portal.PortletException; 12 import org.apache.jetspeed.portal.factory.PortletFactory; 13 import org.apache.jetspeed.services.registrymanager.RegistryManager; 14 import org.apache.jetspeed.om.registry.peer.PortletEntry; 15 16 17 22 public class HelloConfigPortlet extends Action 23 { 24 public void doPerform( RunData rundata ) throws Exception 25 { 26 27 if( rundata.getUser() == null || !rundata.getUser().hasLoggedIn() ) 28 { 29 return; 30 } 31 32 String name = rundata.getParameters().getString ( "portletName", null ); 33 if ( name == null ) 34 { 35 return; 36 } 37 38 PortletEntry entry = (PortletEntry)RegistryManager.getEntry(RegistryManager.PORTLET_REGISTRY, name ); 39 if ( entry == null ) 40 { 41 return; 42 } 43 44 Portlet portlet = PortletFactory.getPortlet( entry ); 45 if ( portlet == null ) 46 { 47 return; 48 } 49 50 String saludo = rundata.getParameters().getString ( "saludo", null ); 51 if ( saludo == null ) 52 { 53 return; 54 } 55 56 ( (AbstractVTLPortlet)portlet ).setAttribute( "saludo", saludo, rundata ); 57 } 58 59 } 60 | Popular Tags |