Class UserRest
java.lang.Object
org.exoplatform.social.rest.impl.user.UserRest
- All Implemented Interfaces:
org.exoplatform.services.rest.resource.ResourceContainer,org.picocontainer.Startable
public class UserRest
extends Object
implements org.exoplatform.services.rest.resource.ResourceContainer, org.picocontainer.Startable
Provides REST Services for manipulating jobs related to users.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCreation source stamped on accounts provisioned through this API, as opposed to the "ui" source stamped by the users management screens (org.exoplatform.portal.rest.UserRestResourcesV1#CREATION_SOURCE_UI).static final StringCode answered as 400 when the onboarding message exceeds its limitstatic final StringCode answered as 500 when the onboarding email could not be sentstatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionUserRest(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, io.meeds.social.core.identity.service.UserExportService userExportService, io.meeds.social.core.identity.service.UserImportService userImportService, org.exoplatform.services.thumbnail.ImageThumbnailService imageThumbnailService, org.exoplatform.social.core.profileproperty.ProfilePropertyService profilePropertyService, org.exoplatform.web.login.recovery.PasswordRecoveryService passwordRecoveryService, org.exoplatform.services.resources.LocaleConfigService localeConfigService, org.exoplatform.commons.api.settings.SettingService settingService, io.meeds.web.security.service.OtpService otpService) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.ResponseaddUser(javax.ws.rs.core.UriInfo uriInfo, jakarta.servlet.http.HttpServletRequest request, String expand, UserEntity model) javax.ws.rs.core.Responsejavax.ws.rs.core.ResponsedeleteUserById(javax.ws.rs.core.UriInfo uriInfo, jakarta.servlet.http.HttpServletRequest request, String id, String expand) javax.ws.rs.core.ResponsegetCommonSpacesOfUser(javax.ws.rs.core.UriInfo uriInfo, String userId, String profileId, int offset, int limit, boolean returnSize, String expand) Deprecated.javax.ws.rs.core.ResponsegetConnectionsOfUser(javax.ws.rs.core.UriInfo uriInfo, String id, String q, boolean returnSize, String expand) javax.ws.rs.core.ResponsegetInvitationsOfUser(javax.ws.rs.core.UriInfo uriInfo, boolean returnSize, String expand) javax.ws.rs.core.ResponsegetPendingOfUser(javax.ws.rs.core.UriInfo uriInfo, boolean returnSize, String expand) javax.ws.rs.core.ResponsegetSpacesOfUser(javax.ws.rs.core.UriInfo uriInfo, String id, int offset, int limit, boolean returnSize, String expand) Deprecated.since 7.3.0, useGET /social/rest/users/{username}/spaces(io.meeds.social.space.rest.UserSpacesRest) instead: it applies the viewer's visibility rules in the Service layer and takes the scope (common spaces or all visible spaces) as a parameter.javax.ws.rs.core.ResponsegetUserAvatarById(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.ResponsegetUserBannerById(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.Request request, String id, boolean byId, String lastModified, String token) javax.ws.rs.core.ResponsegetUserByEmail(javax.ws.rs.core.UriInfo uriInfo, String email) javax.ws.rs.core.ResponsegetUserById(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.Request request, String id, String expand) javax.ws.rs.core.ResponsegetUserCardSettings(javax.ws.rs.core.Request request) javax.ws.rs.core.ResponsegetUsers(javax.ws.rs.core.UriInfo uriInfo, jakarta.servlet.http.HttpServletRequest request, String q, boolean searchEmail, boolean searchUsername, String status, String userType, String isConnected, List<Long> spaceIds, List<String> groupIds, boolean includeInheritedMemberships, boolean isDisabled, String enrollmentStatus, boolean excludeCurrentUser, List<String> includeUsers, String exportId, boolean exportFile, boolean download, String sortField, String sortDirection, int offset, int limit, boolean returnSize, String expand) javax.ws.rs.core.ResponsegetUsersOrConnectionsByAdvancedFilter(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, String wildcardSearch, boolean excludeCurrentUser) javax.ws.rs.core.ResponseimportUsers(jakarta.servlet.http.HttpServletRequest request, String uploadId, boolean progress, boolean clean, boolean sync) javax.ws.rs.core.ResponsesendOnBoardingEmail(jakarta.servlet.http.HttpServletRequest request, String id, OnboardingEmailEntity onboardingEmail) voidstop()javax.ws.rs.core.ResponseupdateUserById(javax.ws.rs.core.UriInfo uriInfo, String id, String expand, UserEntity model) javax.ws.rs.core.ResponseupdateUserProfileAttribute(jakarta.servlet.http.HttpServletRequest request, String username, String name, String value, String otpMethod, String otpCode) javax.ws.rs.core.ResponseupdateUserProfileAttributes(jakarta.servlet.http.HttpServletRequest request, String username, String otpMethod, String otpCode, ProfileEntity profileEntity) javax.ws.rs.core.ResponseupdateUserProfileAttributes(jakarta.servlet.http.HttpServletRequest request, String username, List<ProfilePropertySettingEntity> profilePropertySettingEntities) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.picocontainer.Startable
start
-
Field Details
-
CREATION_SOURCE_API
Creation source stamped on accounts provisioned through this API, as opposed to the "ui" source stamped by the users management screens (org.exoplatform.portal.rest.UserRestResourcesV1#CREATION_SOURCE_UI). It marks accounts whose lifecycle is driven by the integrating system, which excludes them from the self service account deactivation.- See Also:
-
PROFILE_DEFAULT_BANNER_URL
- See Also:
-
PROFILE_DEFAULT_AVATAR_URL
- See Also:
-
USER_CARD_SETTINGS
- See Also:
-
MESSAGE_TOO_LONG
Code answered as 400 when the onboarding message exceeds its limit- See Also:
-
ONBOARDING_SEND_FAILED
Code answered as 500 when the onboarding email could not be sent- See Also:
-
-
Constructor Details
-
UserRest
public UserRest(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, io.meeds.social.core.identity.service.UserExportService userExportService, io.meeds.social.core.identity.service.UserImportService userImportService, org.exoplatform.services.thumbnail.ImageThumbnailService imageThumbnailService, org.exoplatform.social.core.profileproperty.ProfilePropertyService profilePropertyService, org.exoplatform.web.login.recovery.PasswordRecoveryService passwordRecoveryService, org.exoplatform.services.resources.LocaleConfigService localeConfigService, org.exoplatform.commons.api.settings.SettingService settingService, io.meeds.web.security.service.OtpService otpService)
-
-
Method Details
-
stop
public void stop()- Specified by:
stopin interfaceorg.picocontainer.Startable
-
getUsers
@RolesAllowed("users") public javax.ws.rs.core.Response getUsers(@Context javax.ws.rs.core.UriInfo uriInfo, @Context jakarta.servlet.http.HttpServletRequest request, String q, boolean searchEmail, boolean searchUsername, String status, String userType, String isConnected, List<Long> spaceIds, List<String> groupIds, boolean includeInheritedMemberships, boolean isDisabled, String enrollmentStatus, boolean excludeCurrentUser, List<String> includeUsers, String exportId, boolean exportFile, boolean download, String sortField, String sortDirection, int offset, int limit, boolean returnSize, String expand) throws Exception - 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, String wildcardSearch, boolean excludeCurrentUser) throws Exception- Throws:
Exception
-
addUser
@RolesAllowed("administrators") public javax.ws.rs.core.Response addUser(@Context javax.ws.rs.core.UriInfo uriInfo, @Context jakarta.servlet.http.HttpServletRequest request, String expand, UserEntity model) throws Exception - Throws:
Exception
-
getUserById
-
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
-
updateUserProfileAttributes
public javax.ws.rs.core.Response updateUserProfileAttributes(@Context jakarta.servlet.http.HttpServletRequest request, String username, String otpMethod, String otpCode, 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) -
deleteUserById
@RolesAllowed("users") public javax.ws.rs.core.Response deleteUserById(@Context javax.ws.rs.core.UriInfo uriInfo, @Context jakarta.servlet.http.HttpServletRequest request, String id, String expand) throws Exception - 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 - Throws:
Exception
-
sendOnBoardingEmail
@RolesAllowed("users") public javax.ws.rs.core.Response sendOnBoardingEmail(@Context jakarta.servlet.http.HttpServletRequest request, String id, OnboardingEmailEntity onboardingEmail) 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 - 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 - Throws:
Exception
-
getPendingOfUser
public javax.ws.rs.core.Response getPendingOfUser(@Context javax.ws.rs.core.UriInfo uriInfo, boolean returnSize, String expand) throws Exception - Throws:
Exception
-
getSpacesOfUser
@Deprecated @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 Deprecated.since 7.3.0, useGET /social/rest/users/{username}/spaces(io.meeds.social.space.rest.UserSpacesRest) instead: it applies the viewer's visibility rules in the Service layer and takes the scope (common spaces or all visible spaces) as a parameter. Kept for the integrations that still call it; not scheduled for removal yet.- Throws:
Exception
-
getCommonSpacesOfUser
@Deprecated @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 Deprecated.since 7.3.0, useGET /social/rest/users/{username}/spaces?scope=COMMON(io.meeds.social.space.rest.UserSpacesRest) instead, which lists the spaces shared between the authenticated user and the given profile with the visibility rules applied in the Service layer. Kept for the integrations that still call it; not scheduled for removal yet.- 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) -
getUserCardSettings
@RolesAllowed("users") public javax.ws.rs.core.Response getUserCardSettings(@Context javax.ws.rs.core.Request request)
-
GET /social/rest/users/{username}/spaces?scope=COMMON(io.meeds.social.space.rest.UserSpacesRest) instead, which lists the spaces shared between the authenticated user and the given profile with the visibility rules applied in the Service layer.