JBoss.orgCommunity Documentation
You can add portlet or gadget applications to spaces. Once added, all members of the space can use that application. The following code shows you how to add an application to a space:
public void addApplicationToSpace() throws SpaceException {
//Your portlet name
String appId = "SocialBannerPortlet";
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.installApplication(spaceId, appId);
//you must activate installed application to be able to use it
spaceService.activateApplication(spaceId, appId);
}
appId is the portlet or gadget name as defined in portlet.xml or gadget.xml in the web-app. You can find it in social-portlet.war and social.war.