JBoss.orgCommunity Documentation

Space's members management

SpaceService allows you to manage the spaces' members. Here is the way to add a new member to a space:



String spacePrettyName = "mySpace";
PortalContainer container = PortalContainer.getInstance();
SpaceService spaceService = (SpaceService) container.getComponentInstanceOfType(SpaceService.class);
Space space = service.getSpaceByPrettyName(spacePrettyName);
if (space != null) {
    spaceService.addMember(space, "mary");
}