Class 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 Detail

      • 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 Detail

      • 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)
    • Method Detail

      • 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,
                                                  String status,
                                                  String userType,
                                                  String isConnected,
                                                  String spaceId,
                                                  boolean isDisabled,
                                                  String enrollmentStatus,
                                                  int offset,
                                                  int limit,
                                                  boolean returnSize,
                                                  String expand)
                                           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
      • 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,
                                                           String lastModified,
                                                           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,
                                                           String lastModified,
                                                           String token)
                                                    throws IOException
        Throws:
        IOException
      • updateUserProfileAttribute

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

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

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

        @RolesAllowed("users")
        public javax.ws.rs.core.Response bulk​(@Context
                                              javax.servlet.http.HttpServletRequest request,
                                              String action,
                                              List<String> users)
                                       throws Exception
        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
      • 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
                                                     javax.servlet.http.HttpServletRequest request,
                                                     String uploadId,
                                                     boolean progress,
                                                     boolean clean,
                                                     boolean sync)