com.ibm.commerce.tools.optools.order.commands
Class CSRCustomerAddressAddCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.tools.command.ToolsControllerCommandImpl
                          |
                          +--com.ibm.commerce.tools.optools.order.commands.CSRCustomerAddressAddCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, CSRCustomerAddressAddCmd, ECCommand, ECTargetableCommand, ToolsControllerCommand

public class CSRCustomerAddressAddCmdImpl
extends ToolsControllerCommandImpl
implements CSRCustomerAddressAddCmd

This is the default implementation of the CSRCustomerAddressCmd command.

This command calls the following ControllerCommand(s):

This command uses the following AccessBean(s):

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
static java.lang.String ERRTASK_NAME
          Error handling viewname for this command.
 java.lang.Integer orgLangId
          The language id.
 
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.tools.optools.order.commands. CSRCustomerAddressAddCmd
defaultCommandClassName, NAME
 
Constructor Summary
CSRCustomerAddressAddCmdImpl()
           
 
Method Summary
protected  void createAddress()
          This method calls AddressUpdateCmd to create an address based on an internal address information hashtable.
protected  TypedProperty exceptionUtil( TypedProperty prop, java.lang.Exception ex, java.lang.String methodName, java.lang.String cmdName)
          This method sets up the response property when an excetion occurs.
 java.util.Hashtable getAddress()
          Returns the address information as a hashtable.
 java.lang.String getAddressId()
          Returns the address ID.
 java.lang.String getCustomerId()
          Returns the customer ID.
protected  java.lang.String getMissingParam(java.lang.String msg)
          Returns the missing parameter for the address.
 java.lang.String getNickName()
          Returns the nickname used by the customer.
 java.util.Hashtable getNLS()
          Return the properties containing all translatable messages for this command.
  CommandContext getOrgCmdContext()
          Returns the original commandContext (administrator's command context).
 java.lang.Integer getOrgLangId()
          Returns original language ID.
 java.util.Locale getOrgLocale()
          Returns original locale.
  TypedProperty getOrgReqProperties()
          Returns original request properties.
 java.lang.String getRedirectURL()
          Returns the redirect URL that is to be executed after this controller command terminates.
  AccessVector getResources()
          Gets the resources accessed by this command.
 void performExecute()
          This method performs the execution for creating an addressId for the shopper.
protected  void setAddress(java.util.Hashtable newAddress)
          Sets the address.
protected  void setAddressId(java.lang.String newAddressId)
          Sets address ID.
protected  void setCustomerId(java.lang.String newCustomerId)
          Sets customer ID.
protected  void setNickName(java.lang.String newNickName)
          Sets customer's nickname.
protected  void setNLS(java.util.Hashtable newNLS)
          Sets NLS properties.
protected  void setOrgCmdContext( CommandContext newOrgCmdContext)
          Sets original commandContext.
protected  void setOrgLangId(java.lang.Integer newOrgLangId)
          Sets the original language ID.
protected  void setOrgLocale(java.util.Locale newOrgLocale)
          Sets original locale.
protected  void setOrgReqProperties( TypedProperty newOrgReqProperties)
          Sets original request properties.
protected  void setRedirectURL(java.lang.String newRedirectURL)
          Sets redirect URL.
 void validateParameters()
          This method gets the XMLObject from the GUI dialog.
 
Methods inherited from class com.ibm.commerce.tools.command. ToolsControllerCommandImpl
getViewInputProperties, setRequestProperties
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, 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
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command. AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command. ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, 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

ERRTASK_NAME

public static java.lang.String ERRTASK_NAME
Error handling viewname for this command.

orgLangId

public java.lang.Integer orgLangId
The language id.
Constructor Detail

CSRCustomerAddressAddCmdImpl

public CSRCustomerAddressAddCmdImpl()
Method Detail

createAddress

protected void createAddress()
                      throws ECException
This method calls AddressUpdateCmd to create an address based on an internal address information hashtable.

The address information contains

Throws:
ECException - rethrow all the exceptions from AddressUpdateCmd.

exceptionUtil

protected TypedProperty exceptionUtil(TypedProperty prop,
                                      java.lang.Exception ex,
                                      java.lang.String methodName,
                                      java.lang.String cmdName)
This method sets up the response property when an excetion occurs.
Parameters:
prop - The response typed property.
ex - The catched exception.
methodName - The name of the method with exception.
cmdName - The name of the command.
Returns:
The proper typed property with redirection to the error page.

getAddress

public java.util.Hashtable getAddress()
Returns the address information as a hashtable.
Returns:
Value-pair containing the address information to be created.

getAddressId

public java.lang.String getAddressId()
Returns the address ID.
Specified by:
getAddressId in interface CSRCustomerAddressAddCmd
Returns:
The address ID that was created. If no address has been created then it returns null.

getCustomerId

public java.lang.String getCustomerId()
Returns the customer ID.
Returns:
The customer ID that owns the address.

getMissingParam

protected java.lang.String getMissingParam(java.lang.String msg)
Returns the missing parameter for the address.
Parameters:
msg - The error message from the AddressUpdateCmd command.
Returns:
The formatted error message string that will be sent to the error page.

getNickName

public java.lang.String getNickName()
Returns the nickname used by the customer.
Returns:
The nickname of the customer.

getNLS

public java.util.Hashtable getNLS()
Return the properties containing all translatable messages for this command.
Returns:
Name value pairs of translatable messages.

getOrgCmdContext

public CommandContext getOrgCmdContext()
Returns the original commandContext (administrator's command context).
Returns:
The original command context when calling this command.

getOrgLangId

public java.lang.Integer getOrgLangId()
Returns original language ID.
Returns:
The original language ID.

getOrgLocale

public java.util.Locale getOrgLocale()
Returns original locale.
Returns:
The original locale.

getOrgReqProperties

public TypedProperty getOrgReqProperties()
Returns original request properties.
Returns:
The original request properties.

getRedirectURL

public java.lang.String getRedirectURL()
Returns the redirect URL that is to be executed after this controller command terminates.
Returns:
The name of the view to be redirected to.

getResources

public AccessVector getResources()
                          throws ECException
Gets the resources accessed by this command. For this command, the resource accessed is the customer.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
A vector of resource action pairs used by the command.
Throws:
ECException - If the resource can not be retrieved.

performExecute

public void performExecute()
                    throws ECException
This method performs the execution for creating an addressId for the shopper.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException

setAddress

protected void setAddress(java.util.Hashtable newAddress)
Sets the address.
Parameters:
newAddress - Contains the name-value pairs with the address information.

setAddressId

protected void setAddressId(java.lang.String newAddressId)
Sets address ID.
Parameters:
newAddressId - The newly created address ID.

setCustomerId

protected void setCustomerId(java.lang.String newCustomerId)
Sets customer ID.
Parameters:
newCustomerId - The customer ID.

setNickName

protected void setNickName(java.lang.String newNickName)
Sets customer's nickname.
Parameters:
newNickName - The customer's nickname.

setNLS

protected void setNLS(java.util.Hashtable newNLS)
Sets NLS properties.
Parameters:
newNLS - The name-value pairs containing the messages to be used by this command.

setOrgCmdContext

protected void setOrgCmdContext(CommandContext newOrgCmdContext)
Sets original commandContext.
Parameters:
newOrgCmdContext - The original command context (admin command context).

setOrgLangId

protected void setOrgLangId(java.lang.Integer newOrgLangId)
Sets the original language ID.
Parameters:
newOrgLangId - The original language ID.

setOrgLocale

protected void setOrgLocale(java.util.Locale newOrgLocale)
Sets original locale.
Parameters:
newOrgLocale - The locale from the original command context.

setOrgReqProperties

protected void setOrgReqProperties(TypedProperty newOrgReqProperties)
Sets original request properties.
Parameters:
newOrgReqProperties - The original request properties.

setRedirectURL

protected void setRedirectURL(java.lang.String newRedirectURL)
Sets redirect URL.
Parameters:
newRedirectURL - The name of the redirect page.

validateParameters

public void validateParameters()
                        throws ECApplicationException
This method gets the XMLObject from the GUI dialog. It parses the XMLObject to get the information into the commands local variables. It also sets the success redirect URL.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECApplicationException - If cannot parse the XMLObject as expected, throw ECApplicationException