com.ibm.commerce.rest.member.handler

Class PersonHandler

  • All Implemented Interfaces:
    DocumentedResourceHandler, IResourceHandler


    @Path(value="store/{storeId}/person")
     @Encoded
    public class PersonHandler
    extends AbstractConfigBasedClassicHandler
    This class provides RESTful services to get Person details, register a member, and update a member. This class also provides RESTful services used by an administrator to find person information, register new and update existing user information.
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
      • RESOURCE_NAME

        public static final java.lang.String RESOURCE_NAME
        Resource name for person.
        See Also:
        Constant Field Values
      • RESOURCE_MAPPING_KEY

        public static final java.lang.String RESOURCE_MAPPING_KEY
        The Constant RESOURCE_MAPPING_KEY.
        See Also:
        Constant Field Values
      • FORMAT_GROUP_NAME

        public static final java.lang.String FORMAT_GROUP_NAME
        The constant FORMAT_GROUP_NAME
        See Also:
        Constant Field Values
      • PARAMETER_USER_ID

        public static final java.lang.String PARAMETER_USER_ID
        The constant PARAMETER_USER_ID
        See Also:
        Constant Field Values
      • PARAMETER_USER_ID_DESCRIPTION

        public static final java.lang.String PARAMETER_USER_ID_DESCRIPTION
        The constant PARAMETER_USER_ID_DESCRIPTION
        See Also:
        Constant Field Values
      • PARAMETER_MEMBER_ID

        public static final java.lang.String PARAMETER_MEMBER_ID
        The constant PARAMETER_MEMBER_ID
        See Also:
        Constant Field Values
      • PARAMETER_SCOPED_BY_ORGS_I_CAN_ADMIN

        public static final java.lang.String PARAMETER_SCOPED_BY_ORGS_I_CAN_ADMIN
        The constant PARAMETER_SCOPED_BY_ORGS_I_CAN_ADMIN
        See Also:
        Constant Field Values
    • Constructor Detail

      • PersonHandler

        public PersonHandler()
    • Method Detail

      • getResourceName

        public java.lang.String getResourceName()
        Description copied from interface: IResourceHandler
        This method returns the name of the resource used primarily to determine the representation of the resource. This class can be overridden to change the name of the resource and therefore the representation, while keeping all the methods in this class.
        Returns:
        the resource name
      • getHelper

        public PersonHelper getHelper()
        This method returns the BOD helper used to get product data
        Returns:
        PersonHelper
      • findPersonBySelf

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="@self")
        public javax.ws.rs.core.Response findPersonBySelf(@PathParam(value="storeId")
                                                                                                                                                                                             java.lang.String storeId,
                                                                                                                                                                                             @QueryParam(value="responseFormat")
                                                                                                                                                                                             java.lang.String responseFormat)
        This method retrieves user data for the logged in user using Member service.
        Parameters:
        storeId - the store id
        responseFormat - the response format
        Returns:
        the response
      • changeLanguageCurrency

        @PUT
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="@self/languageCurrency")
        public javax.ws.rs.core.Response changeLanguageCurrency(@PathParam(value="storeId")
                                                                                                                                                                                                                    java.lang.String storeId,
                                                                                                                                                                                                                    @QueryParam(value="responseFormat")
                                                                                                                                                                                                                    java.lang.String responseFormat)
        Change language and currency preference for a person
        Parameters:
        storeId - the store id
        responseFormat - the response format
        Returns:
        the response
      • findByUserId

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="{userId}")
        public javax.ws.rs.core.Response findByUserId(@PathParam(value="storeId")
                                                                                                                                                                                            java.lang.String storeId,
                                                                                                                                                                                            @PathParam(value="userId")
                                                                                                                                                                                            java.lang.String userId)
        This allows an administrator to find user information by user identifier.
        Parameters:
        storeId - The store ID
        userId - The user ID
        Returns:
        The response
      • findByUserIdWUserRegistrationDetailsProfileName

        @Path(value="{userId}")
        public javax.ws.rs.core.Response findByUserIdWUserRegistrationDetailsProfileName(@PathParam(value="storeId")
                                                                                                                 java.lang.String storeId,
                                                                                                                 @PathParam(value="userId")
                                                                                                                 java.lang.String userId)
        Internal method findByUserIdWUserRegistrationDetailsProfileName for documentation ONLY.
        Parameters:
        storeId - the store ID
        userId - the user ID
        Returns:
        the null response
      • findByUserIdWUserRegistrationSummaryProfileName

        @Path(value="{userId}")
        public javax.ws.rs.core.Response findByUserIdWUserRegistrationSummaryProfileName(@PathParam(value="storeId")
                                                                                                                 java.lang.String storeId,
                                                                                                                 @PathParam(value="userId")
                                                                                                                 java.lang.String userId)
        Internal method findByUserIdWUserRegistrationSummaryProfileName for documentation ONLY.
        Parameters:
        storeId - the store ID
        userId - the user ID
        Returns:
        the null response
      • findByUserIdWAssignedRolesDetailsProfileName

        @Path(value="{userId}")
        public javax.ws.rs.core.Response findByUserIdWAssignedRolesDetailsProfileName(@PathParam(value="storeId")
                                                                                                              java.lang.String storeId,
                                                                                                              @PathParam(value="userId")
                                                                                                              java.lang.String userId)
        Internal method findByUserIdWAssignedRolesDetailsProfileName for documentation ONLY.
        Parameters:
        storeId - the store ID
        userId - the user ID
        Returns:
        the null response
      • findByUserIdWUserTopLevelOrganizationsAdministered

        @Path(value="{userId}")
        public javax.ws.rs.core.Response findByUserIdWUserTopLevelOrganizationsAdministered(@PathParam(value="storeId")
                                                                                                                    java.lang.String storeId,
                                                                                                                    @PathParam(value="userId")
                                                                                                                    java.lang.String userId)
        Internal method findByUserIdWUserTopLevelOrganizationsAdministered for documentation ONLY.
        Parameters:
        storeId - the store ID
        userId - the user ID
        Returns:
        the null response
      • findByUserIdWRolesOfUserAllProfileName

        @Path(value="{userId}")
        public javax.ws.rs.core.Response findByUserIdWRolesOfUserAllProfileName(@PathParam(value="storeId")
                                                                                                        java.lang.String storeId,
                                                                                                        @PathParam(value="userId")
                                                                                                        java.lang.String userId)
        Internal method findByUserIdWRolesOfUserAllProfileName for documentation ONLY.
        Parameters:
        storeId - the store ID
        userId - the user ID
        Returns:
        the null response
      • findByUserIdWRolesOfUserInOrgsICanAdminProfileName

        @Path(value="{userId}")
        public javax.ws.rs.core.Response findByUserIdWRolesOfUserInOrgsICanAdminProfileName(@PathParam(value="storeId")
                                                                                                                    java.lang.String storeId,
                                                                                                                    @PathParam(value="userId")
                                                                                                                    java.lang.String userId)
        Internal method findByUserIdWRolesOfUserInOrgsICanAdminProfileName for documentation ONLY.
        Parameters:
        storeId - the store ID
        userId - the user ID
        Returns:
        the null response
      • usersICanAdmin

        public javax.ws.rs.core.Response usersICanAdmin(@PathParam(value="storeId")
                                                        java.lang.String storeId)
        This allows an administrator to find users in organizations that he/she can administer.
        Parameters:
        storeId - The store ID.
        Returns:
        The response.
      • registeredUsersICanManage

        public javax.ws.rs.core.Response registeredUsersICanManage(@PathParam(value="storeId")
                                                                   java.lang.String storeId)
        This allows CSR/CSS to find approved registered users in store organizations that he/she can manage.
        Parameters:
        storeId - The store ID.
        Returns:
        The response.
      • usersICanAdminWUserListDetailsProfileName

        public javax.ws.rs.core.Response usersICanAdminWUserListDetailsProfileName(@PathParam(value="storeId")
                                                                                   java.lang.String storeId)
        Internal method usersICanAdminWUserListDetailsProfileName for documentation ONLY.
        Parameters:
        storeId - the store ID
        Returns:
        the null response
      • registeredUsersICanManageWUserListDetailsProfileName

        public javax.ws.rs.core.Response registeredUsersICanManageWUserListDetailsProfileName(@PathParam(value="storeId")
                                                                                              java.lang.String storeId)
        Internal method registeredUsersICanManageWUserListDetailsProfileName for documentation ONLY.
        Parameters:
        storeId - the store ID
        Returns:
        the null response
      • findByQuery

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
        public javax.ws.rs.core.Response findByQuery(@PathParam(value="storeId")
                                                                                                                                                                  java.lang.String storeId,
                                                                                                                                                                  @QueryParam(value="q")
                                                                                                                                                                  java.lang.String queryName)
        This allows an administrator to find users based on a query name. Supported query name is usersICanAdmin.
        Parameters:
        storeId - The store ID.
        queryName - The query name.
        Returns:
        The response.
      • findOptOutBySelf

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="@self/optOut")
        public javax.ws.rs.core.Response findOptOutBySelf(@PathParam(value="storeId")
                                                                                                                                                                                                    java.lang.String storeId)
        Find personal opt-out. When the store level personal opt-out does not exist, the site level personal opt-out is returned.
        Parameters:
        storeId - The store ID.
        Returns:
        The response.
      • findOptOutBySelfWOptOutSmsProfileName

        @Path(value="@self/optOut")
        public javax.ws.rs.core.Response findOptOutBySelfWOptOutSmsProfileName(@PathParam(value="storeId")
                                                                                                           java.lang.String storeId)
        Internal method findOptOutBySelfWOptOutSmsProfileName for documentation ONLY.
        Parameters:
        storeId - the store ID
        Returns:
        the null response
      • findOptOutBySelfWOptOutAllProfileName

        @Path(value="@self/optOut")
        public javax.ws.rs.core.Response findOptOutBySelfWOptOutAllProfileName(@PathParam(value="storeId")
                                                                                                           java.lang.String storeId)
        Internal method findOptOutBySelfWOptOutAllProfileName for documentation ONLY.
        Parameters:
        storeId - the store ID
        Returns:
        the null response
      • registerPerson

        @POST
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Consumes(value={"application/json","application/xml"})
        public javax.ws.rs.core.Response registerPerson(@PathParam(value="storeId")
                                                                                                                                                                                                                               java.lang.String storeId,
                                                                                                                                                                                                                               @QueryParam(value="responseFormat")
                                                                                                                                                                                                                               java.lang.String responseFormat)
        Registers a new user. When mode is set to admin, the register is done by an administrator.
        Parameters:
        storeId - the store id
        responseFormat - the response format
        Returns:
        the response
      • registerPersonOnUserRegistrationAdminAdd

        @Consumes(value={"application/json","application/xml"})
        public javax.ws.rs.core.Response registerPersonOnUserRegistrationAdminAdd(@PathParam(value="storeId")
                                                                                                                                          java.lang.String storeId,
                                                                                                                                          @QueryParam(value="responseFormat")
                                                                                                                                          java.lang.String responseFormat)
        Internal method registerPersonOnUserRegistrationAdminAdd for documentation ONLY.
        Parameters:
        storeId - the store ID
        responseFormat - the response format
        Returns:
        the null response
      • updatePerson

        @PUT
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Consumes(value={"application/json","application/xml"})
         @Path(value="@self")
        public javax.ws.rs.core.Response updatePerson(@PathParam(value="storeId")
                                                                                                                                                                                                                                                  java.lang.String storeId,
                                                                                                                                                                                                                                                  @QueryParam(value="responseFormat")
                                                                                                                                                                                                                                                  java.lang.String responseFormat)
        Update user account data for a registered shopper. This includes user self address, profile data, and password.

        Supporting 2 scenarios to reset a shopper's password:

        While unauthenticated: If you do not know the password and want to reset password, you will pass in a Map with the following keys.

        • resetPassword - set it to true
        • logonId - user login id
        • challengeAnswer - challenge answer
        a) the new password will be sent to you via email. OR

        b) Two-step process: Beginning in 7.0.0.9, the CMDREG.PROPERTIES of ResetPasswordGuestCmd can be updated to include inSessionValidationCode=true to enable the following flow. (Note: A guest identity must be obtained before this two-step process can be invoked):

      • i) [7.0.0.9+] A validation code can be emailed to the person, which must be specified to update the password.
      • ii)[7.0.0.9+] The validation code, along with a new password, and verification of the new password are subsequently specified in the same session, to update the password.
        • resetPassword - set it to true
        • logonPassword - new logon password
        • xcred_logonPasswordVerify - new logon verify password
        • xcred_validationCode - the validation code
        While authenticated: If you do know the current password but want to change the password with a new password, you will pass in a Map with the following keys and values. The existing password will then be changed to use the new password you specify.
        • resetPassword - set it to true
        • logonPassword - new logon password
        • xcred_logonPasswordOld - existing/old logon password
        • xcred_logonPasswordVerify - new logon verify password
