|
|||||||||
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.CommerceItemManager
public class CommerceItemManager
This class is the business layer object for managing and manipulating Orders. This class holds all the business logic for manipulating an Order.
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 | |
---|---|
CommerceItemManager()
Constructs a CommerceItemManager object. |
Method Summary | |
---|---|
CommerceItem |
addAsSeparateItemToOrder(Order pOrder,
CommerceItem pItem)
Adds the given item to the given order. |
CommerceItem |
addAsSeparateSubItemToConfigurableItem(ConfigurableCommerceItem pItem,
SubSkuCommerceItem pSubItem)
Adds the SubItem to the ConfigurableCommerceItem as a separate item. |
void |
addItemAmountToPaymentGroup(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pPaymentGroupId,
double pAmount)
Adds the given amount of the CommerceItem with the given id to the PaymentGroup with the given id. |
void |
addItemQuantityToShippingGroup(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pShippingGroupId,
long pQuantity)
Adds the given quantity of the CommerceItem with the given id to the ShippingGroup with the given id. |
CommerceItem |
addItemToOrder(Order pOrder,
CommerceItem pItem)
Adds the given item to the given order. |
void |
addRemainingItemAmountToPaymentGroup(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pPaymentGroupId)
Adds any unassigned amount of the CommerceItem with the given id to the ShippingGroup with the given id. |
void |
addRemainingItemQuantityToShippingGroup(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pShippingGroupId)
Adds any unassigned quantity of the CommerceItem with the given id to the ShippingGroup with the given id. |
CommerceItem |
addSubItemToConfigurableItem(ConfigurableCommerceItem pItem,
SubSkuCommerceItem pSubItem)
Adds a sub item to a configurable commerce item |
protected void |
conditionallyEnforceProductSkuRelationship(java.lang.String pCatalogId,
java.lang.String pProductId,
java.lang.Object pProductRef,
java.lang.String pCatalogRefId,
java.lang.Object pCatalogRef)
If 'enforceProductSkuRelationship' is true, verify that the sku is actually one of the product's child skus. |
CommerceItem |
createCommerceItem(java.lang.String pCatalogRefId,
java.lang.Object pCatalogRef,
java.lang.String pProductId,
long pQuantity)
Creates a new CommerceItem object using the default CommerceItem type defined in the OrderTools property defaultCommerceItemType. |
CommerceItem |
createCommerceItem(java.lang.String pCatalogRefId,
java.lang.Object pCatalogRef,
java.lang.String pProductId,
long pQuantity,
ItemPriceInfo pPriceInfo)
Creates a new CommerceItem object using the default CommerceItem type defined in the OrderTools property defaultCommerceItemType. |
CommerceItem |
createCommerceItem(java.lang.String pCatalogRefId,
java.lang.Object pCatalogRef,
java.lang.String pProductId,
java.lang.Object pProductRef,
long pQuantity)
Creates a new CommerceItem object using the default CommerceItem type defined in the OrderTools property defaultCommerceItemType. |
CommerceItem |
createCommerceItem(java.lang.String pCatalogRefId,
java.lang.Object pCatalogRef,
java.lang.String pProductId,
java.lang.Object pProductRef,
long pQuantity,
ItemPriceInfo pPriceInfo)
Creates a new CommerceItem object using the default CommerceItem type defined in the OrderTools property defaultCommerceItemType. |
CommerceItem |
createCommerceItem(java.lang.String pCatalogRefId,
java.lang.String pProductId,
long pQuantity)
Creates a new CommerceItem object using the default CommerceItem type defined in the OrderTools property defaultCommerceItemType. |
CommerceItem |
createCommerceItem(java.lang.String pCatalogRefId,
java.lang.String pProductId,
long pQuantity,
java.lang.String pCatalogKey)
Creates a new CommerceItem object using the default CommerceItem type defined in the OrderTools property defaultCommerceItemType. |
CommerceItem |
createCommerceItem(java.lang.String pItemType,
java.lang.String pCatalogRefId,
java.lang.Object pCatalogRef,
java.lang.String pProductId,
java.lang.Object pProductRef,
long pQuantity,
ItemPriceInfo pPriceInfo)
Creates a new CommerceItem object using the CommerceItem type defined in the pItemType. |
CommerceItem |
createCommerceItem(java.lang.String pItemType,
java.lang.String pCatalogRefId,
java.lang.Object pCatalogRef,
java.lang.String pProductId,
java.lang.Object pProductRef,
long pQuantity,
java.lang.String pCatalogKey,
ItemPriceInfo pPriceInfo)
Creates a new CommerceItem object using the CommerceItem type defined in the pItemType. |
CommerceItem |
createCommerceItem(java.lang.String pItemType,
java.lang.String pCatalogRefId,
java.lang.Object pCatalogRef,
java.lang.String pProductId,
java.lang.Object pProductRef,
long pQuantity,
java.lang.String pCatalogKey,
java.lang.String pCatalogId,
ItemPriceInfo pPriceInfo)
Creates a new CommerceItem object using the CommerceItem type defined in the pItemType. |
CommerceItem |
createCommerceItem(java.lang.String pItemType,
java.lang.String pCatalogRefId,
java.lang.Object pCatalogRef,
java.lang.String pProductId,
java.lang.Object pProductRef,
long pQuantity,
java.lang.String pCatalogKey,
java.lang.String pCatalogId,
java.lang.String pSiteId,
ItemPriceInfo pPriceInfo)
Creates a new CommerceItem object using the CommerceItem type defined in the pItemType. |
CommerceItem |
createCommerceItem(java.lang.String pItemType,
java.lang.String pCatalogRefId,
java.lang.String pProductId,
long pQuantity)
Creates a new CommerceItem object using the supplied CommerceItem type. |
void |
generateRangeForItem(CommerceItem pItem)
For each ShippingGroupCommerceItemRelationship in the order, update the Range |
void |
generateRangesForOrder(Order pOrder)
For each ShippingGroupCommerceItemRelationship in the order, update the Range |
java.util.List |
getAllCommerceItemRelationships(Order pOrder)
Provides a List of all CommerceItemRelationships associated with the given Order. |
java.util.List |
getCommerceItemsFromPaymentGroup(PaymentGroup pPaymentGroup)
Returns a List of all the CommerceItems within the given PaymentGroup. |
java.util.List |
getCommerceItemsFromShippingGroup(ShippingGroup pShippingGroup)
Returns a List of all the CommerceItems within the given ShippingGroup. |
HandlingInstructionManager |
getHandlingInstructionManager()
Returns property handlingInstructionManager |
OrderTools |
getOrderTools()
Returns property orderTools |
PaymentGroupManager |
getPaymentGroupManager()
Returns property paymentGroupManager |
protected java.lang.String |
getProductDisplayName(java.lang.Object pProduct)
Return the display name of a product to use when constructing user visible error messages about it, or a string indicating that the product's display name could not be found. |
java.lang.String |
getProductDisplayNamePropertyName()
Return the name of the product property that holds the display name for that product. |
java.lang.String |
getProductIdFromSkuId(java.lang.String pSKUId)
Returns a Product ID for a given SKU, if one is found. |
java.util.Collection |
getProductSkus(java.lang.Object pProduct)
Get a collection of SKU items from the specified product object |
java.lang.String |
getProductSkusPropertyName()
Return the name of the product property that holds the list of skus associated with that product. |
java.lang.String |
getProfilesCatalogPropertyName()
The name of the property in the profile that stores the catalog |
ShippingGroupManager |
getShippingGroupManager()
Returns property shippingGroupManager |
atg.multisite.SiteGroupManager |
getSiteGroupManager()
Returns property siteGroupManager |
java.lang.Object |
getSku(java.lang.String pCatalogRefId,
java.lang.String pCatalogKey)
Get the SKU object corresponding to the specified ID and (optional) catalog. |
protected java.lang.String |
getSkuDisplayName(java.lang.Object pSku)
Return the display name of a sku to use when constructing user visible error messages about it, or a string indicating that the sku's display name could not be found. |
java.lang.String |
getSkuDisplayNamePropertyName()
Return the name of the sku property that holds the display name for the sku. |
long |
getUnassignedQuantityForCommerceItem(CommerceItem pItem)
This method returns the unassigned quantity for a CommerceItem. |
boolean |
isEnforceProductSkuRelationship()
Return true if the createCommerceItem methods should
verify that the product (if any) and sku being used to construct the
commerce item are related -- i.e., that the sku is one of the product's
child skus. |
protected CommerceItem |
mergeOrdersCopyCommerceItem(Order pSrcOrder,
Order pDstOrder,
CommerceItem pItem)
This method is used by OrderManager.mergeOrders to copy a commerce item from a source order to a destination order. |
boolean |
productContainsSku(java.lang.Object pProduct,
java.lang.String pSkuId)
Verify that a specified sku ID is an ID of a child sku of the specified product. |
protected boolean |
productContainsSku(java.lang.String pCatalogId,
java.lang.String pProductId,
java.lang.Object pProduct,
java.lang.String pSkuId,
java.lang.Object pSku)
Verify that a specified sku is actually a child sku of the specified product during creation of a commerce item. |
void |
removeAllCommerceItemsFromOrder(Order pOrder)
Removes all the CommerceItems and their Relationships from an Order. |
void |
removeAllRelationshipsFromCommerceItem(Order pOrder,
java.lang.String pCommerceItemId)
Removes all the relationships from the CommerceItem with the given id in the given order. |
void |
removeAllSubItemsFromConfigurableItem(ConfigurableCommerceItem pItem)
Removes all the SubItems from the ConfigurableCommerceItem. |
void |
removeItemAmountFromPaymentGroup(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pPaymentGroupId,
double pAmount)
Removes the given amount of the CommerceItem with the given id from the PaymentGroup with the given id. |
void |
removeItemFromOrder(Order pOrder,
java.lang.String pCommerceItemId)
Removes the given item from the given order. |
void |
removeItemQuantityFromShippingGroup(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pShippingGroupId,
long pQuantity)
Removes the given quantity of the CommerceItem with the given id from the ShippingGroup with the given id. |
void |
removeRemainingItemAmountFromPaymentGroup(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pPaymentGroupId)
Removes the "remaining" amount of the CommerceItem with the given id from the PaymentGroup with the given id. |
void |
removeRemainingItemQuantityFromShippingGroup(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pShippingGroupId)
Removes the "remaining" quantity of the CommerceItem with the given id from the ShippingGroup with the given id. |
void |
removeSubItemFromConfigurableItem(ConfigurableCommerceItem pItem,
java.lang.String pSubItemId)
Removes the SubItem with the given id from the ConfigurableCommerceItem. |
void |
returnCommerceItem(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pShippingGroupId,
long pQuantity)
Marks a CommerceItem as returned in an Order. |
java.lang.Object |
setCommerceItemSku(CommerceItem pCommerceItem,
java.lang.String pSkuId)
Change the SKU to which the commerce item refers. |
void |
setEnforceProductSkuRelationship(boolean pEnforceProductSkuRelationship)
Specify whether the createCommerceItem methods should
verify that the product (if any) and sku being used to construct the
commerce item are related -- i.e., that the sku is one of the product's
child skus. |
void |
setHandlingInstructionManager(HandlingInstructionManager pHandlingInstructionManager)
Sets property handlingInstructionManager |
void |
setOrderTools(OrderTools pOrderTools)
Sets property orderTools |
void |
setPaymentGroupManager(PaymentGroupManager pPaymentGroupManager)
Sets property paymentGroupManager |
void |
setProductDisplayNamePropertyName(java.lang.String pProductDisplayNamePropertyName)
Specify the name of the product property that holds the display name for the product. |
void |
setProductSkusPropertyName(java.lang.String pProductSkusPropertyName)
Specify the name of the product property that holds the list of skus associated with that product. |
void |
setProfilesCatalogPropertyName(java.lang.String pProfilesCatalogPropertyName)
|
void |
setShippingGroupManager(ShippingGroupManager pShippingGroupManager)
Sets property shippingGroupManager |
void |
setSiteGroupManager(atg.multisite.SiteGroupManager pSiteGroupManager)
Sets property siteGroupManager |
void |
setSkuDisplayNamePropertyName(java.lang.String pSkuDisplayNamePropertyName)
Specify the name of the sku property that holds the display name for the sku. |
protected boolean |
shouldMergeItems(CommerceItem pExistingItem,
CommerceItem pNewItem)
Determine whether or not we should merge the quantity in one commerce item or subitem into the quantity in an already existing item or subitem, rather than adding the new item to the order as a separate line item or subitem. |
protected boolean |
shouldMergeItems(Order pOrder,
CommerceItem pExistingItem,
CommerceItem pNewItem)
Determine whether or not we should merge the quantity in one commerce item into the quantity in an already existing item, rather than adding the new item to the order as a separate line item. |
protected boolean |
shouldMergeSubItems(ConfigurableCommerceItem pItem,
CommerceItem pExistingSubItem,
CommerceItem pNewSubItem)
Determine whether or not we should merge the quantity in one commerce subitem into the quantity in an already existing sibitem, rather than adding the new subitem to the ConfigurableCommerceItem as a separate subitem. |
protected void |
updateOrderSite(Order pOrder,
CommerceItem pItem)
Update the order to indicate the site from which the most recent item addition occurred. |
protected void |
validateSiteCompatibility(java.lang.String pExistingSiteId,
java.lang.String pNewSiteId)
Determine whether a new item's site is compatible with other sites in an order. |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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 java.lang.String CLASS_VERSION
protected static java.util.ResourceBundle sResourceBundle
Constructor Detail |
---|
public CommerceItemManager()
Method Detail |
---|
public void setProfilesCatalogPropertyName(java.lang.String pProfilesCatalogPropertyName)
public java.lang.String getProfilesCatalogPropertyName()
public void setProductSkusPropertyName(java.lang.String pProductSkusPropertyName)
public java.lang.String getProductSkusPropertyName()
public void setProductDisplayNamePropertyName(java.lang.String pProductDisplayNamePropertyName)
public java.lang.String getProductDisplayNamePropertyName()
public void setSkuDisplayNamePropertyName(java.lang.String pSkuDisplayNamePropertyName)
public java.lang.String getSkuDisplayNamePropertyName()
public boolean isEnforceProductSkuRelationship()
createCommerceItem
methods should
verify that the product (if any) and sku being used to construct the
commerce item are related -- i.e., that the sku is one of the product's
child skus. The default value is false, to preserve backward
compatibility with pre-7.0 versions of the code.
public void setEnforceProductSkuRelationship(boolean pEnforceProductSkuRelationship)
createCommerceItem
methods should
verify that the product (if any) and sku being used to construct the
commerce item are related -- i.e., that the sku is one of the product's
child skus. If true, createCommerceItem
will throw a
CommerceException if passed a product and sku that are not related
to each other.
public OrderTools getOrderTools()
public void setOrderTools(OrderTools pOrderTools)
pOrderTools
- the value to set for property orderToolspublic ShippingGroupManager getShippingGroupManager()
public void setShippingGroupManager(ShippingGroupManager pShippingGroupManager)
pShippingGroupManager
- the value to set for property shippingGroupManagerpublic 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 atg.multisite.SiteGroupManager getSiteGroupManager()
public void setSiteGroupManager(atg.multisite.SiteGroupManager pSiteGroupManager)
pSiteGroupManager
- the value to set for property siteGroupManagerpublic CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.String pProductId, long pQuantity) throws CommerceException
pCatalogRefId
- the id of the catalog object reference that this CommerceItem representspProductId
- the product id that this CommerceItem referencespQuantity
- the quantity that this CommerceItem should represent
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.getDefaultCommerceItemType()
public CommerceItem createCommerceItem(java.lang.String pItemType, java.lang.String pCatalogRefId, java.lang.String pProductId, long pQuantity) throws CommerceException
pItemType
- the name that is mapped in the OrderTools.properties file to the class of
the desired type to createpCatalogRefId
- the id of the catalog object reference that this CommerceItem representspProductId
- the product id that this CommerceItem referencespQuantity
- the quantity that this CommerceItem should represent
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.getDefaultCommerceItemType()
public CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.String pProductId, long pQuantity, java.lang.String pCatalogKey) throws CommerceException
pCatalogRefId
- the id of the catalog object reference that this CommerceItem representspProductId
- the product id that this CommerceItem referencespCatalogKey
- the catalog key reference (locale) for this CommerceItempQuantity
- the quantity that this CommerceItem should represent
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.getDefaultCommerceItemType()
public CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, long pQuantity) throws CommerceException
pCatalogRefId
- the id of the catalog object reference that this CommerceItem representspCatalogRef
- the catalog object reference that this CommerceItem representspProductId
- the product id that this CommerceItem referencespQuantity
- the quantity that this CommerceItem should represent
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.getDefaultCommerceItemType()
public CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, java.lang.Object pProductRef, long pQuantity) throws CommerceException
pCatalogRefId
- the id of the catalog object reference that this CommerceItem representspCatalogRef
- the catalog object reference that this CommerceItem representspProductId
- the product id that this CommerceItem referencespProductRef
- the product object reference that this CommerceItem representspQuantity
- the quantity that this CommerceItem should represent
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.getDefaultCommerceItemType()
public CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, long pQuantity, ItemPriceInfo pPriceInfo) throws CommerceException
pCatalogRefId
- the id of the catalog object reference that this CommerceItem representspCatalogRef
- the catalog object reference that this CommerceItem representspProductId
- the product id that this CommerceItem referencespQuantity
- the quantity that this CommerceItem should representpPriceInfo
- the ItemPriceInfo object for this CommerceItem
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.getDefaultCommerceItemType()
public CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, java.lang.Object pProductRef, long pQuantity, ItemPriceInfo pPriceInfo) throws CommerceException
pCatalogRefId
- the id of the catalog object reference that this CommerceItem representspCatalogRef
- the catalog object reference that this CommerceItem representspProductId
- the product id that this CommerceItem referencespProductRef
- the product object reference that this CommerceItem representspQuantity
- the quantity that this CommerceItem should representpPriceInfo
- the ItemPriceInfo object for this CommerceItem
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.getDefaultCommerceItemType()
public CommerceItem createCommerceItem(java.lang.String pItemType, java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, java.lang.Object pProductRef, long pQuantity, ItemPriceInfo pPriceInfo) throws CommerceException
pItemType
- the name that is mapped in the OrderTools.properties file to the class of
the desired type to createpCatalogRefId
- the id of the catalog object reference that this CommerceItem representspCatalogRef
- the catalog object reference that this CommerceItem representspProductId
- the product id that this CommerceItem referencespProductRef
- the product object reference that this CommerceItem representspQuantity
- the quantity that this CommerceItem should representpPriceInfo
- the ItemPriceInfo object for this CommerceItem
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.getDefaultCommerceItemType()
public CommerceItem createCommerceItem(java.lang.String pItemType, java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, java.lang.Object pProductRef, long pQuantity, java.lang.String pCatalogKey, ItemPriceInfo pPriceInfo) throws CommerceException
pItemType
- the name that is mapped in the OrderTools.properties file to the class of
the desired type to createpCatalogRefId
- the id of the catalog object reference that this CommerceItem representspCatalogRef
- the catalog object reference that this CommerceItem representspProductId
- the product id that this CommerceItem referencespProductRef
- the product object reference that this CommerceItem representspCatalogKey
- the catalog key reference (locale) for this CommerceItempQuantity
- the quantity that this CommerceItem should representpPriceInfo
- the ItemPriceInfo object for this CommerceItem
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.getDefaultCommerceItemType()
public CommerceItem createCommerceItem(java.lang.String pItemType, java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, java.lang.Object pProductRef, long pQuantity, java.lang.String pCatalogKey, java.lang.String pCatalogId, ItemPriceInfo pPriceInfo) throws CommerceException
pItemType
- the name that is mapped in the OrderTools.properties file to the class of
the desired type to createpCatalogRefId
- the id of the catalog object reference that this CommerceItem representspCatalogRef
- the catalog object reference that this CommerceItem representspProductId
- the product id that this CommerceItem referencespProductRef
- the product object reference that this CommerceItem representspQuantity
- the quantity that this CommerceItem should representpCatalogKey
- the catalog key reference (locale) for this CommerceItempCatalogId
- the id of the catalog repository item that this item is inpPriceInfo
- the ItemPriceInfo object for this CommerceItem
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.getDefaultCommerceItemType()
public CommerceItem createCommerceItem(java.lang.String pItemType, java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, java.lang.Object pProductRef, long pQuantity, java.lang.String pCatalogKey, java.lang.String pCatalogId, java.lang.String pSiteId, ItemPriceInfo pPriceInfo) throws CommerceException
pItemType
- the name that is mapped in the OrderTools.properties file to the class of
the desired type to createpCatalogRefId
- the id of the catalog object reference that this CommerceItem representspCatalogRef
- the catalog object reference that this CommerceItem representspProductId
- the product id that this CommerceItem referencespProductRef
- the product object reference that this CommerceItem representspQuantity
- the quantity that this CommerceItem should representpCatalogKey
- the catalog key reference (locale) for this CommerceItempCatalogId
- the id of the catalog repository item that this item is inpSiteId
- the id of the site that this item is associated withpPriceInfo
- the ItemPriceInfo object for this CommerceItem
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.getDefaultCommerceItemType()
public java.lang.Object setCommerceItemSku(CommerceItem pCommerceItem, java.lang.String pSkuId) throws CommerceException
pCommerceItem
- the commerce itempSkuId
- the ID of the new
CommerceException
public java.lang.Object getSku(java.lang.String pCatalogRefId, java.lang.String pCatalogKey) throws RepositoryException
pCatalogRefId
- the SKU IDpCatalogKey
- the catalog key or null
RepositoryException
public CommerceItem addItemToOrder(Order pOrder, CommerceItem pItem) throws CommerceException
pOrder
- the Order to add the CommerceItem topItem
- the CommerceItem to add to the Order
InvalidParameterException
- thrown if any of the parameters are null
atg.commerce.IncompatibleSitesException
- thrown if the sites for the new item and the order's old
items can not share the cart
CommerceException
- thrown if a CommerceItem is added and a DuplicateCommerceItemException
is caught. This is an internal error and will get thrown only if the id of the
CommerceItem being added already exists in the order. This should not happen
under normal circumstances.protected void conditionallyEnforceProductSkuRelationship(java.lang.String pCatalogId, java.lang.String pProductId, java.lang.Object pProductRef, java.lang.String pCatalogRefId, java.lang.Object pCatalogRef) throws CommerceException
pCatalogId
- the id of the catalog repository item that this
item is inpProductId
- the product id that this CommerceItem referencespProductRef
- the product object reference that this
CommerceItem representspCatalogRefId
- the id of the catalog object reference that
this CommerceItem representspCatalogRef
- the catalog object reference that this
CommerceItem represents
CommerceException
- if enforceProductSkuRelationship is
true and SKU is not valid for productprotected boolean shouldMergeItems(Order pOrder, CommerceItem pExistingItem, CommerceItem pNewItem)
pOrder
- The order to which pNewItem is being added. This is not used by
the default implementation but is provided in case subclasses need
it to implement alternative item-merging logic.pExistingItem
- An item already in the cartpNewItem
- The item being added to the cart
shouldMergeItems(CommerceItem, CommerceItem)
protected boolean shouldMergeItems(CommerceItem pExistingItem, CommerceItem pNewItem)
pExistingItem
- An item already in the cartpNewItem
- The item being added to the cart
protected void validateSiteCompatibility(java.lang.String pExistingSiteId, java.lang.String pNewSiteId) throws CommerceException
pExistingSiteId
- The site ID already associated with the cartpNewSiteId
- The site ID for the item or subitem being added to the cart
CommerceException
- if the two sites can not share the cartprotected void updateOrderSite(Order pOrder, CommerceItem pItem)
pOrder
- the Order being updatedpItem
- the new or updated CommerceItempublic CommerceItem addAsSeparateItemToOrder(Order pOrder, CommerceItem pItem) throws CommerceException
pOrder
- the Order to add the CommerceItem topItem
- the CommerceItem to add to the Order
InvalidParameterException
- thrown if any of the parameters are null
atg.commerce.IncompatibleSitesException
- thrown if the sites for the new item and the order's old
items can not share the cart
CommerceException
- thrown if a CommerceItem is added and a DuplicateCommerceItemException
is caught. This is an internal error and will get thrown only if the id of the
CommerceItem being added already exists in the order. This should not happen
under normal circumstances.public void removeAllCommerceItemsFromOrder(Order pOrder) throws CommerceException
pOrder
- the Order which contains the CommerceItems to be removed
InvalidParameterException
- thrown if any of the parameters are null
ObjectRemovalException
- thrown if a CommerceItem cannot be removed
CommerceException
public void removeItemFromOrder(Order pOrder, java.lang.String pCommerceItemId) throws CommerceException
pOrder
- the Order to remove the CommerceItem fompCommerceItemId
- the id of the CommerceItem to remove from the Order
InvalidParameterException
- thrown if any of the parameters are null
ObjectRemovalException
- thrown if the CommerceItem cannot be removed
CommerceException
public void removeAllRelationshipsFromCommerceItem(Order pOrder, java.lang.String pCommerceItemId) throws CommerceException
pOrder
- the Order which contains the CommerceItem to remove the relationships frompCommerceItemId
- the id of the CommerceItem
InvalidParameterException
- thrown if any of the parameters are null
CommerceItemNotFoundException
- if an item with the given id is not found in the given order
ObjectRemovalException
- thrown if a relationship cannot be removed
CommerceException
public java.util.List getAllCommerceItemRelationships(Order pOrder) throws CommerceException
pOrder
- the Order whose relationships are sought
InvalidParameterException
- thrown if order parameter is null
CommerceException
Relationship
,
CommerceItemRelationship
,
ShippingGroupCommerceItemRelationship
,
PaymentGroupCommerceItemRelationship
public java.util.List getCommerceItemsFromShippingGroup(ShippingGroup pShippingGroup) throws CommerceException
pShippingGroup
- the ShippingGroup to retrieve the CommerceItems from
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
public java.util.List getCommerceItemsFromPaymentGroup(PaymentGroup pPaymentGroup) throws CommerceException
pPaymentGroup
- the PaymentGroup to retrieve the CommerceItems from
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
public long getUnassignedQuantityForCommerceItem(CommerceItem pItem)
pItem
- the CommerceItem we are checking
ShippingGroupManager.getRemainingQuantityForShippingGroup(CommerceItem)
public void addItemAmountToPaymentGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pPaymentGroupId, double pAmount) throws CommerceException
pOrder
- the Order which the CommerceItem and ShippingGroup existpCommerceItemId
- the id of the CommerceItem to addpPaymentGroupId
- the id of the PaymentGroup which the CommerceItem will be added topAmount
- the amount of the CommerceItem which will be added
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
PaymentGroupCommerceItemRelationship
public void addRemainingItemAmountToPaymentGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pPaymentGroupId) throws CommerceException
pOrder
- the Order which the CommerceItem and ShippingGroup existpCommerceItemId
- the id of the CommerceItem to addpPaymentGroupId
- the id of the PaymentGroup which the CommerceItem 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
ShippingGroupCommerceItemRelationship
public void addItemQuantityToShippingGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId, long pQuantity) throws CommerceException
pOrder
- the Order which the CommerceItem and ShippingGroup existpCommerceItemId
- the id of the CommerceItem to addpShippingGroupId
- the id of the ShippingGroup which the CommerceItem will be added topQuantity
- the quantity of the CommerceItem which will be added
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
ShippingGroupCommerceItemRelationship
public void addRemainingItemQuantityToShippingGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId) throws CommerceException
pOrder
- the Order which the CommerceItem and ShippingGroup existpCommerceItemId
- the id of the CommerceItem to addpShippingGroupId
- the id of the ShippingGroup which the CommerceItem 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 ShippingGroup
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
ShippingGroupCommerceItemRelationship
public void removeItemQuantityFromShippingGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId, long pQuantity) throws CommerceException
pOrder
- the Order which the CommerceItem and ShippingGroup existpCommerceItemId
- the id of the CommerceItem to to remove from the ShippingGrouppShippingGroupId
- the id of the ShippingGroup which the CommerceItem will be removed frompQuantity
- the quantity of the CommerceItem which will be removed
InvalidParameterException
- thrown if any of the parameters are null
ObjectRemovalException
- if the removal of the quantity fails
CommerceException
public void removeRemainingItemQuantityFromShippingGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId) throws CommerceException
pOrder
- the Order which the CommerceItem and ShippingGroup existpCommerceItemId
- the id of the CommerceItem to to remove from the ShippingGrouppShippingGroupId
- the id of the ShippingGroup which the CommerceItem will be removed from
InvalidParameterException
- thrown if any of the parameters are null
ShippingGroupNotFoundException
- if a ShippingGroup with the given id is not found in the given order
CommerceItemNotFoundException
- if a CommerceItem with the given id is not found in the given order
ObjectRemovalException
- if the removal of the object fails
CommerceException
public void removeItemAmountFromPaymentGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pPaymentGroupId, double pAmount) throws CommerceException
pOrder
- the Order which the CommerceItem and PaymentGroup existpCommerceItemId
- the id of the CommerceItempPaymentGroupId
- the id of the PaymentGrouppAmount
- the amount to remove
InvalidParameterException
- thrown if any of the parameters are null or invalid
RelationshipNotFoundException
- if the given relationship is not found in the
PaymentGroup or CommerceItem
ObjectRemovalException
- if the removal of the quantity fails
CommerceException
public void removeRemainingItemAmountFromPaymentGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pPaymentGroupId) throws CommerceException
pOrder
- the Order which the CommerceItem and PaymentGroup existpCommerceItemId
- the id of the CommerceItempPaymentGroupId
- 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 CommerceItem
ObjectRemovalException
- if the removal of the object fails
CommerceException
public CommerceItem addSubItemToConfigurableItem(ConfigurableCommerceItem pItem, SubSkuCommerceItem pSubItem) throws CommerceException
pItem
- the ConfigurableCommerceItem to add the sub item topSubItem
- the SubSkuCommerceItem to add to the ConfigurableCommerceItem
InvalidParameterException
- thrown if any of the parameters are null
atg.commerce.IncompatibleSitesException
- thrown if the sites for the new subitem and the
configurable commerce item can not share the cart
CommerceException
SubSkuCommerceItem
,
ConfigurableCommerceItem
protected boolean shouldMergeSubItems(ConfigurableCommerceItem pItem, CommerceItem pExistingSubItem, CommerceItem pNewSubItem)
pItem
- The configurable item to which pNewSubItem is being added. This is not used by
the default implementation but is provided in case subclasses need
it to implement alternative item-merging logic.pExistingSubItem
- A subitem already in the configurable itempNewSubItem
- The subitem being added to the configurable item
public CommerceItem addAsSeparateSubItemToConfigurableItem(ConfigurableCommerceItem pItem, SubSkuCommerceItem pSubItem) throws CommerceException
pItem
- the ConfigurableCommerceItem to add the sub item topSubItem
- the SubSkuCommerceItem to add to the ConfigurableCommerceItem
InvalidParameterException
- thrown if any of the parameters are null
atg.commerce.IncompatibleSitesException
- thrown if the sites for the new subitem and the
configurable commerce item can not share the cart
CommerceException
SubSkuCommerceItem
,
ConfigurableCommerceItem
public void removeSubItemFromConfigurableItem(ConfigurableCommerceItem pItem, java.lang.String pSubItemId) throws CommerceException
pItem
- the ConfigurableCommerceItem to remove the sub item frompSubItemId
- the SubSkuCommerceItem id to remove from the ConfigurableCommerceItem
InvalidParameterException
- thrown if any of the parameters are null
ObjectRemovalException
- if the removal of the object fails
CommerceException
SubSkuCommerceItem
,
ConfigurableCommerceItem
public void removeAllSubItemsFromConfigurableItem(ConfigurableCommerceItem pItem) throws CommerceException
pItem
- the ConfigurableCommerceItem to remove the SubSkuCommerceItems from
InvalidParameterException
- thrown if any of the parameters are null
ObjectRemovalException
- if the removal of the object fails
CommerceException
SubSkuCommerceItem
,
ConfigurableCommerceItem
public void returnCommerceItem(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId, long pQuantity) throws CommerceException
pOrder
- the Order which contains the CommerceItem to returnpCommerceItemId
- the id of the CommerceItem to returnpShippingGroupId
- the id of the ShippingGroup which contains the CommerceItem to returnpQuantity
- the quantity of the CommerceItem to return. The quantity cannot be larger than
the quantity in the ShippingGroupCommerceItemRelationship
CommerceException
- if an exception occurs while returning a CommerceItempublic void generateRangesForOrder(Order pOrder) throws CommerceException
pOrder
- The order to calculate the ranges for
CommerceException
public void generateRangeForItem(CommerceItem pItem) throws CommerceException
pOrder
- The item to calculate the ranges for
CommerceException
protected CommerceItem mergeOrdersCopyCommerceItem(Order pSrcOrder, Order pDstOrder, CommerceItem pItem) throws CommerceException
Applications that have extended CommerceItem to include additional data should subclass CommerceItemManager and override this method if any of that data must be preserved when merging orders.
pSrcOrder
- The source order from which commerce items are being copied.pDstOrder
- The destination order to which commerce items are being copied.pItem
- The item currently being copied.
CommerceException
protected java.lang.String getProductDisplayName(java.lang.Object pProduct)
protected java.lang.String getSkuDisplayName(java.lang.Object pSku)
public java.util.Collection getProductSkus(java.lang.Object pProduct) throws CommerceException
pProduct
- the product
CommerceException
public boolean productContainsSku(java.lang.Object pProduct, java.lang.String pSkuId) throws CommerceException
pProduct
- The productpSkuId
- The sku id to test
CommerceException
- if unable to find or recognize the type
of the product's child SKU propertyprotected boolean productContainsSku(java.lang.String pCatalogId, java.lang.String pProductId, java.lang.Object pProduct, java.lang.String pSkuId, java.lang.Object pSku)
pCatalogId
- The catalog id of the particular catalog from which a commerce item
is being created. May be null if custom catalogs are not in use.pProductId
- The product id of the product being examined. May be null if no
product id was supplied in the call to createCommerceItem
.pProduct
- The product object corresponding to pProductId
, which
may be null if pProductId
is null.pSkuId
- The sku id of the sku being examined. This value should never be null.pSku
- The sku object corresponding to pSkuId
public java.lang.String getProductIdFromSkuId(java.lang.String pSKUId)
pSKUId
- the sku to get a product forpResponse
- the servlet's response
javax.servlet.ServletException
- if there was an error while executing the code
java.io.IOException
- if there was an error with servlet io
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |