JBoss.orgCommunity Documentation

Remove an application from a space

You can remove portlet or gadget applications from a space and the members of this space will not see them anymore. The following code shows you how to remove an application from a space:



public void removeApplicationFromSpace() throws SpaceException {
  //Your portlet name
  String appId = "SocialBannerPortlet";
  String appName = "SocialBannerPortlet1"
  String spaceId = "zunSpace";
  //get container to get other registered components
  PortalContainer container = PortalContainer.getInstance();
  //get space service for installing operations
  SpaceService spaceService = (SpaceService) container.getComponentInstanceOfType(SpaceService.class);
  //install application for the space
  spaceService.removeApplication(spaceId, appId, appName);
}