Parameters:
storeId - The store identifier.
responseFormat - The response format.
Returns:
Response
  • updatePersonOnUserRegistrationUpdate

    @Consumes(value={"application/json","application/xml"})
     @Path(value="@self")
    public javax.ws.rs.core.Response updatePersonOnUserRegistrationUpdate(@PathParam(value="storeId")
                                                                                                                                                        java.lang.String storeId,
                                                                                                                                                        @QueryParam(value="responseFormat")
                                                                                                                                                        java.lang.String responseFormat)
    Internal method updatePersonOnUserRegistrationUpdate for documentation ONLY.
    Parameters:
    storeId - the store ID
    responseFormat - the response format
    Returns:
    the null response
  • updatePersonByAdmin

    @PUT
     @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
     @Consumes(value={"application/json","application/xml"})
     @Path(value="{userId}")
    public javax.ws.rs.core.Response updatePersonByAdmin(@PathParam(value="storeId")
                                                                                                                                                                                                                                                        java.lang.String storeId,
                                                                                                                                                                                                                                                        @PathParam(value="userId")
                                                                                                                                                                                                                                                        java.lang.String userId)
    This allows an administrator to update account data for a registered user.
    Parameters:
    storeId - the store ID
    userId - the user ID
    Returns:
    the response
  • assignRoleByAdmin

    @Consumes(value={"application/json","application/xml"})
     @Path(value="{userId}")
    public javax.ws.rs.core.Response assignRoleByAdmin(@PathParam(value="storeId")
                                                                                                                                        java.lang.String storeId,
                                                                                                                                        @PathParam(value="userId")
                                                                                                                                        java.lang.String userId)
    This allows an administrator to assign role(s) to a registered user.
    Parameters:
    storeId - the store ID
    userId - the user ID
    Returns:
    the response
  • unassignRoleByAdmin

    @Consumes(value={"application/json","application/xml"})
     @Path(value="{userId}")
    public javax.ws.rs.core.Response unassignRoleByAdmin(@PathParam(value="storeId")
                                                                                                                                          java.lang.String storeId,
                                                                                                                                          @PathParam(value="userId")
                                                                                                                                          java.lang.String userId)
    This allows an administrator to unassign role(s) from a registered user.
    Parameters:
    storeId - the store ID
    userId - the user ID
    Returns:
    the response
  • resetPasswordByAdmin

    @POST
     @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
     @Consumes(value={"application/json","application/xml"})
     @Path(value="updateMemberPassword")
    public javax.ws.rs.core.Response resetPasswordByAdmin(@PathParam(value="storeId")
                                                                                                                                                                                                                                                                      java.lang.String storeId)
    This method allows an administrator to reset password for a registered user. Password can be reset in administrator session or while running on-behalf session for a registered user.
    Parameters:
    storeId - the store ID
    Returns:
    the response
  • performActionByAdmin

    @POST
     @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
     @Consumes(value={"application/json","application/xml"})
     @Path(value="{userId}")
    public javax.ws.rs.core.Response performActionByAdmin(@PathParam(value="storeId")
                                                                                                                                                                                                                                                          java.lang.String storeId,
                                                                                                                                                                                                                                                          @PathParam(value="userId")
                                                                                                                                                                                                                                                          java.lang.String userId)
    Performs an action on a person. See each action for details on input and output.
    Parameters:
    storeId - the store ID
    userId - the user ID
    Returns:
    the response
  • deleteContextAttributeForPerson

    @DELETE
     @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
     @Path(value="@self/contextattributes/{jobNames}/{values}")
    public javax.ws.rs.core.Response deleteContextAttributeForPerson(@PathParam(value="jobNames")
                                                                                                                                                                                                                                                 java.lang.String jobName,
                                                                                                                                                                                                                                                 @PathParam(value="values")
                                                                                                                                                                                                                                                 java.lang.String values,
                                                                                                                                                                                                                                                 @PathParam(value="storeId")
                                                                                                                                                                                                                                                 java.lang.String storeId,
                                                                                                                                                                                                                                                 @QueryParam(value="responseFormat")
                                                                                                                                                                                                                                                 java.lang.String responseFormat)
    Deletes one or more context attributes of an existing person.
    Parameters:
    jobName - is the name of the context attribute.
    values - is the value of the context attribute . Multiple context attribute values can be passed to the URI separated by comma ','.
    storeId - storeId
    responseFormat - response Format
    Returns:
    Response
  • postProcess

    public void postProcess(java.util.Map<java.lang.String,java.lang.Object> responseMap)
    Description copied from class: AbstractBaseResourceHandler
    Method to provide post process in out of box JSON/XML entity providers after each DataObject has been converted to a Map and before constructing the REST response. By default, it does nothing. Overwrite this method in your resource handler class to perform any post process, for example, merge maps from multiple DataObjects into a single Map.
    Specified by:
    postProcess in interface IResourceHandler
    Overrides:
    postProcess in class AbstractBaseResourceHandler
    Parameters:
    responseMap - The response Map after each DataObject has been converted to a Map.
  • updateMemberUser

    @POST
     @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
     @Path(value="updateMemberUser/{userId}")
    public javax.ws.rs.core.Response updateMemberUser(@PathParam(value="storeId")
                                                                                                                                                                                                              java.lang.String storeId,
                                                                                                                                                                                                              @PathParam(value="userId")
                                                                                                                                                                                                              java.lang.String userId)
    Updates user to be included/excluded from a member group or to be unassigned
    Parameters:
    storeId - the store ID
    userId - the user Id
    Returns:
    Response