KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > modules > actions > portlets > HelloConfigPortlet


1 package org.apache.jetspeed.modules.actions.portlets;
2
3 import org.apache.jetspeed.portal.portlets.AbstractVTLPortlet;
4
5 // Turbine stuff
6
import org.apache.turbine.modules.Action;
7 import org.apache.turbine.util.RunData;
8
9 // Jetspeed stuff
10
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 /**
18 Action to config the VTL Hello World portlet
19
20 @author <a HREF="mailto:re_carrasco@bco011.sonda.cl">Roberto Carrasco</a>
21 */

22 public class HelloConfigPortlet extends Action
23 {
24     public void doPerform( RunData rundata ) throws Exception JavaDoc
25     {
26
27         if( rundata.getUser() == null || !rundata.getUser().hasLoggedIn() )
28         {
29             return;
30         }
31
32         String JavaDoc 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 JavaDoc 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