Class SpaceServiceImpl

java.lang.Object
io.meeds.social.space.service.SpaceServiceImpl
All Implemented Interfaces:
org.exoplatform.social.core.space.spi.SpaceService

public class SpaceServiceImpl extends Object implements org.exoplatform.social.core.space.spi.SpaceService
  • Constructor Details

    • SpaceServiceImpl

      public SpaceServiceImpl(SpaceStorage spaceStorage, org.exoplatform.social.core.storage.api.GroupSpaceBindingStorage groupSpaceBindingStorage, SpaceSearchConnector spaceSearchConnector, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.portal.config.UserACL userAcl, org.exoplatform.services.resources.ResourceBundleService resourceBundleService, org.exoplatform.services.resources.LocaleConfigService localeConfigService, org.exoplatform.commons.file.services.FileService fileService, org.exoplatform.web.security.security.CookieTokenService cookieTokenService)
  • Method Details

    • getSpaceByPrettyName

      public org.exoplatform.social.core.space.model.Space getSpaceByPrettyName(String spacePrettyName)
      Specified by:
      getSpaceByPrettyName in interface org.exoplatform.social.core.space.spi.SpaceService
    • getSpaceMembershipDate

      public Instant getSpaceMembershipDate(long spaceId, String username)
      Specified by:
      getSpaceMembershipDate in interface org.exoplatform.social.core.space.spi.SpaceService
    • getSpaceByGroupId

      public org.exoplatform.social.core.space.model.Space getSpaceByGroupId(String groupId)
      Specified by:
      getSpaceByGroupId in interface org.exoplatform.social.core.space.spi.SpaceService
    • getSpaceById

      public org.exoplatform.social.core.space.model.Space getSpaceById(long spaceId)
      Specified by:
      getSpaceById in interface org.exoplatform.social.core.space.spi.SpaceService
    • getAccessibleSpacesWithListAccess

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getAccessibleSpacesWithListAccess(String username)
      Specified by:
      getAccessibleSpacesWithListAccess in interface org.exoplatform.social.core.space.spi.SpaceService
    • getAccessibleSpacesByFilter

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getAccessibleSpacesByFilter(String username, org.exoplatform.social.core.space.SpaceFilter spaceFilter)
      Specified by:
      getAccessibleSpacesByFilter in interface org.exoplatform.social.core.space.spi.SpaceService
    • getVisibleSpacesWithListAccess

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getVisibleSpacesWithListAccess(String username, org.exoplatform.social.core.space.SpaceFilter spaceFilter)
      Specified by:
      getVisibleSpacesWithListAccess in interface org.exoplatform.social.core.space.spi.SpaceService
    • getPendingSpacesWithListAccess

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getPendingSpacesWithListAccess(String username)
      Specified by:
      getPendingSpacesWithListAccess in interface org.exoplatform.social.core.space.spi.SpaceService
    • getAllSpacesWithListAccess

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getAllSpacesWithListAccess()
      Specified by:
      getAllSpacesWithListAccess in interface org.exoplatform.social.core.space.spi.SpaceService
    • getAllSpacesByFilter

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getAllSpacesByFilter(org.exoplatform.social.core.space.SpaceFilter spaceFilter)
      Specified by:
      getAllSpacesByFilter in interface org.exoplatform.social.core.space.spi.SpaceService
    • getInvitedSpacesWithListAccess

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getInvitedSpacesWithListAccess(String username)
      Specified by:
      getInvitedSpacesWithListAccess in interface org.exoplatform.social.core.space.spi.SpaceService
    • getInvitedSpacesByFilter

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getInvitedSpacesByFilter(String username, org.exoplatform.social.core.space.SpaceFilter spaceFilter)
      Specified by:
      getInvitedSpacesByFilter in interface org.exoplatform.social.core.space.spi.SpaceService
    • getMemberSpaces

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getMemberSpaces(String username)
      Specified by:
      getMemberSpaces in interface org.exoplatform.social.core.space.spi.SpaceService
    • getMemberSpacesByFilter

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getMemberSpacesByFilter(String username, org.exoplatform.social.core.space.SpaceFilter spaceFilter)
      Specified by:
      getMemberSpacesByFilter in interface org.exoplatform.social.core.space.spi.SpaceService
    • getManagerSpaces

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getManagerSpaces(String username)
      Specified by:
      getManagerSpaces in interface org.exoplatform.social.core.space.spi.SpaceService
    • getManagerSpacesByFilter

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getManagerSpacesByFilter(String username, org.exoplatform.social.core.space.SpaceFilter spaceFilter)
      Specified by:
      getManagerSpacesByFilter in interface org.exoplatform.social.core.space.spi.SpaceService
    • getEditableSpacesByFilter

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getEditableSpacesByFilter(String username, org.exoplatform.social.core.space.SpaceFilter spaceFilter)
      Specified by:
      getEditableSpacesByFilter in interface org.exoplatform.social.core.space.spi.SpaceService
    • getFavoriteSpacesByFilter

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getFavoriteSpacesByFilter(String username, org.exoplatform.social.core.space.SpaceFilter spaceFilter)
      Specified by:
      getFavoriteSpacesByFilter in interface org.exoplatform.social.core.space.spi.SpaceService
    • getPendingSpacesByFilter

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getPendingSpacesByFilter(String username, org.exoplatform.social.core.space.SpaceFilter spaceFilter)
      Specified by:
      getPendingSpacesByFilter in interface org.exoplatform.social.core.space.spi.SpaceService
    • getPendingSpaceRequestsToManage

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getPendingSpaceRequestsToManage(String username)
      Specified by:
      getPendingSpaceRequestsToManage in interface org.exoplatform.social.core.space.spi.SpaceService
    • getLastAccessedSpace

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getLastAccessedSpace(String username)
      Specified by:
      getLastAccessedSpace in interface org.exoplatform.social.core.space.spi.SpaceService
    • getLastAccessedSpaceByFilter

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getLastAccessedSpaceByFilter(String username, org.exoplatform.social.core.space.SpaceFilter spaceFilter)
      Specified by:
      getLastAccessedSpaceByFilter in interface org.exoplatform.social.core.space.spi.SpaceService
    • getCommonSpaces

      public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.space.model.Space> getCommonSpaces(String username, String otherUserId)
      Specified by:
      getCommonSpaces in interface org.exoplatform.social.core.space.spi.SpaceService
    • getMemberSpacesIds

      public List<String> getMemberSpacesIds(String username, int offset, int limit)
      Specified by:
      getMemberSpacesIds in interface org.exoplatform.social.core.space.spi.SpaceService
    • getManagerSpacesIds

      public List<String> getManagerSpacesIds(String username, int offset, int limit)
      Specified by:
      getManagerSpacesIds in interface org.exoplatform.social.core.space.spi.SpaceService
    • getManagerSpacesCount

      public int getManagerSpacesCount(String username)
      Specified by:
      getManagerSpacesCount in interface org.exoplatform.social.core.space.spi.SpaceService
    • getLastSpaces

      public List<org.exoplatform.social.core.space.model.Space> getLastSpaces(int limit)
      Specified by:
      getLastSpaces in interface org.exoplatform.social.core.space.spi.SpaceService
    • createSpace

      public org.exoplatform.social.core.space.model.Space createSpace(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      createSpace in interface org.exoplatform.social.core.space.spi.SpaceService
    • createSpace

      public org.exoplatform.social.core.space.model.Space createSpace(org.exoplatform.social.core.space.model.Space space, String username, List<org.exoplatform.social.core.identity.model.Identity> identitiesToInvite) throws org.exoplatform.social.core.space.SpaceException
      Specified by:
      createSpace in interface org.exoplatform.social.core.space.spi.SpaceService
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • inviteIdentities

      public void inviteIdentities(org.exoplatform.social.core.space.model.Space space, List<org.exoplatform.social.core.identity.model.Identity> identitiesToInvite)
      Specified by:
      inviteIdentities in interface org.exoplatform.social.core.space.spi.SpaceService
    • isSpaceContainsExternals

      public boolean isSpaceContainsExternals(Long spaceId)
      Specified by:
      isSpaceContainsExternals in interface org.exoplatform.social.core.space.spi.SpaceService
    • createSpace

      public org.exoplatform.social.core.space.model.Space createSpace(org.exoplatform.social.core.space.model.Space space)
      Specified by:
      createSpace in interface org.exoplatform.social.core.space.spi.SpaceService
    • renameSpace

      public void renameSpace(org.exoplatform.social.core.space.model.Space space, String newDisplayName)
      Specified by:
      renameSpace in interface org.exoplatform.social.core.space.spi.SpaceService
    • renameSpace

      public void renameSpace(org.exoplatform.social.core.space.model.Space space, String newDisplayName, String username) throws org.exoplatform.social.core.space.SpaceException
      Specified by:
      renameSpace in interface org.exoplatform.social.core.space.spi.SpaceService
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • deleteSpace

      public void deleteSpace(org.exoplatform.social.core.space.model.Space space) throws org.exoplatform.social.core.space.SpaceException
      Specified by:
      deleteSpace in interface org.exoplatform.social.core.space.spi.SpaceService
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • deleteSpace

      public void deleteSpace(org.exoplatform.social.core.space.model.Space space, boolean deleteGroup) throws org.exoplatform.social.core.space.SpaceException
      Specified by:
      deleteSpace in interface org.exoplatform.social.core.space.spi.SpaceService
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • addMember

      public void addMember(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      addMember in interface org.exoplatform.social.core.space.spi.SpaceService
    • removeMember

      public void removeMember(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      removeMember in interface org.exoplatform.social.core.space.spi.SpaceService
    • isMember

      public boolean isMember(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      isMember in interface org.exoplatform.social.core.space.spi.SpaceService
    • isIgnored

      public boolean isIgnored(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      isIgnored in interface org.exoplatform.social.core.space.spi.SpaceService
    • setIgnored

      public void setIgnored(String spaceId, String username)
      Specified by:
      setIgnored in interface org.exoplatform.social.core.space.spi.SpaceService
    • registerSpaceLifeCycleListener

      public void registerSpaceLifeCycleListener(org.exoplatform.social.core.space.spi.SpaceLifeCycleListener listener)
      Specified by:
      registerSpaceLifeCycleListener in interface org.exoplatform.social.core.space.spi.SpaceService
    • unregisterSpaceLifeCycleListener

      public void unregisterSpaceLifeCycleListener(org.exoplatform.social.core.space.spi.SpaceLifeCycleListener listener)
      Specified by:
      unregisterSpaceLifeCycleListener in interface org.exoplatform.social.core.space.spi.SpaceService
    • addInvitedUser

      public void addInvitedUser(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      addInvitedUser in interface org.exoplatform.social.core.space.spi.SpaceService
    • addPendingUser

      public void addPendingUser(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      addPendingUser in interface org.exoplatform.social.core.space.spi.SpaceService
    • hasSettingPermission

      public boolean hasSettingPermission(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      hasSettingPermission in interface org.exoplatform.social.core.space.spi.SpaceService
    • canDeleteSpace

      public boolean canDeleteSpace(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      canDeleteSpace in interface org.exoplatform.social.core.space.spi.SpaceService
    • canAccessSpacePublicSite

      public boolean canAccessSpacePublicSite(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      canAccessSpacePublicSite in interface org.exoplatform.social.core.space.spi.SpaceService
    • canManageSpace

      public boolean canManageSpace(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      canManageSpace in interface org.exoplatform.social.core.space.spi.SpaceService
    • isInvitedUser

      public boolean isInvitedUser(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      isInvitedUser in interface org.exoplatform.social.core.space.spi.SpaceService
    • isManager

      public boolean isManager(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      isManager in interface org.exoplatform.social.core.space.spi.SpaceService
    • isRedactor

      public boolean isRedactor(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      isRedactor in interface org.exoplatform.social.core.space.spi.SpaceService
    • isPublisher

      public boolean isPublisher(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      isPublisher in interface org.exoplatform.social.core.space.spi.SpaceService
    • hasRedactor

      public boolean hasRedactor(org.exoplatform.social.core.space.model.Space space)
      Specified by:
      hasRedactor in interface org.exoplatform.social.core.space.spi.SpaceService
    • isOnlyManager

      public boolean isOnlyManager(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      isOnlyManager in interface org.exoplatform.social.core.space.spi.SpaceService
    • isPendingUser

      public boolean isPendingUser(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      isPendingUser in interface org.exoplatform.social.core.space.spi.SpaceService
    • registerSpaceListenerPlugin

      public void registerSpaceListenerPlugin(org.exoplatform.social.core.space.SpaceListenerPlugin spaceListenerPlugin)
      Specified by:
      registerSpaceListenerPlugin in interface org.exoplatform.social.core.space.spi.SpaceService
    • removeInvitedUser

      public void removeInvitedUser(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      removeInvitedUser in interface org.exoplatform.social.core.space.spi.SpaceService
    • removePendingUser

      public void removePendingUser(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      removePendingUser in interface org.exoplatform.social.core.space.spi.SpaceService
    • addRedactor

      public void addRedactor(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      addRedactor in interface org.exoplatform.social.core.space.spi.SpaceService
    • removeRedactor

      public void removeRedactor(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      removeRedactor in interface org.exoplatform.social.core.space.spi.SpaceService
    • addPublisher

      public void addPublisher(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      addPublisher in interface org.exoplatform.social.core.space.spi.SpaceService
    • removePublisher

      public void removePublisher(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      removePublisher in interface org.exoplatform.social.core.space.spi.SpaceService
    • setManager

      public void setManager(org.exoplatform.social.core.space.model.Space space, String username, boolean isManager)
      Specified by:
      setManager in interface org.exoplatform.social.core.space.spi.SpaceService
    • unregisterSpaceListenerPlugin

      public void unregisterSpaceListenerPlugin(org.exoplatform.social.core.space.SpaceListenerPlugin spaceListenerPlugin)
      Specified by:
      unregisterSpaceListenerPlugin in interface org.exoplatform.social.core.space.spi.SpaceService
    • updateSpace

      public org.exoplatform.social.core.space.model.Space updateSpace(org.exoplatform.social.core.space.model.Space existingSpace)
      Specified by:
      updateSpace in interface org.exoplatform.social.core.space.spi.SpaceService
    • updateSpace

      public org.exoplatform.social.core.space.model.Space updateSpace(org.exoplatform.social.core.space.model.Space space, List<org.exoplatform.social.core.identity.model.Identity> identitiesToInvite)
      Specified by:
      updateSpace in interface org.exoplatform.social.core.space.spi.SpaceService
    • updateSpaceAvatar

      public org.exoplatform.social.core.space.model.Space updateSpaceAvatar(org.exoplatform.social.core.space.model.Space existingSpace, String username)
      Specified by:
      updateSpaceAvatar in interface org.exoplatform.social.core.space.spi.SpaceService
    • updateSpaceBanner

      public org.exoplatform.social.core.space.model.Space updateSpaceBanner(org.exoplatform.social.core.space.model.Space existingSpace, String username)
      Specified by:
      updateSpaceBanner in interface org.exoplatform.social.core.space.spi.SpaceService
    • updateSpaceAccessed

      public void updateSpaceAccessed(String remoteId, org.exoplatform.social.core.space.model.Space space)
      Specified by:
      updateSpaceAccessed in interface org.exoplatform.social.core.space.spi.SpaceService
    • findSpaceExternalInvitationsBySpaceId

      public List<org.exoplatform.social.core.model.SpaceExternalInvitation> findSpaceExternalInvitationsBySpaceId(String spaceId)
      Specified by:
      findSpaceExternalInvitationsBySpaceId in interface org.exoplatform.social.core.space.spi.SpaceService
    • saveSpaceExternalInvitation

      public void saveSpaceExternalInvitation(String spaceId, String email, String tokenId)
      Specified by:
      saveSpaceExternalInvitation in interface org.exoplatform.social.core.space.spi.SpaceService
    • getSpaceExternalInvitationById

      public org.exoplatform.social.core.model.SpaceExternalInvitation getSpaceExternalInvitationById(String invitationId)
      Specified by:
      getSpaceExternalInvitationById in interface org.exoplatform.social.core.space.spi.SpaceService
    • getSpaceCategoryIds

      public List<Long> getSpaceCategoryIds()
      Specified by:
      getSpaceCategoryIds in interface org.exoplatform.social.core.space.spi.SpaceService
    • deleteSpaceExternalInvitation

      public void deleteSpaceExternalInvitation(String invitationId)
      Specified by:
      deleteSpaceExternalInvitation in interface org.exoplatform.social.core.space.spi.SpaceService
    • findExternalInvitationsSpacesByEmail

      public List<String> findExternalInvitationsSpacesByEmail(String email)
      Specified by:
      findExternalInvitationsSpacesByEmail in interface org.exoplatform.social.core.space.spi.SpaceService
    • deleteExternalUserInvitations

      public void deleteExternalUserInvitations(String email)
      Specified by:
      deleteExternalUserInvitations in interface org.exoplatform.social.core.space.spi.SpaceService
    • isSuperManager

      public boolean isSuperManager(String username)
      Specified by:
      isSuperManager in interface org.exoplatform.social.core.space.spi.SpaceService
    • isSuperManager

      public boolean isSuperManager(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      isSuperManager in interface org.exoplatform.social.core.space.spi.SpaceService
    • canManageSpacePublicSite

      public boolean canManageSpacePublicSite(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      canManageSpacePublicSite in interface org.exoplatform.social.core.space.spi.SpaceService
    • canManageSpaceLayout

      public boolean canManageSpaceLayout(org.exoplatform.social.core.space.model.Space space, String username)
      Specified by:
      canManageSpaceLayout in interface org.exoplatform.social.core.space.spi.SpaceService
    • isContentManager

      public boolean isContentManager(String username)
      Specified by:
      isContentManager in interface org.exoplatform.social.core.space.spi.SpaceService
    • isContentPublisher

      public boolean isContentPublisher(String username)
      Specified by:
      isContentPublisher in interface org.exoplatform.social.core.space.spi.SpaceService
    • countSpacesByTemplate

      public Map<Long,Long> countSpacesByTemplate()
      Specified by:
      countSpacesByTemplate in interface org.exoplatform.social.core.space.spi.SpaceService
    • prepareSpaceInstance

      public String prepareSpaceInstance(io.meeds.social.space.model.SpaceCreationInstance spaceCreationInstance)
      Specified by:
      prepareSpaceInstance in interface org.exoplatform.social.core.space.spi.SpaceService
    • addSpaceListener

      public void addSpaceListener(org.exoplatform.social.core.space.SpaceListenerPlugin plugin)
    • setDeletePermissions

      public static void setDeletePermissions(org.exoplatform.social.core.space.model.Space space, SpaceTemplate spaceTemplate, String groupId)