KickJava   Java API By Example, From Geeks To Geeks.

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


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 Change the internal state of a portlet from normal to minimized
19
20 @author <a HREF="mailto:re_carrasco@bco011.sonda.cl">Roberto Carrasco</a>
21 */

22 public class MinimizePortlet 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         ( (AbstractVTLPortlet)portlet ).setMinimized( true, rundata );
51     }
52
53 }
54
Popular Tags