Interface SpaceService


  • public interface SpaceService
    Provides methods to work with Space.
    Since:
    Aug 29, 2008
    • Method Detail

      • getSpaceByDisplayName

        Space getSpaceByDisplayName​(String spaceDisplayName)
        Gets a space by its display name.
        Parameters:
        spaceDisplayName - The space display name.
        Returns:
        The space.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getSpaceByPrettyName

        Space getSpaceByPrettyName​(String spacePrettyName)
        Gets a space by its pretty name.
        Parameters:
        spacePrettyName - The space's pretty name.
        Returns:
        The space.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getSpaceByGroupId

        Space getSpaceByGroupId​(String groupId)
        Gets a space by its group Id.
        Parameters:
        groupId - The group Id.
        Returns:
        The space.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getSpaceById

        Space getSpaceById​(String spaceId)
        Gets a space by its Id.
        Parameters:
        spaceId - Id of the space.
        Returns:
        The space.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getSpaceByUrl

        Space getSpaceByUrl​(String spaceUrl)
        Gets a space by its URL.
        Parameters:
        spaceUrl - URL of the space.
        Returns:
        The space.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getAllSpacesWithListAccess

        org.exoplatform.commons.utils.ListAccess<Space> getAllSpacesWithListAccess()
        Gets a list access that contains all spaces.
        Returns:
        The list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getAllSpacesByFilter

        org.exoplatform.commons.utils.ListAccess<Space> getAllSpacesByFilter​(SpaceFilter spaceFilter)
        Gets a list access that contains all spaces matching with a filter.
        Parameters:
        spaceFilter - The space filter.
        Returns:
        The list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getManagerSpaces

        default org.exoplatform.commons.utils.ListAccess<Space> getManagerSpaces​(String userId)
        Gets a list access containing all spaces that a user has the "manager" role.
        Parameters:
        userId - The remote user Id.
        Returns:
        The list access.
        eXo level API
        Platform
      • getManagerSpacesByFilter

        default org.exoplatform.commons.utils.ListAccess<Space> getManagerSpacesByFilter​(String userId,
                                                                                         SpaceFilter spaceFilter)
        Gets a list access containing all spaces that a user has the "manager" role. This list access matches with the provided space filter.
        Parameters:
        userId - The remote user Id.
        spaceFilter - The space filter.
        Returns:
        The list access.
        eXo level API
        Platform
      • getMemberSpaces

        org.exoplatform.commons.utils.ListAccess<Space> getMemberSpaces​(String userId)
        Gets a list access containing all spaces that a user has the "member" role.
        Parameters:
        userId - The remote user Id.
        Returns:
        The list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getMemberSpacesByFilter

        org.exoplatform.commons.utils.ListAccess<Space> getMemberSpacesByFilter​(String userId,
                                                                                SpaceFilter spaceFilter)
        Gets a list access containing all spaces that a user has the "member" role. This list access matches with the provided space filter.
        Parameters:
        userId - The remote user Id.
        spaceFilter - The space filter.
        Returns:
        The list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getAccessibleSpacesWithListAccess

        org.exoplatform.commons.utils.ListAccess<Space> getAccessibleSpacesWithListAccess​(String userId)
        Gets a list access containing all spaces that a user has the access permission.
        Parameters:
        userId - The remote user Id.
        Returns:
        The space list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getAccessibleSpacesByFilter

        org.exoplatform.commons.utils.ListAccess<Space> getAccessibleSpacesByFilter​(String userId,
                                                                                    SpaceFilter spaceFilter)
        Gets a list access containing all spaces that a user has the access permission. This list access matches with the provided space filter.
        Parameters:
        userId - The remote user Id.
        spaceFilter - The provided space filter.
        Returns:
        The list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getSettingableSpaces

        org.exoplatform.commons.utils.ListAccess<Space> getSettingableSpaces​(String userId)
        Gets a list access containing all spaces that a user has the setting permission.
        Parameters:
        userId - The remote user Id.
        Returns:
        The space list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getSettingabledSpacesByFilter

        org.exoplatform.commons.utils.ListAccess<Space> getSettingabledSpacesByFilter​(String userId,
                                                                                      SpaceFilter spaceFilter)
        Gets a list access containing all spaces that a user has the setting permission. This list access matches with the provided space filter.
        Parameters:
        userId - The remote user Id.
        spaceFilter - The provided space filter.
        Returns:
        The space list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getInvitedSpacesWithListAccess

        org.exoplatform.commons.utils.ListAccess<Space> getInvitedSpacesWithListAccess​(String userId)
        Gets a list access containing all spaces that a user is invited to join.
        Parameters:
        userId - The remote user Id.
        Returns:
        The list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getInvitedSpacesByFilter

        org.exoplatform.commons.utils.ListAccess<Space> getInvitedSpacesByFilter​(String userId,
                                                                                 SpaceFilter spaceFilter)
        Gets a list access containing all spaces that a user is invited to join. This list access matches with the provided space filter.
        Parameters:
        userId - The remote user Id.
        spaceFilter - The provided space filter.
        Returns:
        The list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getPublicSpacesWithListAccess

        org.exoplatform.commons.utils.ListAccess<Space> getPublicSpacesWithListAccess​(String userId)
        Gets a list access containing all spaces that a user can request to join.
        Parameters:
        userId - The remote user Id.
        Returns:
        The space list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getPublicSpacesByFilter

        org.exoplatform.commons.utils.ListAccess<Space> getPublicSpacesByFilter​(String userId,
                                                                                SpaceFilter spaceFilter)
        Gets a list access containing all spaces that a user can request to join. This list access matches with the provided space filter.
        Parameters:
        userId - The remote user Id.
        spaceFilter - The provided space filter.
        Returns:
        The list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getPendingSpacesWithListAccess

        org.exoplatform.commons.utils.ListAccess<Space> getPendingSpacesWithListAccess​(String userId)
        Gets a list access containing all spaces that a user sent a request for joining a space.
        Parameters:
        userId - The remote user Id.
        Returns:
        The list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getPendingSpacesByFilter

        org.exoplatform.commons.utils.ListAccess<Space> getPendingSpacesByFilter​(String userId,
                                                                                 SpaceFilter spaceFilter)
        Gets a list access containing all spaces that a user sent a request for joining a space. This list access matches with the provided space filter.
        Parameters:
        userId - The remote user Id.
        spaceFilter - The provided space filter.
        Returns:
        The list access.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • createSpace

        Space createSpace​(Space space,
                          String creatorUserId)
        Creates a new space: creating a group, its group navigation with pages for installing space applications.
        Parameters:
        space - The space to be created.
        creatorUserId - The remote user Id.
        Returns:
        The created space.
        eXo level API
        Platform
      • updateSpace

        default Space updateSpace​(Space existingSpace,
                                  List<Identity> identitiesToInvite)
        Updates information of a space and invites all users from identitiesToInvite to join this space.
        Parameters:
        existingSpace - The existing space to be updated.
        identitiesToInvite - The list of identities who are invited to join the space. Identity could be of type user or space
        Returns:
        updated space entity
      • updateSpace

        Space updateSpace​(Space existingSpace)
        Updates information of a space.
        Parameters:
        existingSpace - The existing space to be updated.
        Returns:
        The updated space.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • updateSpaceAvatar

        Space updateSpaceAvatar​(Space existingSpace)
        Updates a space's avatar.
        Parameters:
        existingSpace - The existing space to be updated.
        Returns:
        The updated space.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • updateSpaceBanner

        Space updateSpaceBanner​(Space existingSpace)
        Updates a space's avatar.
        Parameters:
        existingSpace - The existing space to be updated.
        Returns:
        The updated space.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • deleteSpace

        void deleteSpace​(Space space)
        Deletes a space. When a space is deleted, all of its page navigations and its group will be deleted.
        Parameters:
        space - The space to be deleted.
        eXo level API
        Platform
      • deleteSpace

        default void deleteSpace​(Space space,
                                 boolean deleteGroup)
        Deletes a space without deleting the user's group. When a space is deleted, all of its page navigations and its group will be deleted.
        Parameters:
        space - The space to be deleted.
        eXo level API
        Platform
      • addPendingUser

        void addPendingUser​(Space space,
                            String userId)
        Adds a user to the list of pending requests for joining a space.
        Parameters:
        space - The exising space.
        userId - The remote user Id.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • removePendingUser

        void removePendingUser​(Space space,
                               String userId)
        Removes a user from a list of pending requests for joining a space.
        Parameters:
        space - The existing space.
        userId - The remote user Id.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • isPendingUser

        boolean isPendingUser​(Space space,
                              String userId)
        Checks if a user is in the list of pending requests for joining a space.
        Parameters:
        space - The existing space.
        userId - The remote user Id.
        Returns:
        TRUE if the user request is pending. Otherwise, it is FALSE.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • addInvitedUser

        void addInvitedUser​(Space space,
                            String userId)
        Adds a user to the list of users who are invited to join a space.
        Parameters:
        space - The existing space.
        userId - The remote user Id.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • removeInvitedUser

        void removeInvitedUser​(Space space,
                               String userId)
        Removes a user from the list of users who are invited to join a space.
        Parameters:
        space - The existing space.
        userId - The remote user Id.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • isInvitedUser

        boolean isInvitedUser​(Space space,
                              String userId)
        Checks if a user is in the list of users who are invited to join a space.
        Parameters:
        space - The existing space.
        userId - The remote user Id.
        Returns:
        TRUE if the user is in the list of invited users. Otherwise, it is FALSE.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • addMember

        void addMember​(Space space,
                       String userId)
        Adds a user to a space. The user will get the "member" role in a space.
        Parameters:
        space - The existing space.
        userId - The remote user Id.
        eXo level API
        Platform
      • removeMember

        void removeMember​(Space space,
                          String userId)
        Removes a member from a space.
        Parameters:
        space - The existing space.
        userId - The remote user Id.
        eXo level API
        Platform
      • isMember

        boolean isMember​(Space space,
                         String userId)
        Checks if a given user is member of space or not.
        Parameters:
        space - The existing space.
        userId - The remote user Id.
        Returns:
        TRUE if the user is member. Otherwise, it is FALSE.
        eXo level API
        Platform
      • addRedactor

        default void addRedactor​(Space space,
                                 String userId)
        Assigns the "redactor" role to a user in a space.
        Parameters:
        space - The space that its user is assigned to redactor.
        userId - The remote user Id.
        eXo level API
        Platform
      • removeRedactor

        default void removeRedactor​(Space space,
                                    String userId)
        Removes the "redactor" role of a user in a space.
        Parameters:
        space - The space that its user is assigned to redactor.
        userId - The remote user Id.
        eXo level API
        Platform
      • isRedactor

        default boolean isRedactor​(Space space,
                                   String userId)
        Checks if a given user has the "redactor" role in a space.
        Parameters:
        space - The space that its user is checked if he has the "redactor" role or not.
        userId - The remote user Id.
        Returns:
        "True" if the user has the "redactor" role. Otherwise, it returns "false".
        eXo level API
        Platform
      • hasRedactor

        default boolean hasRedactor​(Space space)
        Checks if a given space has at least one "redactor"
        Parameters:
        space - The space that its user is checked if he has the "redactor" role or not.
        Returns:
        true if the user has a "redactor" role into it
      • canRedactOnSpace

        default boolean canRedactOnSpace​(Space space,
                                         org.exoplatform.services.security.Identity viewer)
        checks whether the user can add content on space or not
        Parameters:
        space - Space
        viewer - Identity
        Returns:
        true if can add content, else false
      • setManager

        void setManager​(Space space,
                        String userId,
                        boolean isManager)
        Assigns the "manager" role to a user in a space.
        Parameters:
        space - The space that its user is assigned to manager.
        userId - The remote user Id.
        isManager - "True" if the user gets the "manager" role. "False" if the user only gets the "member" role.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • isManager

        boolean isManager​(Space space,
                          String userId)
        Checks if a given user has the "manager" role in a space.
        Parameters:
        space - The space that its user is checked if he has the "manager" role or not.
        userId - The remote user Id.
        Returns:
        "True" if the user has the "manager" role. Otherwise, it returns "false".
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • isOnlyManager

        boolean isOnlyManager​(Space space,
                              String userId)
        Checks if a given user is the only one who has the "manager" role in a space.
        Parameters:
        space - The space that its user is checked if he is the only manager or not.
        userId - The remote user Id.
        Returns:
        "True" if the user Id is the only one who has "manager" role in the space. Otherwise, it returns "false".
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • hasAccessPermission

        boolean hasAccessPermission​(Space space,
                                    String userId)
        Checks if a given user can access a space or not.
        Parameters:
        space - The space that its user is checked if he can access it.
        userId - The remote user Id.
        Returns:
        "True" if the access permission is allowed. Otherwise, it returns "false".
        eXo level API
        Platform
      • hasSettingPermission

        boolean hasSettingPermission​(Space space,
                                     String userId)
        Checks if a given user has the setting permission to a space or not.
        Parameters:
        space - The space that its user is checked if he has the setting permission or not.
        userId - The remote user Id.
        Returns:
        If the user is root or the space's member, "true" is returned. Otherwise, it returns "false".
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • registerSpaceListenerPlugin

        void registerSpaceListenerPlugin​(SpaceListenerPlugin spaceListenerPlugin)
        Registers a space listener plugin to listen to space lifecyle events: creating, updating, installing an application, and more.
        Parameters:
        spaceListenerPlugin - The space listener plugin to be registered.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • unregisterSpaceListenerPlugin

        void unregisterSpaceListenerPlugin​(SpaceListenerPlugin spaceListenerPlugin)
        Unregisters an existing space listener plugin.
        Parameters:
        spaceListenerPlugin - The space listener plugin to be unregistered.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • setSpaceApplicationConfigPlugin

        @Deprecated
        void setSpaceApplicationConfigPlugin​(SpaceApplicationConfigPlugin spaceApplicationConfigPlugin)
        Deprecated.
        Sets a space application config plugin for configuring the home and space applications.
        By configuring this, the space service will know how to create a new page node with title, URL and portlet.
        Parameters:
        spaceApplicationConfigPlugin - The space application config plugin to be set.
        Since:
        1.2.0-GA
        eXo level API
        Platform
      • getSpaceApplicationConfigPlugin

        @Deprecated
        SpaceApplicationConfigPlugin getSpaceApplicationConfigPlugin()
        Deprecated.
        Gets the space application config plugin.
        Returns:
        The space application config plugin.
        eXo level API
        Platform
      • getVisibleSpaces

        List<Space> getVisibleSpaces​(String userId,
                                     SpaceFilter spaceFilter)
                              throws SpaceException
        Gets spaces that a given user can see.
        Parameters:
        userId - Id of the user.
        spaceFilter - Condition by which spaces are filtered.
        Returns:
        The list of spaces.
        Throws:
        SpaceException
        Since:
        1.2.5-GA
        eXo level API
        Platform
      • getVisibleSpacesWithListAccess

        SpaceListAccess getVisibleSpacesWithListAccess​(String userId,
                                                       SpaceFilter spaceFilter)
        Gets spaces that a given user can see.
        Parameters:
        userId - Id of the user.
        spaceFilter - The condition by which spaces are filtered.
        Returns:
        The list of spaces.
        Since:
        1.2.5-GA
        eXo level API
        Platform
      • getUnifiedSearchSpacesWithListAccess

        SpaceListAccess getUnifiedSearchSpacesWithListAccess​(String userId,
                                                             SpaceFilter spaceFilter)
        Provides the Unified Search feature to get spaces that a user can see.
        Parameters:
        userId - Id of the user.
        spaceFilter - The condition by which spaces are filtered.
        Returns:
        The list of spaces.
        Since:
        4.0.0-GA
        eXo level API
        Platform
      • createSpace

        @Deprecated
        Space createSpace​(Space space,
                          String creator,
                          String invitedGroupId)
                   throws SpaceException
        Deprecated.
        Creates a new space and invites all users from invitedGroupId to join this newly created space.
        Parameters:
        space - The space to be created.
        creator - The user who creates the space.
        invitedGroupId - Id of group who is invited to join the space.
        Returns:
        The space.
        Throws:
        SpaceException - with possible code SpaceException.Code.SPACE_ALREADY_EXIST; UNABLE_TO_ADD_CREATOR
        eXo level API
        Platform
      • createSpace

        Space createSpace​(Space space,
                          String creator,
                          List<Identity> identitiesToInvite)
                   throws SpaceException
        Creates a new space and invites all users from identitiesToInvite to join this newly created space.
        Parameters:
        space - The space to be created.
        creator - The user who creates the space.
        identitiesToInvite - The list of identities who are invited to join the space. Identity could be of type user or space
        Returns:
        The space.
        Throws:
        SpaceException - with possible code SpaceException.Code.SPACE_ALREADY_EXIST; UNABLE_TO_ADD_CREATOR
      • saveSpace

        void saveSpace​(Space space,
                       boolean isNew)
                throws SpaceException
        Deprecated.
        Use updateSpace(org.exoplatform.social.core.space.model.Space) instead. Will be removed by 4.0.x.
        Saves a new space or updates a space.
        Parameters:
        space - The space to be saved or updated.
        isNew - "True" if a new space is created. "False" if an existing space is updated.
        Throws:
        SpaceException - with code: SpaceException.Code.ERROR_DATASTORE
        eXo level API
        Provisional
      • renameSpace

        void renameSpace​(Space space,
                         String newDisplayName)
                  throws SpaceException
        Renames a space.
        Parameters:
        space - The space to be renamed.
        newDisplayName - New name of the space.
        Throws:
        SpaceException
        Since:
        1.2.8
        eXo level API
        Platform
      • renameSpace

        void renameSpace​(String remoteId,
                         Space space,
                         String newDisplayName)
                  throws SpaceException
        Renames a space by an identity who has rights of super admin.
        Parameters:
        remoteId - The identity who has renamed a space.
        space - The space to be renamed.
        newDisplayName - New name of the space.
        Throws:
        SpaceException
        Since:
        4.0.0
        eXo level API
        Platform
      • initApp

        @Deprecated
        void initApp​(Space space)
              throws SpaceException
        Deprecated.
        Will be removed by 4.0.x.
        Does nothing, just for compatible.
        Parameters:
        space - The space.
        Throws:
        SpaceException - with code SpaceException.Code.UNABLE_INIT_APP
        eXo level API
        Provisional
      • initApps

        @Deprecated
        void initApps​(Space space)
               throws SpaceException
        Deprecated.
        Will be removed by 4.0.x.
        Does nothing, just for compatible.
        Parameters:
        space - The space.
        Throws:
        SpaceException - with code SpaceException.Code.UNABLE_INIT_APP
        eXo level API
        Provisional
      • deInitApps

        @Deprecated
        void deInitApps​(Space space)
                 throws SpaceException
        Deprecated.
        Will be removed by 4.0.x.
        Does nothing, just for compatible.
        Parameters:
        space - The space.
        Throws:
        SpaceException
        eXo level API
        Provisional
      • isIgnored

        default boolean isIgnored​(Space space,
                                  String userId)
        Checks if a user is in the list of users who have ignored the space.
        Parameters:
        space - The existing space.
        userId - The remote user Id.
        Returns:
        TRUE if the space is an ignored space. Otherwise, it is FALSE.
      • setIgnored

        default void setIgnored​(String spaceId,
                                String userId)
        Assigns the user who has ignored the space.
        Parameters:
        spaceId - The Id of the space ignored by the user.
        userId - The remote user Id.
      • installApplication

        void installApplication​(String spaceId,
                                String appId)
                         throws SpaceException
        Installs an application in a space.
        Parameters:
        spaceId - Id of the space that the application is installed.
        appId - Id of the application which is installed.
        Throws:
        SpaceException - with code SpaceException.Code.ERROR_DATA_STORE
        eXo level API
        Platform
      • installApplication

        void installApplication​(Space space,
                                String appId)
                         throws SpaceException
        Installs an application in a space.
        Parameters:
        space - The space that the application is installed.
        appId - Id of the installed application.
        Throws:
        SpaceException - with code SpaceException.Code.ERROR_DATA_STORE
        eXo level API
        Platform
      • activateApplication

        void activateApplication​(Space space,
                                 String appId)
                          throws SpaceException
        Activates an installed application in a space.
        Parameters:
        space - The space that the installed application is activated.
        appId - Id of the installed application.
        Throws:
        SpaceException - with possible code: SpaceException.Code.UNABLE_TO_ADD_APPLICATION, SpaceExeption.Code.ERROR_DATA_STORE
        eXo level API
        Platform
      • activateApplication

        void activateApplication​(String spaceId,
                                 String appId)
                          throws SpaceException
        Activates an installed application in a space.
        Parameters:
        spaceId - Id of the space that the installed application is activated.
        appId - Id of the installed application.
        Throws:
        SpaceException - with possible code: SpaceException.Code.UNABLE_TO_ADD_APPLICATION, SpaceExeption.Code.ERROR_DATA_STORE
        eXo level API
        Platform
      • deactivateApplication

        void deactivateApplication​(Space space,
                                   String appId)
                            throws SpaceException
        Deactivates an installed application in a space.
        Parameters:
        space - The space that the installed application is deactivated.
        appId - Id of the installed application.
        Throws:
        SpaceException
        eXo level API
        Platform
      • deactivateApplication

        void deactivateApplication​(String spaceId,
                                   String appId)
                            throws SpaceException
        Deactivates an installed application in a space.
        Parameters:
        spaceId - Id of the space that the installed application is deactivated.
        appId - Id of the installed application.
        Throws:
        SpaceException
        eXo level API
        Platform
      • removeApplication

        void removeApplication​(Space space,
                               String appId,
                               String appName)
                        throws SpaceException
        Removes an installed application from a space.
        Parameters:
        space - The space that the installed application is removed.
        appId - Id of the installed application.
        Throws:
        SpaceException
        eXo level API
        Platform
      • removeApplication

        void removeApplication​(String spaceId,
                               String appId,
                               String appName)
                        throws SpaceException
        Removes an installed application from a space.
        Parameters:
        spaceId - Id of the space that the installed application is removed.
        appId - Id of the installed application.
        Throws:
        SpaceException
        eXo level API
        Platform
      • updateSpaceAccessed

        void updateSpaceAccessed​(String remoteId,
                                 Space space)
                          throws SpaceException
        Updates the most recently accessed space of a user to the top of spaces list.
        Parameters:
        remoteId - The remote Id of the user.
        space - The last accessed space of the user.
        Throws:
        SpaceException
        eXo level API
        Platform
      • getLastAccessedSpace

        List<Space> getLastAccessedSpace​(String remoteId,
                                         String appId,
                                         int offset,
                                         int limit)
                                  throws SpaceException
        Gets a list of the most recently accessed spaces of a user.
        Parameters:
        remoteId - The remote Id of user.
        appId - Id of the installed application in a space.
        offset - The starting point to get the most recently accessed spaces.
        limit - The limitation of the most recently accessed spaces.
        Throws:
        SpaceException
        eXo level API
        Platform
      • getLastSpaces

        List<Space> getLastSpaces​(int limit)
        Gets the last spaces that have been created.
        Parameters:
        limit - the limit of spaces to provide.
        Returns:
        The last spaces.
        Since:
        4.0.x
        eXo level API
        Experimental
      • getLastAccessedSpace

        org.exoplatform.commons.utils.ListAccess<Space> getLastAccessedSpace​(String remoteId,
                                                                             String appId)
        Gets a list of the most recently accessed spaces of a user.
        Parameters:
        remoteId - The remote Id of a user.
        appId - Id of the installed application in a space.
        eXo level API
        Platform
      • registerSpaceLifeCycleListener

        @Deprecated
        void registerSpaceLifeCycleListener​(SpaceLifeCycleListener listener)
        Deprecated.
        Will be removed by 4.0.x.
        Registers a space lifecycle listener.
        Parameters:
        listener - The space lifecycle listener to be registered.
        eXo level API
        Provisional
      • unregisterSpaceLifeCycleListener

        @Deprecated
        void unregisterSpaceLifeCycleListener​(SpaceLifeCycleListener listener)
        Deprecated.
        Will be removed by 4.0.x.
        Unregisters a space lifecycle listener.
        Parameters:
        listener - The space lifecycle listener to be unregistered.
        eXo level API
        Provisional
      • setPortletsPrefsRequired

        @Deprecated
        void setPortletsPrefsRequired​(PortletPreferenceRequiredPlugin portletPrefsRequiredPlugin)
        Deprecated.
        Use SpaceApplicationConfigPlugin instead. Will be removed by 4.0.x.
        Sets the portlet preferences got from the plugin configuration.
        Parameters:
        portletPrefsRequiredPlugin - The plugin that configures portlets to store spaceUrl in its portlet-preference.
        eXo level API
        Provisional
      • getPortletsPrefsRequired

        String[] getPortletsPrefsRequired()
        Deprecated.
        Will be removed by 4.0.x.
        Gets the portlet preferences which are required for creating the portlet application.
        Returns:
        Array of the portlet preferences.
        eXo level API
        Provisional
      • getVisitedSpaces

        org.exoplatform.commons.utils.ListAccess<Space> getVisitedSpaces​(String remoteId,
                                                                         String appId)
        Gets the list of spaces which are visited by users
        Parameters:
        remoteId -
        appId -
        Returns:
      • isSuperManager

        boolean isSuperManager​(String userId)
        Checks if the user is a super manager of all spaces
        Parameters:
        userId - username
        Returns:
        true if the user is member of super administrators groups, else false
      • inviteIdentities

        default void inviteIdentities​(Space space,
                                      List<Identity> identitiesToInvite)
        Invites users or members of spaces identified by identities list into a a designated space
        Parameters:
        space - target Space to invite identites
        identitiesToInvite - List of Identity (space or user) to invite
      • isSpaceContainsExternals

        default boolean isSpaceContainsExternals​(Long spaceId)
        Checks if a specific space contains external users
        Parameters:
        spaceId -
        Returns:
        true if the space contains external users
      • getPendingSpaceRequestsToManage

        default org.exoplatform.commons.utils.ListAccess<Space> getPendingSpaceRequestsToManage​(String remoteId)
        Retrieves the list of pending 'requests to join' a space that the user manages
        Parameters:
        remoteId -
        Returns:
        ListAccess of Space with pending users requesting to join spaces that the designated user manages
      • moveApplication

        default void moveApplication​(String spaceId,
                                     String appId,
                                     int transition)
                              throws SpaceException
        Parameters:
        spaceId - technical id of the space
        appId - application identifier
        transition - how much levels to move up or down an application
        Throws:
        SpaceException
      • getSpacesApplications

        default List<org.exoplatform.application.registry.Application> getSpacesApplications()
        Returns:
        List of Application that can be instantiated in spaces
      • findSpaceExternalInvitationsBySpaceId

        default List<SpaceExternalInvitation> findSpaceExternalInvitationsBySpaceId​(String spaceId)
        Returns:
        a list of external invitations in space
      • saveSpaceExternalInvitation

        default void saveSpaceExternalInvitation​(String spaceId,
                                                 String email,
                                                 String tokenId)
        Add an external invitation to space
        Parameters:
        spaceId -
        email -
        tokenId -
      • getSpaceExternalInvitationById

        default SpaceExternalInvitation getSpaceExternalInvitationById​(String invitationId)
        Gets a Space external invitation by its Id.
        Parameters:
        invitationId -
      • deleteSpaceExternalInvitation

        default void deleteSpaceExternalInvitation​(String invitationId)
        delete an external invitation from a space
        Parameters:
        invitationId -
      • findExternalInvitationsSpacesByEmail

        default List<String> findExternalInvitationsSpacesByEmail​(String email)
        Parameters:
        email -
        Returns:
        a list of spaces ids by external email
      • deleteExternalUserInvitations

        default void deleteExternalUserInvitations​(String email)
        delete external invitations
        Parameters:
        email -
      • addSpacesApplication

        default void addSpacesApplication​(org.exoplatform.application.registry.Application application)
        Add an application to applications list that can be instantiated in space context
        Parameters:
        application - of type Application
      • deleteSpacesApplication

        default void deleteSpacesApplication​(String applicationName)
        Delete application from list of spaces applications
        Parameters:
        applicationName - application name to delete
      • getCommonSpaces

        default org.exoplatform.commons.utils.ListAccess<Space> getCommonSpaces​(String userId,
                                                                                String otherUserId)
        Gets a list access containing all common spaces between two users
        Parameters:
        userId - connected user id
        otherUserId - visited profile user id
        Returns:
        list of common spaces between two users in param