com.ibm.commerce.usermanagement.commands
Class ProcessProfileTypeCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.usermanagement.commands.ProcessProfileTypeCmdImpl
All Implemented Interfaces:
ECCommand, ECTargetableCommand, ProcessProfileTypeCmd, TaskCommand

public class ProcessProfileTypeCmdImpl
extends TaskCommandImpl
implements ProcessProfileTypeCmd

This task command is called by UserRegistration commands to determine the profileType of a user during registration.

This task comand is called after the ProcessParentMember task command being called. The default logic of this task command is: If profileType is found in requestProperties, check if it equals to either 'C' or 'B', if not, an exception will thrown. If profileType is not found in requestProperties, If parentMemberId is null or is Default Organiztion, then set profileType to 'C', otherwise, set profileType to 'C'. The default logic can be overwriten.

Inputs of this task command are:

 setRequestProperties(TypedProperty)
 - sets request properties which may or may not contain profileType property. But it should contain
   parentMemberId property. otherwise, an exception will thrown.
Outputs of this task command is:
 getRequestProperties(TypedProperty)
 - returns request properties which contains determined profileType property.
 getProfileType
 - gets the profile type determined.
See Also:
Serialized Form

Field Summary
static java.lang.String CLASSNAME
          The name of this implementation of the command.
static java.lang.String COPYRIGHT
          IBM Copyright notice field.
protected  TypedProperty requestProperties
          The request properties.
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.usermanagement.commands. ProcessProfileTypeCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
ProcessProfileTypeCmdImpl()
           
 
Method Summary
 java.lang.String getProfileType()
          Returns the profile type.
  TypedProperty getRequestProperties()
          Returns the request properties.
 void performExecute()
          Process the specified profile type of the member.
 void setRequestProperties( TypedProperty aRequestProperties)
          Sets the request properties.
 
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, validateParameters
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

requestProperties

protected TypedProperty requestProperties
The request properties.
Constructor Detail

ProcessProfileTypeCmdImpl

public ProcessProfileTypeCmdImpl()
Method Detail

getProfileType

public java.lang.String getProfileType()
Returns the profile type.
Specified by:
getProfileType in interface ProcessProfileTypeCmd
Returns:
The profile type.

getRequestProperties

public TypedProperty getRequestProperties()
Returns the request properties.
Specified by:
getRequestProperties in interface ProcessProfileTypeCmd
Returns:
The request properties.

performExecute

public void performExecute()
                    throws ECException
Process the specified profile type of the member. If the member does not have a profile type, ECUserConstants.EC_USER_PROFILE_CUSTOMER is used if the parent organization is default organization, otherwise ECUserConstants.EC_USER_PROFILE_BUSINESS. If the profile type does not equal one of these two values, an ECException is thrown.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - If the profile type is not either ECUserConstants.EC_USER_PROFILE_BUSINESS or ECUserConstants.EC_USER_PROFILE_CUSTOMER.

setRequestProperties

public void setRequestProperties(TypedProperty aRequestProperties)
Sets the request properties.
Specified by:
setRequestProperties in interface ProcessProfileTypeCmd
Parameters:
aRequestProperties - the request properties.