KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.apache.jetspeed.modules.actions.portlets;
2
3 // Turbine stuff
4
import org.apache.turbine.modules.Action;
5 import org.apache.turbine.util.RunData;
6
7 // Jetspeed stuff
8
import org.apache.jetspeed.portal.Portlet;
9 import org.apache.jetspeed.portal.PortletException;
10 import org.apache.jetspeed.portal.factory.PortletFactory;
11 import org.apache.jetspeed.services.registrymanager.RegistryManager;
12 import org.apache.jetspeed.om.registry.peer.PortletEntry;
13
14
15 /**
16 Remove a portlet from user configuration
17
18 @author <a HREF="mailto:re_carrasco@bco011.sonda.cl">Roberto Carrasco</a>
19 */

20 public class ClosePortlet extends Action
21 {
22     public void doPerform( RunData rundata ) throws Exception JavaDoc
23     {
24
25         if( rundata.getUser() == null || !rundata.getUser().hasLoggedIn() )
26         {
27             return;
28         }
29
30         String JavaDoc name = rundata.getParameters().getString ( "portletName", null );
31         if ( name == null )
32         {
33             return;
34         }
35
36         PortletEntry entry = (PortletEntry)RegistryManager.getEntry(RegistryManager.PORTLET_REGISTRY, name );
37         if ( entry == null )
38         {
39             return;
40         }
41
42         Portlet portlet = PortletFactory.getPortlet( entry );
43         if ( portlet == null )
44         {
45             return;
46         }
47
48         // ToDo: remove the portlet
49
}
50
51 }
52
Popular Tags