Class UserRestResourcesV1

java.lang.Object
org.exoplatform.social.rest.impl.user.UserRestResourcesV1
All Implemented Interfaces:
org.exoplatform.services.rest.resource.ResourceContainer, SocialRest, UserRestResources, org.picocontainer.Startable

public class UserRestResourcesV1 extends Object implements UserRestResources, org.picocontainer.Startable
Provides REST Services for manipulating jobs related to users.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.exoplatform.portal.rest.UserFieldValidator
     
    static final org.exoplatform.portal.rest.UserFieldValidator
     
    static final org.exoplatform.portal.rest.UserFieldValidator
     
    static final org.exoplatform.portal.rest.UserFieldValidator
     
    static final String
     
    static final String
     
    static final List<org.exoplatform.portal.rest.UserFieldValidator>
     
    static final org.exoplatform.portal.rest.UserFieldValidator
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    UserRestResourcesV1(ActivityRestResourcesV1 activityRestResourcesV1, org.exoplatform.portal.config.UserACL userACL, org.exoplatform.services.organization.OrganizationService organizationService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.manager.RelationshipManager relationshipManager, org.exoplatform.services.user.UserStateService userStateService, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.upload.UploadService uploadService, org.exoplatform.services.organization.search.UserSearchService userSearchService, org.exoplatform.social.metadata.thumbnail.ImageThumbnailService imageThumbnailService, org.exoplatform.social.core.profileproperty.ProfilePropertyService profilePropertyService, org.exoplatform.web.login.recovery.PasswordRecoveryService passwordRecoveryService, org.exoplatform.services.resources.LocaleConfigService localeConfigService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    javax.ws.rs.core.Response
    addActivityByUser(javax.ws.rs.core.UriInfo uriInfo, String id, String expand, ActivityEntity model)
    Deprecated.
    javax.ws.rs.core.Response
    addUser(javax.ws.rs.core.UriInfo uriInfo, String expand, UserEntity model)
    Creates an user
    javax.ws.rs.core.Response
    bulk(jakarta.servlet.http.HttpServletRequest request, String action, List<String> users)
     
    javax.ws.rs.core.Response
    deleteUserById(javax.ws.rs.core.UriInfo uriInfo, String id, String expand)
     
    javax.ws.rs.core.Response
    getActivitiesOfUser(javax.ws.rs.core.UriInfo uriInfo, String id, String type, int offset, int limit, String before, String after, boolean returnSize, String expand)
    Deprecated.
    javax.ws.rs.core.Response
    getCommonSpacesOfUser(javax.ws.rs.core.UriInfo uriInfo, String userId, String profileId, int offset, int limit, boolean returnSize, String expand)
     
    javax.ws.rs.core.Response
    getConnectionsOfUser(javax.ws.rs.core.UriInfo uriInfo, String id, String q, boolean returnSize, String expand)
     
    javax.ws.rs.core.Response
    getInvitationsOfUser(javax.ws.rs.core.UriInfo uriInfo, boolean returnSize, String expand)
     
    javax.ws.rs.core.Response
    getPendingOfUser(javax.ws.rs.core.UriInfo uriInfo, boolean returnSize, String expand)
     
    javax.ws.rs.core.Response
    getSpacesOfUser(javax.ws.rs.core.UriInfo uriInfo, String id, int offset, int limit, boolean returnSize, String expand)
     
    javax.ws.rs.core.Response
    getUserAvatarById(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.Request request, String id, boolean byId, String lastModified, String size, String token)
     
    javax.ws.rs.core.Response
    getUserBannerById(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.Request request, String id, boolean byId, String lastModified, String token)
     
    javax.ws.rs.core.Response
    getUserByEmail(javax.ws.rs.core.UriInfo uriInfo, String email)
     
    javax.ws.rs.core.Response
    getUserById(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.Request request, String id, String expand)
     
    javax.ws.rs.core.Response
    getUsers(javax.ws.rs.core.UriInfo uriInfo, String q, boolean searchEmail, boolean searchUsername, String status, String userType, String isConnected, String spaceId, boolean isDisabled, String enrollmentStatus, int offset, int limit, boolean returnSize, String expand, boolean excludeCurrentUser)
    Get all users, filter by name if exists.
    javax.ws.rs.core.Response
    getUsersOrConnectionsByAdvancedFilter(javax.ws.rs.core.UriInfo uriInfo, String userType, String filterType, boolean isDisabled, int offset, int limit, boolean returnSize, String expand, Map<String,String> settings, String q, boolean excludeCurrentUser)
     
    javax.ws.rs.core.Response
    importUsers(jakarta.servlet.http.HttpServletRequest request, String uploadId, boolean progress, boolean clean, boolean sync)
     
    javax.ws.rs.core.Response
    sendOnBoardingEmail(jakarta.servlet.http.HttpServletRequest request, String id)
     
    void
     
    void
     
    javax.ws.rs.core.Response
    updateUserById(javax.ws.rs.core.UriInfo uriInfo, String id, String expand, UserEntity model)
     
    javax.ws.rs.core.Response
    updateUserProfileAttribute(jakarta.servlet.http.HttpServletRequest request, String username, String name, String value)
     
    javax.ws.rs.core.Response
    updateUserProfileAttributes(jakarta.servlet.http.HttpServletRequest request, String username, List<ProfilePropertySettingEntity> profilePropertySettingEntities)
     
    javax.ws.rs.core.Response
    updateUserProfileAttributes(jakarta.servlet.http.HttpServletRequest request, String username, ProfileEntity profileEntity)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PROFILE_DEFAULT_BANNER_URL

      public static final String PROFILE_DEFAULT_BANNER_URL
      See Also:
    • PROFILE_DEFAULT_AVATAR_URL

      public static final String PROFILE_DEFAULT_AVATAR_URL
      See Also:
    • USERNAME_VALIDATOR

      public static final org.exoplatform.portal.rest.UserFieldValidator USERNAME_VALIDATOR
    • EMAIL_VALIDATOR

      public static final org.exoplatform.portal.rest.UserFieldValidator EMAIL_VALIDATOR
    • LASTNAME_VALIDATOR

      public static final org.exoplatform.portal.rest.UserFieldValidator LASTNAME_VALIDATOR
    • FIRSTNAME_VALIDATOR

      public static final org.exoplatform.portal.rest.UserFieldValidator FIRSTNAME_VALIDATOR
    • PASSWORD_VALIDATOR

      public static final org.exoplatform.portal.rest.UserFieldValidator PASSWORD_VALIDATOR
    • USER_FIELD_VALIDATORS

      public static final List<org.exoplatform.portal.rest.UserFieldValidator> USER_FIELD_VALIDATORS
  • Constructor Details

    • UserRestResourcesV1

      public UserRestResourcesV1(ActivityRestResourcesV1 activityRestResourcesV1, org.exoplatform.portal.config.UserACL userACL, org.exoplatform.services.organization.OrganizationService organizationService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.manager.RelationshipManager relationshipManager, org.exoplatform.services.user.UserStateService userStateService, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.upload.UploadService uploadService, org.exoplatform.services.organization.search.UserSearchService userSearchService, org.exoplatform.social.metadata.thumbnail.ImageThumbnailService imageThumbnailService, org.exoplatform.social.core.profileproperty.ProfilePropertyService profilePropertyService, org.exoplatform.web.login.recovery.PasswordRecoveryService passwordRecoveryService, org.exoplatform.services.resources.LocaleConfigService localeConfigService)
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface org.picocontainer.Startable
    • stop

      public void stop()
      Specified by:
      stop in interface org.picocontainer.Startable
    • getUsers

      @RolesAllowed("users") public javax.ws.rs.core.Response getUsers(@Context javax.ws.rs.core.UriInfo uriInfo, String q, boolean searchEmail, boolean searchUsername, String status, String userType, String isConnected, String spaceId, boolean isDisabled, String enrollmentStatus, int offset, int limit, boolean returnSize, String expand, boolean excludeCurrentUser) throws Exception
      Description copied from interface: UserRestResources
      Get all users, filter by name if exists.
      Specified by:
      getUsers in interface UserRestResources
      q - value that an user's name match
      status - filter only online users
      userType - filter by user type
      isConnected - filter by connected users
      spaceId - filter only space members
      isDisabled - only disabled users
      enrollmentStatus - filter by enrollment status
      Returns:
      List of users in json format.
      Throws:
      Exception
    • getUsersOrConnectionsByAdvancedFilter

      @RolesAllowed("users") public javax.ws.rs.core.Response getUsersOrConnectionsByAdvancedFilter(@Context javax.ws.rs.core.UriInfo uriInfo, String userType, String filterType, boolean isDisabled, int offset, int limit, boolean returnSize, String expand, Map<String,String> settings, String q, boolean excludeCurrentUser) throws Exception
      Throws:
      Exception
    • addUser

      @RolesAllowed("users") public javax.ws.rs.core.Response addUser(@Context javax.ws.rs.core.UriInfo uriInfo, String expand, UserEntity model) throws Exception
      Description copied from interface: UserRestResources
      Creates an user
      Specified by:
      addUser in interface UserRestResources
      Returns:
      user created in json format
      Throws:
      Exception
    • getUserById

      @RolesAllowed("users") public javax.ws.rs.core.Response getUserById(@Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.Request request, String id, String expand) throws Exception
      Specified by:
      getUserById in interface UserRestResources
      Throws:
      Exception
    • getUserByEmail

      @RolesAllowed("users") public javax.ws.rs.core.Response getUserByEmail(@Context javax.ws.rs.core.UriInfo uriInfo, String email) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • getUserAvatarById

      public javax.ws.rs.core.Response getUserAvatarById(@Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.Request request, String id, boolean byId, String lastModified, String size, String token) throws IOException
      Throws:
      IOException
    • getUserBannerById

      public javax.ws.rs.core.Response getUserBannerById(@Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.Request request, String id, boolean byId, String lastModified, String token) throws IOException
      Throws:
      IOException
    • updateUserProfileAttribute

      public javax.ws.rs.core.Response updateUserProfileAttribute(@Context jakarta.servlet.http.HttpServletRequest request, String username, String name, String value) throws IOException
      Throws:
      IOException
    • updateUserProfileAttributes

      public javax.ws.rs.core.Response updateUserProfileAttributes(@Context jakarta.servlet.http.HttpServletRequest request, String username, ProfileEntity profileEntity) throws Exception
      Throws:
      Exception
    • updateUserProfileAttributes

      public javax.ws.rs.core.Response updateUserProfileAttributes(@Context jakarta.servlet.http.HttpServletRequest request, String username, List<ProfilePropertySettingEntity> profilePropertySettingEntities) throws Exception
      Throws:
      Exception
    • deleteUserById

      @RolesAllowed("users") public javax.ws.rs.core.Response deleteUserById(@Context javax.ws.rs.core.UriInfo uriInfo, String id, String expand) throws Exception
      Specified by:
      deleteUserById in interface UserRestResources
      Throws:
      Exception
    • updateUserById

      @RolesAllowed("users") public javax.ws.rs.core.Response updateUserById(@Context javax.ws.rs.core.UriInfo uriInfo, String id, String expand, UserEntity model) throws Exception
      Specified by:
      updateUserById in interface UserRestResources
      Throws:
      Exception
    • sendOnBoardingEmail

      @RolesAllowed("users") public javax.ws.rs.core.Response sendOnBoardingEmail(@Context jakarta.servlet.http.HttpServletRequest request, String id) throws Exception
      Throws:
      Exception
    • bulk

      @RolesAllowed("users") public javax.ws.rs.core.Response bulk(@Context jakarta.servlet.http.HttpServletRequest request, String action, List<String> users) throws Exception
      Throws:
      Exception
    • getConnectionsOfUser

      @RolesAllowed("users") public javax.ws.rs.core.Response getConnectionsOfUser(@Context javax.ws.rs.core.UriInfo uriInfo, String id, String q, boolean returnSize, String expand) throws Exception
      Specified by:
      getConnectionsOfUser in interface UserRestResources
      Throws:
      Exception
    • getInvitationsOfUser

      @RolesAllowed("users") public javax.ws.rs.core.Response getInvitationsOfUser(@Context javax.ws.rs.core.UriInfo uriInfo, boolean returnSize, String expand) throws Exception
      Specified by:
      getInvitationsOfUser in interface UserRestResources
      Throws:
      Exception
    • getPendingOfUser

      public javax.ws.rs.core.Response getPendingOfUser(@Context javax.ws.rs.core.UriInfo uriInfo, boolean returnSize, String expand) throws Exception
      Specified by:
      getPendingOfUser in interface UserRestResources
      Throws:
      Exception
    • getSpacesOfUser

      @RolesAllowed("users") public javax.ws.rs.core.Response getSpacesOfUser(@Context javax.ws.rs.core.UriInfo uriInfo, String id, int offset, int limit, boolean returnSize, String expand) throws Exception
      Specified by:
      getSpacesOfUser in interface UserRestResources
      Throws:
      Exception
    • getCommonSpacesOfUser

      @RolesAllowed("users") public javax.ws.rs.core.Response getCommonSpacesOfUser(@Context javax.ws.rs.core.UriInfo uriInfo, String userId, String profileId, int offset, int limit, boolean returnSize, String expand) throws Exception
      Throws:
      Exception
    • addActivityByUser

      @RolesAllowed("users") @Deprecated public javax.ws.rs.core.Response addActivityByUser(@Context javax.ws.rs.core.UriInfo uriInfo, String id, String expand, ActivityEntity model) throws Exception
      Deprecated.
      Throws:
      Exception
    • getActivitiesOfUser

      @RolesAllowed("users") @Deprecated public javax.ws.rs.core.Response getActivitiesOfUser(@Context javax.ws.rs.core.UriInfo uriInfo, String id, String type, int offset, int limit, String before, String after, boolean returnSize, String expand) throws Exception
      Deprecated.
      Throws:
      Exception
    • importUsers

      @RolesAllowed("administrators") public javax.ws.rs.core.Response importUsers(@Context jakarta.servlet.http.HttpServletRequest request, String uploadId, boolean progress, boolean clean, boolean sync)