public class UpdateShippingGroupFormHandler extends PurchaseProcessFormHandler
UpdateShippingGroupFormHandler class is used to update
any ShippingGroup type. This class could be used to update shipping groups in the
ShippingGroupMapContainer and Order
In order to validate each shipping group type, this class is using validateShippingGroupChainId property value pipeline chain.
The default configured value for validateShippingGroupChainId is validateShippingGroup. If you have any additional
shipping groups, you need to add validation for the shipping group type. Also if you want to perform anything other than the out of box validation,
you need to over ride the validation pipe line processors.
The shipping group information is copied using the ShippingGroupPropertyContainer implementation. If any shipping group does not implement
this interface, the shipping group information is not copied and this class won't work. Either you need to implement this
interface or extend the copyShippingGroupProperties(ShippingGroup, ShippingGroup, DynamoHttpServletRequest, DynamoHttpServletResponse) method.
This class has two flags to update shipping groups in the ShippingGroupMapContainter and Order. The flags are as follows:
updateContainer -- This flag is used to update the shipping group in the ShippingGroupMapContainterupdateOrder -- This flag is used to update the shipping group in the orderGenericFormHandler,
PurchaseProcessFormHandler,
UpdateHardgoodShippingGroupFormHandler| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION |
static java.lang.String |
COULD_NOT_FIND_SHIPPING_GROUP_IN_CONTAINER |
static java.lang.String |
COULD_NOT_FIND_VALID_NICKNAME |
static java.lang.String |
MSG_COPY_ADDRESS |
static java.lang.String |
MSG_NO_SHIPPING_GROUP_IN_ORDER |
static java.lang.String |
MSG_ORDER_UPDATE_ERROR |
static java.lang.String |
MSG_VALIDATE_SHIPPING_GROUP |
protected ShippingGroup |
mShippingGroup |
protected java.lang.String |
mShippingGroupName |
protected java.lang.String |
mShippingGroupType |
protected boolean |
mUpdateContainer |
protected boolean |
mUpdateOrder |
protected java.lang.String |
mUpdateShippingGroupErrorURL |
protected java.lang.String |
mUpdateShippingGroupSuccessURL |
protected java.lang.String |
mValidateShippingGroupChainId
The name of the chain that is used to validate shipping group
|
protected ShippingGroup |
mWorkingShippingGroup |
static java.lang.String |
NOT_VALID_SHIPPING_GROUP_NICKNAME |
LOCK_NAME_ATTRIBUTE_NAME, PARAM_TRANSACTION_CREATED, PARAM_VALUE_TRUEPARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDSSERVICE_INFO_KEYDEFAULT_LOG_TRACE_STATUSDEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description |
|---|
UpdateShippingGroupFormHandler()
Creates a new
UpdateShippingGroupFormHandler instance. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
copyConfiguration()
Copy property settings from the optional
PurchaseProcessConfiguration component. |
protected void |
copyShippingGroupProperties(ShippingGroup pSrcShippingGroup,
ShippingGroup pDestShippingGroup,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
This methods copies information from one shipping group to the other shipping group.
|
ShippingGroup |
getShippingGroup()
Returns the shippingGroup.
|
java.lang.String |
getShippingGroupName()
Returns the shippingGroupName
This property is used to look up the shipping group name in the
ShippingGroupMapContainer. |
java.lang.String |
getShippingGroupType()
Returns the shippingGroupType.
|
java.lang.String |
getUpdateShippingGroupErrorURL()
Returns the updateShippingGroupErrorURL
|
java.lang.String |
getUpdateShippingGroupSuccessURL()
Returns the updateShippingGroupSuccessURL
|
java.lang.String |
getValidateShippingGroupChainId()
Return the validateShippingGroupChainId property.
|
ShippingGroup |
getWorkingShippingGroup()
Returns the workingShippingGroup.
|
boolean |
handleUpdateShippingGroup(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
handleUpdateShippingGroup is used to update a ShippingGroup. |
boolean |
isUpdateContainer()
Returns the updateContainer
This flag is used to update the updated shipping group information in the
ShippingGroupMapContainer. |
boolean |
isUpdateOrder()
Returns the updateOrder
This flag is used to update the new information in the order.
|
void |
postUpdateShippingGroup(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
postUpdateShippingGroup is for work that must happen after
updating ShippingGroup. |
void |
preUpdateShippingGroup(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
preUpdateShippingGroup is for work that must happen before
updating ShippingGroup. |
void |
setShippingGroup(ShippingGroup pShippingGroup)
Sets the shippingGroup.
|
void |
setShippingGroupByNickname(java.lang.String pShippingGroupNickname)
This method is used to locate the original shipping group from the
ShippingGroupMapContainer by the
pShippingGroupNickname and copies the information from original shipping group
to working shipping group. |
void |
setShippingGroupName(java.lang.String pShippingGroupName)
Sets the shippingGroupName
This property is used to look up the shipping group name in the
ShippingGroupMapContainer. |
void |
setShippingGroupType(java.lang.String pShippingGroupType)
Sets the shippingGroupType
This property is used to create the working version of the shipping group type.
|
void |
setUpdateContainer(boolean pUpdateContainer)
Sets the updateContainer
This flag is used to update the updated shipping group information in the
ShippingGroupMapContainer. |
void |
setUpdateOrder(boolean pUpdateOrder)
Sets the updateOrder
This flag is used to update the new information in the order.
|
void |
setUpdateShippingGroupErrorURL(java.lang.String pUpdateShippingGroupErrorURL)
Sets the updateShippingGroupErrorURL
|
void |
setUpdateShippingGroupSuccessURL(java.lang.String pUpdateShippingGroupSuccessURL)
Sets the updateShippingGroupSuccessURL
|
void |
setValidateShippingGroupChainId(java.lang.String pValidateShippingGroupChainId)
Set the validateShippingGroupChainId property.
|
void |
setWorkingShippingGroup(ShippingGroup pWorkingShippingGroup)
Sets the workingShippingGroup.
|
void |
updateContainer(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
ShippingGroup pWorkingShippingGroup,
java.lang.String pShippingGroupName)
This methods updates the new information to the
shipping group which is in the
ShippingGroupMapContainer. |
void |
updateOrder(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
ShippingGroup pWorkingShippingGroup,
ShippingGroup pOriginalShippingGroup)
This method is used to update new information from
pWorkingShippingGroup
to pOriginalShippingGroup (which is in the order). |
void |
updateShippingGroup(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
The
updateShippingGroup updates ShippingGroup. |
protected void |
validateShippingGroup(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
ShippingGroup pShippingGroup,
java.lang.String pShippingGroupName)
This method is invokes the pipeline chain to validate the shipping group.
|
acquireTransactionLock, acquireTransactionLock, afterSet, beforeSet, checkFormRedirect, commitTransaction, createRepriceParameterMap, defaultLocalLockManager, defaultUserProfile, doStartService, ensureTransaction, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, generatePropertyPath, getClaimableManager, getCommerceIdentifierPaymentInfoContainer, getCommerceItemManager, getCommerceItemShippingInfoContainer, getCommerceProfileTools, getCommercePropertyManager, getConfiguration, getCurrentTransaction, getDefaultLocale, getGiftlistManager, getHandlingInstructionManager, getLocalLockManager, getOrder, getOrderManager, getPaymentGroupManager, getPaymentGroupMapContainer, getPipelineManager, getPriceList, getPriceListId, getPriceListManager, getProfile, getProfileRepository, getPurchaseProcessHelper, getRepeatingRequestMonitor, getRepriceOrderChainId, getResourceBundle, getResourceBundle, getResourceBundleName, getSessionExpirationURL, getShippingGroupManager, getShippingGroupMapContainer, getShoppingCart, getTransactionManager, getUserLocale, getUserLocale, getUserPricingModels, handlePipelineError, isConcurrentUpdate, isEnsureTransaction, isFormSubmission, isTransactionCreated, isTransactionMarkedAsRollBack, isUseLocksAroundTransactions, isUseRequestLocale, processException, processPipelineErrors, releaseTransactionLock, releaseTransactionLock, runProcess, runProcess, runProcess, runProcessRepriceOrder, runProcessRepriceOrder, runRepricingProcess, setClaimableManager, setCommerceIdentifierPaymentInfoContainer, setCommerceItemManager, setCommerceItemShippingInfoContainer, setCommerceProfileTools, setCommercePropertyManager, setConfiguration, setCurrentTransaction, setDefaultLocale, setEnsureTransaction, setGiftlistManager, setHandlingInstructionManager, setLocalLockManager, setOrder, setOrderManager, setPaymentGroupManager, setPaymentGroupMapContainer, setPipelineManager, setPriceListId, setPriceListManager, setProfile, setProfileRepository, setPurchaseProcessHelper, setRepeatingRequestMonitor, setRepriceOrderChainId, setSessionExpirationURL, setShippingGroupManager, setShippingGroupMapContainer, setShoppingCart, setTransactionCreated, setTransactionManager, setTransactionToRollbackOnly, setUseLocksAroundTransactions, setUseRequestLocale, setUserLocale, setUserPricingModels, transactionLockName, unsetTransactionCreatedaddFormException, addUncheckedFormException, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwardsafterGet, beforeGetaddLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopServicevlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningpublic static java.lang.String CLASS_VERSION
public static final java.lang.String COULD_NOT_FIND_VALID_NICKNAME
public static final java.lang.String COULD_NOT_FIND_SHIPPING_GROUP_IN_CONTAINER
public static final java.lang.String NOT_VALID_SHIPPING_GROUP_NICKNAME
public static final java.lang.String MSG_COPY_ADDRESS
public static final java.lang.String MSG_NO_SHIPPING_GROUP_IN_ORDER
public static final java.lang.String MSG_ORDER_UPDATE_ERROR
public static final java.lang.String MSG_VALIDATE_SHIPPING_GROUP
protected ShippingGroup mWorkingShippingGroup
protected ShippingGroup mShippingGroup
protected java.lang.String mShippingGroupType
protected java.lang.String mShippingGroupName
protected boolean mUpdateContainer
protected boolean mUpdateOrder
protected java.lang.String mUpdateShippingGroupSuccessURL
protected java.lang.String mUpdateShippingGroupErrorURL
protected java.lang.String mValidateShippingGroupChainId
public UpdateShippingGroupFormHandler()
UpdateShippingGroupFormHandler instance.public ShippingGroup getWorkingShippingGroup()
shippingGroup.public void setWorkingShippingGroup(ShippingGroup pWorkingShippingGroup)
shippingGroup.pWorkingShippingGroup - public ShippingGroup getShippingGroup()
This is the original version of the shipping group (before making any updates).
public void setShippingGroup(ShippingGroup pShippingGroup)
This is the original version of the shipping group (before making any updates).
pShippingGroup - the shippingGroup to setpublic java.lang.String getShippingGroupType()
public void setShippingGroupType(java.lang.String pShippingGroupType)
pShippingGroupType - the shippingGroupType to setpublic java.lang.String getShippingGroupName()
ShippingGroupMapContainer.public void setShippingGroupName(java.lang.String pShippingGroupName)
ShippingGroupMapContainer.pShippingGroupName - the shippingGroupName to setpublic boolean isUpdateContainer()
ShippingGroupMapContainer.
If the flag is turned on the new information is updated to the container.Otherwise it won't.public void setUpdateContainer(boolean pUpdateContainer)
ShippingGroupMapContainer.
If the flag is turned on the new information is updated to the container.Otherwise it won't.pUpdateContainer - The updateContainer to set.public boolean isUpdateOrder()
public void setUpdateOrder(boolean pUpdateOrder)
pUpdateOrder - The updateOrder to set.public void setValidateShippingGroupChainId(java.lang.String pValidateShippingGroupChainId)
pValidateShippingGroupChainId - public java.lang.String getValidateShippingGroupChainId()
public java.lang.String getUpdateShippingGroupSuccessURL()
public void setUpdateShippingGroupSuccessURL(java.lang.String pUpdateShippingGroupSuccessURL)
pUpdateShippingGroupSuccessURL - the updateShippingGroupSuccessURL to setpublic java.lang.String getUpdateShippingGroupErrorURL()
public void setUpdateShippingGroupErrorURL(java.lang.String pUpdateShippingGroupErrorURL)
pUpdateShippingGroupErrorURL - the updateShippingGroupErrorURL to setpublic boolean handleUpdateShippingGroup(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
handleUpdateShippingGroup is used to update a ShippingGroup.pRequest - a DynamoHttpServletRequest valuepResponse - a DynamoHttpServletResponse valueboolean valuejavax.servlet.ServletException - if an error occursjava.io.IOException - if an error occurspublic void preUpdateShippingGroup(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
preUpdateShippingGroup is for work that must happen before
updating ShippingGroup.pRequest - a DynamoHttpServletRequest valuepResponse - a DynamoHttpServletResponse valuejavax.servlet.ServletException - if an error occursjava.io.IOException - if an error occurspublic void postUpdateShippingGroup(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
postUpdateShippingGroup is for work that must happen after
updating ShippingGroup.pRequest - a DynamoHttpServletRequest valuepResponse - a DynamoHttpServletResponse valuejavax.servlet.ServletException - if an error occursjava.io.IOException - if an error occurspublic void updateShippingGroup(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
updateShippingGroup updates ShippingGroup.
First this method validates the working copy of the shipping group. If there is no errors in the
validation, then the updated information is copied.
This class has two flags to update shipping groups in the ShippingGroupMapContainter and Order. The flags are as follows:
updateContainer -- This flag is used to update the shipping group in the ShippingGroupMapContainterupdateOrder -- This flag is used to update the shipping group in the orderpRequest - a DynamoHttpServletRequest valuepResponse - a DynamoHttpServletResponse valuejavax.servlet.ServletExceptionjava.io.IOExceptionprotected void validateShippingGroup(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, ShippingGroup pShippingGroup, java.lang.String pShippingGroupName) throws javax.servlet.ServletException, java.io.IOException
validateShippingGroupChainId property
is used to validate the shipping group.
The default configured value for validateShippingGroupChainId is validateShippingGroup.
Also this method checks for the emptiness of the shipping group name. If the shipping group name is empty, this method adds an exception.
pRequest - pResponse - pShippingGroup - The working shipping group or any shipping group that needs to be validated.pShippingGroupName - The shipping group name to be validated.javax.servlet.ServletExceptionjava.io.IOExceptionpublic void updateContainer(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, ShippingGroup pWorkingShippingGroup, java.lang.String pShippingGroupName) throws javax.servlet.ServletException, java.io.IOException
ShippingGroupMapContainer.
This method gets the shipping group by using the pShippingGroupName
and updates the new information.pRequest - pResponse - pWorkingShippingGroup - The working copy of the shipping group. From this shipping group the information is copied.pShippingGroupName - The shipping group name parameter tells which shipping group to be updated.javax.servlet.ServletExceptionjava.io.IOExceptionpublic void updateOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, ShippingGroup pWorkingShippingGroup, ShippingGroup pOriginalShippingGroup) throws javax.servlet.ServletException, java.io.IOException
pWorkingShippingGroup
to pOriginalShippingGroup (which is in the order).pRequest - pResponse - pWorkingShippingGroup - The working copy of the shipping group. From this shipping group the information is copied.pOriginalShippingGroup - The original shipping group that needs to be updated in the order.javax.servlet.ServletExceptionjava.io.IOExceptionpublic void setShippingGroupByNickname(java.lang.String pShippingGroupNickname)
ShippingGroupMapContainer by the
pShippingGroupNickname and copies the information from original shipping group
to working shipping group.pShippingGroupNickname - This property is used to look up shipping group from the containerprotected void copyShippingGroupProperties(ShippingGroup pSrcShippingGroup, ShippingGroup pDestShippingGroup, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
ShippingGroupPropertyContainer. If the shipping group does not
implement this ShippingGroupPropertyContainer interface, the form exception is added.
If you want to copy the shipping group information between two shipping groups, either you need to
implement this ShippingGroupPropertyContainer interface or over ride this method.
pSrcShippingGroup - The shipping group from where the information needs to be copiedpDestShippingGroup - The destination shipping grouppRequest - pResponse - javax.servlet.ServletExceptionjava.io.IOExceptionprotected void copyConfiguration()
PurchaseProcessConfiguration component. Property
values that were configured locally are preserved.
Configures the following properties (if not already set):
copyConfiguration in class PurchaseProcessFormHandler