com.ibm.commerce.usermanagement.commands
Class ResellerRegistrationAddCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.usermanagement.commands.ResellerRegistrationAddCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, ResellerRegistrationAddCmd
Direct Known Subclasses:
BuyerRegistrationAddCmdImpl

public class ResellerRegistrationAddCmdImpl
extends ControllerCommandImpl
implements ResellerRegistrationAddCmd

This command is used to perform reseller organization registration. Because the implementation calls organization registration command and user registration command, the parameters on request properties are prefixed with org_ and usr_ in order to separate the parameters. The non prefixed names of attributes are same as for commands OrgEntityAddCmd and UserRegistrationAddCmd.

Behavior

Exception Conditions

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
 
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.usermanagement.commands. ResellerRegistrationAddCmd
NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
ResellerRegistrationAddCmdImpl()
          Constructor for ResellerRegistrationAddCmdImpl.
 
Method Summary
protected  void assignRolesToMemberInOrg(java.lang.Long memberId, java.lang.Long orgEntityId, java.lang.Integer[] roles)
          Assign roles of an organization to a member specified by memberId.
protected  void createMemberGroupForApprovals(java.lang.Long orgentity_id, java.lang.Long user_id)
          Sets up the member group, UserRegistrationApprovalGroup, for approval.
 java.lang.Long getUniqueUserId()
          Creates a new guest user, and returns the userId of this user.
 boolean isGeneric()
          Checks if this is a generic command.
 boolean isRetriable()
          Checks if this command is retriable on transaction rollback exception.
 void performExecute()
          Executes the command.
protected  void prepareRequestProperties()
          Prepares the request properties.
protected  void setRegisterTypeForUser(java.lang.String user_id)
          Set the register type of the user depending on whether the user is a site administrator or any other administrator.
 void setRequestProperties( TypedProperty reqProperties)
          Sets the request properties for this command.
protected  void setResellerOrgParent()
          Sets the reseller organization parent in the request properties, based on the values in the MemberRegistrationAttributes.xml.
 void setViewInputProperties( TypedProperty reqProperties)
          Sets the input properties to be passed to the view command.
 void validateParameters()
          Performs server side parameter checking.
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command. ControllerCommand
execute
 
Methods inherited from interface com.ibm.commerce.command. AccCommand
accessControlCheck, getAccCheck, setAccCheck
 
Methods inherited from interface com.ibm.commerce.command. ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values
Constructor Detail

ResellerRegistrationAddCmdImpl

public ResellerRegistrationAddCmdImpl()
Constructor for ResellerRegistrationAddCmdImpl.
Method Detail

setRequestProperties

public void setRequestProperties(TypedProperty reqProperties)
                          throws ECException
Sets the request properties for this command.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Throws:
ECException

validateParameters

public void validateParameters()
                        throws ECException
Description copied from interface: ECCommand
Performs server side parameter checking. This method replaces the checkParameters() method in a previous version of the code.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException
See Also:
ECCommand.validateParameters()

performExecute

public void performExecute()
                    throws ECException
Executes the command. Registers the new organization, and the new user.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException
See Also:
com.ibm.sfc.cmd.TargetableCommand#performExecute()

isGeneric

public boolean isGeneric()
Description copied from class: ControllerCommandImpl
Checks if this is a generic command. A generic command is a command that can be invoked by a generic user. The default is false for all controller commands and true for all view commands.
Specified by:
isGeneric in interface ControllerCommand
Overrides:
isGeneric in class ControllerCommandImpl
Returns:
boolean
See Also:
ControllerCommand.isGeneric()

isRetriable

public boolean isRetriable()
Description copied from class: ControllerCommandImpl
Checks if this command is retriable on transaction rollback exception. A retriable command will be retried once on transaction rollback exception. The default implementation is to return false.
Specified by:
isRetriable in interface ControllerCommand
Overrides:
isRetriable in class ControllerCommandImpl
Returns:
boolean
See Also:
ControllerCommand.isRetriable()

prepareRequestProperties

protected void prepareRequestProperties()
Prepares the request properties.

assignRolesToMemberInOrg

protected void assignRolesToMemberInOrg(java.lang.Long memberId,
                                        java.lang.Long orgEntityId,
                                        java.lang.Integer[] roles)
                                 throws ECException
Assign roles of an organization to a member specified by memberId.
Parameters:
memberId - the member that roles are to be assigned to
orgEntityId - the organization that the roles are to be played
roles - a list of roles to be assigned
Throws:
ECException

setResellerOrgParent

protected void setResellerOrgParent()
                             throws ECSystemException
Sets the reseller organization parent in the request properties, based on the values in the MemberRegistrationAttributes.xml.
Throws:
ECSystemException

createMemberGroupForApprovals

protected void createMemberGroupForApprovals(java.lang.Long orgentity_id,
                                             java.lang.Long user_id)
Sets up the member group, UserRegistrationApprovalGroup, for approval.
Parameters:
orgentity_id - The organization that the member group belongs to.
user_id - The user in the member group.

setRegisterTypeForUser

protected void setRegisterTypeForUser(java.lang.String user_id)
Set the register type of the user depending on whether the user is a site administrator or any other administrator.
Parameters:
user_id - The userId of the user for whom the register type will be set.

setViewInputProperties

public void setViewInputProperties(TypedProperty reqProperties)
                            throws ECException
Sets the input properties to be passed to the view command. This is initialized to be the request properties for this command.
Specified by:
setViewInputProperties in interface ControllerCommand
Overrides:
setViewInputProperties in class ControllerCommandImpl
Throws:
com.ibm.commerce.exception.ECException.
ECException

getUniqueUserId

public java.lang.Long getUniqueUserId()
                               throws ECException
Creates a new guest user, and returns the userId of this user.
Returns:
The userId of the new user.
Throws:
com.ibm.commerce.exception.ECException.
ECException