atg.b2bcommerce.order
Class B2BOrderTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.order.OrderTools
              extended by atg.b2bcommerce.order.B2BOrderTools
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class B2BOrderTools
extends OrderTools

This class is a low level business layer class. It provides the raw functionality for manipulating an Order. The methods in this class are not meant for direct use, but rather are used primarily by the OrderManager. This class does all the work like instantiating and creating the objects in the repository. In addition to the raw functionality, it also contains properties which control key parts of the commerce platform. For example, it contains the mappings for names to class types for the major objects, Order, CommerceItem, ShippingGroup, PaymentGroup, Relationship, and HandlingInstruction. In addition to mapping names it also contains the default types for each class type. It also contains the mapping for item descriptor names to class types. Other objects it contains are key components used in the commerce system, such as PipelineManager, GiftlistManager, ProfileTools, CatalogTools, OrderRepository, and ProfileRepository. The main functionality which this class provides is object construction and initialization. This is done by methods like createOrder(), createCommerceItem(), etc. The initialization methods provided are only for Relationships.

See Also:
OrderManager

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
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
B2BOrderTools()
          Constructs an OrderTools object.
 
Method Summary
 CostCenter createCostCenter(java.lang.String pType)
          Returns a new instance of a CostCenter whose class is mapped to the type supplied in pType.
 java.util.Properties getCostCenterTypeClassMap()
          returns a java.util.Properties object of the type to classname map for CostCenter classes.
 boolean getCreateDefaultCostCenter()
          Returns property createDefaultCostCenter
 java.lang.String getDefaultCostCenterType()
          Returns the defaultCostCenterType
 void initializeRelationship(B2BOrder pOrder, CostCenterCommerceItemRelationship pRelationship, java.lang.String pCostCenterId, java.lang.String pCommerceItemId)
          This method initializes the Relationship to contain a CostCenter and a CommerceItem.
 void initializeRelationship(B2BOrder pOrder, CostCenterOrderRelationship pRelationship, java.lang.String pCostCenterId)
          This method initializes the Relationship to contain a CostCenter and an Order.
 void initializeRelationship(B2BOrder pOrder, CostCenterShippingGroupRelationship pRelationship, java.lang.String pCostCenterId, java.lang.String pShippingGroupId)
          This method initializes the Relationship to contain a CostCenter and a ShippingGroup.
 void setCostCenterTypeClassMap(java.util.Properties pProp)
          sets a java.util.Properties object to contain the type to classname map for CostCenters.
 void setCreateDefaultCostCenter(boolean pCreateDefaultCostCenter)
          Sets property createDefaultCostCenter
 void setDefaultCostCenterType(java.lang.String pDefaultCostCenterType)
          Sets the defaultCostCenterType
 
Methods inherited from class atg.commerce.order.OrderTools
addManualAdjustment, addManualAdjustment, copyAddress, copyAddress, copyAddress, createCommerceItem, createHandlingInstruction, createManualAdjustmentItem, createOrder, createOrder, createOrder, createOrder, createOrderFixedAmountAdjustment, createPaymentGroup, createRelationship, createShippingGroup, createShippingGroup, deleteManualAdjustment, doStartService, getBeanNameToItemDescriptorMap, getCatalogTools, getCommerceItemTypeClassMap, getCreateDefaultPaymentGroup, getCreateDefaultShippingGroup, getDefaultCommerceItemType, getDefaultHandlingInstructionType, getDefaultItemPriceInfoClass, getDefaultOrderPriceInfoClass, getDefaultOrderType, getDefaultPaymentGroupAddressType, getDefaultPaymentGroupType, getDefaultProfileType, getDefaultShippingGroupAddressType, getDefaultShippingGroupType, getDefaultShippingPriceInfoClass, getDefaultTaxPriceInfoClass, getGiftlistManager, getHandlingTypeClassMap, getInventoryManager, getItemDescriptorForCommerceItemType, getItemDescriptorForOrderType, getItemDescriptorForPaymentType, getItemDescriptorForShippingType, getItemDescriptorToBeanNameMap, getMappedBeanName, getMappedItemDescriptorName, getOrderFixedAmountAdjustmentType, getOrderItemDescriptorName, getOrderLookupService, getOrderRepository, getOrderTypeClassMap, getPaymentGroupBillingAddressClassNameMap, getPaymentTypeClassMap, getPipelineManager, getProfileRepository, getProfileTools, getRelationshipTypeClassMap, getShippingGroupShippingAddressClassNameMap, getShippingTypeClassMap, getTransactionManager, initializeRelationship, initializeRelationship, initializeRelationship, initializeRelationship, invertBeanToItemMap, isAssignCatalogInCommerceItem, isNullAddress, isNullCreditCard, isOrderState, registerSynchronization, setAssignCatalogInCommerceItem, setBeanNameToItemDescriptorMap, setCatalogTools, setCommerceItemTypeClassMap, setCreateDefaultPaymentGroup, setCreateDefaultShippingGroup, setDefaultCommerceItemType, setDefaultHandlingInstructionType, setDefaultItemPriceInfoClass, setDefaultOrderPriceInfoClass, setDefaultOrderType, setDefaultPaymentGroupAddressType, setDefaultPaymentGroupType, setDefaultProfileType, setDefaultShippingGroupAddressType, setDefaultShippingGroupType, setDefaultShippingPriceInfoClass, setDefaultTaxPriceInfoClass, setGiftlistManager, setHandlingTypeClassMap, setInventoryManager, setItemDescriptorToBeanNameMap, setOrderFixedAmountAdjustmentType, setOrderItemDescriptorName, setOrderLookupService, setOrderRepository, setOrderTypeClassMap, setPaymentGroupBillingAddressClassNameMap, setPaymentTypeClassMap, setPipelineManager, setProfileRepository, setProfileTools, setRelationshipTypeClassMap, setShippingGroupShippingAddressClassNameMap, setShippingTypeClassMap, setTransactionManager
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

B2BOrderTools

public B2BOrderTools()
Constructs an OrderTools object.

Method Detail

getCostCenterTypeClassMap

public java.util.Properties getCostCenterTypeClassMap()
returns a java.util.Properties object of the type to classname map for CostCenter classes.


setCostCenterTypeClassMap

public void setCostCenterTypeClassMap(java.util.Properties pProp)
sets a java.util.Properties object to contain the type to classname map for CostCenters.


getDefaultCostCenterType

public java.lang.String getDefaultCostCenterType()
Returns the defaultCostCenterType


setDefaultCostCenterType

public void setDefaultCostCenterType(java.lang.String pDefaultCostCenterType)
Sets the defaultCostCenterType


getCreateDefaultCostCenter

public boolean getCreateDefaultCostCenter()
Returns property createDefaultCostCenter

Returns:
returns property createDefaultCostCenter

setCreateDefaultCostCenter

public void setCreateDefaultCostCenter(boolean pCreateDefaultCostCenter)
Sets property createDefaultCostCenter

Parameters:
pCreateDefaultCostCenter - the value to set for property createDefaultCostCenter

createCostCenter

public CostCenter createCostCenter(java.lang.String pType)
                            throws CommerceException
Returns a new instance of a CostCenter whose class is mapped to the type supplied in pType. The class must be an instance of atg.commerce.order.CostCenter. The type to class mapping is defined in the property CostCenterClassMap.

Parameters:
pType - the type which is mapped to the class to use
Returns:
the CostCenter object which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidTypeException - if the supplied type is not mapped to any class
CommerceException

initializeRelationship

public void initializeRelationship(B2BOrder pOrder,
                                   CostCenterCommerceItemRelationship pRelationship,
                                   java.lang.String pCostCenterId,
                                   java.lang.String pCommerceItemId)
                            throws CommerceException
This method initializes the Relationship to contain a CostCenter and a CommerceItem. This initialization sets the above fields in the Relationship object and also adds the Relationship to the CostCenter, CommerceItem, and Order.

Parameters:
pOrder - the Order object which contains the CommerceItem and CostCenter to add the Relationship to
pRelationship - the relationship object to add to the Order.
pCostCenterId - the id of the CostCenter object which makes up a half of the relationship
pCommerceItemId - the id of the CommerceItem object which makes up a half of the relationship
Throws:
InvalidParameterException - if any of the given method parameters are invalid
InvalidTypeException - if there is more than one QUANTITYREMAINING relationship type in the CommerceItem
CommerceException

initializeRelationship

public void initializeRelationship(B2BOrder pOrder,
                                   CostCenterShippingGroupRelationship pRelationship,
                                   java.lang.String pCostCenterId,
                                   java.lang.String pShippingGroupId)
                            throws CommerceException
This method initializes the Relationship to contain a CostCenter and a ShippingGroup. This initialization sets the above fields in the Relationship object and also adds the Relationship to the CostCenter, ShippingGroup, and Order.

Parameters:
pOrder - the Order object which contains the ShippingGroup and CostCenter to add the Relationship to
pRelationship - the relationship object to add to the Order.
pCostCenterId - the id of the CostCenter object which makes up a half of the relationship
pShippingGroupId - the id of the ShippingGroup object which makes up a half of the relationship
Throws:
InvalidParameterException - if any of the given method parameters are invalid
InvalidTypeException - if there is more than one CCSHIPPINGAMOUNTREMAINING relationship type in the ShippingGroup
CommerceException

initializeRelationship

public void initializeRelationship(B2BOrder pOrder,
                                   CostCenterOrderRelationship pRelationship,
                                   java.lang.String pCostCenterId)
                            throws CommerceException
This method initializes the Relationship to contain a CostCenter and an Order. This initialization sets the above fields in the Relationship object and also adds the Relationship to the CostCenter and Order.

Parameters:
pOrder - the Order object which contains the CostCenter to add the Relationship to
pRelationship - the relationship object to add to the Order.
pCostCenterId - the id of the CostCenter object which makes up a half of the relationship
Throws:
InvalidParameterException - if any of the given method parameters are invalid
InvalidTypeException - if there is more than one CCTAXAMOUNTREMAINING relationship type in the Order
CommerceException