|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.commerce.order.ShippingGroupManager
public class ShippingGroupManager
This class is the business layer object for managing and manipulating ShippingGroups. This class holds all the business logic for manipulating all types of ShippingGroups.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected static java.util.ResourceBundle |
sResourceBundle
Resource Bundle |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
ShippingGroupManager()
Constructs a ShippingGroupManager object. |
Method Summary | |
---|---|
void |
addRemainingShippingCostToPaymentGroup(Order pOrder,
java.lang.String pShippingGroupId,
java.lang.String pPaymentGroupId)
Adds any unassigned amount of the ShippingGroup's cost with the given id to the PaymentGroup with the given id. |
void |
addShippingCostAmountToPaymentGroup(Order pOrder,
java.lang.String pShippingGroupId,
java.lang.String pPaymentGroupId,
double pAmount)
Adds the given amount of the ShippingGroup's cost with the given id to the PaymentGroup with the given id. |
java.lang.String |
addShippingGroupToMap(ShippingGroup pShippingGroup,
ShippingGroupMapContainer pShippingGroupMapContainer,
java.util.Collection pShippingGroupMatchers)
Deprecated. |
void |
addShippingGroupToOrder(Order pOrder,
ShippingGroup pShippingGroup)
Adds the given ShippingGroup to the given order. |
ShippingGroup |
cloneShippingGroup(ShippingGroup pShippingGroup)
Duplicate the specified shipping group by creating a new instance of the same class and copying selected properties from the old shipping group to the new one. |
void |
copyShippingAddress(ShippingGroup pFromShippingGroup,
ShippingGroupImpl pToShippingGroup)
Copy the address from one shipping group to another |
void |
copySpecialInstructions(ShippingGroup pFromShippingGroup,
ShippingGroupImpl pToShippingGroup)
Copy the special instructions |
ShippingGroup |
createShippingGroup()
Creates a new ShippingGroup object using the type mapped to the defaultShippingGroupType property in OrderTools. |
ShippingGroup |
createShippingGroup(java.lang.String pShippingGroupType)
Creates a new ShippingGroup object using the type mapped to the type supplied in pShippingGroupType. |
ShippingGroup |
createShippingGroup(java.lang.String pShippingGroupType,
ShippingPriceInfo pPriceInfo)
Creates a new ShippingGroup object using the type mapped to the type supplied in pShippingGroupType. |
java.util.List |
getAllShippingGroupRelationships(Order pOrder)
Provides a List of all ShippingGroupRelationships associated with the given Order. |
CommerceItemManager |
getCommerceItemManager()
Returns property commerceItemManager |
java.util.Collection<java.lang.String> |
getCommonShippingGroupTypes(Order pOrder)
This method returns the common shipping group types that are supported by all commerce items in the order. |
java.util.List |
getElectronicShippingGroups(Order pOrder)
Returns all the electronic shipping groups with commerce item relationships |
HardgoodShippingGroup |
getFirstNonGiftHardgoodShippingGroup(Order pOrder)
Returns the first non-gift hardgood shipping group from the order |
HardgoodShippingGroup |
getFirstNonGiftHardgoodShippingGroupWithRels(Order pOrder)
Returns the first non-gift hardgood shipping group with relationships from the order |
java.lang.String |
getFirstShippingGroupType(java.lang.String pSkuId,
java.lang.String pCatalogKey,
CommerceItem pCommerceItem)
Note: If you do not want to use sku's fulfiller property to identify the sku's applicable shipping group type, you need to over ride this method. |
GiftlistManager |
getGiftlistManager()
The giftlist manager |
java.util.List |
getGiftShippingGroups(Order pOrder)
Returns a list of all shipping groups that contain gifts. |
HandlingInstructionManager |
getHandlingInstructionManager()
Returns property handlingInstructionManager |
java.util.List |
getHardgoodShippingGroups(Order pOrder)
Returns all the hardgood shipping groups with commerce item relationships |
java.lang.String |
getNewShippingGroupName(ShippingGroup pShippingGroup,
java.util.Collection pShippingGroupMatchers)
Deprecated. - This method is moved to ShippingGroupMapContainerService |
int |
getNonGiftHardgoodShippingGroupCount(Order pOrder)
Returns the number of non-gift hardgood shipping groups with commerce item relationships |
java.util.List |
getNonGiftHardgoodShippingGroups(Order pOrder)
Returns the non-gift hardgood shipping groups with commerce item relationships |
java.util.List |
getNonModifiableShippingGroups(Order pOrder)
This method determines whether the shipping group is in a condusive to editing state |
java.lang.String[] |
getNonModifiableShippingGroupStates()
|
OrderFulfillmentTools |
getOrderFulfillmentTools()
|
OrderTools |
getOrderTools()
Returns property orderTools |
PaymentGroupManager |
getPaymentGroupManager()
Returns property paymentGroupManager |
long |
getRemainingQuantityForShippingGroup(CommerceItem pItem)
Calculate the "quantity remaining" for a given item. |
ShippingGroup |
getShippingGroupByDescription(java.util.List pShippingGroups,
java.lang.String pDescription)
This method will return a ShippingGroup whose description is pDescription. |
ShippingGroupCommerceItemRelationship |
getShippingGroupCommerceItemRelationship(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pShippingGroupId)
Returns the relationship object which exists between the given CommerceItem and ShippingGroup. |
java.lang.String |
getShippingGroupName(ShippingGroup pShippingGroup,
ShippingGroupMapContainer pShippingGroupMapContainer,
java.util.Collection pShippingGroupMatchers)
Deprecated. |
java.util.Collection<java.lang.String> |
getShippingGroupTypes(Order pOrder)
This method returns all possible shipping group types that are supported by each commerce item in the order. |
java.util.Collection<java.lang.String> |
getShippingGroupTypes(java.lang.String pSkuId,
java.lang.String pCatalogKey,
CommerceItem pCommerceItem)
Note: If you do not want to use sku's fulfiller property to identify the sku's applicable shipping group type, you need to over ride this method. |
boolean |
isAnyElectronicShippingGroups(Order pOrder)
Returns true if the order has at least one electronic shipping group with commerce item relationships |
boolean |
isAnyHardgoodShippingGroups(Order pOrder)
Returns true if the order has at least one hargood shipping group with commerce item relationships. |
boolean |
isAnyNonGiftHardgoodShippingGroups(Order pOrder)
Determines if there are any non-gift hardgood shipping groups with relationships |
boolean |
isMultipleHardgoodShippingGroupsWithRelationships(Order pOrder)
Returns true if the order has more than one hardgood shipping group with commerce item relationships |
boolean |
isMultipleNonGiftHardgoodItems(Order pOrder)
Determines if the total quantity of all non-gift hardgood items is more than one. |
boolean |
isMultipleNonGiftHardgoodShippingGroups(Order pOrder)
Returns true if the order has more than one non-gift hardgood shipping group with commerce item relationships |
protected boolean |
isNonGiftItem(CommerceItem pItem)
Determines if a CommerceItem is a Gift Item or not. |
protected boolean |
isNullAddress(Address pAddress)
Query whether an Address object is null or empty. |
boolean |
isShippingGroupInOrder(Order pOrder,
java.lang.String pShippingGroupId)
isShippingGroupInOrder is used to determine if the ShippingGroup
is already in the Order. |
protected ElectronicShippingGroup |
mergeOrdersCopyElectronicShippingGroup(Order pSrcOrder,
Order pDstOrder,
ElectronicShippingGroup pGroup)
This method is used by mergeOrdersCopyShippingGroup to copy an electronic shipping group from a source order to a destination order. |
protected HardgoodShippingGroup |
mergeOrdersCopyHardgoodShippingGroup(Order pSrcOrder,
Order pDstOrder,
HardgoodShippingGroup pGroup)
This method is used by mergeOrdersCopyShippingGroup to copy a hardgood shipping group from a source order to a destination order. |
protected ShippingGroup |
mergeOrdersCopyShippingGroup(Order pSrcOrder,
Order pDstOrder,
ShippingGroup pGroup)
This method is used by OrderManager.mergeOrders to copy a shipping group from a source order to a destination order. |
protected void |
postCloneShippingGroup(ShippingGroup pOldGroup,
ShippingGroup pNewGroup)
This method is called just before cloneShippingGroup returns a newly created shipping group. |
void |
removeAllRelationshipsFromShippingGroup(Order pOrder,
java.lang.String pShippingGroupId)
Removes all the relationships from the ShippingGroup with the given id in the given order. |
void |
removeAllRelationshipsFromShippingGroup(ShippingGroup pShippingGroup)
Removes all commerce item relationships from the given ShippingGroup. |
void |
removeAllShippingGroupsFromOrder(Order pOrder)
Removes all the ShippingGroups and their Relationships from an Order. |
void |
removeAllShippingGroupsFromOrder(Order pOrder,
java.util.List pExclusions)
Removes ShippingGroups and their Relationships from an Order, retaining the ShippingGroups passed in via the exclusion list parameter. |
void |
removeEmptyShippingGroups(Order pOrder)
Removes all the ShippingGroups which have no CommerceItems. |
void |
removeRemainingShippingCostFromPaymentGroup(Order pOrder,
java.lang.String pShippingGroupId,
java.lang.String pPaymentGroupId)
Removes the "remaining" amount of the ShippingGroup with the given id from the PaymentGroup with the given id. |
void |
removeShippingCostAmountFromPaymentGroup(Order pOrder,
java.lang.String pShippingGroupId,
java.lang.String pPaymentGroupId,
double pAmount)
Removes the given amount of the ShippingGroup's cost with the given id from the PaymentGroup with the given id. |
void |
removeShippingGroupFromOrder(Order pOrder,
java.lang.String pShippingGroupId)
Removes the given ShippingGroup from the given order. |
void |
setCommerceItemManager(CommerceItemManager pCommerceItemManager)
Sets property commerceItemManager |
void |
setGiftlistManager(GiftlistManager pGiftlistManager)
Specifies the GiftlistManager. |
void |
setHandlingInstructionManager(HandlingInstructionManager pHandlingInstructionManager)
Sets property handlingInstructionManager |
void |
setNonModifiableShippingGroupStates(java.lang.String[] pNonModifiableShippingGroupStates)
Sets array of shipping group states that indicate that a shipping group is not modifiable |
void |
setOrderFulfillmentTools(OrderFulfillmentTools pOrderFulfillmentTools)
|
void |
setOrderTools(OrderTools pOrderTools)
Sets property orderTools |
void |
setPaymentGroupManager(PaymentGroupManager pPaymentGroupManager)
Sets property paymentGroupManager |
boolean |
shippingGroupIsModifiable(ShippingGroup pShippingGroup)
This method determines whether the shipping group is in a condusive to editing state |
java.util.List |
splitShippingGroup(Order pOrder,
java.lang.String pShippingGroupId,
java.lang.String[] pItemIds)
Moves a set of Items from a ShippingGroup to a new ShippingGroup. |
java.util.List |
splitShippingGroup(Order pOrder,
java.lang.String pShippingGroupId,
java.lang.String[] pItemIds,
long[] pQuantities)
Moves a set of Items from a ShippingGroup to a new ShippingGroup. |
protected java.util.List |
splitShippingGroupWithImplicitRelationships(Order pOrder,
ShippingGroup pShippingGroup,
java.lang.String[] pItemIds,
long[] pQuantities)
This method is called by splitShippingGroup(). |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_VERSION
protected static java.util.ResourceBundle sResourceBundle
Constructor Detail |
---|
public ShippingGroupManager()
Method Detail |
---|
public OrderTools getOrderTools()
public void setOrderTools(OrderTools pOrderTools)
pOrderTools
- the value to set for property orderToolspublic CommerceItemManager getCommerceItemManager()
public void setCommerceItemManager(CommerceItemManager pCommerceItemManager)
pCommerceItemManager
- the value to set for property commerceItemManagerpublic PaymentGroupManager getPaymentGroupManager()
public void setPaymentGroupManager(PaymentGroupManager pPaymentGroupManager)
pPaymentGroupManager
- the value to set for property paymentGroupManagerpublic HandlingInstructionManager getHandlingInstructionManager()
public void setHandlingInstructionManager(HandlingInstructionManager pHandlingInstructionManager)
pHandlingInstructionManager
- the value to set for property handlingInstructionManagerpublic void setNonModifiableShippingGroupStates(java.lang.String[] pNonModifiableShippingGroupStates)
pNonModifiableShippingGroupStates
- an array of shipping group states
that indicate that a shipping group is not modifiablepublic java.lang.String[] getNonModifiableShippingGroupStates()
public void setGiftlistManager(GiftlistManager pGiftlistManager)
pGiftlistManager
- a GiftlistManager
valuepublic GiftlistManager getGiftlistManager()
GiftlistManager
valuepublic OrderFulfillmentTools getOrderFulfillmentTools()
public void setOrderFulfillmentTools(OrderFulfillmentTools pOrderFulfillmentTools)
pOrderFulfillmentTools
- the orderFulfillmentTools to setpublic java.util.List getGiftShippingGroups(Order pOrder)
pOrder
- the order to use.
public int getNonGiftHardgoodShippingGroupCount(Order pOrder)
pOrder
- the order to use.
public boolean isAnyHardgoodShippingGroups(Order pOrder)
pOrder
- the order to use.
public boolean isAnyElectronicShippingGroups(Order pOrder)
pOrder
- the order to use.
public boolean isMultipleNonGiftHardgoodShippingGroups(Order pOrder)
pOrder
- the order to use.
public boolean isMultipleHardgoodShippingGroupsWithRelationships(Order pOrder)
public boolean isAnyNonGiftHardgoodShippingGroups(Order pOrder)
pOrder
- the order to use.
public java.util.List getNonGiftHardgoodShippingGroups(Order pOrder)
pOrder
- the order to use.public HardgoodShippingGroup getFirstNonGiftHardgoodShippingGroupWithRels(Order pOrder)
pOrder
- the order to use.
public HardgoodShippingGroup getFirstNonGiftHardgoodShippingGroup(Order pOrder)
pOrder
- the order to use.
public java.util.List getHardgoodShippingGroups(Order pOrder)
pOrder
- the order to use.public java.util.List getElectronicShippingGroups(Order pOrder)
pOrder
- the order to use.public boolean isMultipleNonGiftHardgoodItems(Order pOrder)
pOrder
- the order to use.
protected boolean isNonGiftItem(CommerceItem pItem)
pItem
- the CommerceItem to check for.
public ShippingGroup createShippingGroup() throws CommerceException
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.getDefaultShippingGroupType()
public ShippingGroup createShippingGroup(java.lang.String pShippingGroupType) throws CommerceException
pShippingGroupType
- the type mapped to the object instance to use for the ShippingGroup
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
public ShippingGroup createShippingGroup(java.lang.String pShippingGroupType, ShippingPriceInfo pPriceInfo) throws CommerceException
pShippingGroupType
- the type mapped to the object instance to use for the ShippingGrouppPriceInfo
- the ShippingPriceInfo object for this ShippingGroup
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
public void addShippingGroupToOrder(Order pOrder, ShippingGroup pShippingGroup) throws CommerceException
pOrder
- the Order to add the ShippingGroup topShippingGroup
- the ShippingGroup to add to the Order
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
public void removeAllShippingGroupsFromOrder(Order pOrder) throws CommerceException
pOrder
- the Order which contains the ShippingGroups to be removed
InvalidParameterException
- thrown if any of the parameters are null
ObjectRemovalException
- thrown if a ShippingGroup cannot be removed
CommerceException
public void removeAllShippingGroupsFromOrder(Order pOrder, java.util.List pExclusions) throws CommerceException
pOrder
- the Order which contains the ShippingGroups to be removedpExclusions
- the ShippingGroups to be retained (can be null or an empty list)
InvalidParameterException
- thrown if any required parameter is null
ObjectRemovalException
- thrown if a ShippingGroup cannot be removed
CommerceException
public void removeShippingGroupFromOrder(Order pOrder, java.lang.String pShippingGroupId) throws CommerceException
pOrder
- the Order to remove the ShippingGroup frompShippingGroupId
- the id of the ShippingGroup to remove from the Order
InvalidParameterException
- thrown if any of the parameters are null
ObjectRemovalException
- thrown if the ShippingGroup contains any relationships
CommerceException
public void removeAllRelationshipsFromShippingGroup(Order pOrder, java.lang.String pShippingGroupId) throws CommerceException
pOrder
- the Order which contains the CommerceItem to remove the relationships frompShippingGroupId
- the id of the ShippingGroup
InvalidParameterException
- thrown if any of the parameters are null
ShippingGroupNotFoundException
- if a ShippingGroup with the given id is not found in the given order
ObjectRemovalException
- thrown if a relationship cannot be removed
CommerceException
public void removeAllRelationshipsFromShippingGroup(ShippingGroup pShippingGroup) throws CommerceException
pShippingGroup
- the ShippingGroup from which all relationships needs to be removed
CommerceException
ShippingGroup#removeAllCommerceItemRelationships()}
public java.util.List getAllShippingGroupRelationships(Order pOrder) throws CommerceException
pOrder
- the Order whose relationships are sought
InvalidParameterException
- thrown if order parameter is null
CommerceException
Relationship
,
ShippingGroupRelationship
,
ShippingGroupCommerceItemRelationship
,
PaymentGroupShippingGroupRelationship
public void addShippingCostAmountToPaymentGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pPaymentGroupId, double pAmount) throws CommerceException
pOrder
- the Order which the PaymentGroup and ShippingGroup existpShippingGroupId
- the id of the ShippingGroup's cost to addpPaymentGroupId
- the id of the PaymentGroup which the ShippingGroup's cost will be added topAmount
- the amount that is assigned for payment to the PaymentGroup
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a PaymentGroup
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
PaymentGroupShippingGroupRelationship
public void addRemainingShippingCostToPaymentGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pPaymentGroupId) throws CommerceException
pOrder
- the Order which the PaymentGroup and ShippingGroup existpShippingGroupId
- the id of the ShippingGroup's cost to addpPaymentGroupId
- the id of the PaymentGroup which the ShippingGroup's cost will be added to
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a PaymentGroup
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
PaymentGroupShippingGroupRelationship
public void removeShippingCostAmountFromPaymentGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pPaymentGroupId, double pAmount) throws CommerceException
pOrder
- the Order which the PaymentGroup and ShippingGroup existpShippingGroupId
- the id of the ShippingGrouppPaymentGroupId
- the id of the PaymentGrouppAmount
- the amount to remove
InvalidParameterException
- thrown if any of the parameters are null
RelationshipNotFoundException
- if the given Relationship is not found in the ShippingGroup or
PaymentGroup
ObjectRemovalException
- if the removal of the object fails
CommerceException
public void removeRemainingShippingCostFromPaymentGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pPaymentGroupId) throws CommerceException
pOrder
- the Order which the PaymentGroup and ShippingGroup existpShippingGroupId
- the id of the ShippingGrouppPaymentGroupId
- the id of the PaymentGroup
InvalidParameterException
- thrown if any of the parameters are null
RelationshipNotFoundException
- if the given relationship is not found in the
PaymentGroup or ShippingGroup
ObjectRemovalException
- if the removal of the object fails
CommerceException
public java.util.List splitShippingGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String[] pItemIds, long[] pQuantities) throws CommerceException
pOrder
- the Order which the ShippingGroup and CommerceItems exist inpShippingGroupId
- the id of the ShippingGroup which contains the CommerceItems in
pItems which are to be moved to a new ShippingGrouppItemIds
- the ids of the CommerceItems which are to be split into a new
ShippingGroup. The length of the array must be equal to the number of ids supplied in the
array and not greater, otherwise an exception will be thrown.pQuantities
- the quantities of the CommerceItems which are to be moved into the new
ShippingGroup. This array is in parallel with pItems, so pQuantities[0] contains the
quantity of the item at pItems[0] which should be moved to the new ShippingGroup. The
length of this array must be the same as the length of pItemIds.
InvalidParameterException
- thrown if any of the parameters are null or invalid
ObjectCreationException
- if during the process of splitting some object cannot be instantiated
InvalidTypeException
- if an invalid type is found in a Relationship
CommerceException
- if some unexpected event occurspublic java.util.List splitShippingGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String[] pItemIds) throws CommerceException
pOrder
- the Order which the ShippingGroup and CommerceItems exist inpShippingGroupId
- the id of the ShippingGroup which contains the CommerceItems in
pItems which are to be moved to a new ShippingGrouppItemIds
- the ids of the CommerceItems which are to be split into a new
ShippingGroup. The length of the array must be equal to the number of ids supplied in the
array and not greater, otherwise an exception will be thrown.
CommerceException
protected java.util.List splitShippingGroupWithImplicitRelationships(Order pOrder, ShippingGroup pShippingGroup, java.lang.String[] pItemIds, long[] pQuantities) throws CommerceException
pOrder
- the Order which the ShippingGroup and CommerceItems exist inpShippingGroupId
- the id of the ShippingGroup which contains the CommerceItems in pItems
which are to be moved to a new ShippingGrouppItemIds
- the ids of the CommerceItems which are to be split into a new ShippingGroup. The length
of the array must be equal to the number of ids supplied in the array and not greater, otherwise
an exception will be thrown.pQuantities
- the quantities of the CommerceItems which are to be moved into
the new ShippingGroup. This array is in parallel with pItems, so pQuantities[0]
contains the quantity of the item at pItems[0] which should be moved to the new
ShippingGroup. The length of this array must be the same as the length of pItemIds.
InvalidParameterException
- thrown if any of the parameters are null or invalid
ObjectCreationException
- if during the process of splitting some object cannot be instantiated
InvalidTypeException
- if an invalid type is found in a Relationship
CommerceException
- if some unexpected event occurspublic ShippingGroup cloneShippingGroup(ShippingGroup pShippingGroup) throws CommerceException
ShippingAddressContainer
)
EmailAddressContainer
)
Relationships and handling instructions are not copied, nor are prices
or application-specific custom properties. The PriceInfo of the new
shipping group sets all shipping-related prices to zero.
Custom properties may be copied from the old shipping group to the new
one by subclassing ShippingGroupManager
and implementing
the postCloneShippingGroup
method to perform additional
copying.
pShippingGroup
- the ShippingGroup to clone.
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
public void copyShippingAddress(ShippingGroup pFromShippingGroup, ShippingGroupImpl pToShippingGroup) throws CommerceException
pFromShippingGroup
- the shipping group to copy frompToShippingGroup
- the shipping group to copy to
CommerceException
public void copySpecialInstructions(ShippingGroup pFromShippingGroup, ShippingGroupImpl pToShippingGroup)
pFromShippingGroup
- the shipping group to copy frompToShippingGroup
- the shipping group to copy toprotected void postCloneShippingGroup(ShippingGroup pOldGroup, ShippingGroup pNewGroup) throws CommerceException
ShippingGroupManager
can implement this method to add
code that copies custom shipping group properties from the original
shipping group to the new one.
pOldGroup
- The shipping group being cloned.pNewGroup
- The newly created shipping group, whose initial property values
will already have been set by cloneShippingGroup
.
CommerceException
- if any error occurs during the post-clone operationpublic long getRemainingQuantityForShippingGroup(CommerceItem pItem)
pItem
- The CommerceItem we are checking
public ShippingGroup getShippingGroupByDescription(java.util.List pShippingGroups, java.lang.String pDescription) throws CommerceException
pShippingGroups
- a List of ShippingGroupspDescription
- the description to search for in the List of ShippingGroups
InvalidParameterException
- if any of the parameters are null
CommerceException
public void removeEmptyShippingGroups(Order pOrder) throws CommerceException
pOrder
- the Order which contains the ShippingGroups
CommerceException
- if an exception occurs while removing a ShippingGrouppublic ShippingGroupCommerceItemRelationship getShippingGroupCommerceItemRelationship(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId) throws CommerceException
pCommerceItemId
- the id of the CommerceItem which makes up a half of the relationshippShippingGroupId
- the id of the ShippingGroup which makes up a half of the relationship
InvalidParameterException
- thrown if any of the parameters are null
RelationshipNotFoundException
- if a relationship is not found
CommerceException
protected ShippingGroup mergeOrdersCopyShippingGroup(Order pSrcOrder, Order pDstOrder, ShippingGroup pGroup) throws CommerceException
Applications that have extended shipping groups to add additional types not derived from HardgoodShippingGroup or ElectronicShippingGroup, or that have extended HardgoodShippingGroup or ElectronicShippingGroup to include additional data, should subclass ShippingGroupManager and override this method if any of that data must be preserved when merging orders.
pSrcOrder
- The source order from which shipping groups are being copied.pDstOrder
- The destination order to which shipping groups are being copied.pGroup
- The shipping group currently being copied.
CommerceException
protected HardgoodShippingGroup mergeOrdersCopyHardgoodShippingGroup(Order pSrcOrder, Order pDstOrder, HardgoodShippingGroup pGroup) throws CommerceException
Applications that have extended hardgood shipping group to include additional data should subclass ShippingGroupManager and override this method if any of that data must be preserved when merging orders.
pSrcOrder
- The source order from which shipping groups are being copied.pDstOrder
- The destination order to which shipping groups are being copied.pGroup
- The shipping group currently being copied.
CommerceException
protected ElectronicShippingGroup mergeOrdersCopyElectronicShippingGroup(Order pSrcOrder, Order pDstOrder, ElectronicShippingGroup pGroup) throws CommerceException
Applications that have extended electronic shipping group to include additional data should subclass ShippingGroupManager and override this method if any of that data must be preserved when merging orders.
pSrcOrder
- The source order from which shipping groups are being copied.pDstOrder
- The destination order to which shipping groups are being copied.pGroup
- The shipping group currently being copied.
CommerceException
protected boolean isNullAddress(Address pAddress)
public boolean shippingGroupIsModifiable(ShippingGroup pShippingGroup)
pShippingGroup
- the shipping group
CommerceException,
- if the order or the shipping group id are boguspublic java.util.List getNonModifiableShippingGroups(Order pOrder)
pShippingGroup
- the shipping group
CommerceException,
- if the order or the shipping group id are boguspublic java.lang.String getShippingGroupName(ShippingGroup pShippingGroup, ShippingGroupMapContainer pShippingGroupMapContainer, java.util.Collection pShippingGroupMatchers)
public java.lang.String getNewShippingGroupName(ShippingGroup pShippingGroup, java.util.Collection pShippingGroupMatchers)
pShippingGroup
- pShippingGroupMatchers
-
public boolean isShippingGroupInOrder(Order pOrder, java.lang.String pShippingGroupId)
isShippingGroupInOrder
is used to determine if the ShippingGroup
is already in the Order.
pOrder
- an Order
valuepShippingGroupId
- a String
value
boolean
valuepublic java.lang.String addShippingGroupToMap(ShippingGroup pShippingGroup, ShippingGroupMapContainer pShippingGroupMapContainer, java.util.Collection pShippingGroupMatchers)
pShippingGroup
-
public java.lang.String getFirstShippingGroupType(java.lang.String pSkuId, java.lang.String pCatalogKey, CommerceItem pCommerceItem) throws CommerceException
This method returns first shipping group type for a sku. If system could not find any shipping group type for a sku, then the
OrderTools.defaultShippingGroupType
configured value is returned.
First this method gets the sku's fulfiller property value. After getting the fulfiller value, this method uses OrderFulfillmentTools
fulfiller to shipping group classes map and OrderTools
shipping group type to shipping group classes maps to find first shipping group type.
The OrderFulfillmentTools
fulfiller to shipping group classes map contains the list of supported shipping group classes for a fulfiller.
From the the list of supported shipping group classes for a fulfiller, this method gets the first shipping group class and finds its corresponding
the shipping group type.
For a given shipping group class there may be more than one supported shipping group types. If there is more than shipping group types for a shipping group class, then the the first matching random shipping group type is returned.
pSkuId
- -- The sku to be looked atpCatalogKey
- -- The catalog in which the sku is availablepCommerceItem
- -- In case if you have access to the commerce item instead of the sku and catalog id, you can pass in this parameter.
CommerceException
- -- If there is any exception while trying to find the sku, the exception is broadcasted to the calling methods.OrderFulfillmentTools.getFulfiller(String, String, CommerceItem)
public java.util.Collection<java.lang.String> getShippingGroupTypes(java.lang.String pSkuId, java.lang.String pCatalogKey, CommerceItem pCommerceItem) throws CommerceException
OrderTools.defaultShippingGroupType
configured value is returned.
First this method gets the sku's fulfiller property value. After getting the fulfiller value this method uses OrderFulfillmentTools
fulfiller to shipping group classes map and OrderTools
shipping group type to shipping group classes maps to find shipping group types.
The OrderFulfillmentTools
fulfiller to shipping group classes map contains the list of supported shipping group classes for a fulfiller.
From the the list of supported shipping group classes for a fulfiller, this method gets the shipping group types for all shipping group classes.
For a given shipping group class there may be more than one supported shipping group types. If there is more than shipping group types for a shipping
group class, then the the first matching random shipping group type is returned.
pSkuId
- -- The sku to be looked atpCatalogKey
- -- The catalog in which the sku is availablepCommerceItem
- -- In case if you have access to the commerce item instead of the sku and catalog id, you can pass in this parameter.
CommerceException
- -- If there is any exception while trying to find the sku, the exception is broadcasted to the calling methods.OrderFulfillmentTools.getFulfiller(String, String, CommerceItem)
public java.util.Collection<java.lang.String> getShippingGroupTypes(Order pOrder) throws CommerceException
pOrder
- -- The order to be looked at
CommerceException
- -- If there is any exception the exception is broadcasted-- For all possible shipping group types for a sku
public java.util.Collection<java.lang.String> getCommonShippingGroupTypes(Order pOrder) throws CommerceException
Each commerce item supports certain shipping group type/s. This method gathers the common shipping group type list that is supported by each commerce item in the order.
This method walks through each commerce items in the order and computes the intersection of shipping group types.
pOrder
- -- The order to be looked at
CommerceException
- -- If there is any exception the exception is broadcasted-- For all possible shipping group types for a sku
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |