com.ibm.commerce.collaboration.livehelp.commands
Class RetrieveShopperProfileCmdImpl
com.ibm.commerce.command.AbstractECTargetableCommand
|
+--com.ibm.commerce.command.ControllerCommandImpl
|
+--com.ibm.commerce.collaboration.livehelp.commands.RetrieveShopperProfileCmdImpl
- All Implemented Interfaces:
- AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, RetrieveShopperProfileCmd
- public class RetrieveShopperProfileCmdImpl
- extends ControllerCommandImpl
- implements RetrieveShopperProfileCmd
Retrieves a shoppers profile for the Customer Care (sametime) tooling in Commerce Accelerator
Behaviour
The command does the following:
- Verifies that the user requesting the action is a Customer Service Representative (CSR), Customer Service
Supervisor (CSS), Seller, or a Site Administrator role in the seller organization. Otherwise, the requester does not have the authority
to execute this command.
- Creates an instance of UserRegistrationDataBean.
- Creates an instance of UserAccessBean.
- Creates an instance of OrderAccessBean.
- Checks if the user is registered.
- If the user is NOT registered, puts the userId in the responseProperties as "Title" and puts the following short xml description in "UserInformation"
<UserInformation>
<Identify></Identify>
<Profile>
<HasProfile></HasProfile>
</Profile>
</UserInformation>
- If the user is registered, puts the logonName in the responseProperties as "Title" and puts the following full xml description in "UserInformation"
<UserInformation>
<Identify></Identify>
<Name></Name>
<Preference>
<Language></Language>
<Currency></Currency>
<DeliveryMethod></DeliveryMethod>
</Preference>
<Session>
<LastSessionTimeStamp></LastSessionTimeStamp>
</Session>
<Profile>
<DisplayName></DisplayName>
<Description></Description>
<HasProfile></HasProfile>
</Profile>
<LastOrder>
<LastOrdered></LastOrdered>
<LastOrderValue></LastOrderValue>
<LastOrderCurrency></LastOrderCurrency>
<LastOrderStatus></LastOrderStatus>
</LastOrder>
<UserOrderHistory>
<OrderId></OrderId>
<OrderCurrency></OrderCurrency>
<OrderDescription></OrderDescription>
<OrderTimePlaced></OrderTimePlaced>
<OrderStatus></OrderStatus>
<OrderTotalAmount></OrderTotalAmount>
</UserOrderHistory>
</UserInformation>
- Sets the viewtask to LiveHelpUserProfileView in responseProperties
Exception Conditions
If any parameters are missing, the command sets the _ERR_MISSING_PARMS exception task to handle the error.
Method Summary |
AccessVector |
getResources()
Gets the access vector accessed by this command. |
java.lang.StringBuffer |
getShopperProfile()
Returns the shopper profile |
void |
performExecute()
Contains the business logic for the command. |
protected java.lang.String |
safeString(java.lang.String riskyString)
Utility function to check if a string is safe to use. |
void |
validateParameters()
Validates the parameters expected in the request properties. |
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl |
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setRequestProperties, setResponseProperties, setRetriable, setViewInputProperties |
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties |
Methods inherited from interface com.ibm.commerce.command.ControllerCommand |
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties |
bnRegister
protected UserRegistrationDataBean bnRegister
CLASSNAME
public static final java.lang.String CLASSNAME
COPYRIGHT
public static final java.lang.String COPYRIGHT
ERRTASK_NAME
public static final java.lang.String ERRTASK_NAME
storeId
protected java.lang.String storeId
userId
protected java.lang.String userId
vOrder
protected java.util.Vector vOrder
xmlStringBuffer
protected java.lang.StringBuffer xmlStringBuffer
RetrieveShopperProfileCmdImpl
public RetrieveShopperProfileCmdImpl()
- RetrieveShopperProfileCmdImpl constructor.
getResources
public AccessVector getResources()
throws ECException
- Gets the access vector accessed by this command.
The default implementation returns null indicating that no protectable resource is
accessed by this command. It is the responsibilities of the command writer to
return the protectable primary resource(s) and the corresponding actions accessed
by this command.
- Specified by:
getResources
in interface ECCommand
- Overrides:
getResources
in class AbstractECTargetableCommand
- Returns:
- AccessVector - a vector of resource action pairs.
- Throws:
ECException
- - if anything goes wrong with the resources being instantiated.
getShopperProfile
public java.lang.StringBuffer getShopperProfile()
- Returns the shopper profile
- Returns:
- java.lang.StringBuffer
performExecute
public void performExecute()
throws ECException
- Contains the business logic for the command.
- Specified by:
performExecute
in interface ECCommand
- Overrides:
performExecute
in class AbstractECTargetableCommand
- Throws:
ECException
- - if anything goes wrong with the data resources being queried.
safeString
protected java.lang.String safeString(java.lang.String riskyString)
- Utility function to check if a string is safe to use.
- Parameters:
riskyString
- A string that could be null, or contain leading or trailing spaces.- Returns:
- A safe string, trimmed, and set to "" if the input was null.
validateParameters
public void validateParameters()
throws ECException
- Validates the parameters expected in the request properties.
- Specified by:
validateParameters
in interface ECCommand
- Overrides:
validateParameters
in class AbstractECTargetableCommand
- Throws:
ECException
- If parameters are missing.