atg.commerce.order
Class OrderManager

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.order.OrderManager
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
SimpleOrderManager

public class OrderManager
extends GenericService

This class is the business layer object for managing and manipulating Orders. This class plus CommerceItemManager, ShippingGroupManager, and PaymentGroupManager hold all the business logic for manipulating an Order. The various types of methods in this class are used for creating objects, adding objects to an Order, adding objects to other objects, removing objects from other objects. Below is an example of creating an Order, adding CommerceItems to it, assigning those items to a ShippingGroup and PaymentGroup, and checking the Order out.

 OrderManager om = getOrderManager();
 CommerceItemManager cm = getCommerceItemManager();
 PricingTools pt = getPricingTools();
 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 and CommerceItems. The Order has a ShippingGroup and PaymentGroup
 // in it when constructed
 Order order = om.createOrder(profileId);
 CommerceItem item1 = cm.createCommerceItem(catalogRefId1, productId1, quantity1);
 CommerceItem item2 = cm.createCommerceItem(catalogRefId2, productId2, quantity2);

 // add the items to the Order, set the return value back to the object because if an
 // item with catalogRefId already existed in the Order, the quantity is incremented rather
 // than adding the new object
 item1 = cm.addItemToOrder(order, item1);
 item2 = cm.addItemToOrder(order, item2);

 // get the ShippingGroup and add the items to it
 ShippingGroup sg = (ShippingGroup) order.getShippingGroups().get(0);
 cm.addItemQuantityToShippingGroup(order, item1.getId(), sg.getId(), quantity1);
 cm.addRemainingItemQuantityToShippingGroup(order, item2.getId(), sg.getId());

 // add the entire order amount to the PaymentGroup
 PaymentGroup pg = (PaymentGroup) order.getPaymentGroups().get(0);
 om.addRemainingOrderAmountToPaymentGroup(order, pg.getId());

 // Compute the prices using pricing tools
 pt.priceOrderTotal(order);

 // 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]));
 }


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected static OrderManager mOrderManager
           
protected  java.util.List mOrderMergeListeners
           
protected  ComponentName mUserPricingModelsPath
          The path to the PricingModelHolder in Nucleus which holds the user's pricing models
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
OrderManager()
          Constructs an OrderManager object.
 
Method Summary
 CommerceItem addAsSeparateItemToOrder(Order pOrder, CommerceItem pItem)
          Deprecated. this method has been moved to the CommerceItemManager
 void addHandlingInstructionToShippingGroup(Order pOrder, HandlingInstruction pHandlingInstruction)
          Deprecated. this method has been moved to the HandlingInstructionManager
 void addItemAmountToPaymentGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pPaymentGroupId, double pAmount)
          Deprecated. this method has been moved to the CommerceItemManager
 void addItemQuantityToShippingGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId, long pQuantity)
          Deprecated. this method has been moved to the CommerceItemManager
 CommerceItem addItemToOrder(Order pOrder, CommerceItem pItem)
          Deprecated. this method has been moved to the CommerceItemManager
 void addOrder(Order pOrder)
          Adds the Order to the repository.
 void addOrderAmountToPaymentGroup(Order pOrder, java.lang.String pPaymentGroupId, double pAmount)
          Adds the given amount of the Order's cost to the PaymentGroup with the given id.
 void addOrderMergeListener(OrderMergeListener pListener)
          Add a listener to the set of event listeners that are notified when orders are merged.
 void addPaymentGroupToOrder(Order pOrder, PaymentGroup pPaymentGroup)
          Deprecated. this method has been moved to the PaymentGroupManager
 void addPaymentGroupToOrder(Order pOrder, PaymentGroup pPaymentGroup, int pIndex)
          Deprecated. this method has been moved to the PaymentGroupManager
 void addRemainingItemAmountToPaymentGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pPaymentGroupId)
          Deprecated. this method has been moved to the CommerceItemManager
 void addRemainingItemQuantityToShippingGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId)
          Deprecated. this method has been moved to the CommerceItemManager
 void addRemainingOrderAmountToPaymentGroup(Order pOrder, java.lang.String pPaymentGroupId)
          Adds any unassigned amount of the Order's cost to the PaymentGroup with the given id.
 void addRemainingShippingCostToPaymentGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pPaymentGroupId)
          Deprecated. this method has been moved to the ShippingGroupManager
 void addRemainingTaxAmountToPaymentGroup(Order pOrder, java.lang.String pPaymentGroupId)
          Adds any unassigned amount of the Order's tax to the PaymentGroup with the given id.
 void addShippingCostAmountToPaymentGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pPaymentGroupId, double pAmount)
          Deprecated. this method has been moved to the ShippingGroupManager
 void addShippingGroupToOrder(Order pOrder, ShippingGroup pShippingGroup)
          Deprecated. this method has been moved to the ShippingGroupManager
 void addTaxAmountToPaymentGroup(Order pOrder, java.lang.String pPaymentGroupId, double pAmount)
          Adds the given amount of the Order's tax to the PaymentGroup with the given id.
 Order[] areOrdersMergeable(Order pSrcOrder, Order pDestOrder)
          Checks to see if we can merge two orders.
 ShippingGroup cloneShippingGroup(ShippingGroup pShippingGroup)
          Deprecated. this method has been moved to the ShippingGroupManager
 boolean compareElectronicShippingGroups(ShippingGroup pSrcShippingGroup, ShippingGroup pDestShippingGroup)
          Compares two ElectronicShippingGroup objects to check if their shipping addresses match.
 boolean compareGiftlistHandlingInstructions(GiftlistHandlingInstruction pSrcGiftListHandlingInst, GiftlistHandlingInstruction pDestGiftListHandlingInst)
          Compares two GiftlistHandlingInstruction objects to check if they match.
 boolean compareHandlingInstructions(HandlingInstruction pSrcHandlingInstruction, HandlingInstruction pDestHandlingInstruction)
          Compares two HandlingInstruction objects to check if they match.
 boolean compareHardgoodShippingGroups(ShippingGroup pSrcShippingGroup, ShippingGroup pDestShippingGroup)
          Compares two HardgoodShippingGroup objects to check if their shipping addresses match.
 void copyAddress(Address pSrcAddress, Address pDestAddress)
          Deprecated. this method has been moved to the OrderTools class
 void copyAddress(Address pAddress, RepositoryItem pProfileAddress)
          Deprecated. this method has been moved to the OrderTools class
 void copyAddress(RepositoryItem pProfileAddress, Address pAddress)
          Deprecated. this method has been moved to the OrderTools class
 HandlingInstruction copyHandlingInstruction(HandlingInstruction pHandlingInstruction)
          Deprecated. this method has been moved to the HandlingInstructionManager
 CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, long pQuantity)
          Deprecated. this method has been moved to the CommerceItemManager
 CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, long pQuantity, ItemPriceInfo pPriceInfo)
          Deprecated. this method has been moved to the CommerceItemManager
 CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, java.lang.Object pProductRef, long pQuantity)
          Deprecated. this method has been moved to the CommerceItemManager
 CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, java.lang.Object pProductRef, long pQuantity, ItemPriceInfo pPriceInfo)
          Deprecated. this method has been moved to the CommerceItemManager
 CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.String pProductId, long pQuantity)
          Deprecated. this method has been moved to the CommerceItemManager
 CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.String pProductId, long pQuantity, java.lang.String pCatalogKey)
          Deprecated. this method has been moved to the CommerceItemManager
 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)
          Deprecated. this method has been moved to the CommerceItemManager
 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)
          Deprecated. this method has been moved to the CommerceItemManager
 HandlingInstruction createHandlingInstruction()
          Deprecated. this method has been moved to the HandlingInstructionManager
 HandlingInstruction createHandlingInstruction(java.lang.String pHandlingInstructionType)
          Deprecated. this method has been moved to the HandlingInstructionManager
 HandlingInstruction createHandlingInstruction(java.lang.String pShippingGroupId, java.lang.String pCommerceItemId, long pQuantity)
          Deprecated. this method has been moved to the HandlingInstructionManager
 HandlingInstruction createHandlingInstruction(java.lang.String pHandlingInstructionType, java.lang.String pShippingGroupId, java.lang.String pCommerceItemId, long pQuantity)
          Deprecated. this method has been moved to the HandlingInstructionManager
 Order createOrder(java.lang.String pProfileId)
          Creates a new Order object using the default type specified in the OrderTools defaultOrderType property.
 Order createOrder(java.lang.String pProfileId, OrderPriceInfo pOrderPriceInfo, TaxPriceInfo pTaxPriceInfo, ShippingPriceInfo pShippingPriceInfo)
          Creates a new Order object using the default type specified in the OrderTools defaultOrderType property.
 Order createOrder(java.lang.String pProfileId, OrderPriceInfo pOrderPriceInfo, TaxPriceInfo pTaxPriceInfo, ShippingPriceInfo pShippingPriceInfo, java.lang.String pOrderType)
          Creates a new Order object using the class mapped to the given name in pOrderType.
 Order createOrder(java.lang.String pProfileId, java.lang.String pOrderType)
          Creates a new Order object using the class mapped to the given name in pOrderType.
 Order createOrder(java.lang.String pProfileId, java.lang.String pOrderId, OrderPriceInfo pOrderPriceInfo, TaxPriceInfo pTaxPriceInfo, ShippingPriceInfo pShippingPriceInfo, java.lang.String pOrderType)
          Creates a new Order object using the class mapped to the given name in pOrderType and whose id will be that which is supplied in pOrderId.
 Order createOrder(java.lang.String pProfileId, java.lang.String pOrderId, java.lang.String pOrderType)
          Creates a new Order object using the class mapped to the given name in pOrderType.
 PaymentGroup createPaymentGroup()
          Deprecated. this method has been moved to the PaymentGroupManager
 PaymentGroup createPaymentGroup(java.lang.String pPaymentGroupType)
          Deprecated. this method has been moved to the PaymentGroupManager
protected  Relationship createRelationship(java.lang.String pRelationshipType)
          Creates a new Relationship object using the class type mapped to the type supplied in pShippingGroupType.
 ShippingGroup createShippingGroup()
          Deprecated. this method has been moved to the ShippingGroupManager
 ShippingGroup createShippingGroup(java.lang.String pShippingGroupType)
          Deprecated. this method has been moved to the ShippingGroupManager
 ShippingGroup createShippingGroup(java.lang.String pShippingGroupType, ShippingPriceInfo pPriceInfo)
          Deprecated. this method has been moved to the ShippingGroupManager
 void doStartService()
          Prepare this OrderManager for use by calling initializeDefaultPropertyValues
 java.util.List getAllCommerceItemRelationships(Order pOrder)
          Deprecated. this method has been moved to the CommerceItemManager
 java.util.List getAllOrderRelationships(Order pOrder)
          Provides a List of all OrderRelationships associated with the given Order.
 java.util.List getAllPaymentGroupRelationships(Order pOrder)
          Deprecated. this method has been moved to the PaymentGroupManager
 java.util.List getAllShippingGroupRelationships(Order pOrder)
          Deprecated. this method has been moved to the ShippingGroupManager
 CatalogTools getCatalogTools()
          Returns the catalogTools
 java.lang.String getCommerceItemItemDescriptorName()
          Returns the commerceItemItemDescriptorName
 CommerceItemManager getCommerceItemManager()
          Returns property commerceItemManager
 java.lang.String getCommerceItemOrderPropertyName()
          Returns the commerceItemOrderPropertyName
 java.util.List getCommerceItemsFromPaymentGroup(PaymentGroup pPaymentGroup)
          Deprecated. this method has been moved to the CommerceItemManager
 java.util.List getCommerceItemsFromShippingGroup(ShippingGroup pShippingGroup)
          Deprecated. this method has been moved to the CommerceItemManager
 java.lang.String getCostCenterItemDescriptorName()
          Returns the costCenterItemDescriptorName
 java.lang.String getCostCenterOrderPropertyName()
          Returns the costCenterOrderPropertyName
protected  Query getDateRangeQuery(java.util.Date pFrom, java.util.Date pTo)
          Deprecated. this method has been moved to the OrderQueries class
 boolean getDebugOrderRepositoryItemUpdateTransaction()
          Sets whether or not warning debug stack trace should be generated.
 java.util.Locale getDefaultLocale()
          Returns property DefaultLocale.
 boolean getDefaultOrderByDirection()
          Returns the defaultOrderByDirection, true = ascending, false = descending, default is true
 java.lang.String getDefaultOrderByProperty()
          Returns the defaultOrderByProperty
 HandlingInstructionManager getHandlingInstructionManager()
          Returns property handlingInstructionManager
 java.util.List getHandlingInstructionsForCommerceItem(ShippingGroup pShippingGroup, java.lang.String pCommerceItemId)
          Deprecated. this method has been moved to the HandlingInstructionManager
 javax.naming.InitialContext getJNDIContext()
          Returns the JNDIContext
 java.lang.String getOrderCommerceItemsPropertyName()
          Returns the orderCommerceItemsPropertyName
 java.lang.String getOrderCostCentersPropertyName()
          Returns the orderCostCentersPropertyName
 int getOrderCountForProfile(java.lang.String pProfileId)
          Returns the count of orders for the passed in profile id.
 int getOrderCountForProfileInState(java.lang.String pProfileId, int[] pStates)
          Returns the count of orders whose state matches the pStates list for the given profile id.
 Order getOrderForCommerceItem(CommerceItem pCommerceItem)
          Returns the order that the given CommerceItem is in.
 Order getOrderForCostCenter(CostCenter pCostCenter)
          Returns the order that the given CostCenter is in.
 Order getOrderForPaymentGroup(PaymentGroup pPaymentGroup)
          Returns the order that the given PaymentGroup is in.
 Order getOrderForRelationship(Relationship pRelationship)
          Returns the order that the given Relationship is in.
 Order getOrderForShippingGroup(ShippingGroup pShippingGroup)
          Returns the order that the given ShippingGroup is in.
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pState)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int[] pStates)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int[] pStates, java.lang.String pOrderByProperty, boolean pAscending)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int pState)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int[] pStates)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int[] pStates, java.lang.String pOrderByProperty, boolean pAscending)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int pState, java.lang.String pOrderByProperty, boolean pAscending)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, java.lang.String pOrderByProperty, boolean pAscending)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pState, java.lang.String pOrderByProperty, boolean pAscending)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, java.lang.String pOrderByProperty, boolean pAscending)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsForProfileWithinDateRange(java.lang.String pProfileId, java.util.Date pFrom, java.util.Date pTo)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrderIdsWithinDateRange(java.util.Date pFrom, java.util.Date pTo)
          Deprecated. this method has been moved to the OrderQueries class
 java.lang.String getOrderItemDescriptorName()
          Returns property OrderItemDescriptorName
static OrderManager getOrderManager()
           
 java.lang.String getOrderPaymentGroupsPropertyName()
          Returns the orderPaymentGroupsPropertyName
 OrderQueries getOrderQueries()
          Returns property orderQueries
 java.lang.String getOrderRelationshipsPropertyName()
          Returns the orderRelationshipsPropertyName
 java.util.List getOrdersForProfile(java.lang.String pProfileId)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrdersForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrdersForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, java.lang.String pOrderByProperty, boolean pAscending)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrdersForProfile(java.lang.String pProfileId, java.lang.String pOrderByProperty, boolean pAscending)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pState)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int[] pStates)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int[] pStates, java.lang.String pOrderByProperty, boolean pAscending)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int pState)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int[] pStates)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int[] pStates, java.lang.String pOrderByProperty, boolean pAscending)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int pState, java.lang.String pOrderByProperty, boolean pAscending)
          Deprecated. this method has been moved to the OrderQueries class
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pState, java.lang.String pOrderByProperty, boolean pAscending)
          Deprecated. this method has been moved to the OrderQueries class
 java.lang.String getOrderShippingGroupsPropertyName()
          Returns the orderShippingGroupsPropertyName
 OrderTools getOrderTools()
          Returns the OrderTools
 java.lang.String getOrderVersionPropertyName()
          Returns property orderVersionPropertyName
 PaymentGroupCommerceItemRelationship getPaymentGroupCommerceItemRelationship(Order pOrder, java.lang.String pItemId, java.lang.String pPaymentGroupId)
          Deprecated. this method has been moved to the PaymentGroupManager
 java.lang.String getPaymentGroupItemDescriptorName()
          Returns the paymentGroupItemDescriptorName
 PaymentGroupManager getPaymentGroupManager()
          Returns property paymentGroupManager
 java.lang.String getPaymentGroupOrderPropertyName()
          Returns the paymentGroupOrderPropertyName
 PaymentGroupOrderRelationship getPaymentGroupOrderRelationship(Order pOrder, java.lang.String pPaymentGroupId)
          Deprecated. this method has been moved to the PaymentGroupManager
 PaymentGroupShippingGroupRelationship getPaymentGroupShippingGroupRelationship(Order pOrder, java.lang.String pPaymentGroupId, java.lang.String pShippingGroupId)
          Deprecated. this method has been moved to the PaymentGroupManager
 PipelineManager getPipelineManager()
          Returns the pipelineManager
 java.util.HashMap getProcessOrderMap(java.util.Locale pLocale, java.util.Map pMap)
          This map is used to pass additional information in the process order pipe line.
 java.lang.String getRelationshipItemDescriptorName()
          Returns the relationshipItemDescriptorName
 java.lang.String getRelationshipOrderPropertyName()
          Returns the relationshipOrderPropertyName
 long getRemainingQuantityForShippingGroup(CommerceItem pItem)
          Deprecated. this method has been moved to the ShippingGroupManager
 java.util.List getShipItemRelsForRange(java.util.List pRelationships, atg.core.util.Range pRange)
          Return the relationships whose range fall within the given range
 ShippingGroup getShippingGroupByDescription(java.util.List pShippingGroups, java.lang.String pDescription)
          Deprecated. this method has been moved to the ShippingGroupManager
 ShippingGroupCommerceItemRelationship getShippingGroupCommerceItemRelationship(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId)
          Deprecated. this method has been moved to the ShippingGroupManager
 java.lang.String getShippingGroupItemDescriptorName()
          Returns the shippingGroupItemDescriptorName
 ShippingGroupManager getShippingGroupManager()
          Returns property shippingGroupManager
 java.lang.String getShippingGroupOrderPropertyName()
          Returns the shippingGroupOrderPropertyName
 SiteGroupManager getSiteGroupManager()
          Returns the SiteGroupManager
 long getUnassignedQuantityForCommerceItem(CommerceItem pItem)
          Deprecated. this method has been moved to the CommerceItemManager
 java.util.List getUniqueCatalogRefIds(Order pOrder)
          For the given order, return a list of all the catalog ref ids in the order.
 java.lang.String getUserPricingModelsPath()
          The path to the PricingModelHolder in Nucleus which holds the user's pricing models
 java.lang.String[] getValidOrderProcessingStates()
          Returns property validOrderProcessingStates
 java.lang.String[] getValidProcessOrderErrorStates()
          Returns property validProcessOrderErrorStates.
 void initializeCreditCard(CreditCard pCreditCard, java.lang.String pCreditCardNumber, java.lang.String pCreditCardType)
          Deprecated. this method has been moved to the PaymentGroupManager
protected  void initializeDefaultPropertyValues()
          Initialize any properites whose default values should be computed at runtime before this component is first used.
 void initializeGiftCertificate(GiftCertificate pGiftCertificate, java.lang.String pProfileId, java.lang.String pGiftCertificateNumber)
          Deprecated. this method has been moved to the PaymentGroupManager
 boolean isCreateSGRelationshipsOnMerge()
          Return the createSGRelationshipsOnMerge property.
 boolean isOrderStateValidForProcessing(int pState)
          This method returns true if pState is a valid state for processing.
protected  boolean isTransactionMarkedAsRollBack()
          Returns true if the transaction associated with the current thread is marked for rollback.
 Order loadOrder(java.lang.String pOrderId)
          Loads the order from the repository.
 java.util.List<Order> loadOrders(java.util.List<java.lang.String> pOrderIds)
          Utility method to convert a list of order ids into a list of Order objects.
protected  boolean markTransactionForRollback()
          Returns true if the transaction has been marked for rollback, false if unable to access the transaction.
 void mergeOrders(Order pSrcOrder, Order pDestOrder)
          This method merges the CommerceItems and ShippingGroups from pSrcOrder to pDestOrder.
 void mergeOrders(Order pSrcOrder, Order pDestOrder, boolean pMergeShippingGroups, boolean pRemoveSrcOrder)
          This method merges the CommerceItems and optionally ShippingGroups from pSrcOrder to pDestOrder.
 boolean orderExists(java.lang.String pOrderId)
          Checks to see if an order id exists in the OrderRepository.
 PipelineResult processOrder(Order pOrder)
          Begins processing the order.
 PipelineResult processOrder(Order pOrder, java.util.HashMap pMap)
          Begins processing the order.
 PipelineResult processOrder(Order pOrder, java.util.Locale pLocale)
          Begins processing the order.
 PipelineResult processOrder(Order pOrder, java.lang.String pProcessOrderChainId, java.util.HashMap pMap)
          Begins processing the order.
 PipelineResult processOrderWithReprice(Order pOrder, java.lang.String pLocale)
          Deprecated.  
 PipelineResult processOrderWithReprice(Order pOrder, java.lang.String pLocale, java.util.HashMap pExtraParams)
          Submits the given order by calling processOrder with the chain: PipelineConstants.PROCESSORDERWITHREPRICE The locale that is used is determined in the following order: pLocale - If not null OrderManager.defaultLocale - if not null ServletUtil.getUserLocale
 PipelineResult recalculatePaymentGroupAmounts(Order pOrder)
          Deprecated. this method has been moved to the PaymentGroupManager
 void removeAllCommerceItemsFromOrder(Order pOrder)
          Deprecated. this method has been moved to the CommerceItemManager
 void removeAllHandlingInstructionsFromShippingGroup(Order pOrder, java.lang.String pShippingGroupId)
          Deprecated. this method has been moved to the HandlingInstructionManager
 void removeAllPaymentGroupsFromOrder(Order pOrder)
          Deprecated. this method has been moved to the PaymentGroupManager
 void removeAllRelationshipsFromCommerceItem(Order pOrder, java.lang.String pCommerceItemId)
          Deprecated. this method has been moved to the CommerceItemManager
 void removeAllRelationshipsFromPaymentGroup(Order pOrder, java.lang.String pPaymentGroupId)
          Deprecated. this method has been moved to the PaymentGroupManager
 void removeAllRelationshipsFromShippingGroup(Order pOrder, java.lang.String pShippingGroupId)
          Deprecated. this method has been moved to the ShippingGroupManager
 void removeAllShippingGroupsFromOrder(Order pOrder)
          Deprecated. this method has been moved to the ShippingGroupManager
 void removeEmptyPaymentGroups(Order pOrder)
          Deprecated. this method has been moved to the PaymentGroupManager
 void removeEmptyShippingGroups(Order pOrder)
          Deprecated. this method has been moved to the ShippingGroupManager
 void removeHandlingInstructionFromShippingGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pHandlingInstructionId)
          Deprecated. this method has been moved to the HandlingInstructionManager
 void removeHandlingInstructionsFromShippingGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pCommerceItemId)
          Deprecated. this method has been moved to the HandlingInstructionManager
 void removeItemAmountFromPaymentGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pPaymentGroupId, double pAmount)
          Deprecated. this method has been moved to the CommerceItemManager
 void removeItemFromOrder(Order pOrder, java.lang.String pCommerceItemId)
          Deprecated. this method has been moved to the CommerceItemManager
protected  void removeItemFromPaymentGroupInternal(Order pOrder, PaymentGroupCommerceItemRelationship pRel)
          Deprecated. this method has been moved to the CommerceItemManager
 void removeItemQuantityFromShippingGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId, long pQuantity)
          Deprecated. this method has been moved to the CommerceItemManager
 void removeOrder(java.lang.String pOrderId)
          Removes the Order with the given id from the repository.
 void removeOrderAmountFromPaymentGroup(Order pOrder, java.lang.String pPaymentGroupId, double pAmount)
          Removes the given amount of the Order's cost from the PaymentGroup with the given id.
protected  void removeOrderFromPaymentGroupInternal(Order pOrder, PaymentGroupOrderRelationship pRel)
          Removes the PaymentGroupOrderRelationship from the Order.
 void removeOrderMergeListener(OrderMergeListener pListener)
          Remove a listener from the set of event listeners that are notified when orders are merged.
 void removePaymentGroupFromOrder(Order pOrder, java.lang.String pPaymentGroupId)
          Deprecated. this method has been moved to the PaymentGroupManager
 void removeRemainingItemAmountFromPaymentGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pPaymentGroupId)
          Deprecated. this method has been moved to the CommerceItemManager
 void removeRemainingItemQuantityFromShippingGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId)
          Deprecated. this method has been moved to the CommerceItemManager
 void removeRemainingOrderAmountFromPaymentGroup(Order pOrder, java.lang.String pPaymentGroupId)
          Removes the "remaining" amount of the Order's cost from the PaymentGroup with the given id.
 void removeRemainingShippingCostFromPaymentGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pPaymentGroupId)
          Deprecated. this method has been moved to the ShippingGroupManager
 void removeRemainingTaxAmountFromPaymentGroup(Order pOrder, java.lang.String pPaymentGroupId)
          Removes the "remaining" amount of the Order's tax from the PaymentGroup with the given id.
 void removeShippingCostAmountFromPaymentGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pPaymentGroupId, double pAmount)
          Deprecated. this method has been moved to the ShippingGroupManager
protected  void removeShippingCostFromPaymentGroupInternal(Order pOrder, PaymentGroupShippingGroupRelationship pRel)
          Deprecated. this method has been moved to the ShippingGroupManager
 void removeShippingGroupFromOrder(Order pOrder, java.lang.String pShippingGroupId)
          Deprecated. this method has been moved to the ShippingGroupManager
 void removeTaxAmountFromPaymentGroup(Order pOrder, java.lang.String pPaymentGroupId, double pAmount)
          Removes the given amount of the Order's tax from the PaymentGroup with the given id.
 void resetOrder(Order pClonedOrder)
          This method takes an order and resets it to a state where it can be resubmitted for checkout.
 void resetOrderCommerceItemRelationships(Order pOrder)
          Resets the commerce item relationships in the order.
 void returnCommerceItem(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId, long pQuantity)
          Deprecated. this method has been moved to the CommerceItemManager
 void sendOrderMergeEvent(Order pSource, Order pDest, boolean pRemove)
          Send an order merged event to the current set of event listeners.
 void setCommerceItemItemDescriptorName(java.lang.String pCommerceItemItemDescriptorName)
          Sets the commerceItemItemDescriptorName
 void setCommerceItemManager(CommerceItemManager pCommerceItemManager)
          Sets property commerceItemManager
 void setCommerceItemOrderPropertyName(java.lang.String pCommerceItemOrderPropertyName)
          Sets the commerceItemOrderPropertyName
 void setCostCenterItemDescriptorName(java.lang.String pCostCenterItemDescriptorName)
          Sets the costCenterItemDescriptorName
 void setCostCenterOrderPropertyName(java.lang.String pCostCenterOrderPropertyName)
          Sets the costCenterOrderPropertyName
 void setCreateSGRelationshipsOnMerge(boolean pCreateSGRelationshipsOnMerge)
          Set the createSGRelationshipsOnMerge property.
 void setDebugOrderRepositoryItemUpdateTransaction(boolean pDebugOrderRepositoryItemUpdateTransaction)
          This method returns whether or not an warning debug stack trace will be generated when order repoisoty item is updated but OrderManager.updateOrder is not be called in the same transaction.
 void setDefaultLocale(java.util.Locale pDefaultLocale)
          Sets property DefaultLocale
 void setDefaultOrderByDirection(boolean pDefaultOrderByDirection)
          Sets the defaultOrderByDirection
 void setDefaultOrderByProperty(java.lang.String pDefaultOrderByProperty)
          Sets the defaultOrderByProperty
 void setHandlingInstructionManager(HandlingInstructionManager pHandlingInstructionManager)
          Sets property handlingInstructionManager
 void setOrderCommerceItemsPropertyName(java.lang.String pOrderCommerceItemsPropertyName)
          Sets the orderCommerceItemsPropertyName
 void setOrderCostCentersPropertyName(java.lang.String pOrderCostCentersPropertyName)
          Sets the orderCostCentersPropertyName
 void setOrderItemDescriptorName(java.lang.String pOrderItemDescriptorName)
          Sets property OrderItemDescriptorName
 void setOrderPaymentGroupsPropertyName(java.lang.String pOrderPaymentGroupsPropertyName)
          Sets the orderPaymentGroupsPropertyName
 void setOrderQueries(OrderQueries pOrderQueries)
          Sets property orderQueries
 void setOrderRelationshipsPropertyName(java.lang.String pOrderRelationshipsPropertyName)
          Sets the orderRelationshipsPropertyName
 void setOrderShippingGroupsPropertyName(java.lang.String pOrderShippingGroupsPropertyName)
          Sets the orderShippingGroupsPropertyName
 void setOrderTools(OrderTools pOrderTools)
          Sets the OrderTools
 void setOrderVersionPropertyName(java.lang.String pOrderVersionPropertyName)
          Sets property orderVersionPropertyName
 void setPaymentGroupItemDescriptorName(java.lang.String pPaymentGroupItemDescriptorName)
          Sets the paymentGroupItemDescriptorName
 void setPaymentGroupManager(PaymentGroupManager pPaymentGroupManager)
          Sets property paymentGroupManager
 void setPaymentGroupOrderPropertyName(java.lang.String pPaymentGroupOrderPropertyName)
          Sets the paymentGroupOrderPropertyName
 void setRelationshipItemDescriptorName(java.lang.String pRelationshipItemDescriptorName)
          Sets the relationshipItemDescriptorName
 void setRelationshipOrderPropertyName(java.lang.String pRelationshipOrderPropertyName)
          Sets the relationshipOrderPropertyName
 void setShippingGroupItemDescriptorName(java.lang.String pShippingGroupItemDescriptorName)
          Sets the shippingGroupItemDescriptorName
 void setShippingGroupManager(ShippingGroupManager pShippingGroupManager)
          Sets property shippingGroupManager
 void setShippingGroupOrderPropertyName(java.lang.String pShippingGroupOrderPropertyName)
          Sets the shippingGroupOrderPropertyName
 void setSiteGroupManager(SiteGroupManager pSiteGroupManager)
          Sets the SiteGroupManager
 void setUserPricingModelsPath(java.lang.String pUserPricingModelsPath)
          the path to the PricingModelHolder in Nucleus which holds the user's pricing models
 void setValidOrderProcessingStates(java.lang.String[] pValidOrderProcessingStates)
          Sets property validOrderProcessingStates
 void setValidProcessOrderErrorStates(java.lang.String[] pValidProcessOrderErrorStates)
          Sets property validProcessOrderErrorStates
 java.util.List splitShippingGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String[] pItemIds)
          Deprecated. this method has been moved to the ShippingGroupManager
 java.util.List splitShippingGroup(Order pOrder, java.lang.String pShippingGroupId, java.lang.String[] pItemIds, long[] pQuantities)
          Deprecated. this method has been moved to the ShippingGroupManager
protected  java.util.List splitShippingGroupWithImplicitRelationships(Order pOrder, ShippingGroup pShippingGroup, java.lang.String[] pItemIds, long[] pQuantities)
          Deprecated. this method has been moved to the ShippingGroupManager
 void updateOrder(Order pOrder)
          Updates (saves) the data in the order to the repository.
 PipelineResult validateOrder(Order pOrder)
          Validates an order.
 PipelineResult validateOrder(Order pOrder, java.util.HashMap pMap)
          Validates an order.
 PipelineResult validateOrder(Order pOrder, java.util.Locale pLocale)
          Validates an order.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
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

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

sResourceBundle

protected static java.util.ResourceBundle sResourceBundle
Resource Bundle


mOrderManager

protected static OrderManager mOrderManager

mUserPricingModelsPath

protected ComponentName mUserPricingModelsPath
The path to the PricingModelHolder in Nucleus which holds the user's pricing models


mOrderMergeListeners

protected java.util.List mOrderMergeListeners
Constructor Detail

OrderManager

public OrderManager()
Constructs an OrderManager object.

Method Detail

getOrderManager

public static OrderManager getOrderManager()

setUserPricingModelsPath

public void setUserPricingModelsPath(java.lang.String pUserPricingModelsPath)
the path to the PricingModelHolder in Nucleus which holds the user's pricing models

Parameters:
pUserPricingModelsPath - new value to set

getUserPricingModelsPath

public java.lang.String getUserPricingModelsPath()
The path to the PricingModelHolder in Nucleus which holds the user's pricing models

Returns:
property UserPricingModelsPath

getOrderItemDescriptorName

public java.lang.String getOrderItemDescriptorName()
Returns property OrderItemDescriptorName

Returns:
returns property OrderItemDescriptorName

setOrderItemDescriptorName

public void setOrderItemDescriptorName(java.lang.String pOrderItemDescriptorName)
Sets property OrderItemDescriptorName

Parameters:
pOrderItemDescriptorName - the value to set for property OrderItemDescriptorName

getShippingGroupItemDescriptorName

public java.lang.String getShippingGroupItemDescriptorName()
Returns the shippingGroupItemDescriptorName


setShippingGroupItemDescriptorName

public void setShippingGroupItemDescriptorName(java.lang.String pShippingGroupItemDescriptorName)
Sets the shippingGroupItemDescriptorName


getPaymentGroupItemDescriptorName

public java.lang.String getPaymentGroupItemDescriptorName()
Returns the paymentGroupItemDescriptorName


setPaymentGroupItemDescriptorName

public void setPaymentGroupItemDescriptorName(java.lang.String pPaymentGroupItemDescriptorName)
Sets the paymentGroupItemDescriptorName


getCommerceItemItemDescriptorName

public java.lang.String getCommerceItemItemDescriptorName()
Returns the commerceItemItemDescriptorName


setCommerceItemItemDescriptorName

public void setCommerceItemItemDescriptorName(java.lang.String pCommerceItemItemDescriptorName)
Sets the commerceItemItemDescriptorName


getRelationshipItemDescriptorName

public java.lang.String getRelationshipItemDescriptorName()
Returns the relationshipItemDescriptorName


setRelationshipItemDescriptorName

public void setRelationshipItemDescriptorName(java.lang.String pRelationshipItemDescriptorName)
Sets the relationshipItemDescriptorName


getCostCenterItemDescriptorName

public java.lang.String getCostCenterItemDescriptorName()
Returns the costCenterItemDescriptorName


setCostCenterItemDescriptorName

public void setCostCenterItemDescriptorName(java.lang.String pCostCenterItemDescriptorName)
Sets the costCenterItemDescriptorName


getOrderRelationshipsPropertyName

public java.lang.String getOrderRelationshipsPropertyName()
Returns the orderRelationshipsPropertyName


setOrderRelationshipsPropertyName

public void setOrderRelationshipsPropertyName(java.lang.String pOrderRelationshipsPropertyName)
Sets the orderRelationshipsPropertyName


getOrderPaymentGroupsPropertyName

public java.lang.String getOrderPaymentGroupsPropertyName()
Returns the orderPaymentGroupsPropertyName


setOrderPaymentGroupsPropertyName

public void setOrderPaymentGroupsPropertyName(java.lang.String pOrderPaymentGroupsPropertyName)
Sets the orderPaymentGroupsPropertyName


getOrderShippingGroupsPropertyName

public java.lang.String getOrderShippingGroupsPropertyName()
Returns the orderShippingGroupsPropertyName


setOrderShippingGroupsPropertyName

public void setOrderShippingGroupsPropertyName(java.lang.String pOrderShippingGroupsPropertyName)
Sets the orderShippingGroupsPropertyName


getOrderCommerceItemsPropertyName

public java.lang.String getOrderCommerceItemsPropertyName()
Returns the orderCommerceItemsPropertyName


setOrderCommerceItemsPropertyName

public void setOrderCommerceItemsPropertyName(java.lang.String pOrderCommerceItemsPropertyName)
Sets the orderCommerceItemsPropertyName


getOrderCostCentersPropertyName

public java.lang.String getOrderCostCentersPropertyName()
Returns the orderCostCentersPropertyName


setOrderCostCentersPropertyName

public void setOrderCostCentersPropertyName(java.lang.String pOrderCostCentersPropertyName)
Sets the orderCostCentersPropertyName


getCommerceItemOrderPropertyName

public java.lang.String getCommerceItemOrderPropertyName()
Returns the commerceItemOrderPropertyName


setCommerceItemOrderPropertyName

public void setCommerceItemOrderPropertyName(java.lang.String pCommerceItemOrderPropertyName)
Sets the commerceItemOrderPropertyName


getShippingGroupOrderPropertyName

public java.lang.String getShippingGroupOrderPropertyName()
Returns the shippingGroupOrderPropertyName


setShippingGroupOrderPropertyName

public void setShippingGroupOrderPropertyName(java.lang.String pShippingGroupOrderPropertyName)
Sets the shippingGroupOrderPropertyName


getPaymentGroupOrderPropertyName

public java.lang.String getPaymentGroupOrderPropertyName()
Returns the paymentGroupOrderPropertyName


setPaymentGroupOrderPropertyName

public void setPaymentGroupOrderPropertyName(java.lang.String pPaymentGroupOrderPropertyName)
Sets the paymentGroupOrderPropertyName


getRelationshipOrderPropertyName

public java.lang.String getRelationshipOrderPropertyName()
Returns the relationshipOrderPropertyName


setRelationshipOrderPropertyName

public void setRelationshipOrderPropertyName(java.lang.String pRelationshipOrderPropertyName)
Sets the relationshipOrderPropertyName


getCostCenterOrderPropertyName

public java.lang.String getCostCenterOrderPropertyName()
Returns the costCenterOrderPropertyName


setCostCenterOrderPropertyName

public void setCostCenterOrderPropertyName(java.lang.String pCostCenterOrderPropertyName)
Sets the costCenterOrderPropertyName


getOrderVersionPropertyName

public java.lang.String getOrderVersionPropertyName()
Returns property orderVersionPropertyName

Returns:
returns property orderVersionPropertyName

setOrderVersionPropertyName

public void setOrderVersionPropertyName(java.lang.String pOrderVersionPropertyName)
Sets property orderVersionPropertyName

Parameters:
pOrderVersionPropertyName - the value to set for property orderVersionPropertyName

getJNDIContext

public javax.naming.InitialContext getJNDIContext()
                                           throws javax.naming.NamingException
Returns the JNDIContext

Throws:
javax.naming.NamingException

getCommerceItemManager

public CommerceItemManager getCommerceItemManager()
Returns property commerceItemManager

Returns:
returns property commerceItemManager

setCommerceItemManager

public void setCommerceItemManager(CommerceItemManager pCommerceItemManager)
Sets property commerceItemManager

Parameters:
pCommerceItemManager - the value to set for property commerceItemManager

getShippingGroupManager

public ShippingGroupManager getShippingGroupManager()
Returns property shippingGroupManager

Returns:
returns property shippingGroupManager

setShippingGroupManager

public void setShippingGroupManager(ShippingGroupManager pShippingGroupManager)
Sets property shippingGroupManager

Parameters:
pShippingGroupManager - the value to set for property shippingGroupManager

getPaymentGroupManager

public PaymentGroupManager getPaymentGroupManager()
Returns property paymentGroupManager

Returns:
returns property paymentGroupManager

setPaymentGroupManager

public void setPaymentGroupManager(PaymentGroupManager pPaymentGroupManager)
Sets property paymentGroupManager

Parameters:
pPaymentGroupManager - the value to set for property paymentGroupManager

getHandlingInstructionManager

public HandlingInstructionManager getHandlingInstructionManager()
Returns property handlingInstructionManager

Returns:
returns property handlingInstructionManager

setHandlingInstructionManager

public void setHandlingInstructionManager(HandlingInstructionManager pHandlingInstructionManager)
Sets property handlingInstructionManager

Parameters:
pHandlingInstructionManager - the value to set for property handlingInstructionManager

getOrderQueries

public OrderQueries getOrderQueries()
Returns property orderQueries

Returns:
returns property orderQueries

setOrderQueries

public void setOrderQueries(OrderQueries pOrderQueries)
Sets property orderQueries

Parameters:
pOrderQueries - the value to set for property orderQueries

setCreateSGRelationshipsOnMerge

public void setCreateSGRelationshipsOnMerge(boolean pCreateSGRelationshipsOnMerge)
Set the createSGRelationshipsOnMerge property.


isCreateSGRelationshipsOnMerge

public boolean isCreateSGRelationshipsOnMerge()
Return the createSGRelationshipsOnMerge property.


setDefaultLocale

public void setDefaultLocale(java.util.Locale pDefaultLocale)
Sets property DefaultLocale


getDefaultLocale

public java.util.Locale getDefaultLocale()
Returns property DefaultLocale. If the property value is null, then JVM's default locale is returned.


getPipelineManager

public PipelineManager getPipelineManager()
Returns the pipelineManager


getCatalogTools

public CatalogTools getCatalogTools()
Returns the catalogTools


getOrderTools

public OrderTools getOrderTools()
Returns the OrderTools


setOrderTools

public void setOrderTools(OrderTools pOrderTools)
Sets the OrderTools


getSiteGroupManager

public SiteGroupManager getSiteGroupManager()
Returns the SiteGroupManager

Returns:
returns property siteGroupManager

setSiteGroupManager

public void setSiteGroupManager(SiteGroupManager pSiteGroupManager)
Sets the SiteGroupManager

Parameters:
pSiteGroupManager - the value to set for property siteGroupManager

getDefaultOrderByProperty

public java.lang.String getDefaultOrderByProperty()
Returns the defaultOrderByProperty


setDefaultOrderByProperty

public void setDefaultOrderByProperty(java.lang.String pDefaultOrderByProperty)
Sets the defaultOrderByProperty


getDefaultOrderByDirection

public boolean getDefaultOrderByDirection()
Returns the defaultOrderByDirection, true = ascending, false = descending, default is true


setDefaultOrderByDirection

public void setDefaultOrderByDirection(boolean pDefaultOrderByDirection)
Sets the defaultOrderByDirection


getValidOrderProcessingStates

public java.lang.String[] getValidOrderProcessingStates()
Returns property validOrderProcessingStates

Returns:
returns property validOrderProcessingStates

setValidOrderProcessingStates

public void setValidOrderProcessingStates(java.lang.String[] pValidOrderProcessingStates)
Sets property validOrderProcessingStates

Parameters:
pValidOrderProcessingStates - the value to set for property validOrderProcessingStates

getValidProcessOrderErrorStates

public java.lang.String[] getValidProcessOrderErrorStates()
Returns property validProcessOrderErrorStates. This property is a list of order states which the process order chain can set in an order which will not be reset if an error occurs. If an error occurs, rather than setting the order state back to its state before the processOrder chain was called, if the state is in this list, it will not be reset.

Returns:
returns property validProcessOrderErrorStates

setValidProcessOrderErrorStates

public void setValidProcessOrderErrorStates(java.lang.String[] pValidProcessOrderErrorStates)
Sets property validProcessOrderErrorStates

Parameters:
pValidProcessOrderErrorStates - the value to set for property validProcessOrderErrorStates

setDebugOrderRepositoryItemUpdateTransaction

public void setDebugOrderRepositoryItemUpdateTransaction(boolean pDebugOrderRepositoryItemUpdateTransaction)
This method returns whether or not an warning debug stack trace will be generated when order repoisoty item is updated but OrderManager.updateOrder is not be called in the same transaction. This is only used for debug purpose.


getDebugOrderRepositoryItemUpdateTransaction

public boolean getDebugOrderRepositoryItemUpdateTransaction()
Sets whether or not warning debug stack trace should be generated.


initializeDefaultPropertyValues

protected void initializeDefaultPropertyValues()
                                        throws CommerceException
Initialize any properites whose default values should be computed at runtime before this component is first used. This method is by called from doStartService. If a subclass of OrderManager provides its own doStartService method, that method must either call super.doStartService or call initializeDefaultPropertyValues directly. Otherwise certain property values may not be set correctly and OrderManager may throw exceptions at runtime.

Throws:
CommerceException

doStartService

public void doStartService()
                    throws ServiceException
Prepare this OrderManager for use by calling initializeDefaultPropertyValues

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

createOrder

public Order createOrder(java.lang.String pProfileId)
                  throws CommerceException
Creates a new Order object using the default type specified in the OrderTools defaultOrderType property. Populates the Order with the supplied data and priceInfo objects using the default OrderPriceInfo, TaxPriceInfo, and ShippingPriceInfo classes as defined in the OrderTools nucleus component.

Parameters:
pProfileId - the id of the Profile object which this Order belongs to
Returns:
the Order object which was created
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectCreationException - if the instantiation of an object fails
CommerceException
See Also:
OrderTools.getDefaultOrderType()

createOrder

public Order createOrder(java.lang.String pProfileId,
                         java.lang.String pOrderType)
                  throws CommerceException
Creates a new Order object using the class mapped to the given name in pOrderType. Populates the Order with the supplied data and priceInfo objects using the default OrderPriceInfo, TaxPriceInfo, and ShippingPriceInfo classes as defined in the OrderTools nucleus component.

Parameters:
pProfileId - the id of the Profile object which this Order belongs to
pOrderType - the type that is mapped in the OrderTools.properties file to the class of the desired type to create
Returns:
the Order object which was created
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectCreationException - if the instantiation of an object fails
CommerceException

createOrder

public Order createOrder(java.lang.String pProfileId,
                         java.lang.String pOrderId,
                         java.lang.String pOrderType)
                  throws CommerceException
Creates a new Order object using the class mapped to the given name in pOrderType. Populates the Order with the supplied data and priceInfo objects using the default OrderPriceInfo, TaxPriceInfo, and ShippingPriceInfo classes as defined in the OrderTools nucleus component.

Parameters:
pProfileId - the id of the Profile object which this Order belongs to
pOrderId - the id which will be assigned to the Order
pOrderType - the type that is mapped in the OrderTools.properties file to the class of the desired type to create
Returns:
the Order object which was created
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectCreationException - if the instantiation of an object fails
CommerceException

createOrder

public Order createOrder(java.lang.String pProfileId,
                         OrderPriceInfo pOrderPriceInfo,
                         TaxPriceInfo pTaxPriceInfo,
                         ShippingPriceInfo pShippingPriceInfo)
                  throws CommerceException
Creates a new Order object using the default type specified in the OrderTools defaultOrderType property. Populates the Order with the supplied data.

Parameters:
pProfileId - the id of the Profile object which this Order belongs to
pOrderPriceInfo - the OrderPriceInfo object for this Order. Can be null.
pTaxPriceInfo - the TaxPriceInfo object for this Order Can be null.
pShippingPriceInfo - the ShippingPriceInfo object for the default ShippingGroup. Can be null.
Returns:
the Order object which was created
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectCreationException - if the instantiation of an object fails
CommerceException
See Also:
OrderTools.getDefaultOrderType()

createOrder

public Order createOrder(java.lang.String pProfileId,
                         OrderPriceInfo pOrderPriceInfo,
                         TaxPriceInfo pTaxPriceInfo,
                         ShippingPriceInfo pShippingPriceInfo,
                         java.lang.String pOrderType)
                  throws CommerceException
Creates a new Order object using the class mapped to the given name in pOrderType. Populates the Order with the supplied data.

Parameters:
pProfileId - the id of the Profile object which this Order belongs to
pOrderPriceInfo - the OrderPriceInfo object for this Order. Can be null.
pTaxPriceInfo - the TaxPriceInfo object for this Order. Can be null.
pShippingPriceInfo - the ShippingPriceInfo object for the default ShippingGroup. Can be null.
pOrderType - the name that is mapped in the OrderTools.properties file to the class of the desired type to create
Returns:
the Order object which was created
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectCreationException - if the instantiation of an object fails
CommerceException

createOrder

public Order createOrder(java.lang.String pProfileId,
                         java.lang.String pOrderId,
                         OrderPriceInfo pOrderPriceInfo,
                         TaxPriceInfo pTaxPriceInfo,
                         ShippingPriceInfo pShippingPriceInfo,
                         java.lang.String pOrderType)
                  throws CommerceException
Creates a new Order object using the class mapped to the given name in pOrderType and whose id will be that which is supplied in pOrderId. Populates the Order with the supplied data.

Parameters:
pProfileId - the id of the Profile object which this Order belongs to
pOrderId - the id which will be assigned to the Order
pOrderPriceInfo - the OrderPriceInfo object for this Order
pTaxPriceInfo - the TaxPriceInfo object for this Order
pShippingPriceInfo - the ShippingPriceInfo object for the default ShippingGroup
pOrderType - the name that is mapped in the OrderTools.properties file to the class of the desired type to create
Returns:
the Order object which was created
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectCreationException - if the instantiation of an object fails
CommerceException

addOrder

public void addOrder(Order pOrder)
              throws CommerceException
Adds the Order to the repository. This method makes any transient Orders persistent by saving them to the repository. This method can only be called once per Order. Once it has been called, any new objects which have been added to the order will automatically be added to the repository when updateOrder() is called.

Parameters:
pOrder - the order to add to the repository
Throws:
InvalidParameterException - thrown if any of the parameters are null or if the Order is not transient
CommerceException - if an error occurs accessing the repository

