public class CurrentShippingGroupSelectionDroplet
extends atg.servlet.DynamoServlet
CurrentShippingGroupSelectionDroplet
is a DynamoServlet that is used to identify and select a default shipping group. The shipping groups are
available from Profile, Order and ShippingGroupMapConatainer. This droplet first looks for a shipping group from the current order. If there is
shipping group in the order, the shipping group that is valid for all commerce items is selected as default.
If there are more than one shipping groups in the order, first valid and all commerce item supported shipping group type is seleced as the default shipping group
in a random manner. If there is no shipping groups is available from the order, then the user's default shipping address is used to initialize as default.
If there is no default found from the order and profile, then the shipping groups is selected randomly from the ShippingGroupMapConatainer.
This servlet renders the following output parameters.
- output
- If there is any shipping groups found in the profile or order, those shipping groups are rendered in the
in the output parameter.
- newAddress
-
This parameter is not used anymore and it is deprecated.
This parameter provides various parameter to add a new address. For example, if no other address is selected by default
the new address is selected as default address and available shipping methods also available in the parameter list.
- error
- If there is any error, the error parameter is served.
This servlet provides following parameters.
- shippingGroups
- This parameter contains list of all shipping groups.
- selectedShippingGroup
- This parameter is the default selected shipping group.
- selectedShippingGroupNickname
- This parameter is the default selected shipping group nickname.
- shippingGroupTypeForAllItems
- This parameter is the supported shipping group types for all commerce items in the order.
- shippingGroupTypeForAnyItem
- This parameter is the supported shipping group types for any commerce item in the order.
-- This FormHandler resets USER_SELECTED_SHIP_TO_NICKNAME based on the result of add address operation.
,
This droplet initializes ShippingGroupMapContainer
,
ApplicableShippingGroups
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Deprecated.
|
static atg.nucleus.naming.ParameterName |
ERROR
Deprecated.
|
static atg.nucleus.naming.ParameterName |
LOCALE_PARAM
Deprecated.
|
static atg.nucleus.naming.ParameterName |
NEW_ADDRESS
Deprecated.
|
static atg.nucleus.naming.ParameterName |
NEW_SHIPPING_GROUP
Deprecated.
|
static java.lang.String |
ORDER
Deprecated.
|
static atg.nucleus.naming.ParameterName |
OUTPUT
Deprecated.
|
static atg.nucleus.naming.ParameterName |
SELECT_DEFAULT_FROM_ORDER
Deprecated.
|
static java.lang.String |
SELECTED_SHIPPING_GROUP
Deprecated.
|
static java.lang.String |
SELECTED_SHIPPING_GROUP_NICKNAME
Deprecated.
|
static java.lang.String |
SHIPPING_GROUP_TYPE_FOR_ALL_ITEMS
Deprecated.
|
static java.lang.String |
SHIPPING_GROUP_TYPE_FOR_ANY_ITEM
Deprecated.
|
static java.lang.String |
SHIPPING_GROUPS
Deprecated.
|
static java.lang.String |
SHIPPING_METHODS
Deprecated.
|
static atg.nucleus.naming.ParameterName |
USER_SELECTED_SHIP_TO_NICKNAME
Deprecated.
|
static int |
ZERO
Deprecated.
|
Constructor and Description |
---|
CurrentShippingGroupSelectionDroplet()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addNewAddressShippingMethod(java.util.Map pShippingMethods,
atg.commerce.order.ShippingGroup pShippingGroup)
Deprecated.
|
protected void |
copyConfiguration()
Deprecated.
Copy property settings from the optional
PurchaseProcessConfiguration component. |
void |
doStartService()
Deprecated.
Perform one-time startup operations, including copying property
settings from the optional
PurchaseProcessConfiguration
component. |
java.lang.String |
firstValidAddressNickname(java.util.Map pShippingGroupMap)
Deprecated.
This method returns first valid shipping group that is supported
by all commerce items.
|
java.util.HashMap |
generateShippingMethods(java.util.Map pShippingGroups,
atg.servlet.DynamoHttpServletRequest pRequest)
Deprecated.
|
java.util.List |
getAvailableMethods(atg.commerce.order.ShippingGroup pShippingGroup)
Deprecated.
|
atg.commerce.order.purchase.PurchaseProcessConfiguration |
getConfiguration()
Deprecated.
Returns property Configuration
|
java.lang.Object |
getInputParameter(atg.servlet.DynamoHttpServletRequest pReq,
atg.nucleus.naming.ParameterName pInputParamter)
Deprecated.
Gets the input parameter values.
|
java.lang.String |
getNewAddressNickname()
Deprecated.
|
atg.commerce.order.ShippingGroup |
getNewShippingGroup()
Deprecated.
|
atg.commerce.order.Order |
getOrder()
Deprecated.
Return the Order property.
|
atg.userprofiling.Profile |
getProfile()
Deprecated.
Return the Profile property.
|
atg.nucleus.ServiceMap |
getShippingGroupInitializers()
Deprecated.
|
atg.commerce.order.ShippingGroupManager |
getShippingGroupManager()
Deprecated.
|
atg.commerce.order.purchase.ShippingGroupMapContainer |
getShippingGroupMapContainer()
Deprecated.
Return the ShippingGroupMapContainer property.
|
atg.commerce.pricing.ShippingPricingEngine |
getShippingPricingEngine()
Deprecated.
the shipping pricing engine to consult for available shipping methods
|
protected java.util.Locale |
getUserLocale(atg.servlet.DynamoHttpServletRequest pRequest)
Deprecated.
Returns the locale associated with the request.
|
atg.commerce.pricing.PricingModelHolder |
getUserPricingModels()
Deprecated.
Returns property UserPricingModels
|
java.lang.String |
getUserSelectedShipToNickname()
Deprecated.
|
atg.commerce.order.ShippingGroup |
getValidHardGoodShippingGroup(atg.commerce.order.HardgoodShippingGroup pShippingGroup)
Deprecated.
|
protected void |
initializeRequestParameters(atg.servlet.DynamoHttpServletRequest pRequest)
Deprecated.
The
initializeRequestParameters method gathers the necessary
input parameters and uses them to adjust initialization requirements. |
boolean |
isIncludeShippingMethods()
Deprecated.
Returns the includeShippingMethods.
|
boolean |
isNullAddress(atg.core.util.Address pAddress)
Deprecated.
|
boolean |
isSelectDefaultFromOrder()
Deprecated.
Returns the selectDefaultFromOrder.
|
boolean |
isServeNewAddressParamter()
Deprecated.
|
boolean |
isShippingAddressSupportedByAllItems(atg.commerce.order.ShippingGroup pShippingGroup)
Deprecated.
This method takes the currently passed in shipping group and checks to see if the
shipping group type is supported by all commerce items in the order.
|
boolean |
isValidAddress(atg.commerce.order.ShippingGroup pShippingGroup)
Deprecated.
This method uses
ShippingGroupPropertyContainer.isEmpty to check for the shipping group's emptiness. |
protected java.lang.String |
obtainApplicationSelectedShippingGroupNickname()
Deprecated.
This method returns a user's default shipping group nickname or first available shipping group nickname from
ShippingGroupMapContainer.
|
java.lang.String |
selectOrderAddress()
Deprecated.
This method loops through shipping groups in the order and checks to see if the shipping group is supported by
all commerce items.
|
void |
serveNewAddressParameter(java.lang.String pSelectedShipToNickname,
atg.commerce.order.ShippingGroup pNewShippingGroup,
atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Deprecated.
|
java.lang.String |
serveOutputParameter(java.lang.String pSelectedShipToNickname,
atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Deprecated.
This method serves the output parameter.
|
void |
service(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Deprecated.
This method serves output/error and newAddress parameter.
|
void |
setConfiguration(atg.commerce.order.purchase.PurchaseProcessConfiguration pConfiguration)
Deprecated.
Sets property Configuration
|
void |
setIncludeShippingMethods(boolean pIncludeShippingMethods)
Deprecated.
Sets the includeShippingMethods.
|
void |
setNewAddressNickname(java.lang.String pNewAddressNickname)
Deprecated.
|
void |
setNewShippingGroup(atg.commerce.order.ShippingGroup pNewShippingGroup)
Deprecated.
|
void |
setOrder(atg.commerce.order.Order pOrder)
Deprecated.
Set the Order property.
|
void |
setProfile(atg.userprofiling.Profile pProfile)
Deprecated.
Set the Profile property.
|
void |
setSelectDefaultFromOrder(boolean pSelectDefaultFromOrder)
Deprecated.
Sets the selectDefaultFromOrder.
|
void |
setServeNewAddressParamter(boolean pServeNewAddressParamter)
Deprecated.
|
void |
setShippingGroupInitializers(atg.nucleus.ServiceMap pShippingGroupInitializers)
Deprecated.
|
void |
setShippingGroupManager(atg.commerce.order.ShippingGroupManager pShippingGroupManager)
Deprecated.
|
void |
setShippingGroupMapContainer(atg.commerce.order.purchase.ShippingGroupMapContainer pShippingGroupMapContainer)
Deprecated.
Set the ShippingGroupMapContainer property.
|
void |
setShippingPricingEngine(atg.commerce.pricing.ShippingPricingEngine pShippingPricingEngine)
Deprecated.
the shipping pricing engine to consult for available shipping methods
|
void |
setUserPricingModels(atg.commerce.pricing.PricingModelHolder pUserPricingModels)
Deprecated.
Sets property UserPricingModels
|
void |
setUserSelectedShipToNickname(java.lang.String pUserSelectedShipToNickname)
Deprecated.
|
java.util.Map |
supplyValidAddresses(java.util.Map pAddressMap)
Deprecated.
This method creates a temporary map and adds only non null addresses to the temporary map.
|
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, init, service, service, setParameter
destroy, getServletConfig, getServletInfo, setServletInfo
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
addLogListener, 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, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
public static final int ZERO
public static final java.lang.String ORDER
public static final atg.nucleus.naming.ParameterName USER_SELECTED_SHIP_TO_NICKNAME
public static final atg.nucleus.naming.ParameterName NEW_SHIPPING_GROUP
public static final atg.nucleus.naming.ParameterName LOCALE_PARAM
public static final atg.nucleus.naming.ParameterName SELECT_DEFAULT_FROM_ORDER
public static final atg.nucleus.naming.ParameterName OUTPUT
public static final atg.nucleus.naming.ParameterName ERROR
public static final atg.nucleus.naming.ParameterName NEW_ADDRESS
public static final java.lang.String SELECTED_SHIPPING_GROUP_NICKNAME
public static final java.lang.String SELECTED_SHIPPING_GROUP
public static final java.lang.String SHIPPING_GROUPS
public static final java.lang.String SHIPPING_METHODS
public static final java.lang.String SHIPPING_GROUP_TYPE_FOR_ALL_ITEMS
public static final java.lang.String SHIPPING_GROUP_TYPE_FOR_ANY_ITEM
public CurrentShippingGroupSelectionDroplet()
public boolean isIncludeShippingMethods()
public void setIncludeShippingMethods(boolean pIncludeShippingMethods)
pIncludeShippingMethods
- public boolean isSelectDefaultFromOrder()
public void setSelectDefaultFromOrder(boolean pSelectDefaultFromOrder)
pSelectDefaultFromOrder
- public atg.nucleus.ServiceMap getShippingGroupInitializers()
public void setShippingGroupInitializers(atg.nucleus.ServiceMap pShippingGroupInitializers)
pShippingGroupInitializers
- The shippingGroupInitializers to set.public atg.commerce.order.ShippingGroupManager getShippingGroupManager()
public void setShippingGroupManager(atg.commerce.order.ShippingGroupManager pShippingGroupManager)
pShippingGroupManager
- The shippingGroupManager to set.public atg.commerce.order.ShippingGroup getNewShippingGroup()
public void setNewShippingGroup(atg.commerce.order.ShippingGroup pNewShippingGroup)
pNewShippingGroup
- The newShippingGroup to set.public java.lang.String getUserSelectedShipToNickname()
public void setUserSelectedShipToNickname(java.lang.String pUserSelectedShipToNickname)
pUserSelectedShipToNickname
- The userSelectedShipToNickname to set.public void setConfiguration(atg.commerce.order.purchase.PurchaseProcessConfiguration pConfiguration)
pConfiguration
- a PurchaseProcessConfiguration
valuepublic atg.commerce.order.purchase.PurchaseProcessConfiguration getConfiguration()
PurchaseProcessConfiguration
valuepublic void setProfile(atg.userprofiling.Profile pProfile)
pProfile
- a Profile
valuepublic atg.userprofiling.Profile getProfile()
Profile
valuepublic void setOrder(atg.commerce.order.Order pOrder)
pOrder
- an Order
valuepublic atg.commerce.order.Order getOrder()
Order
valuepublic void setShippingGroupMapContainer(atg.commerce.order.purchase.ShippingGroupMapContainer pShippingGroupMapContainer)
pShippingGroupMapContainer
- a ShippingGroupMapContainer
valuepublic atg.commerce.order.purchase.ShippingGroupMapContainer getShippingGroupMapContainer()
ShippingGroupMapContainer
valuepublic void setUserPricingModels(atg.commerce.pricing.PricingModelHolder pUserPricingModels)
public atg.commerce.pricing.PricingModelHolder getUserPricingModels()
public void setShippingPricingEngine(atg.commerce.pricing.ShippingPricingEngine pShippingPricingEngine)
pShippingPricingEngine
- new value to setpublic atg.commerce.pricing.ShippingPricingEngine getShippingPricingEngine()
public java.lang.String getNewAddressNickname()
public void setNewAddressNickname(java.lang.String pNewAddressNickname)
pNewAddressNickname
- The newAddressNickname to set.public boolean isServeNewAddressParamter()
public void setServeNewAddressParamter(boolean pServeNewAddressParamter)
pServeNewAddressParamter
- The serveNewAddressParamter to set.public void doStartService() throws atg.nucleus.ServiceException
PurchaseProcessConfiguration
component.doStartService
in class atg.nucleus.GenericService
atg.nucleus.ServiceException
public void service(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
service
in class atg.servlet.DynamoServlet
pRequest
- pResponse
- javax.servlet.ServletException
java.io.IOException
public java.lang.Object getInputParameter(atg.servlet.DynamoHttpServletRequest pReq, atg.nucleus.naming.ParameterName pInputParamter)
pReq
- pInputParamter
- protected void initializeRequestParameters(atg.servlet.DynamoHttpServletRequest pRequest)
initializeRequestParameters
method gathers the necessary
input parameters and uses them to adjust initialization requirements.pRequest
- a DynamoHttpServletRequest
valuepublic java.lang.String serveOutputParameter(java.lang.String pSelectedShipToNickname, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pSelectedShipToNickname
- pRequest
- pResponse
- javax.servlet.ServletException
java.io.IOException
public void serveNewAddressParameter(java.lang.String pSelectedShipToNickname, atg.commerce.order.ShippingGroup pNewShippingGroup, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pSelectedShipToNickname
- pNewShippingGroup
- pRequest
- pResponse
- javax.servlet.ServletException
java.io.IOException
protected void copyConfiguration()
PurchaseProcessConfiguration
component. Property
values that were configured locally are preserved.
Configures the following properties (if not already set):
protected java.lang.String obtainApplicationSelectedShippingGroupNickname()
public java.lang.String selectOrderAddress()
This method loops through shipping groups in the order and checks to see if the shipping group is supported by all commerce items. Then this method finds the nickname of a shipping group in the order. If there is a valid nickname found, then the shipping group is selected as default selection.
public java.util.HashMap generateShippingMethods(java.util.Map pShippingGroups, atg.servlet.DynamoHttpServletRequest pRequest)
pShippingGroups
- Shipping GroupspRequest
- protected java.util.Locale getUserLocale(atg.servlet.DynamoHttpServletRequest pRequest)
locale
. This value can be
either a java.util.Locale object or a String which represents the locale.
Next if the useRequestLocale
property is true, then the locale
of the request will be returned. Finally, if the locale cannot be determined,
the the defaultLocale
property is used.pRequest
- the request to be processedjavax.servlet.ServletException
- an application specific error occurred
processing this requestjava.io.IOException
- an error occurred reading data from the request
or writing data to the response.public atg.commerce.order.ShippingGroup getValidHardGoodShippingGroup(atg.commerce.order.HardgoodShippingGroup pShippingGroup)
pShippingGroup
- This instance may be null or not nullpublic void addNewAddressShippingMethod(java.util.Map pShippingMethods, atg.commerce.order.ShippingGroup pShippingGroup)
pShippingMethods
- that contains all shipping address name as the key and its available methodspShippingGroup
- the shipping group that needs to add its available addresses to the mappublic java.util.List getAvailableMethods(atg.commerce.order.ShippingGroup pShippingGroup)
pShippingGroup
- ShippingGroup that needs shipping methodspublic boolean isNullAddress(atg.core.util.Address pAddress)
public java.lang.String firstValidAddressNickname(java.util.Map pShippingGroupMap)
pShippingGroupMap
- public java.util.Map supplyValidAddresses(java.util.Map pAddressMap)
pAddressMap
- public boolean isShippingAddressSupportedByAllItems(atg.commerce.order.ShippingGroup pShippingGroup)
pShippingGroup
- -- The shipping group to be checked against the list of supported shipping group typespublic boolean isValidAddress(atg.commerce.order.ShippingGroup pShippingGroup)
ShippingGroupPropertyContainer.isEmpty
to check for the shipping group's emptiness.
If the shipping group has any information, then the shipping group is valid.pShippingGroup
-