|
|||||||||
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.OrderManager atg.commerce.order.SimpleOrderManager
public class SimpleOrderManager
This class is the business layer object for Order manipulation. Use of this class eliminates
the need to know about Relationships and only requires basic knowledge of the
commerce class hierarchy. Logically, this class is one level above the OrderManager
class and attempts to do as much as possible for the user.
The methods in the class allow CommerceItems to be added to or removed from an Order and
ShippingGroup with a single call. It also allows movement of CommerceItems between
ShippingGroups. Below is an example of using the SimpleOrderManager.
OrderManager om = getOrderManager();
String profileId = "10000";
String catalogRefId1 = "sku-1";
String catalogRefId2 = "sku-2";
String productId1 = "product-1";
String productId2 = "product-2";
long quantity1 = 1;
long quantity2 = 2;
// create the Order. The Order has a ShippingGroup and PaymentGroup in it when
// constructed
Order order = om.createOrder(profileId);
// get the ShippingGroup and add the items to it
ShippingGroup sg = (ShippingGroup) order.getShippingGroups().get(0);
item1 = om.addItemToShippingGroup(order, catalogRefId1, productId1, quantity1, sg.getId());
item2 = om.addItemToShippingGroup(order, catalogRefId2, productId2, quantity2, sg.getId());
// checkout the Order and iterate through the result object displaying errors
PipelineResult pr = om.processOrder(order);
if (pr.hasErrors()) {
Object[] keys = pr.getErrorKeys();
for (int i = 0; i < keys.length; i++)
System.out.println(pr.getError(keys[i]));
}
OrderManager
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.commerce.order.OrderManager |
---|
mOrderManager, mOrderMergeListeners, mUserPricingModelsPath, sResourceBundle |
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 | |
---|---|
SimpleOrderManager()
Constructs a SimpleOrderManager object. |
Method Summary | |
---|---|
CommerceItem |
addItemToShippingGroup(Order pOrder,
java.lang.String pCatalogRefId,
java.lang.String pProductId,
long pQuantity,
ShippingGroup pShippingGroup)
This method adds a new item to the order and shippingGroup. |
CommerceItem |
addItemToShippingGroup(Order pOrder,
java.lang.String pCatalogRefId,
java.lang.String pProductId,
long pQuantity,
java.lang.String pShippingGroupId)
This method adds a new item to the order and shippingGroup. |
void |
moveItemToShippingGroup(Order pOrder,
CommerceItem pCommerceItem,
long pQuantity,
ShippingGroup pSrcShippingGroup,
ShippingGroup pDestShippingGroup)
This method moves an item from one ShippingGroup to another. |
void |
moveItemToShippingGroup(Order pOrder,
java.lang.String pCatalogRefId,
long pQuantity,
java.lang.String pSrcShippingGroupId,
java.lang.String pDestShippingGroupId)
This method moves an item from one ShippingGroup to another. |
void |
removeItemFromShippingGroup(Order pOrder,
CommerceItem pCommerceItem,
ShippingGroup pShippingGroup,
long pQuantity)
This method removes an item from the order and shippingGroup. |
void |
removeItemFromShippingGroup(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pShippingGroupId,
long pQuantity)
This method removes an item from the order and shippingGroup. |
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
Constructor Detail |
---|
public SimpleOrderManager()
Method Detail |
---|
public CommerceItem addItemToShippingGroup(Order pOrder, java.lang.String pCatalogRefId, java.lang.String pProductId, long pQuantity, java.lang.String pShippingGroupId) throws CommerceException
pOrder
- the order which the item is to be added topCatalogRefId
- the catalogRefId of the item being addedpProductId
- the productId of the item being addedpQuantity
- the quantity to addpShippingGroupId
- the id of the shippingGroup to add the item to
CommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public CommerceItem addItemToShippingGroup(Order pOrder, java.lang.String pCatalogRefId, java.lang.String pProductId, long pQuantity, ShippingGroup pShippingGroup) throws CommerceException
pOrder
- the order which the item is to be added topCatalogRefId
- the catalogRefId of the item being addedpProductId
- the productId of the item being addedpQuantity
- the quantity to addpShippingGroup
- the shippingGroup to add the item to
CommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public void removeItemFromShippingGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId, long pQuantity) throws CommerceException
pOrder
- the order which the item is to be added topCommerceItem
- the CommerceItem to removepShippingGroup
- the shippingGroup to remove the item frompQuantity
- the quantity to remove
CommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public void removeItemFromShippingGroup(Order pOrder, CommerceItem pCommerceItem, ShippingGroup pShippingGroup, long pQuantity) throws CommerceException
pOrder
- the order which the item is to be added topCommerceItem
- the CommerceItem to removepShippingGroup
- the shippingGroup to remove the item frompQuantity
- the quantity to remove
CommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public void moveItemToShippingGroup(Order pOrder, java.lang.String pCatalogRefId, long pQuantity, java.lang.String pSrcShippingGroupId, java.lang.String pDestShippingGroupId) throws CommerceException
pOrder
- the order which the item exists inpCatalogRefId
- the catalogRefId of the item to movepQuantity
- the quantity to movepSrcShippingGroupId
- the id of the shippingGroup to move the item frompDestShippingGroupId
- the id of the shippingGroup to move the item to
CommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public void moveItemToShippingGroup(Order pOrder, CommerceItem pCommerceItem, long pQuantity, ShippingGroup pSrcShippingGroup, ShippingGroup pDestShippingGroup) throws CommerceException
pOrder
- the order which the item exists inpCatalogRefId
- the catalogRefId of the item to movepQuantity
- the quantity to movepSrcShippingGroup
- the shippingGroup to move the item frompDestShippingGroup
- the shippingGroup to move the item to
CommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |