com.ibm.commerce.usermanagement.commands

Class UserRegistrationAddPreApprovalCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, com.ibm.commerce.ubf.commands.BusinessFlowCmd, UserRegistrationAddCmd, UserRegistrationAddPreApprovalCmd, UserRegistrationCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class UserRegistrationAddPreApprovalCmdImpl
    extends UserRegistrationAddCmdImpl
    implements UserRegistrationAddPreApprovalCmd
    The UserRegistrationAddPreApprovalCmd command registers a guest user. This command is called by Unified Business Flow (UBF) framework if the URL command UserRegistrationAdd is called.

    This command replaces UserRegistrationAddCmd in WCS V5.1. After the user is registered, the user automatically logs on.

    A B2B user can be created by specified profileType equals to 'B'. B2B users may need to be approved. To register a user under an organization or organizational unit, specify the parameter parentMember.

    The information of the new user is stored in the MEMBER, USERS, USERREG, MBRREL, USERPROF, BUSPROF, USERDEMO and ADDRESS tables.

    Use this command with SSL (Secure Sockets Layer) to ensure that the information are encrypted. To do so type the command with the HTTPS secure protocol.

    The parameter URL, logonId, logonPassword and logonPasswordVerify are mandatory. The rest of the parameters are all optional.

    Behavior

    • Calls an empty task command PreUserRegistrationAddCmd. Store Developers can overwrite it change the input to the command.
    • Updates the record of the current guest user in USERS table and changes the registration type from 'G' (guest) to 'R' (registered) and populates Distinguished Name.
    • Create a new record in USERREG table. If Authentication Mode is 'LDAP', the logonId field in USERREG table stores the Distinguished Name of the user and the logon password is only stored in LDAP server, not in the USERREG table.
    • Member relationship information is stored in MBRREL table.
    • If any field related to USERPROF, BUSPROF and USERDEMO is specified, a new record will be created in these tables, otherwise, no record will be created.
    • If any field related to ADDRESS table is specified, a self address (also called register address, with selfAddress field set to '1' and nickname is same as logonId) will be created. Otherwise no record will be created in the ADDRESS table.
      Each user can have at most one self address.
    • Calls a task command ProcessParentMemberCmd to validate parentMember.
      If parentMember is null, the default parent is Default Organization (orgEntityId = -2000). If parentMember is not null, it can take two different type of values:
      • Encrypted orgEntityId (using "nc_crypt -e <orgentityId>")
      • Distinguished Name of the organization or organizational unit (eg. "o=Default Organization,o=Root Organization").
    • Calls a task command ProcessProfileTypeCmd to determinate and validate profileType.
      If profileType is not specified, and parentMember is not specified or is Default Organization, by default, the profileType is set to "C" and a B2C user will be created;
      If profileType is not specified and parentMember is not Default Organization, by default, the profileType is set to"B" and a B2B user will be created.
    • Calls a task command AuthenticationPolicyCmd to performs verification or update of a user credentials.
    • If preferredCurrency is not specified, default is the preferred currency in command context.
    • If a new address need to be created but addressType is not specified, default is 'SB' (Shipping and Billing address).
    • Check the required registration information parameters.
    • Calls a task command AuditUserRegistrationCmd to check the additional parameters. Store Developers need to add new code to the task command if they want to customizable check.
    • Calls a task command SetCurrencyPrefCmd to set preferred currency to command context.
    • Calls a task command UserRegistrationRoleAssignCmd to assign roles during self-registration. Currently this task command does nothing and it needs to be overridden by customers if they want to assign roles during self-registration.
    • If the authentication mode is 'LDAP', a user entry will be created in the LDAP server.
    • If the command fails, the UserRegistrationErrorView view command is called. Upon successful completion, the specified URL is called.
    • Calls an empty task command PostUserRegistrationAddCmd. Store Developers can overwrite it to perform additional operations.

    Exception Conditions

    • URL is null (_ERR_CMD_MISSING_PARAM).
    • The length of URL length equals 0 (_ERR_CMD_INVALID_PARAM).
    • logonId is null (_ERR_CMD_MISSING_PARAM).
    • The length of logonId equals 0 (_ERR_CMD_INVALID_PARAM).
    • logonId already exists in database (EC_UREG_ERR_LOGONID_EXISTS).
    • In LDAP Mode, the formulated Distinguished Name already exist in LDAP Sever or WCS Database (_ERR_RDN_ALREADY_EXIST).
    • logonPassword is null (_ERR_CMD_MISSING_PARAM).
    • The length of logonPassword equals 0 or greater than 70 (_ERR_CMD_INVALID_PARAM).
    • logonPasswordVerify is null (_ERR_CMD_MISSING_PARAM).
    • logonPassword is not equal to logonPasswordVerify (EC_UREG_ERR_PASSWORDS_NOT_SAME).
    • profileType is not null and not equal to 'B' or 'C' (_ERR_CMD_INVALID_PARAM).
    • parentMemberId is not null and not a foreign key set to the ORGENTITY table (_ERR_CMD_INVALID_PARAM).
    • preferredCurrency is not null and not a foreign key set to the SETCCURR table (_ERR_CMD_INVALID_PARAM).
    • preferredLanguage is not null and not a foreign key set to the LANGUAGE table (_ERR_CMD_INVALID_PARAM).
    • age, income, children, household, demographicField6, publishPhone1, publishPhone2, and packageSupression is not null and not an integer (_ERR_CMD_INVALID_PARAM).
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.String CLASSNAME
        The name of this implementation of the command.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UserRegistrationAddPreApprovalCmdImpl

        public UserRegistrationAddPreApprovalCmdImpl()
    • Method Detail

      • getEntityId

        public java.lang.Long getEntityId()
        Returns the entity identifier.
        Specified by:
        getEntityId in interface com.ibm.commerce.ubf.commands.BusinessFlowCmd
        Returns:
        The entity identifier.
      • getEntityObject

        public com.ibm.commerce.ubf.beans.BusinessFlowEntityBean getEntityObject()
        Returns the entity object.
        Specified by:
        getEntityObject in interface com.ibm.commerce.ubf.commands.BusinessFlowCmd
        Returns:
        The entity object.
      • getFlowContext

        public java.lang.String getFlowContext()
        Returns the flow context.
        Specified by:
        getFlowContext in interface com.ibm.commerce.ubf.commands.BusinessFlowCmd
        Returns:
        The flow context.
      • performExecute

        public void performExecute()
                            throws ECException
        Sets the user registration state to pre-approved and then sets the roles for the member in the organization. Then the credentials are updated and the PostUserRegistationAdd command is called.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class UserRegistrationAddCmdImpl
        Throws:
        ECException - If there is a problem updating the approval state or calling any of the task commands.
      • reset

        public void reset()
        Resets the command so it can be reused for another call.
        Specified by:
        reset in interface UserRegistrationCmd
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class UserRegistrationCmdImpl
      • setFlowContext

        public void setFlowContext(java.lang.String newFlowContext)
        Sets the flow context.
        Specified by:
        setFlowContext in interface com.ibm.commerce.ubf.commands.BusinessFlowCmd
        Parameters:
        newFlowContext - the flow context.
      • setStateIdentifier

        public void setStateIdentifier(java.lang.Integer aStateIdentifier)
        Sets the state identifier.
        Specified by:
        setStateIdentifier in interface com.ibm.commerce.ubf.commands.BusinessFlowCmd
        Parameters:
        aStateIdentifier - the state identifier.