removeOrder

public void removeOrder(java.lang.String pOrderId)
                 throws CommerceException
Removes the Order with the given id from the repository. This method permanently deletes the Order.

Parameters:
pOrderId - the id of the order to remove from the repository
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException - if an error occurs accessing the repository

areOrdersMergeable

public Order[] areOrdersMergeable(Order pSrcOrder,
                                  Order pDestOrder)
Checks to see if we can merge two orders. Both orders must be in state "INCOMPLETE" and the order's sites must be compatible according to the site groups defined for sharing shopping carts. If the orders are compatible, we return null. If not, we return an array containing the order or orders that did not meet the merge requirements. This method can be overridden to produce other merge behaviour.

Parameters:
pOrder1 - -- the source order
pOrder2 - -- the destination order
Returns:
Order[] -- the order(s) which cannot be merged or null if the orders can be merged.

mergeOrders

public void mergeOrders(Order pSrcOrder,
                        Order pDestOrder)
                 throws CommerceException
This method merges the CommerceItems and ShippingGroups from pSrcOrder to pDestOrder. If the createSGRelationshipsOnMerge property is true, then the ShippingGroups will also be merged along with the Relationships which indicate the CommerceItems which are in the ShippingGroups.

Parameters:
pSrcOrder - the Order to copy from
pDestOrder - the Order to copy to
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException - if an error occurs accessing the repository

mergeOrders

public void mergeOrders(Order pSrcOrder,
                        Order pDestOrder,
                        boolean pMergeShippingGroups,
                        boolean pRemoveSrcOrder)
                 throws CommerceException
This method merges the CommerceItems and optionally ShippingGroups from pSrcOrder to pDestOrder. If pMergeShippingGroups is true, then the ShippingGroups and Relationships which indicate the CommerceItems within the ShippingGroup will also be merged.

Parameters:
pSrcOrder - the Order to copy from
pDestOrder - the Order to copy to
pMergeShippingGroups - a flag which indicates whether to merge ShippingGroups
pRemoveSrcOrder - if true, will call removeOrder() on pSrcOrder
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException - if an error occurs accessing the repository

compareHardgoodShippingGroups

public boolean compareHardgoodShippingGroups(ShippingGroup pSrcShippingGroup,
                                             ShippingGroup pDestShippingGroup)
Compares two HardgoodShippingGroup objects to check if their shipping addresses match.

Parameters:
pSrcShippingGroup - source shipping group to be compared
pDestShippingGroup - destination shipping group to be compared
Returns:
true if the shipping group addresses match, false if not

compareElectronicShippingGroups

public boolean compareElectronicShippingGroups(ShippingGroup pSrcShippingGroup,
                                               ShippingGroup pDestShippingGroup)
Compares two ElectronicShippingGroup objects to check if their shipping addresses match.

Parameters:
pSrcShippingGroup - source shipping group to be compared
pDestShippingGroup - destination shipping group to be compared
Returns:
true if the shipping group email addresses match, false if not

compareHandlingInstructions

public boolean compareHandlingInstructions(HandlingInstruction pSrcHandlingInstruction,
                                           HandlingInstruction pDestHandlingInstruction)
Compares two HandlingInstruction objects to check if they match.

Parameters:
pSrcHandlingInstruction - source handling instruction to be compared
pDestHandlingInstruction - destination handling instruction to be compared
Returns:
true if the handling instructions match, false if not

compareGiftlistHandlingInstructions

public boolean compareGiftlistHandlingInstructions(GiftlistHandlingInstruction pSrcGiftListHandlingInst,
                                                   GiftlistHandlingInstruction pDestGiftListHandlingInst)
Compares two GiftlistHandlingInstruction objects to check if they match.

Parameters:
pSrcGiftListHandlingInst - source gift list handling instruction to be compared
pDestGiftListHandlingInst - destination gift list handling instruction to be compared
Returns:
true if the gift list handling instructions match, false if not

createRelationship

protected Relationship createRelationship(java.lang.String pRelationshipType)
                                   throws CommerceException
Creates a new Relationship object using the class type mapped to the type supplied in pShippingGroupType.

Parameters:
pRelationshipType - the type that is mapped in the OrderTools.properties file to the class of the desired type to create
Returns:
the Relationship object which was created
Throws:
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

getAllOrderRelationships

public java.util.List getAllOrderRelationships(Order pOrder)
                                        throws CommerceException
Provides a List of all OrderRelationships associated with the given Order. This includes PaymentGroupOrderRelationships.

Parameters:
pOrder - the Order whose relationships are sought
Returns:
a List of OrderRelationships in the Order
Throws:
InvalidParameterException - thrown if order parameter is null
CommerceException
See Also:
Relationship, OrderRelationship, PaymentGroupOrderRelationship

addTaxAmountToPaymentGroup

public void addTaxAmountToPaymentGroup(Order pOrder,
                                       java.lang.String pPaymentGroupId,
                                       double pAmount)
                                throws CommerceException
Adds the given amount of the Order's tax to the PaymentGroup with the given id. Underneath the surface, this method creates a PaymentGroupOrderRelationship with type TAXAMOUNT and sets the PaymentGroup, Order, and amount properties in that Relationship to those given as parameters in this method. The id parameters are resolved to the actual objects.

Parameters:
pOrder - the Order which the PaymentGroup exists
pPaymentGroupId - the id of the PaymentGroup which the Order's tax will be added to
pAmount - the amount that is assigned for payment to the PaymentGroup
Throws:
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
See Also:
PaymentGroupOrderRelationship

addRemainingTaxAmountToPaymentGroup

public void addRemainingTaxAmountToPaymentGroup(Order pOrder,
                                                java.lang.String pPaymentGroupId)
                                         throws CommerceException
Adds any unassigned amount of the Order's tax to the PaymentGroup with the given id. Underneath the surface, this method creates a PaymentGroupOrderRelationship with type TAXAMOUNTREMAINING and sets the PaymentGroup property in that Relationship to those given as parameters in this method. The id parameters are resolved to the actual objects.

Parameters:
pOrder - the Order which the PaymentGroup exists
pPaymentGroupId - the id of the PaymentGroup which the Order's tax will be added to
Throws:
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
See Also:
PaymentGroupOrderRelationship

addOrderAmountToPaymentGroup

public void addOrderAmountToPaymentGroup(Order pOrder,
                                         java.lang.String pPaymentGroupId,
                                         double pAmount)
                                  throws CommerceException
Adds the given amount of the Order's cost to the PaymentGroup with the given id. Underneath the surface, this method creates a PaymentGroupOrderRelationship with type ORDERAMOUNT and sets the PaymentGroup, Order, and amount properties in that Relationship to those given as parameters in this method. The id parameters are resolved to the actual objects.

Parameters:
pOrder - the Order which the PaymentGroup exists
pPaymentGroupId - the id of the PaymentGroup which the Order's cost will be added to
pAmount - the amount that is assigned for payment to the PaymentGroup
Throws:
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
See Also:
PaymentGroupOrderRelationship

addRemainingOrderAmountToPaymentGroup

public void addRemainingOrderAmountToPaymentGroup(Order pOrder,
                                                  java.lang.String pPaymentGroupId)
                                           throws CommerceException
Adds any unassigned amount of the Order's cost to the PaymentGroup with the given id. Underneath the surface, this method creates a PaymentGroupOrderRelationship with type ORDERAMOUNTREMAINING and sets the PaymentGroup property in that Relationship to those given as parameters in this method. The id parameters are resolved to the actual objects.

Parameters:
pOrder - the Order which the PaymentGroup exists
pPaymentGroupId - the id of the PaymentGroup which the Order's cost will be added to
Throws:
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
See Also:
PaymentGroupOrderRelationship

removeTaxAmountFromPaymentGroup

public void removeTaxAmountFromPaymentGroup(Order pOrder,
                                            java.lang.String pPaymentGroupId,
                                            double pAmount)
                                     throws CommerceException
Removes the given amount of the Order's tax from the PaymentGroup with the given id.

Parameters:
pOrder - the Order which the PaymentGroup exists
pPaymentGroupId - the id of the PaymentGroup to remove the tax amount from
pAmount - the amount to remove
Throws:
InvalidParameterException - thrown if any of the parameters are null
RelationshipNotFoundException - if the given Relationship is not found in the PaymentGroup or Order
ObjectRemovalException - if the removal of the object fails
CommerceException

removeOrderAmountFromPaymentGroup

public void removeOrderAmountFromPaymentGroup(Order pOrder,
                                              java.lang.String pPaymentGroupId,
                                              double pAmount)
                                       throws CommerceException
Removes the given amount of the Order's cost from the PaymentGroup with the given id.

Parameters:
pOrder - the Order which the PaymentGroup exists
pPaymentGroupId - the id of the PaymentGroup to remove the amount from
pAmount - the amount to remove
Throws:
InvalidParameterException - thrown if any of the parameters are null
RelationshipNotFoundException - if the given Relationship is not found in the PaymentGroup or Order
ObjectRemovalException - if the removal of the object fails
CommerceException

removeRemainingOrderAmountFromPaymentGroup

public void removeRemainingOrderAmountFromPaymentGroup(Order pOrder,
                                                       java.lang.String pPaymentGroupId)
                                                throws CommerceException
Removes the "remaining" amount of the Order's cost from the PaymentGroup with the given id.

Parameters:
pOrder - the Order which the PaymentGroup exists
pPaymentGroupId - the id of the PaymentGroup
Throws:
InvalidParameterException - thrown if any of the parameters are null
RelationshipNotFoundException - if the given relationship is not found in the PaymentGroup or Order
ObjectRemovalException - if the removal of the object fails
CommerceException

removeRemainingTaxAmountFromPaymentGroup

public void removeRemainingTaxAmountFromPaymentGroup(Order pOrder,
                                                     java.lang.String pPaymentGroupId)
                                              throws CommerceException
Removes the "remaining" amount of the Order's tax from the PaymentGroup with the given id.

Parameters:
pOrder - the Order which the PaymentGroup exists
pPaymentGroupId - the id of the PaymentGroup
Throws:
InvalidParameterException - thrown if any of the parameters are null
RelationshipNotFoundException - if the given relationship is not found in the PaymentGroup or Order
ObjectRemovalException - if the removal of the object fails
CommerceException

removeOrderFromPaymentGroupInternal

protected void removeOrderFromPaymentGroupInternal(Order pOrder,
                                                   PaymentGroupOrderRelationship pRel)
                                            throws CommerceException
Removes the PaymentGroupOrderRelationship from the Order.

Parameters:
pOrder - the Order which the PaymentGroup exists
pRel - the relationship which assigns the Order to the PaymentGroup
Throws:
RelationshipNotFoundException - if the given relationship is not found in the PaymentGroup or Order
ObjectRemovalException - if the removal of the object fails
CommerceException
See Also:
PaymentGroupOrderRelationship

getShipItemRelsForRange

public java.util.List getShipItemRelsForRange(java.util.List pRelationships,
                                              atg.core.util.Range pRange)
                                       throws CommerceException
Return the relationships whose range fall within the given range

Parameters:
pRelationships - A list of ShippingGroupCommerceItemRelationships
pRange - The range we are interested in
Returns:
A list of ShippingGroupCommerceItemRelationships whose range falls within the given range somehow
Throws:
CommerceException

orderExists

public boolean orderExists(java.lang.String pOrderId)
                    throws CommerceException
Checks to see if an order id exists in the OrderRepository.

Parameters:
pOrderId - the Order id to check
true - if an order with the given id exists, false otherwise.
Returns:
true if the order id refers to an order which exists, false otherwise
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an error occurs while checking the repository

getOrderForShippingGroup

public Order getOrderForShippingGroup(ShippingGroup pShippingGroup)
                               throws CommerceException,
                                      RepositoryException
Returns the order that the given ShippingGroup is in.

Parameters:
pShippingGroup - the Order which the ShippingGroup is in
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException - thrown if an error occurs while updating the Order
RepositoryException - thrown if an error occurs while retriving data from the repository

getOrderForPaymentGroup

public Order getOrderForPaymentGroup(PaymentGroup pPaymentGroup)
                              throws CommerceException,
                                     RepositoryException
Returns the order that the given PaymentGroup is in.

Parameters:
pPaymentGroup - the Order which the PaymentGroup is in
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException - thrown if an error occurs while updating the Order
RepositoryException - thrown if an error occurs while retriving data from the repository

getOrderForCommerceItem

public Order getOrderForCommerceItem(CommerceItem pCommerceItem)
                              throws CommerceException,
                                     RepositoryException
Returns the order that the given CommerceItem is in.

Parameters:
pCommerceItem - the Order which the CommerceItem is in
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException - thrown if an error occurs while updating the Order
RepositoryException - thrown if an error occurs while retriving data from the repository

getOrderForRelationship

public Order getOrderForRelationship(Relationship pRelationship)
                              throws CommerceException,
                                     RepositoryException
Returns the order that the given Relationship is in.

Parameters:
pRelationship - the Order which the Relationship is in
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException - thrown if an error occurs while updating the Order
RepositoryException - thrown if an error occurs while retriving data from the repository

getOrderForCostCenter

public Order getOrderForCostCenter(CostCenter pCostCenter)
                            throws CommerceException,
                                   RepositoryException
Returns the order that the given CostCenter is in.

Parameters:
pCostCenter - the Order which the CostCenter is in
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException - thrown if an error occurs while updating the Order
RepositoryException - thrown if an error occurs while retriving data from the repository

updateOrder

public void updateOrder(Order pOrder)
                 throws CommerceException
Updates (saves) the data in the order to the repository. This method executes the updateOrder pipeline chain.

Parameters:
pOrder - the Order to add the CommerceItem to
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException - thrown if an error occurs while updating the Order

loadOrder

public Order loadOrder(java.lang.String pOrderId)
                throws CommerceException
Loads the order from the repository. This method executes the loadOrder pipeline chain.

Parameters:
pOrderId - the Order id to load from the repository.
Returns:
the Order which pOrderId refers to
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an error occurs while loading the Order

loadOrders

public java.util.List<Order> loadOrders(java.util.List<java.lang.String> pOrderIds)
                                 throws CommerceException
Utility method to convert a list of order ids into a list of Order objects. Beware that the load order pipeline will be called once for each id that is passed in.

Parameters:
pOrderIds - The list of order ids.
Returns:
A List of orders, one for each given order id or EMPTY_LIST if the given list of ids is null or empty
Throws:
CommerceException - If an error occurs while loading an Order

isOrderStateValidForProcessing

public boolean isOrderStateValidForProcessing(int pState)
This method returns true if pState is a valid state for processing. This state is compared against the validOrderProcessingStates property.

Parameters:
pState - the state to check
Returns:
true if pState is a valid state, false if not

processOrder

public PipelineResult processOrder(Order pOrder)
                            throws CommerceException
Begins processing the order. This means that the user checked out the order. This executes the processOrder pipeline chain.

Parameters:
pOrder - the Order to be checked out
Returns:
the PipelineResult object from the execution of the pipeline
Throws:
CommerceException - thrown if an error occurs while checking out the Order

getProcessOrderMap

public java.util.HashMap getProcessOrderMap(java.util.Locale pLocale,
                                            java.util.Map pMap)
                                     throws CommerceException
This map is used to pass additional information in the process order pipe line. This method creates a HashMap and adds the Locale object and other entries that are passed in the map input parameter.

Parameters:
pLocale -
pMap -
Returns:
Throws:
CommerceException

processOrder

public PipelineResult processOrder(Order pOrder,
                                   java.util.Locale pLocale)
                            throws CommerceException
Begins processing the order. This means that the user checked out the order. This executes the processOrder pipeline chain.

Parameters:
pOrder - the Order to be checked out
pLocale - the locale of the user for which this order is being processed. In general this can be used for generating error messages in the user's chosen language
Returns:
the PipelineResult object from the execution of the pipeline
Throws:
CommerceException - thrown if an error occurs while checking out the Order

processOrder

public PipelineResult processOrder(Order pOrder,
                                   java.util.HashMap pMap)
                            throws CommerceException
Begins processing the order. This means that the user checked out the order. This executes the processOrder pipeline chain.

Parameters:
pOrder - the Order to be checked out
pMap - a map of parameters to supply to the processOrder pipeline chain
Returns:
the PipelineResult object from the execution of the pipeline
Throws:
CommerceException - thrown if an error occurs while checking out the Order

processOrder

public PipelineResult processOrder(Order pOrder,
                                   java.lang.String pProcessOrderChainId,
                                   java.util.HashMap pMap)
                            throws CommerceException
Begins processing the order. This means that the user checked out the order. This executes the pipeline chain specified by pProcessOrderChainId to proces the order,

Parameters:
pOrder - the Order to be checked out
pProcessOrderChainId - the chain id to run to process the order
pMap - a map of parameters to supply to the processOrder pipeline chain
Returns:
the PipelineResult object from the execution of the pipeline
Throws:
CommerceException - thrown if an error occurs while checking out the Order

validateOrder

public PipelineResult validateOrder(Order pOrder)
                             throws CommerceException
Validates an order. This runs the validateForCheckout chain.

Parameters:
pOrder - the Order to be validated
Returns:
the PipelineResult object from the execution of the pipeline
Throws:
CommerceException - thrown if an error occurs while validating the Order

validateOrder

public PipelineResult validateOrder(Order pOrder,
                                    java.util.Locale pLocale)
                             throws CommerceException
Validates an order. This runs the validateForCheckout chain.

Parameters:
pOrder - the Order to be validated
pLocale - the locale of the user for which this order is being validated. In general this can be used for generating error messages in the user's chosen language
Returns:
the PipelineResult object from the execution of the pipeline
Throws:
CommerceException - thrown if an error occurs while validating the Order

validateOrder

public PipelineResult validateOrder(Order pOrder,
                                    java.util.HashMap pMap)
                             throws CommerceException
Validates an order. This runs the validateForCheckout chain.

Parameters:
pOrder - the Order to be validated
pMap - a map of parameters to supply to the validateForCheckout pipeline chain
Returns:
the PipelineResult object from the execution of the pipeline
Throws:
CommerceException - thrown if an error occurs while validating the Order

resetOrder

public void resetOrder(Order pClonedOrder)
This method takes an order and resets it to a state where it can be resubmitted for checkout. The purpose of this method is to be used with a cloned order that will be resubmitted for checkout.

Parameters:
pClonedOrder - The order to reset for checkout

resetOrderCommerceItemRelationships

public void resetOrderCommerceItemRelationships(Order pOrder)
Resets the commerce item relationships in the order. All returnedQuantity's are set to 0 and any refund quanity is absorbed back into the commerce item and relationship quantity.

Parameters:
pOrder - an Order item

getUniqueCatalogRefIds

public java.util.List getUniqueCatalogRefIds(Order pOrder)
For the given order, return a list of all the catalog ref ids in the order.

Parameters:
pOrder - The order we are checking
Returns:
The list of catalog ref ids (skus)

isTransactionMarkedAsRollBack

protected boolean isTransactionMarkedAsRollBack()
Returns true if the transaction associated with the current thread is marked for rollback. This is useful if you do not want to perform some action (e.g. updating the order) if some other subservice already needs the transaction rolledback.


markTransactionForRollback

protected boolean markTransactionForRollback()
Returns true if the transaction has been marked for rollback, false if unable to access the transaction.


processOrderWithReprice

public PipelineResult processOrderWithReprice(Order pOrder,
                                              java.lang.String pLocale)
                                       throws CommerceException
Deprecated. 

Submits the given order by calling processOrder with the chain: PipelineConstants.PROCESSORDERWITHREPRICE The locale that is used is determined in the following order: pLocale - If not null OrderManager.defaultLocale - if not null ServletUtil.getUserLocale

Parameters:
pOrderId - The id of the order to be submitted
pLocale - The locale to use. This may be null
pExtraParams - Any extra params to be passed to the pipeline
Returns:
The PipelineResult
Throws:
CommerceException

processOrderWithReprice

public PipelineResult processOrderWithReprice(Order pOrder,
                                              java.lang.String pLocale,
                                              java.util.HashMap pExtraParams)
                                       throws CommerceException
Submits the given order by calling processOrder with the chain: PipelineConstants.PROCESSORDERWITHREPRICE The locale that is used is determined in the following order: pLocale - If not null OrderManager.defaultLocale - if not null ServletUtil.getUserLocale

Parameters:
pOrderId - The id of the order to be submitted
pLocale - The locale to use. This may be null
Returns:
The PipelineResult
Throws:
CommerceException

addOrderMergeListener

public void addOrderMergeListener(OrderMergeListener pListener)
Add a listener to the set of event listeners that are notified when orders are merged.


removeOrderMergeListener

public void removeOrderMergeListener(OrderMergeListener pListener)
Remove a listener from the set of event listeners that are notified when orders are merged.


sendOrderMergeEvent

public void sendOrderMergeEvent(Order pSource,
                                Order pDest,
                                boolean pRemove)
Send an order merged event to the current set of event listeners.


createCommerceItem

public CommerceItem createCommerceItem(java.lang.String pCatalogRefId,
                                       java.lang.String pProductId,
                                       long pQuantity)
                                throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Creates a new CommerceItem object using the default CommerceItem type defined in the OrderTools property defaultCommerceItemType. Populates the CommerceItem with the supplied data and priceInfo objects using the default ItemPriceInfo class as defined in the OrderTools nucleus component.

Parameters:
pCatalogRefId - the id of the catalog object reference that this CommerceItem represents
pProductId - the product id that this CommerceItem references
pQuantity - the quantity that this CommerceItem should represent
Returns:
the CommerceItem which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
OrderTools.getDefaultCommerceItemType(), CommerceItemManager

createCommerceItem

public CommerceItem createCommerceItem(java.lang.String pCatalogRefId,
                                       java.lang.String pProductId,
                                       long pQuantity,
                                       java.lang.String pCatalogKey)
                                throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Creates a new CommerceItem object using the default CommerceItem type defined in the OrderTools property defaultCommerceItemType. Populates the CommerceItem with the supplied data and priceInfo objects using the default ItemPriceInfo class as defined in the OrderTools nucleus component.

Parameters:
pCatalogRefId - the id of the catalog object reference that this CommerceItem represents
pProductId - the product id that this CommerceItem references
pCatalogKey - the catalog key reference (locale) for this CommerceItem
pQuantity - the quantity that this CommerceItem should represent
Returns:
the CommerceItem which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
OrderTools.getDefaultCommerceItemType(), CommerceItemManager

createCommerceItem

public CommerceItem createCommerceItem(java.lang.String pCatalogRefId,
                                       java.lang.Object pCatalogRef,
                                       java.lang.String pProductId,
                                       long pQuantity)
                                throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Creates a new CommerceItem object using the default CommerceItem type defined in the OrderTools property defaultCommerceItemType. Populates the CommerceItem with the supplied data and priceInfo objects using the default ItemPriceInfo class as defined in the OrderTools nucleus component.

Parameters:
pCatalogRefId - the id of the catalog object reference that this CommerceItem represents
pCatalogRef - the catalog object reference that this CommerceItem represents
pProductId - the product id that this CommerceItem references
pQuantity - the quantity that this CommerceItem should represent
Returns:
the CommerceItem which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
OrderTools.getDefaultCommerceItemType(), CommerceItemManager

createCommerceItem

public CommerceItem createCommerceItem(java.lang.String pCatalogRefId,
                                       java.lang.Object pCatalogRef,
                                       java.lang.String pProductId,
                                       java.lang.Object pProductRef,
                                       long pQuantity)
                                throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Creates a new CommerceItem object using the default CommerceItem type defined in the OrderTools property defaultCommerceItemType. Populates the CommerceItem with the supplied data and priceInfo objects using the default ItemPriceInfo class as defined in the OrderTools nucleus component.

Parameters:
pCatalogRefId - the id of the catalog object reference that this CommerceItem represents
pCatalogRef - the catalog object reference that this CommerceItem represents
pProductId - the product id that this CommerceItem references
pProductRef - the product object reference that this CommerceItem represents
pQuantity - the quantity that this CommerceItem should represent
Returns:
the CommerceItem which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
OrderTools.getDefaultCommerceItemType(), CommerceItemManager

createCommerceItem

public CommerceItem createCommerceItem(java.lang.String pCatalogRefId,
                                       java.lang.Object pCatalogRef,
                                       java.lang.String pProductId,
                                       long pQuantity,
                                       ItemPriceInfo pPriceInfo)
                                throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Creates a new CommerceItem object using the default CommerceItem type defined in the OrderTools property defaultCommerceItemType. Populates the CommerceItem with the supplied data.

Parameters:
pCatalogRefId - the id of the catalog object reference that this CommerceItem represents
pCatalogRef - the catalog object reference that this CommerceItem represents
pProductId - the product id that this CommerceItem references
pQuantity - the quantity that this CommerceItem should represent
pPriceInfo - the ItemPriceInfo object for this CommerceItem
Returns:
the CommerceItem which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
OrderTools.getDefaultCommerceItemType(), CommerceItemManager

createCommerceItem

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
Deprecated. this method has been moved to the CommerceItemManager

Creates a new CommerceItem object using the default CommerceItem type defined in the OrderTools property defaultCommerceItemType. Populates the CommerceItem with the supplied data.

Parameters:
pCatalogRefId - the id of the catalog object reference that this CommerceItem represents
pCatalogRef - the catalog object reference that this CommerceItem represents
pProductId - the product id that this CommerceItem references
pProductRef - the product object reference that this CommerceItem represents
pQuantity - the quantity that this CommerceItem should represent
pPriceInfo - the ItemPriceInfo object for this CommerceItem
Returns:
the CommerceItem which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
OrderTools.getDefaultCommerceItemType(), CommerceItemManager

createCommerceItem

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
Deprecated. this method has been moved to the CommerceItemManager

Creates a new CommerceItem object using the default CommerceItem type defined in the pItemType. Populates the CommerceItem with the supplied data.

Parameters:
pItemType - the name that is mapped in the OrderTools.properties file to the class of the desired type to create
pCatalogRefId - the id of the catalog object reference that this CommerceItem represents
pCatalogRef - the catalog object reference that this CommerceItem represents
pProductId - the product id that this CommerceItem references
pProductRef - the product object reference that this CommerceItem represents
pQuantity - the quantity that this CommerceItem should represent
pPriceInfo - the ItemPriceInfo object for this CommerceItem
Returns:
the CommerceItem which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
OrderTools.getDefaultCommerceItemType(), CommerceItemManager

createCommerceItem

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
Deprecated. this method has been moved to the CommerceItemManager

Creates a new CommerceItem object using the default CommerceItem type defined in the pItemType. Populates the CommerceItem with the supplied data.

Parameters:
pItemType - the name that is mapped in the OrderTools.properties file to the class of the desired type to create
pCatalogRefId - the id of the catalog object reference that this CommerceItem represents
pCatalogRef - the catalog object reference that this CommerceItem represents
pProductId - the product id that this CommerceItem references
pProductRef - the product object reference that this CommerceItem represents
pCatalogKey - the catalog key reference (locale) for this CommerceItem
pQuantity - the quantity that this CommerceItem should represent
pPriceInfo - the ItemPriceInfo object for this CommerceItem
Returns:
the CommerceItem which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
OrderTools.getDefaultCommerceItemType(), CommerceItemManager

addItemToOrder

public CommerceItem addItemToOrder(Order pOrder,
                                   CommerceItem pItem)
                            throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Adds the given item to the given order. By default this method will check for a duplicate item in the order and if one is found, will add the quantity in pItem to the one which already exists in the Order. Otherwise it will add the given CommerceItem to the order.

Parameters:
pOrder - the Order to add the CommerceItem to
pItem - the CommerceItem to add to the Order
Returns:
the CommerceItem which contains the item just added. If the item did not exist pItem is returned. If it did, then the item which already existed in the order is returned
Throws:
InvalidParameterException - thrown if any of the parameters are null
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.
See Also:
CommerceItemManager

addAsSeparateItemToOrder

public CommerceItem addAsSeparateItemToOrder(Order pOrder,
                                             CommerceItem pItem)
                                      throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Adds the given item to the given order. This method forces the given CommerceItem to be added to the Order and does not look for one with the same catalogRefId. The result of calling this method is that two or more separate CommerceItems with the same catalogRefId will exist in the Order.

Parameters:
pOrder - the Order to add the CommerceItem to
pItem - the CommerceItem to add to the Order
Returns:
the CommerceItem added to the Order, in this case it will be pItem
Throws:
InvalidParameterException - thrown if any of the parameters are null
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.
See Also:
CommerceItemManager

removeAllCommerceItemsFromOrder

public void removeAllCommerceItemsFromOrder(Order pOrder)
                                     throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Removes all the CommerceItems and their Relationships from an Order.

Parameters:
pOrder - the Order which contains the CommerceItems to be removed
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectRemovalException - thrown if a CommerceItem cannot be removed
CommerceException
See Also:
CommerceItemManager

removeItemFromOrder

public void removeItemFromOrder(Order pOrder,
                                java.lang.String pCommerceItemId)
                         throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Removes the given item from the given order. This method will also remove relationships and HandlingInstructions which reference the CommerceItem. Also if there is only one ShippingGroup, it will check for any HandlingInstructions in that ShippingGroup.

Parameters:
pOrder - the Order to remove the CommerceItem fom
pCommerceItemId - the id of the CommerceItem to remove from the Order
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectRemovalException - thrown if the CommerceItem cannot be removed
CommerceException
See Also:
CommerceItemManager

removeAllRelationshipsFromCommerceItem

public void removeAllRelationshipsFromCommerceItem(Order pOrder,
                                                   java.lang.String pCommerceItemId)
                                            throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Removes all the relationships from the CommerceItem with the given id in the given order. Also removes any HandlingInstructions which reference this CommerceItem.

Parameters:
pOrder - the Order which contains the CommerceItem to remove the relationships from
pCommerceItemId - the id of the CommerceItem
Throws:
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
See Also:
CommerceItemManager

getAllCommerceItemRelationships

public java.util.List getAllCommerceItemRelationships(Order pOrder)
                                               throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Provides a List of all CommerceItemRelationships associated with the given Order. This could include PaymentGroupCommerceItemRelationships or ShippingGroupCommerceItemRelationships.

Parameters:
pOrder - the Order whose relationships are sought
Returns:
a List of CommerceItemRelationships in the Order
Throws:
InvalidParameterException - thrown if order parameter is null
CommerceException
See Also:
Relationship, CommerceItemRelationship, ShippingGroupCommerceItemRelationship, PaymentGroupCommerceItemRelationship, CommerceItemManager

getCommerceItemsFromShippingGroup

public java.util.List getCommerceItemsFromShippingGroup(ShippingGroup pShippingGroup)
                                                 throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Returns a List of all the CommerceItems within the given ShippingGroup.

Parameters:
pShippingGroup - the ShippingGroup to retrieve the CommerceItems from
Returns:
a List of CommerceItems which are in the given ShippingGroup
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
CommerceItemManager

getCommerceItemsFromPaymentGroup

public java.util.List getCommerceItemsFromPaymentGroup(PaymentGroup pPaymentGroup)
                                                throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Returns a List of all the CommerceItems within the given PaymentGroup.

Parameters:
pPaymentGroup - the PaymentGroup to retrieve the CommerceItems from
Returns:
a List of CommerceItems which are in the given PaymentGroup
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
CommerceItemManager

getUnassignedQuantityForCommerceItem

public long getUnassignedQuantityForCommerceItem(CommerceItem pItem)
Deprecated. this method has been moved to the CommerceItemManager

This method returns the unassigned quantity for a CommerceItem. If a CommerceItem contains a ShippingGroupRelationship with type ShippingRemaining, then the unassigned quantity will always be 0. To determine the remaining quantity call getRemainingQuantityForShippingGroup(CommerceItem). This method assumes that ShippingGroupCommerceItemRelationships have been created between the CommerceItem and ShippingGroup.

Parameters:
pItem - the CommerceItem we are checking
Returns:
the unassigned quantity.
See Also:
getRemainingQuantityForShippingGroup(CommerceItem), CommerceItemManager

addItemAmountToPaymentGroup

public void addItemAmountToPaymentGroup(Order pOrder,
                                        java.lang.String pCommerceItemId,
                                        java.lang.String pPaymentGroupId,
                                        double pAmount)
                                 throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Adds the given amount of the CommerceItem with the given id to the PaymentGroup with the given id. Underneath the surface, this method creates a PaymentGroupCommerceItemRelationship with type PAYMENTQUANTITY and sets the PaymentGroup, CommerceItem, and quantity properties in that Relationship to those given as parameters in this method. The id parameters are resolved to the actual objects.

Parameters:
pOrder - the Order which the CommerceItem and ShippingGroup exist
pCommerceItemId - the id of the CommerceItem to add
pPaymentGroupId - the id of the PaymentGroup which the CommerceItem will be added to
pAmount - the amount of the CommerceItem which will be added
Throws:
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
See Also:
PaymentGroupCommerceItemRelationship, CommerceItemManager

addRemainingItemAmountToPaymentGroup

public void addRemainingItemAmountToPaymentGroup(Order pOrder,
                                                 java.lang.String pCommerceItemId,
                                                 java.lang.String pPaymentGroupId)
                                          throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Adds any unassigned amount of the CommerceItem with the given id to the ShippingGroup with the given id. Underneath the surface, this method creates a PaymentGroupCommerceItemRelationship with type PAYMENTAMOUNTREMAINING and sets the PaymentGroup and CommerceItem properties in that Relationship to those given as parameters in this method. The id parameters are resolved to the actual objects.

Parameters:
pOrder - the Order which the CommerceItem and ShippingGroup exist
pCommerceItemId - the id of the CommerceItem to add
pPaymentGroupId - the id of the PaymentGroup which the CommerceItem will be added to
Throws:
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
See Also:
ShippingGroupCommerceItemRelationship, CommerceItemManager

addItemQuantityToShippingGroup

public void addItemQuantityToShippingGroup(Order pOrder,
                                           java.lang.String pCommerceItemId,
                                           java.lang.String pShippingGroupId,
                                           long pQuantity)
                                    throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Adds the given quantity of the CommerceItem with the given id to the ShippingGroup with the given id. Underneath the surface, this method creates a ShippingGroupCommerceItemRelationship with type SHIPPINGQUANTITY and sets the ShippingGroup, CommerceItem, and quantity properties in that Relationship to those given as parameters in this method. The id parameters are resolved to the actual objects.

Parameters:
pOrder - the Order which the CommerceItem and ShippingGroup exist
pCommerceItemId - the id of the CommerceItem to add
pShippingGroupId - the id of the ShippingGroup which the CommerceItem will be added to
pQuantity - the quantity of the CommerceItem which will be added
Throws:
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
See Also:
ShippingGroupCommerceItemRelationship, CommerceItemManager

addRemainingItemQuantityToShippingGroup

public void addRemainingItemQuantityToShippingGroup(Order pOrder,
                                                    java.lang.String pCommerceItemId,
                                                    java.lang.String pShippingGroupId)
                                             throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Adds any unassigned quantity of the CommerceItem with the given id to the ShippingGroup with the given id. Underneath the surface, this method creates a ShippingGroupCommerceItemRelationship with type SHIPPINGQUANTITYREMAINING and sets the ShippingGroup and CommerceItem properties in that Relationship to those given as parameters in this method. The id parameters are resolved to the actual objects.

Parameters:
pOrder - the Order which the CommerceItem and ShippingGroup exist
pCommerceItemId - the id of the CommerceItem to add
pShippingGroupId - the id of the ShippingGroup which the CommerceItem will be added to
Throws:
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
See Also:
ShippingGroupCommerceItemRelationship, CommerceItemManager

removeItemQuantityFromShippingGroup

public void removeItemQuantityFromShippingGroup(Order pOrder,
                                                java.lang.String pCommerceItemId,
                                                java.lang.String pShippingGroupId,
                                                long pQuantity)
                                         throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Removes the given quantity of the CommerceItem with the given id from the ShippingGroup with the given id.

Parameters:
pOrder - the Order which the CommerceItem and ShippingGroup exist
pCommerceItemId - the id of the CommerceItem to to remove from the ShippingGroup
pShippingGroupId - the id of the ShippingGroup which the CommerceItem will be removed from
pQuantity - the quantity of the CommerceItem which will be removed
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectRemovalException - if the removal of the quantity fails
CommerceException
See Also:
CommerceItemManager

removeRemainingItemQuantityFromShippingGroup

public void removeRemainingItemQuantityFromShippingGroup(Order pOrder,
                                                         java.lang.String pCommerceItemId,
                                                         java.lang.String pShippingGroupId)
                                                  throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Removes the "remaining" quantity of the CommerceItem with the given id from the ShippingGroup with the given id.

Parameters:
pOrder - the Order which the CommerceItem and ShippingGroup exist
pCommerceItemId - the id of the CommerceItem to to remove from the ShippingGroup
pShippingGroupId - the id of the ShippingGroup which the CommerceItem will be removed from
Throws:
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
See Also:
CommerceItemManager

removeItemAmountFromPaymentGroup

public void removeItemAmountFromPaymentGroup(Order pOrder,
                                             java.lang.String pCommerceItemId,
                                             java.lang.String pPaymentGroupId,
                                             double pAmount)
                                      throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Removes the given amount of the CommerceItem with the given id from the PaymentGroup with the given id.

Parameters:
pOrder - the Order which the CommerceItem and PaymentGroup exist
pCommerceItemId - the id of the CommerceItem
pPaymentGroupId - the id of the PaymentGroup
pAmount - the amount to remove
Throws:
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
See Also:
CommerceItemManager

removeRemainingItemAmountFromPaymentGroup

public void removeRemainingItemAmountFromPaymentGroup(Order pOrder,
                                                      java.lang.String pCommerceItemId,
                                                      java.lang.String pPaymentGroupId)
                                               throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Removes the "remaining" amount of the CommerceItem with the given id from the PaymentGroup with the given id.

Parameters:
pOrder - the Order which the CommerceItem and PaymentGroup exist
pCommerceItemId - the id of the CommerceItem
pPaymentGroupId - the id of the PaymentGroup
Throws:
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
See Also:
CommerceItemManager

removeItemFromPaymentGroupInternal

protected void removeItemFromPaymentGroupInternal(Order pOrder,
                                                  PaymentGroupCommerceItemRelationship pRel)
                                           throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Removes the PaymentGroupCommerceItemRelationship from the Order.

Parameters:
pOrder - the Order which the CommerceItem and PaymentGroup exist
pRel - the relationship which assigns the CommerceItem to the PaymentGroup
Throws:
RelationshipNotFoundException - if the given relationship is not found in the PaymentGroup or CommerceItem
ObjectRemovalException - if the removal of the object fails
CommerceException
See Also:
PaymentGroupCommerceItemRelationship, CommerceItemManager

returnCommerceItem

public void returnCommerceItem(Order pOrder,
                               java.lang.String pCommerceItemId,
                               java.lang.String pShippingGroupId,
                               long pQuantity)
                        throws CommerceException
Deprecated. this method has been moved to the CommerceItemManager

Marks a CommerceItem as returned in an Order. Marking it as returned sets the returnedQuantity in the ShippingGroupCommerceItemRelationship to pQuantity. It also reduces the quantity in the CommerceItem and the ShippingGroupCommerceItemRelationship by pQuantity.

Parameters:
pOrder - the Order which contains the CommerceItem to return
pCommerceItemId - the id of the CommerceItem to return
pShippingGroupId - the id of the ShippingGroup which contains the CommerceItem to return
pQuantity - the quantity of the CommerceItem to return. The quantity cannot be larger than the quantity in the ShippingGroupCommerceItemRelationship
Throws:
CommerceException - if an exception occurs while returning a CommerceItem
See Also:
CommerceItemManager

createShippingGroup

public ShippingGroup createShippingGroup()
                                  throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Creates a new ShippingGroup object using the type mapped to the defaultShippingGroupType property in OrderTools. Populates the ShippingGroup with the priceInfo object using the default ShippingPriceInfo class as defined in the OrderTools nucleus component.

Returns:
the ShippingGroup object which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
OrderTools.getDefaultShippingGroupType(), ShippingGroupManager

createShippingGroup

public ShippingGroup createShippingGroup(java.lang.String pShippingGroupType)
                                  throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Creates a new ShippingGroup object using the type mapped to the type supplied in pShippingGroupType. Populates the ShippingGroup with the priceInfo object using the default ShippingPriceInfo class as defined in the OrderTools nucleus component.

Parameters:
pShippingGroupType - the type mapped to the object instance to use for the ShippingGroup
Returns:
the ShippingGroup object which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
ShippingGroupManager

createShippingGroup

public ShippingGroup createShippingGroup(java.lang.String pShippingGroupType,
                                         ShippingPriceInfo pPriceInfo)
                                  throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Creates a new ShippingGroup object using the type mapped to the type supplied in pShippingGroupType. Populates the ShippingGroup with the supplied data.

Parameters:
pShippingGroupType - the type mapped to the object instance to use for the ShippingGroup
pPriceInfo - the ShippingPriceInfo object for this ShippingGroup
Returns:
the ShippingGroup object which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
ShippingGroupManager

addShippingGroupToOrder

public void addShippingGroupToOrder(Order pOrder,
                                    ShippingGroup pShippingGroup)
                             throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Adds the given ShippingGroup to the given order.

Parameters:
pOrder - the Order to add the ShippingGroup to
pShippingGroup - the ShippingGroup to add to the Order
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
ShippingGroupManager

removeAllShippingGroupsFromOrder

public void removeAllShippingGroupsFromOrder(Order pOrder)
                                      throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Removes all the ShippingGroups and their Relationships from an Order.

Parameters:
pOrder - the Order which contains the ShippingGroups to be removed
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectRemovalException - thrown if a ShippingGroup cannot be removed
CommerceException
See Also:
ShippingGroupManager

removeShippingGroupFromOrder

public void removeShippingGroupFromOrder(Order pOrder,
                                         java.lang.String pShippingGroupId)
                                  throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Removes the given ShippingGroup from the given order. This method will also remove relationships and HandlingInstructions which reference the ShippingGroup. Also if there is only one ShippingGroup, it will check for any HandlingInstructions in that ShippingGroup.

Parameters:
pOrder - the Order to remove the ShippingGroup from
pShippingGroupId - the id of the ShippingGroup to remove from the Order
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectRemovalException - thrown if the ShippingGroup contains any relationships
CommerceException
See Also:
ShippingGroupManager

removeAllRelationshipsFromShippingGroup

public void removeAllRelationshipsFromShippingGroup(Order pOrder,
                                                    java.lang.String pShippingGroupId)
                                             throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Removes all the relationships from the ShippingGroup with the given id in the given order. Also implicitly removes all the HandlingInstructions in the given ShippingGroup.

Parameters:
pOrder - the Order which contains the CommerceItem to remove the relationships from
pShippingGroupId - the id of the ShippingGroup
Throws:
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
See Also:
ShippingGroupManager

getAllShippingGroupRelationships

public java.util.List getAllShippingGroupRelationships(Order pOrder)
                                                throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Provides a List of all ShippingGroupRelationships associated with the given Order. This could include PaymentGroupShippingGroupRelationships or ShippingGroupCommerceItemRelationships.

Parameters:
pOrder - the Order whose relationships are sought
Returns:
a List of ShippingGroupRelationships in the Order
Throws:
InvalidParameterException - thrown if order parameter is null
CommerceException
See Also:
Relationship, ShippingGroupRelationship, ShippingGroupCommerceItemRelationship, PaymentGroupShippingGroupRelationship, ShippingGroupManager

addShippingCostAmountToPaymentGroup

public void addShippingCostAmountToPaymentGroup(Order pOrder,
                                                java.lang.String pShippingGroupId,
                                                java.lang.String pPaymentGroupId,
                                                double pAmount)
                                         throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Adds the given amount of the ShippingGroup's cost with the given id to the PaymentGroup with the given id. Underneath the surface, this method creates a PaymentGroupShippingGroupRelationship with type SHIPPINGAMOUNT and sets the PaymentGroup, ShippingGroup, and amount properties in that Relationship to those given as parameters in this method. The id parameters are resolved to the actual objects.

Parameters:
pOrder - the Order which the PaymentGroup and ShippingGroup exist
pShippingGroupId - the id of the ShippingGroup's cost to add
pPaymentGroupId - the id of the PaymentGroup which the ShippingGroup's cost will be added to
pAmount - the amount that is assigned for payment to the PaymentGroup
Throws:
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
See Also:
PaymentGroupShippingGroupRelationship, ShippingGroupManager

addRemainingShippingCostToPaymentGroup

public void addRemainingShippingCostToPaymentGroup(Order pOrder,
                                                   java.lang.String pShippingGroupId,
                                                   java.lang.String pPaymentGroupId)
                                            throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Adds any unassigned amount of the ShippingGroup's cost with the given id to the PaymentGroup with the given id. Underneath the surface, this method creates a PaymentGroupShippingGroupRelationship with type SHIPPINGAMOUNTREMAINING and sets the PaymentGroup and ShippingGroup properties in that Relationship to those given as parameters in this method. The id parameters are resolved to the actual objects.

Parameters:
pOrder - the Order which the PaymentGroup and ShippingGroup exist
pShippingGroupId - the id of the ShippingGroup's cost to add
pPaymentGroupId - the id of the PaymentGroup which the ShippingGroup's cost will be added to
Throws:
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
See Also:
PaymentGroupShippingGroupRelationship, ShippingGroupManager

removeShippingCostAmountFromPaymentGroup

public void removeShippingCostAmountFromPaymentGroup(Order pOrder,
                                                     java.lang.String pShippingGroupId,
                                                     java.lang.String pPaymentGroupId,
                                                     double pAmount)
                                              throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Removes the given amount of the ShippingGroup's cost with the given id from the PaymentGroup with the given id.

Parameters:
pOrder - the Order which the PaymentGroup and ShippingGroup exist
pShippingGroupId - the id of the ShippingGroup
pPaymentGroupId - the id of the PaymentGroup
pAmount - the amount to remove
Throws:
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
See Also:
ShippingGroupManager

removeRemainingShippingCostFromPaymentGroup

public void removeRemainingShippingCostFromPaymentGroup(Order pOrder,
                                                        java.lang.String pShippingGroupId,
                                                        java.lang.String pPaymentGroupId)
                                                 throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Removes the "remaining" amount of the ShippingGroup with the given id from the PaymentGroup with the given id.

Parameters:
pOrder - the Order which the PaymentGroup and ShippingGroup exist
pShippingGroupId - the id of the ShippingGroup
pPaymentGroupId - the id of the PaymentGroup
Throws:
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
See Also:
ShippingGroupManager

removeShippingCostFromPaymentGroupInternal

protected void removeShippingCostFromPaymentGroupInternal(Order pOrder,
                                                          PaymentGroupShippingGroupRelationship pRel)
                                                   throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Removes the PaymentGroupShippingGroupRelationship from the Order.

Parameters:
pOrder - the Order which the ShippingGroup and PaymentGroup exist
pRel - the relationship which assigns the ShippingGroup to the PaymentGroup
Throws:
RelationshipNotFoundException - if the given relationship is not found in the PaymentGroup or ShippingGroup
ObjectRemovalException - if the removal of the object fails
CommerceException
See Also:
PaymentGroupShippingGroupRelationship, ShippingGroupManager

splitShippingGroup

public java.util.List splitShippingGroup(Order pOrder,
                                         java.lang.String pShippingGroupId,
                                         java.lang.String[] pItemIds,
                                         long[] pQuantities)
                                  throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Moves a set of Items from a ShippingGroup to a new ShippingGroup. The new ShippingGroup has the same information as the original. The reason for this method is to allow the fulfillment engine to handle partial shipment of an Order. This method creates two new ShippingGroups and moves the items given in pItems to one ShippingGroup and the remaining items in the original ShippingGroup to the other ShippingGroup. The original ShippingGroup, pShippingGroup, is removed from the Order and no longer valid. Note that the ShippingPriceInfo from the original ShippingGroup is moved to the new ShippingGroup which contains the items whose ids were supplied in pItemIds and the other new ShippingGroup contains a ShippingPriceInfo whose value is 0.

Parameters:
pOrder - the Order which the ShippingGroup and CommerceItems exist in
pShippingGroupId - the id of the ShippingGroup which contains the CommerceItems in pItems which are to be moved to a new ShippingGroup
pItemIds - 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.
Returns:
a List of the two new ShippingGroups. The first ShippingGroup in the array contains the original ShippingGroup and the second ShippingGroup contains the specified quantities of the specified items the remaining items.
Throws:
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 occurs
See Also:
ShippingGroupManager

splitShippingGroup

public java.util.List splitShippingGroup(Order pOrder,
                                         java.lang.String pShippingGroupId,
                                         java.lang.String[] pItemIds)
                                  throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Moves a set of Items from a ShippingGroup to a new ShippingGroup. The new ShippingGroup has the same information as the original. The reason for this method is to allow the fulfillment subsystem to split items which are not serviced by the same fulfiller into a different shipping group.

Parameters:
pOrder - the Order which the ShippingGroup and CommerceItems exist in
pShippingGroupId - the id of the ShippingGroup which contains the CommerceItems in pItems which are to be moved to a new ShippingGroup
pItemIds - 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.
Returns:
a List of the two new ShippingGroups. The first ShippingGroup in the array contains the original ShippingGroup and the second ShippingGroup contains the specified quantities of the specified items the remaining items.
Throws:
CommerceException
See Also:
ShippingGroupManager

splitShippingGroupWithImplicitRelationships

protected java.util.List splitShippingGroupWithImplicitRelationships(Order pOrder,
                                                                     ShippingGroup pShippingGroup,
                                                                     java.lang.String[] pItemIds,
                                                                     long[] pQuantities)
                                                              throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

This method is called by splitShippingGroup(). Moves a set of Items from a ShippingGroup to a new ShippingGroup which has no Relationships to the supplied items. This is called by splitShippingGroup in the special case when there is only onr ShippingGroup which has implicit Relationships to all the Items in the Order. The new ShippingGroup has the same information as the original. The reason for this method is to allow the fulfillment engine to handle partial shipment of an Order. This method creates two new ShippingGroups and moves the items given in pItems to one ShippingGroup and the remaining items in the original ShippingGroup to the other ShippingGroup. The original ShippingGroup, pShippingGroup, is removed from the Order and no longer valid. Note that the ShippingPriceInfo from the original ShippingGroup is moved to the new ShippingGroup which contains the items whose ids were supplied in pItemIds and the other new ShippingGroup contains a ShippingPriceInfo whose value is 0.

Parameters:
pOrder - the Order which the ShippingGroup and CommerceItems exist in
pShippingGroupId - the id of the ShippingGroup which contains the CommerceItems in pItems which are to be moved to a new ShippingGroup
pItemIds - 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.
Returns:
a List of the two new ShippingGroups. The first ShippingGroup in the array contains the original ShippingGroup and the second ShippingGroup contains the specified quantities of the specified items the remaining items.
Throws:
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 occurs
See Also:
ShippingGroupManager

cloneShippingGroup

public ShippingGroup cloneShippingGroup(ShippingGroup pShippingGroup)
                                 throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Creates a duplicate of the given ShippingGroup. All data is exactly the same except for the id (which is new), the relationships (which are not copied), the handlingInstructions (which are not copied) and the PriceInfo (which is set to 0 in the new group).

Parameters:
pShippingGroup - the ShippingGroup to clone.
Returns:
the cloned ShippingGroup
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
ShippingGroupManager

getRemainingQuantityForShippingGroup

public long getRemainingQuantityForShippingGroup(CommerceItem pItem)
Deprecated. this method has been moved to the ShippingGroupManager

Calculate the "quantity remaining" for a given item. Add up all the quantities in relationships of type SHIPPINGQUANTITY then subtract from the CommerceItem's quantity. This method assumes that ShippingGroupCommerceItemRelationships have been created between the CommerceItem and ShippingGroup.

Parameters:
pItem - The CommerceItem we are checking
Returns:
The quantity remaining.
See Also:
ShippingGroupManager

getShippingGroupByDescription

public ShippingGroup getShippingGroupByDescription(java.util.List pShippingGroups,
                                                   java.lang.String pDescription)
                                            throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

This method will return a ShippingGroup whose description is pDescription.

Parameters:
pShippingGroups - a List of ShippingGroups
pDescription - the description to search for in the List of ShippingGroups
Returns:
the ShippingGroup whose description is pDescription or null if it is not found
Throws:
InvalidParameterException - if any of the parameters are null
CommerceException
See Also:
ShippingGroupManager

removeEmptyShippingGroups

public void removeEmptyShippingGroups(Order pOrder)
                               throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Removes all the ShippingGroups which have no CommerceItems. Having no CommerceItems means that the ShippingGroup has no CommerceItemRelationships. If the Order has only one ShippingGroup then it is not removed even though it may not have any CommerceItemRelationships.

Parameters:
pOrder - the Order which contains the ShippingGroups
Throws:
CommerceException - if an exception occurs while removing a ShippingGroup
See Also:
ShippingGroupManager

getShippingGroupCommerceItemRelationship

public ShippingGroupCommerceItemRelationship getShippingGroupCommerceItemRelationship(Order pOrder,
                                                                                      java.lang.String pCommerceItemId,
                                                                                      java.lang.String pShippingGroupId)
                                                                               throws CommerceException
Deprecated. this method has been moved to the ShippingGroupManager

Returns the relationship object which exists between the given CommerceItem and ShippingGroup.

Parameters:
pCommerceItemId - the id of the CommerceItem which makes up a half of the relationship
pShippingGroupId - the id of the ShippingGroup which makes up a half of the relationship
Returns:
the ShippingGroupCommerceItemRelationship object that exists between these two objects
Throws:
InvalidParameterException - thrown if any of the parameters are null
RelationshipNotFoundException - if a relationship is not found
CommerceException
See Also:
ShippingGroupManager

createHandlingInstruction

public HandlingInstruction createHandlingInstruction()
                                              throws CommerceException
Deprecated. this method has been moved to the HandlingInstructionManager

Creates a new HandlingInstruction object using the type mapped to the defaultHandlingInstructionType property in OrderTools.

Returns:
the HandlingInstruction object which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
OrderTools.getDefaultHandlingInstructionType(), HandlingInstructionManager

createHandlingInstruction

public HandlingInstruction createHandlingInstruction(java.lang.String pHandlingInstructionType)
                                              throws CommerceException
Deprecated. this method has been moved to the HandlingInstructionManager

Creates a new HandlingInstruction object using the type mapped to the type supplied in pHandlingInstructionType.

Parameters:
pHandlingInstructionType - the name that is mapped in the OrderTools.properties file to the class of the desired type to create
Returns:
the HandlingInstruction object which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
HandlingInstructionManager

createHandlingInstruction

public HandlingInstruction createHandlingInstruction(java.lang.String pShippingGroupId,
                                                     java.lang.String pCommerceItemId,
                                                     long pQuantity)
                                              throws CommerceException
Deprecated. this method has been moved to the HandlingInstructionManager

Creates a new HandlingInstruction object of the default type and populates the HandlingInstruction with the supplied data.

Parameters:
pShippingGroupId - the id of the ShippingGroup which contains the CommerceItem which this HandlingInstruction applies to
pCommerceItemId - the id of the CommerceItem which this HandlingInstruction applies to
pQuantity - the quantity of CommerceItems which this HandlingInstruction applies to
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
OrderTools.getDefaultHandlingInstructionType(), HandlingInstructionManager

createHandlingInstruction

public HandlingInstruction createHandlingInstruction(java.lang.String pHandlingInstructionType,
                                                     java.lang.String pShippingGroupId,
                                                     java.lang.String pCommerceItemId,
                                                     long pQuantity)
                                              throws CommerceException
Deprecated. this method has been moved to the HandlingInstructionManager

Creates a new HandlingInstruction object using the class mapped to the given name. Populates the HandlingInstruction with the supplied data.

Parameters:
pHandlingInstructionType - the name that is mapped in the OrderTools.properties file to the class of the desired type to create
pShippingGroupId - the id of the ShippingGroup which contains the CommerceItem which this HandlingInstruction applies to
pCommerceItemId - the id of the CommerceItem which this HandlingInstruction applies to
pQuantity - the quantity of CommerceItems which this HandlingInstruction applies to
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
HandlingInstructionManager

addHandlingInstructionToShippingGroup

public void addHandlingInstructionToShippingGroup(Order pOrder,
                                                  HandlingInstruction pHandlingInstruction)
                                           throws CommerceException
Deprecated. this method has been moved to the HandlingInstructionManager

Adds the given HandlingInstruction to the ShippingGroup in the given Order. The shippingGroupId property in the HandlingInstruction specifies which ShippingGroup this HandlingInstruction will be added to. By default this method will check that the commerceItemId specified in the HandlingInstruction refers to a CommerceItem which is in the ShippingGroup.

Parameters:
pOrder - the Order which contains the ShippingGroup that this HandlingInstruction will be added to
pHandlingInstruction - the HandlingInstruction to add to the ShippingGroup in the Order
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
HandlingInstructionManager

removeAllHandlingInstructionsFromShippingGroup

public void removeAllHandlingInstructionsFromShippingGroup(Order pOrder,
                                                           java.lang.String pShippingGroupId)
                                                    throws CommerceException
Deprecated. this method has been moved to the HandlingInstructionManager

Removes all the HandlingInstructions and from a ShippingGroup.

Parameters:
pOrder - the Order which contains the ShippingGroup which contains the HandlingInstructions to be removed
pShippingGroupId - the id of the ShippingGroup which contains the HandlingInstructions
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectRemovalException - thrown if a HandlingInstruction cannot be removed
CommerceException
See Also:
HandlingInstructionManager

removeHandlingInstructionFromShippingGroup

public void removeHandlingInstructionFromShippingGroup(Order pOrder,
                                                       java.lang.String pShippingGroupId,
                                                       java.lang.String pHandlingInstructionId)
                                                throws CommerceException
Deprecated. this method has been moved to the HandlingInstructionManager

Removes the HandlingInstruction with the given id from the ShippingGroup with the given id in the Order.

Parameters:
pOrder - the Order which contains the ShippingGroup to remove the HandlingInstruction from
pShippingGroupId - the id of the ShippingGroup which contains the HandlingInstruction
pHandlingInstructionId - the id of the HandlingInstruction
Throws:
InvalidParameterException - thrown if any of the parameters are null
ShippingGroupNotFoundException - if a ShippingGroup with the given id is not found in the given order
CommerceException
See Also:
HandlingInstructionManager

removeHandlingInstructionsFromShippingGroup

public void removeHandlingInstructionsFromShippingGroup(Order pOrder,
                                                        java.lang.String pShippingGroupId,
                                                        java.lang.String pCommerceItemId)
                                                 throws CommerceException
Deprecated. this method has been moved to the HandlingInstructionManager

Removes the HandlingInstructions from the ShippingGroup in the given Order which belong to the CommerceItem with the given id.

Parameters:
pOrder - the Order which contains the ShippingGroup to remove the HandlingInstruction from
pShippingGroupId - the id of the ShippingGroup which contains the HandlingInstructions
pCommerceItemId - the id of the CommerceItem which the HandlingInstructions reference
Throws:
InvalidParameterException - thrown if any of the parameters are null
ShippingGroupNotFoundException - if a ShippingGroup with the given id is not found in the given order
CommerceException
See Also:
HandlingInstructionManager

copyHandlingInstruction

public HandlingInstruction copyHandlingInstruction(HandlingInstruction pHandlingInstruction)
Deprecated. this method has been moved to the HandlingInstructionManager

Copy a handling object. Also copies GiftlistHandlingInstruction properties If new HandlingInstructions are created, this should be extended. If the HandlingInstruction is not a GiftlistHandlingInstruction, only properties of the base class are copied

Parameters:
pHandlingInstruction - The handlingInstruction to copy
Returns:
A new HandlingInstruciton
See Also:
HandlingInstructionManager

getHandlingInstructionsForCommerceItem

public java.util.List getHandlingInstructionsForCommerceItem(ShippingGroup pShippingGroup,
                                                             java.lang.String pCommerceItemId)
Deprecated. this method has been moved to the HandlingInstructionManager

Return a list of handlingInstructions for the given commerce item, if it exists.

Parameters:
pShippingGroup - the shipping group containing the handling instruction
pCommerceItemId - The id of the item
Returns:
a list of HandlingInstructions for the CommerceItem whose id is pCommerceItemId
See Also:
HandlingInstructionManager

createPaymentGroup

public PaymentGroup createPaymentGroup()
                                throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Creates a new PaymentGroup object using the type mapped to the defaultPaymentGroupType property in OrderTools.

Returns:
the PaymentGroup which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
OrderTools.getDefaultPaymentGroupType(), PaymentGroupManager

createPaymentGroup

public PaymentGroup createPaymentGroup(java.lang.String pPaymentGroupType)
                                throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Creates a new PaymentGroup object using the type mapped to the defaultPaymentGroupType property in OrderTools. Populates the PaymentGroup with the supplied data.

Parameters:
pPaymentGroupType - the type that is mapped in the OrderTools.properties file to the class of the desired type to create
Returns:
the PaymentGroup which was created
Throws:
ObjectCreationException - if the instantiation of an object fails
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
PaymentGroupManager

initializeCreditCard

public void initializeCreditCard(CreditCard pCreditCard,
                                 java.lang.String pCreditCardNumber,
                                 java.lang.String pCreditCardType)
                          throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Initializes a CreditCard object to contain the given data.

Parameters:
pCreditCard - the CreditCard object to initialize
pCreditCardNumber - the credit card number
pCreditCardType - the credit card type. See atg.payment.creditcard.CreditCardTypes
Throws:
InvalidParameterException - thrown if any of the required parameters are null
CommerceException
See Also:
CreditCard, PaymentGroupManager

initializeGiftCertificate

public void initializeGiftCertificate(GiftCertificate pGiftCertificate,
                                      java.lang.String pProfileId,
                                      java.lang.String pGiftCertificateNumber)
                               throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Initializes a GiftCertificate object to contain the given data.

Parameters:
pGiftCertificate - the GiftCertificate object to initialize
pProfileId - the profile id for the user who owns this goft certificate
pGiftCertificateNumber - the credit card number
Throws:
InvalidParameterException - thrown if any of the required parameters are null
CommerceException
See Also:
GiftCertificate, PaymentGroupManager

addPaymentGroupToOrder

public void addPaymentGroupToOrder(Order pOrder,
                                   PaymentGroup pPaymentGroup)
                            throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Adds the given PaymentGroup to the given order.

Parameters:
pOrder - the Order to add the PaymentGroup to
pPaymentGroup - the PaymentGroup to add to the Order
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
PaymentGroupManager

addPaymentGroupToOrder

public void addPaymentGroupToOrder(Order pOrder,
                                   PaymentGroup pPaymentGroup,
                                   int pIndex)
                            throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Adds the given PaymentGroup to the given order in the specified location.

Parameters:
pOrder - the Order to add the PaymentGroup to
pPaymentGroup - the PaymentGroup to add to the Order
pIndex - the location in the Order's list of PaymentGroups to add the PaymentGroup to
Throws:
InvalidParameterException - thrown if any of the parameters are null
CommerceException
See Also:
PaymentGroupManager

removeAllPaymentGroupsFromOrder

public void removeAllPaymentGroupsFromOrder(Order pOrder)
                                     throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Removes all the PaymentGroups and their Relationships from an Order.

Parameters:
pOrder - the Order which contains the PaymentGroups to be removed
Throws:
InvalidParameterException - thrown if any of the parameters are null
ObjectRemovalException - thrown if a PaymentGroup cannot be removed
CommerceException
See Also:
PaymentGroupManager

removePaymentGroupFromOrder

public void removePaymentGroupFromOrder(Order pOrder,
                                        java.lang.String pPaymentGroupId)
                                 throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Removes the given PaymentGroup from the given order. This method will also remove relationships which reference the PaymentGroup.

Parameters:
pOrder - the Order to remove the PaymentGroup from
pPaymentGroupId - the id of the PaymentGroup to remove from the Order
Throws:
InvalidParameterException - thrown if any of the parameters are null
PaymentGroupNotFoundException - if a PaymentGroup with the given id is not found in the given order
ObjectRemovalException - thrown if the PaymentGroup contains any relationships
CommerceException
See Also:
PaymentGroupManager

removeAllRelationshipsFromPaymentGroup

public void removeAllRelationshipsFromPaymentGroup(Order pOrder,
                                                   java.lang.String pPaymentGroupId)
                                            throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Removes all the relationships from the PaymentGroup with the given id in the given order.

Parameters:
pOrder - the Order which contains the PaymentGroup to remove the relationships from
pPaymentGroupId - the id of the PaymentGroup
Throws:
InvalidParameterException - thrown if any of the parameters are null
PaymentGroupNotFoundException - if a PaymentGroup with the given id is not found in the given order
ObjectRemovalException - thrown if a relationship cannot be removed
CommerceException
See Also:
PaymentGroupManager

getAllPaymentGroupRelationships

public java.util.List getAllPaymentGroupRelationships(Order pOrder)
                                               throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Provides a List of all PaymentGroupRelationships associated with the given Order. This could include PaymentGroupShippingGroupRelationships, PaymentGroupCommerceItemRelationships, or PaymentGroupOrderRelationships.

Parameters:
pOrder - the Order whose relationships are sought
Returns:
a List of PaymentGroupRelationships in the Order
Throws:
InvalidParameterException - thrown if order parameter is null
CommerceException
See Also:
Relationship, PaymentGroupRelationship, PaymentGroupCommerceItemRelationship, PaymentGroupShippingGroupRelationship, PaymentGroupOrderRelationship, PaymentGroupManager

recalculatePaymentGroupAmounts

public PipelineResult recalculatePaymentGroupAmounts(Order pOrder)
                                              throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Recalculates the amounts for each PaymentGroup supplied in pPaymentGroupList.

Parameters:
pOrder - the Order to recalculate the PaymentGroups in
Returns:
the PipelineResult object from the execution of the pipeline
Throws:
CommerceException - thrown if an error occurs while recalculating the amounts
See Also:
PaymentGroupManager

removeEmptyPaymentGroups

public void removeEmptyPaymentGroups(Order pOrder)
                              throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Removes all the PaymentGroups which are not being used. Not being used means that the PaymentGroup has no Relationships. If the Order has only one PaymentGroup then it is not removed even though it may not have any Relationships.

Parameters:
pOrder - the Order which contains the PaymentGroups
Throws:
CommerceException - if an exception occurs while removing a PaymentGroup
See Also:
PaymentGroupManager

getPaymentGroupCommerceItemRelationship

public PaymentGroupCommerceItemRelationship getPaymentGroupCommerceItemRelationship(Order pOrder,
                                                                                    java.lang.String pItemId,
                                                                                    java.lang.String pPaymentGroupId)
                                                                             throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Returns the relationship object which exists between the given CommerceItem and PaymentGroup.

Parameters:
pItemId - the id of the CommerceItem which makes up a half of the relationship
pPaymentGroupId - the id of the PaymentGroup which makes up a half of the relationship
Returns:
the PaymentGroupCommerceItemRelationship object that exists between these two objects
Throws:
InvalidParameterException - thrown if any of the parameters are null
RelationshipNotFoundException - if a relationship is not found
CommerceException
See Also:
PaymentGroupManager

getPaymentGroupShippingGroupRelationship

public PaymentGroupShippingGroupRelationship getPaymentGroupShippingGroupRelationship(Order pOrder,
                                                                                      java.lang.String pPaymentGroupId,
                                                                                      java.lang.String pShippingGroupId)
                                                                               throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Returns the relationship object which exists between the given ShippingGroup and PaymentGroup.

Parameters:
pShippingGroupId - the id of the ShippingGroup which makes up a half of the relationship
pPaymentGroupId - the id of the PaymentGroup which makes up a half of the relationship
Returns:
the PaymentGroupShippingGroupRelationship object that exists between these two objects
Throws:
InvalidParameterException - thrown if any of the parameters are null
RelationshipNotFoundException - if a relationship is not found
CommerceException
See Also:
PaymentGroupManager

getPaymentGroupOrderRelationship

public PaymentGroupOrderRelationship getPaymentGroupOrderRelationship(Order pOrder,
                                                                      java.lang.String pPaymentGroupId)
                                                               throws CommerceException
Deprecated. this method has been moved to the PaymentGroupManager

Returns the relationship object which exists between the given Order and PaymentGroup.

Parameters:
pOrder - the Order which makes up half of the relationship
pPaymentGroupId - the id of the PaymentGroup which makes up a half of the relationship
Returns:
the PaymentGroupOrderRelationship object that exists between these two objects
Throws:
InvalidParameterException - thrown if any of the parameters are null
RelationshipNotFoundException - if a relationship is not found
CommerceException
See Also:
PaymentGroupManager

copyAddress

public void copyAddress(RepositoryItem pProfileAddress,
                        Address pAddress)
                 throws CommerceException
Deprecated. this method has been moved to the OrderTools class

This method, given a ContactInfo iten descriptor and an atg.core.util.Address or atg.core.util.ContactInfo object, will copy the address information from the profile to the Address or ContactInfo object. If pAddress is a ContactInfo then the phoneNumber and email address will also be copied.

Parameters:
pProfile - a profile object that contains user information
pAddress - the Address or ContactInfo to copy the user data into
Throws:
CommerceException - if an error occurs while copying
See Also:
OrderTools

copyAddress

public void copyAddress(Address pAddress,
                        RepositoryItem pProfileAddress)
                 throws CommerceException
Deprecated. this method has been moved to the OrderTools class

This method, given a Profile object and an atg.core.util.Address or atg.core.util.ContactInfo object, will copy the address information from the Address or ContactInfo object to the profile. If pAddress is a ContactInfo then the phoneNumber and email address will also be copied.

Parameters:
pAddress - the Address or ContactInfo to copy the data from
pProfileAddress - a profile object to copy the data to
Throws:
CommerceException - if an error occurs while copying
See Also:
OrderTools

copyAddress

public void copyAddress(Address pSrcAddress,
                        Address pDestAddress)
                 throws CommerceException
Deprecated. this method has been moved to the OrderTools class

This method, given two atg.core.util.Address or atg.core.util.ContactInfo objects, will copy the address information from the source to the destination object. If pAddress is a ContactInfo then the phoneNumber and email address will also be copied.

Parameters:
pSrcAddress - the object that the data will be copied from
pDestAddress - the object that the data will be copied into
Throws:
CommerceException - if an error occurs while copying
See Also:
OrderTools

getOrdersForProfile

public java.util.List getOrdersForProfile(java.lang.String pProfileId)
                                   throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the orders for the given profile id.

Parameters:
pProfileId - the Profile id
Returns:
a List of all the orders for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrdersForProfile

public java.util.List getOrdersForProfile(java.lang.String pProfileId,
                                          int pStartIndex,
                                          int pNumOrders)
                                   throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns pNumOrders of the orders for the given profile id, starting with the order at position pStartIndex

Parameters:
pProfileId - the Profile id
pStartIndex - the index of the first order to return. (This is an index into the result set return by the repository query.)
pNumOrders - the number of orders to return
Returns:
a List of all the orders for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrdersForProfile

public java.util.List getOrdersForProfile(java.lang.String pProfileId,
                                          java.lang.String pOrderByProperty,
                                          boolean pAscending)
                                   throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the orders for the given profile id optionally ordered by the given property.

Parameters:
pProfileId - the Profile id
pOrderByProperty - order the results by the given item descriptor property or null
pAscending - if pOrderByProperty is not null, true for ascending order, false for descending
Returns:
a List of all the orders for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrdersForProfile

public java.util.List getOrdersForProfile(java.lang.String pProfileId,
                                          int pStartIndex,
                                          int pNumOrders,
                                          java.lang.String pOrderByProperty,
                                          boolean pAscending)
                                   throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns pNumOrders of the orders for the given profile id, starting with the order at position pStartIndex. These orders are ordered by the given property.

Parameters:
pProfileId - the Profile id
pStartIndex - the index of the first order to return. (This is an index into the result set return by the repository query.)
pNumOrders - the number of orders to return
pOrderByProperty - order the results by the given item descriptor property or null
pAscending - if pOrderByProperty is not null, true for ascending order, false for descending
Returns:
a List of all the orders for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pState)
                                          throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the orders for the given profile id in the given state.

Parameters:
pProfileId - the Profile id
pState - specifies what state the orders should be in, if -1 then no constraint is added to the query
Returns:
a List of all the orders for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pStartIndex,
                                                 int pNumOrders,
                                                 int pState)
                                          throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns pNumOrders of the orders for the given profile id in the given state, starting at the order with index pStartIndex

Parameters:
pProfileId - the Profile id
pStartIndex - the index of the first order to return. (This is an index into the result set return by the repository query.)
pNumOrders - the number of orders to return
pState - specifies what state the orders should be in, if -1 then no constraint is added to the query
Returns:
a List of all the orders for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pState,
                                                 java.lang.String pOrderByProperty,
                                                 boolean pAscending)
                                          throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the orders for the given profile id in the given state optionally ordered by the given property.

Parameters:
pProfileId - the Profile id
pState - specifies what state the orders should be in, if -1 then no constraint is added to the query
pOrderByProperty - order the results by the given item descriptor property or null
pAscending - if pOrderByProperty is not null, true for ascending order, false for descending
Returns:
a List of all the orders for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pStartIndex,
                                                 int pNumOrders,
                                                 int pState,
                                                 java.lang.String pOrderByProperty,
                                                 boolean pAscending)
                                          throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns pNumOrders of the orders for the given profile id in the given state optionally ordered by the given property. The first order returned is at index pStartIndex.

Parameters:
pProfileId - the Profile id
pStartIndex - the index of the first order to return. (This is an index into the result set return by the repository query.)
pNumOrders - the number of orders to return
pState - specifies what state the orders should be in, if -1 then no constraint is added to the query
pOrderByProperty - order the results by the given item descriptor property or null
pAscending - if pOrderByProperty is not null, true for ascending order, false for descending
Returns:
a List of all the orders for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int[] pStates)
                                          throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the orders for the given profile id in any of the given states.

Parameters:
pProfileId - the Profile id
pStates - specifies what states the orders should be in
Returns:
a List of all the orders for the given profile id and states
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pStartIndex,
                                                 int pNumOrders,
                                                 int[] pStates)
                                          throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns pNumOrders of the orders for the given profile id in any of the given states starting at index pStartIndex

Parameters:
pProfileId - the Profile id
pStartIndex - the index of the first order to return. (This is an index into the result set return by the repository query.)
pNumOrders - the number of orders to return
pStates - specifies what states the orders should be in
Returns:
a List of all the orders for the given profile id and states
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int[] pStates,
                                                 java.lang.String pOrderByProperty,
                                                 boolean pAscending)
                                          throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the orders for the given profile id in any of the given states optionally ordered by the given property.

Parameters:
pProfileId - the Profile id
pStates - specifies what states the orders should be in
pOrderByProperty - order the results by the given item descriptor property or null
pAscending - if pOrderByProperty is not null, true for ascending order, false for descending
Returns:
a List of all the orders for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pStartIndex,
                                                 int pNumOrders,
                                                 int[] pStates,
                                                 java.lang.String pOrderByProperty,
                                                 boolean pAscending)
                                          throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the orders for the given profile id in any of the given states optionally ordered by the given property.

Parameters:
pProfileId - the Profile id
pStartIndex - the index of the first order to return. (This is an index into the result set return by the repository query.)
pNumOrders - the number of orders to return
pStates - specifies what states the orders should be in
pOrderByProperty - order the results by the given item descriptor property or null
pAscending - if pOrderByProperty is not null, true for ascending order, false for descending
Returns:
a List of all the orders for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId)
                                     throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the order ids for the given profile id.

Parameters:
pProfileId - the Profile id
Returns:
a List of all the order ids for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders)
                                     throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns pNumOrders of the order ids for the given profile id starting at pStartIndex.

Parameters:
pProfileId - the Profile id
pStartIndex - the index of the first order to return. (This is an index into the result set return by the repository query.)
pNumOrders - the number of orders to return
Returns:
a List of all the order ids for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pState)
                                     throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the order ids for the given profile id in the given state.

Parameters:
pProfileId - the Profile id
pState - specifies what state the orders should be in, if -1 then no constraint is added to the query
Returns:
a List of all the order ids for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders,
                                            int pState)
                                     throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns pNumOrders of the order ids for the given profile id in the given state starting at pStartIndex

Parameters:
pProfileId - the Profile id
pStartIndex - the index of the first order to return. (This is an index into the result set return by the repository query.)
pNumOrders - the number of orders to return
pState - specifies what state the orders should be in, if -1 then no constraint is added to the query
Returns:
a List of all the order ids for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int[] pStates)
                                     throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the order ids for the given profile id in any of the given states.

Parameters:
pProfileId - the Profile id
pStates - specifies what states the orders should be in
Returns:
a List of all the order ids for the given profile id and states
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders,
                                            int[] pStates)
                                     throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns pNumOrders of the order ids for the given profile id in any of the given states starting at pStartIndex/

Parameters:
pProfileId - the Profile id
pStartIndex - the index of the first order to return. (This is an index into the result set return by the repository query.)
pNumOrders - the number of orders to return
pStates - specifies what states the orders should be in
Returns:
a List of all the order ids for the given profile id and states
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending)
                                     throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the order ids for the given profile id optionally ordered by the given property.

Parameters:
pProfileId - the Profile id
pOrderByProperty - order the results by the given item descriptor property or null
pAscending - if pOrderByProperty is not null, true for ascending order, false for descending
Returns:
a List of all the order ids for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending)
                                     throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the order ids for the given profile id optionally ordered by the given property.

Parameters:
pProfileId - the Profile id
pStartIndex - the index of the first order to return. (This is an index into the result set return by the repository query.)
pNumOrders - the number of orders to return
pOrderByProperty - order the results by the given item descriptor property or null
pAscending - if pOrderByProperty is not null, true for ascending order, false for descending
Returns:
a List of all the order ids for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pState,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending)
                                     throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the order ids for the given profile id in the given state optionally ordered by the given property.

Parameters:
pProfileId - the Profile id
pState - specifies what state the orders should be in, if -1 then no constraint is added to the query
pOrderByProperty - order the results by the given item descriptor property or null
pAscending - if pOrderByProperty is not null, true for ascending order, false for descending
Returns:
a List of all the order ids for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders,
                                            int pState,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending)
                                     throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns pNumOrders of the order ids for the given profile id in the given state optionally ordered by the given property, starting at pStartIndex.

Parameters:
pProfileId - the Profile id
pStartIndex - the index of the first order to return. (This is an index into the result set return by the repository query.)
pNumOrders - the number of orders to return
pState - specifies what state the orders should be in, if -1 then no constraint is added to the query
pOrderByProperty - order the results by the given item descriptor property or null
pAscending - if pOrderByProperty is not null, true for ascending order, false for descending
Returns:
a List of all the order ids for the given profile id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int[] pStates,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending)
                                     throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns all the order ids for the given profile id in any of the given states optionally ordered by the given property.

Parameters:
pProfileId - the Profile id
pStates - specifies what states the orders should be in
pOrderByProperty - order the results by the given item descriptor property or null
pAscending - if pOrderByProperty is not null, true for ascending order, false for descending
Returns:
a List of all the order ids for the given profile id and states
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders,
                                            int[] pStates,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending)
                                     throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns pNumOrders of the order ids for the given profile id in any of the given states optionally ordered by the given property, starting at pStartIndex.

Parameters:
pProfileId - the Profile id
pStartIndex - the index of the first order to return. (This is an index into the result set return by the repository query.)
pNumOrders - the number of orders to return
pStates - specifies what states the orders should be in
pOrderByProperty - order the results by the given item descriptor property or null
pAscending - if pOrderByProperty is not null, true for ascending order, false for descending
Returns:
a List of all the order ids for the given profile id and states
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsWithinDateRange

public java.util.List getOrderIdsWithinDateRange(java.util.Date pFrom,
                                                 java.util.Date pTo)
                                          throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns a List of orders that were submitted within the given range of dates

Parameters:
pFrom - the lower date limit
pTo - the upper date limit
Returns:
a List of Order Ids that satisfy the query parameters
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderIdsForProfileWithinDateRange

public java.util.List getOrderIdsForProfileWithinDateRange(java.lang.String pProfileId,
                                                           java.util.Date pFrom,
                                                           java.util.Date pTo)
                                                    throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Returns a List of orders that were submitted within the given range of dates and owned by a given user

Parameters:
pProfileId - the profile to which the orders pertain
pFrom - the lower date limit
pTo - the upper date limit
Returns:
a List of Order Ids that satisfy the query parameters
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getDateRangeQuery

protected Query getDateRangeQuery(java.util.Date pFrom,
                                  java.util.Date pTo)
                           throws CommerceException
Deprecated. this method has been moved to the OrderQueries class

Given two dates, contructs a query contrained by the range of these dates

Parameters:
pTo - the upper date limit
pFrom - the lower date limit
Returns:
the query object
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository
See Also:
OrderQueries

getOrderCountForProfileInState

public int getOrderCountForProfileInState(java.lang.String pProfileId,
                                          int[] pStates)
                                   throws CommerceException
Returns the count of orders whose state matches the pStates list for the given profile id.

Parameters:
pProfileId - - the id of the profile whose orders are counted
pStates - - the list of states that are being queried for.
Throws:
CommerceException

getOrderCountForProfile

public int getOrderCountForProfile(java.lang.String pProfileId)
                            throws CommerceException
Returns the count of orders for the passed in profile id.

Parameters:
pProfileId - - the id of the profile whose orders are queried.
Throws:
CommerceException