|
|||||||||
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.CostCenterManager
public class CostCenterManager
This class is the business layer object for managing and manipulating Cost Centers. This class holds all the business logic for manipulating a Cost Center. The various types of methods in this class are used for creating cost centers, adding cost centers to an Order, adding CommerceItems to cost centers.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected static CostCenterManager |
mCostCenterManager
|
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 | |
---|---|
CostCenterManager()
Constructs an CostCenterManager object. |
Method Summary | |
---|---|
CostCenter |
addCostCenterToOrder(Order pOrder,
CostCenter pCostCenter)
Adds the given cost center to the given order. |
void |
addItemAmountToCostCenter(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pCostCenterId,
double pAmount)
Adds the given amount of the CommerceItem with the given id to the CostCenter with the given id. |
void |
addItemQuantityToCostCenter(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pCostCenterId,
long pQuantity)
Adds the given quantity of the CommerceItem with the given id to the CostCenter with the given id. |
void |
addOrderAmountToCostCenter(Order pOrder,
java.lang.String pCostCenterId,
double pAmount)
Adds the given amount of the Order's cost to the CostCenter with the given id. |
void |
addRemainingItemAmountToCostCenter(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pCostCenterId)
Adds any unassigned amount of the CommerceItem with the given id to the CostCenter with the given id. |
void |
addRemainingItemQuantityToCostCenter(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pCostCenterId)
Adds any unassigned quantity of the CommerceItem with the given id to the CostCenter with the given id. |
void |
addRemainingOrderAmountToCostCenter(Order pOrder,
java.lang.String pCostCenterId)
Adds any unassigned amount of the Order's cost to the CostCenter with the given id. |
void |
addRemainingShippingCostToCostCenter(Order pOrder,
java.lang.String pShippingGroupId,
java.lang.String pCostCenterId)
Adds any unassigned amount of the ShippingGroup's cost with the given id to the CostCenter with the given id. |
void |
addRemainingTaxAmountToCostCenter(Order pOrder,
java.lang.String pCostCenterId)
Adds any unassigned amount of the Order's tax to the CostCenter with the given id. |
void |
addShippingCostAmountToCostCenter(Order pOrder,
java.lang.String pShippingGroupId,
java.lang.String pCostCenterId,
double pAmount)
Adds the given amount of the ShippingGroup's cost with the given id to the CostCenter with the given id. |
void |
addTaxAmountToCostCenter(Order pOrder,
java.lang.String pCostCenterId,
double pAmount)
Adds the given amount of the Order's tax to the CostCenter with the given id. |
CostCenter |
createCostCenter(java.lang.String pIdentifier)
Creates a new CostCenter object using the default type specified in the OrderTools defaultCostCenterType property. |
CostCenter |
createCostCenter(java.lang.String pCostCenterType,
java.lang.String pIdentifier)
Creates a new CostCenter object using the class mapped to the given name in pCostCenterType. |
protected Relationship |
createRelationship(java.lang.String pRelationshipType)
Creates a new Relationship object using the class type mapped to the type supplied in pShippingGroupType. |
CostCenter |
getCostCenterByIdentifier(java.util.List pCostCenters,
java.lang.String pIdentifier)
This method will return a CostCenter whose identifier is pIdentifier. |
CostCenterCommerceItemRelationship |
getCostCenterCommerceItemRelationship(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pCostCenterId)
Returns the relationship object which exists between the given CommerceItem and CostCenter. |
static CostCenterManager |
getCostCenterManager()
|
CostCenterOrderRelationship |
getCostCenterOrderRelationship(Order pOrder,
java.lang.String pCostCenterId)
Returns the relationship object which exists between the given Order and CostCenter. |
CostCenterShippingGroupRelationship |
getCostCenterShippingGroupRelationship(Order pOrder,
java.lang.String pCostCenterId,
java.lang.String pShippingGroupId)
Returns the relationship object which exists between the given ShippingGroup and CostCenter. |
int |
getOrderCount(java.lang.String pCostCenterId,
java.lang.String[] pStates,
java.util.Collection<java.lang.String> pSiteIds)
Returns a count of the orders for a given cost center id |
java.util.List |
getOrderIdsForCostCenter(java.lang.String pCostCenterId,
int pStartIndex,
int pNumOrders)
Returns the order ids for the given cost center with the given constraints. |
java.util.List |
getOrderIdsForCostCenter(java.lang.String pCostCenterId,
int pStartIndex,
int pNumOrders,
java.lang.String[] pStates,
java.lang.String pSortProperty,
boolean pAscending,
java.util.Collection<java.lang.String> pSiteIds)
Returns the order ids for the given cost center id with the given constraints and sorting options. |
OrderManager |
getOrderManager()
Returns the OrderManager |
java.util.List |
getOrdersForCostCenter(java.lang.String pCostCenterId,
int pStartIndex,
int pNumOrders)
Returns all the orders for the given cost center id with the given constraints. |
java.util.List |
getOrdersForCostCenter(java.lang.String pCostCenterId,
int pStartIndex,
int pNumOrders,
java.lang.String[] pStates,
java.lang.String pSortProperty,
boolean pAscending,
java.util.Collection<java.lang.String> pSiteIds)
Returns the orders for the given cost center id with the given constraints and sorting options. |
OrderTools |
getOrderTools()
Returns the OrderTools |
double |
getRemainingAmountForCostCenter(CommerceItem pItem)
Calculate the "amount remaining" for a given item. |
long |
getRemainingQuantityForCostCenter(CommerceItem pItem)
Calculate the "quantity remaining" for a given item. |
double |
getUnassignedAmountForCommerceItem(CommerceItem pItem)
This method returns the unassigned amount for a CommerceItem. |
long |
getUnassignedQuantityForCommerceItem(CommerceItem pItem)
This method returns the unassigned quantity for a CommerceItem. |
void |
moveItemToCostCenter(Order pOrder,
CommerceItem pCommerceItem,
long pQuantity,
CostCenter pSrcCostCenter,
CostCenter pDestCostCenter)
This method moves an item from one CostCenter to another. |
void |
moveItemToCostCenter(Order pOrder,
java.lang.String pCatalogRefId,
long pQuantity,
java.lang.String pSrcCostCenterId,
java.lang.String pDestCostCenterId)
This method moves an item from one CostCenter to another. |
PipelineResult |
recalculateCostCenterAmounts(Order pOrder)
Recalculates the amounts for each CostCenter supplied in pCostCenterList. |
void |
removeAllCostCentersFromOrder(Order pOrder)
Removes all the CostCenters and their Relationships from an Order. |
void |
removeAllRelationshipsFromCostCenter(Order pOrder,
java.lang.String pCostCenterId)
Removes all the relationships from the CostCenter with the given id in the given order. |
void |
removeCostCenterFromOrder(Order pOrder,
java.lang.String pCostCenterId)
Removes the given CostCenter from the given order. |
void |
removeItemQuantityFromCostCenter(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pCostCenterId,
long pQuantity)
Removes the given quantity of the CommerceItem with the given id from the CostCenter with the given id. |
void |
setOrderManager(OrderManager pOrderManager)
Sets the OrderManager |
void |
setOrderTools(OrderTools pOrderTools)
Sets the OrderTools |
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 java.lang.String CLASS_VERSION
protected static java.util.ResourceBundle sResourceBundle
protected static CostCenterManager mCostCenterManager
Constructor Detail |
---|
public CostCenterManager()
Method Detail |
---|
public static CostCenterManager getCostCenterManager()
public OrderManager getOrderManager()
public void setOrderManager(OrderManager pOrderManager)
public OrderTools getOrderTools()
public void setOrderTools(OrderTools pOrderTools)
public CostCenter createCostCenter(java.lang.String pIdentifier) throws CommerceException
InvalidParameterException
- thrown if any of the parameters are null
ObjectCreationException
- if the instantiation of an object fails
CommerceException
OrderTools.getDefaultCostCenterType()
public CostCenter createCostCenter(java.lang.String pCostCenterType, java.lang.String pIdentifier) throws CommerceException
pCostCenterType
- the name that is mapped in the OrderTools.properties file to the class of
the desired type to createpIdentifier
- the user-defined name of the CostCenter
InvalidParameterException
- thrown if any of the parameters are null
ObjectCreationException
- if the instantiation of an object fails
CommerceException
public CostCenter addCostCenterToOrder(Order pOrder, CostCenter pCostCenter) throws CommerceException
pOrder
- the Order to add the CommerceItem topCostCenter
- the CostCenter to add to the Order
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
public void removeCostCenterFromOrder(Order pOrder, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order to remove the CostCenter frompCostCenterId
- the id of the CostCenter to remove from the Order
InvalidParameterException
- thrown if any of the parameters are null
CostCenterNotFoundException
- if a CostCenter with the given id is not found in the given order
ObjectRemovalException
- thrown if the CostCenter contains any relationships
CommerceException
public void removeAllCostCentersFromOrder(Order pOrder) throws CommerceException
pOrder
- the Order which contains the CostCenters to be removed
InvalidParameterException
- thrown if any of the parameters are null
ObjectRemovalException
- thrown if a CostCenter cannot be removed
CommerceException
public void removeAllRelationshipsFromCostCenter(Order pOrder, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which contains the CostCenter to remove the relationships frompCostCenterId
- the id of the CostCenter
InvalidParameterException
- thrown if any of the parameters are null
CostCenterNotFoundException
- if a CostCenter with the given id is not found in the given order
ObjectRemovalException
- thrown if a relationship cannot be removed
CommerceException
public CostCenter getCostCenterByIdentifier(java.util.List pCostCenters, java.lang.String pIdentifier) throws CommerceException
pCostCenters
- a List of CostCenterspIdentifier
- the identifier to search for in the List of CostCenters
InvalidParameterException
- if any of the parameters are null
CommerceException
public CostCenterCommerceItemRelationship getCostCenterCommerceItemRelationship(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pCostCenterId) throws CommerceException
pCommerceItemId
- the id of the CommerceItem which makes up a half of the relationshippCostCenterId
- the id of the CostCenter 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
public CostCenterOrderRelationship getCostCenterOrderRelationship(Order pOrder, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which makes up half of the relationshippCostCenterId
- the id of the CostCenter 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
public CostCenterShippingGroupRelationship getCostCenterShippingGroupRelationship(Order pOrder, java.lang.String pCostCenterId, java.lang.String pShippingGroupId) throws CommerceException
pShippingGroupId
- the id of the ShippingGroup which makes up a half of the relationshippCostCenterId
- the id of the CostCenter 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
public void moveItemToCostCenter(Order pOrder, java.lang.String pCatalogRefId, long pQuantity, java.lang.String pSrcCostCenterId, java.lang.String pDestCostCenterId) throws CommerceException
pOrder
- the order which the item exists inpCatalogRefId
- the catalogRefId of the item to movepQuantity
- the quantity to movepSrcCostCenterId
- the id of the costCenter to move the item frompDestCostCenterId
- the id of the costCenter to move the item to
CommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public void moveItemToCostCenter(Order pOrder, CommerceItem pCommerceItem, long pQuantity, CostCenter pSrcCostCenter, CostCenter pDestCostCenter) throws CommerceException
pOrder
- the order which the item exists inpCommerceItem
- the commerce item to movepQuantity
- the quantity to movepSrcCostCenter
- the costCenter to move the item frompDestCostCenter
- the costCenter to move the item to
CommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public void removeItemQuantityFromCostCenter(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pCostCenterId, long pQuantity) throws CommerceException
pOrder
- the Order which the CommerceItem and CostCenter existpCommerceItemId
- the id of the CommerceItem to to remove from the CostCenterpCostCenterId
- the id of the CostCenter 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 addItemQuantityToCostCenter(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pCostCenterId, long pQuantity) throws CommerceException
pOrder
- the Order which the CommerceItem and CostCenter existpCommerceItemId
- the id of the CommerceItem to addpCostCenterId
- the id of the CostCenter 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 CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterCommerceItemRelationship
public void addRemainingItemQuantityToCostCenter(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which the CommerceItem and CostCenter existpCommerceItemId
- the id of the CommerceItem to addpCostCenterId
- the id of the CostCenter 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 CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterCommerceItemRelationship
public void addItemAmountToCostCenter(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pCostCenterId, double pAmount) throws CommerceException
pOrder
- the Order which the CommerceItem and CostCenter existpCommerceItemId
- the id of the CommerceItem to addpCostCenterId
- the id of the CostCenter 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 CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterCommerceItemRelationship
public void addRemainingItemAmountToCostCenter(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which the CommerceItem and CostCenter existpCommerceItemId
- the id of the CommerceItem to addpCostCenterId
- the id of the CostCenter 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 CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterCommerceItemRelationship
public long getUnassignedQuantityForCommerceItem(CommerceItem pItem)
pItem
- the CommerceItem we are checking
getRemainingQuantityForCostCenter(CommerceItem)
public long getRemainingQuantityForCostCenter(CommerceItem pItem)
pItem
- The CommerceItem we are checking
public double getUnassignedAmountForCommerceItem(CommerceItem pItem)
pItem
- the CommerceItem we are checking
getRemainingAmountForCostCenter(CommerceItem)
public double getRemainingAmountForCostCenter(CommerceItem pItem)
pItem
- The CommerceItem we are checking
public void addShippingCostAmountToCostCenter(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pCostCenterId, double pAmount) throws CommerceException
pOrder
- the Order which the CostCenter and ShippingGroup existpShippingGroupId
- the id of the ShippingGroup's cost to addpCostCenterId
- the id of the CostCenter which the ShippingGroup's cost will be added topAmount
- the amount that is assigned for payment to the CostCenter
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterShippingGroupRelationship
public void addRemainingShippingCostToCostCenter(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which the CostCenter and ShippingGroup existpShippingGroupId
- the id of the ShippingGroup's cost to addpCostCenterId
- the id of the CostCenter 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 CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterShippingGroupRelationship
public void addTaxAmountToCostCenter(Order pOrder, java.lang.String pCostCenterId, double pAmount) throws CommerceException
pOrder
- the Order which the CostCenter existspCostCenterId
- the id of the CostCenter which the Order's tax will be added topAmount
- the amount that is assigned for payment to the CostCenter
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterOrderRelationship
public void addRemainingTaxAmountToCostCenter(Order pOrder, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which the PaymentGroup existspCostCenterId
- the id of the CostCenter which the Order's tax 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 CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterOrderRelationship
public void addOrderAmountToCostCenter(Order pOrder, java.lang.String pCostCenterId, double pAmount) throws CommerceException
pOrder
- the Order which the CostCenter existspCostCenterId
- the id of the CostCenter which the Order's cost will be added topAmount
- the amount that is assigned for payment to the CostCenter
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterOrderRelationship
public void addRemainingOrderAmountToCostCenter(Order pOrder, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which the CostCenter existspCostCenterId
- the id of the CostCenter which the Order'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 CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterOrderRelationship
public PipelineResult recalculateCostCenterAmounts(Order pOrder) throws CommerceException
pOrder
- the Order to recalculate the CostCenters in
CommerceException
- thrown if an error occurs while recalculating the amountspublic java.util.List getOrdersForCostCenter(java.lang.String pCostCenterId, int pStartIndex, int pNumOrders) throws CommerceException
pCostCenterId
- the CostCenter idpStartIndex
- The index of the first order to returnpNumOrders
- The number of orders to return
InvalidParameterException
- thrown if any of the parameters are null or empty string
CommerceException
- thrown if an exception occurs while accessing the repositorypublic java.util.List getOrdersForCostCenter(java.lang.String pCostCenterId, int pStartIndex, int pNumOrders, java.lang.String[] pStates, java.lang.String pSortProperty, boolean pAscending, java.util.Collection<java.lang.String> pSiteIds) throws CommerceException
pCostCenterId
- the CostCenter idpStartIndex
- The index of the first order to returnpNumOrders
- The number of orders to returnpStates
- If provided, results will be filtered by the provided statespSortProperty
- The property to sort the results bypAscending
- Whether to return the results in ascending or decending orderpSiteIds
- Results will be filtered by the given site Ids
InvalidParameterException
- thrown if any of the parameters are null or empty string
CommerceException
- thrown if an exception occurs while accessing the repositorypublic java.util.List getOrderIdsForCostCenter(java.lang.String pCostCenterId, int pStartIndex, int pNumOrders) throws CommerceException
pCostCenterId
- the CostCenter idpStartIndex
- The index of the first order to returnpNumOrders
- The number of orders to return
InvalidParameterException
- thrown if any of the parameters are null or empty string
CommerceException
- thrown if an exception occurs while accessing the repositorypublic java.util.List getOrderIdsForCostCenter(java.lang.String pCostCenterId, int pStartIndex, int pNumOrders, java.lang.String[] pStates, java.lang.String pSortProperty, boolean pAscending, java.util.Collection<java.lang.String> pSiteIds) throws CommerceException
pCostCenterId
- the CostCenter idpStartIndex
- The index of the first order to returnpNumOrders
- The number of orders to returnpStates
- If provided, results will be filtered by the provided statespSortProperty
- The property to sort the results bypAscending
- Whether to return the results in ascending or decending orderpSiteIds
- Results will be filtered by the given site Ids
InvalidParameterException
- thrown if any of the parameters are null or empty string
CommerceException
- thrown if an exception occurs while accessing the repositorypublic int getOrderCount(java.lang.String pCostCenterId, java.lang.String[] pStates, java.util.Collection<java.lang.String> pSiteIds) throws CommerceException
pCostCenterId
- The cost center idpStates
- Order states to filter the results bypSiteIds
- SiteIds to filter the results by
CommerceException
protected Relationship createRelationship(java.lang.String pRelationshipType) throws CommerceException
pRelationshipType
- the type that is mapped in the OrderTools.properties file to the class of
the desired type to create
ObjectCreationException
- if the instantiation of an object fails
InvalidTypeException
- if the given type is not valid
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |