atg.commerce.order
Class OrderQueries

java.lang.Object
  extended by atg.commerce.order.OrderQueries

public class OrderQueries
extends java.lang.Object

This class contains methods for executing various types of order queries.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected static java.util.ResourceBundle sResourceBundle
          Resource Bundle
 
Constructor Summary
OrderQueries()
          Constructs an OrderQueries object.
 
Method Summary
protected  Query getDateRangeQuery(java.util.Date pFrom, java.util.Date pTo)
          Given two dates, contructs a query constrained by the range of these dates
 int getOrderCountForCostCenterInState(java.lang.String pCostCenterId, int[] pStates, java.util.Collection<java.lang.String> pSiteIds)
          Returns the count of orders whose state matches the pStates list for the given cost center id and sites.
 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.
 int getOrderCountForProfileInState(java.lang.String pProfileId, int[] pStates, java.util.Collection<java.lang.String> pSiteIds)
          Returns the count of orders whose state matches the pStates list for the given profile id and sites.
 java.util.List getOrderIdsForCostCenter(java.lang.String pCostCenterId, int pStartIndex, int pNumOrders, int[] pStates, java.lang.String pOrderByProperty, boolean pAscending, java.util.Collection<java.lang.String> pSiteIds)
          Returns pNumOrders of the order ids for the given cost center id, in any of the given states, for any of the given sites, optionally ordered by the given property, starting at pStartIndex.
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId)
          Returns all the order ids for the given profile id.
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pState)
          Returns all the order ids for the given profile id in the given state.
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int[] pStates)
          Returns all the order ids for the given profile id in any of the given states.
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int[] pStates, java.lang.String pOrderByProperty, boolean pAscending)
          Returns all the order ids for the given profile id in any of the given states optionally ordered by the given property.
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders)
          Returns pNumOrders of the order ids for the given profile id starting at pStartIndex.
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int pState)
          Returns pNumOrders of the order ids for the given profile id in the given state starting at pStartIndex
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int[] pStates)
          Returns pNumOrders of the order ids for the given profile id in any of the given states starting at pStartIndex/
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int[] pStates, java.lang.String pOrderByProperty, boolean pAscending)
          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.
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int[] pStates, java.lang.String pOrderByProperty, boolean pAscending, java.util.Collection<java.lang.String> pSiteIds)
          Returns pNumOrders of the order ids for the given profile id, in any of the given states, for any of the given sites, optionally ordered by the given property, starting at pStartIndex.
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int pState, java.lang.String pOrderByProperty, boolean pAscending)
          Returns pNumOrders of the order ids for the given profile id in the given state optionally ordered by the given property, starting at pStartIndex.
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, java.lang.String pOrderByProperty, boolean pAscending)
          Returns all the order ids for the given profile id optionally ordered by the given property.
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, int pState, java.lang.String pOrderByProperty, boolean pAscending)
          Returns all the order ids for the given profile id in the given state optionally ordered by the given property.
 java.util.List getOrderIdsForProfile(java.lang.String pProfileId, java.lang.String pOrderByProperty, boolean pAscending)
          Returns all the order ids for the given profile id optionally ordered by the given property.
 java.util.List getOrderIdsForProfileWithinDateRange(java.lang.String pProfileId, java.util.Date pFrom, java.util.Date pTo)
          Returns a List of orders that were submitted within the given range of dates and owned by a given user
 java.util.List getOrderIdsWithinDateRange(java.util.Date pFrom, java.util.Date pTo)
          Returns a List of orders that were submitted within the given range of dates
 OrderManager getOrderManager()
          Returns property orderManager
 Query getOrderQueryForCostCenter(java.lang.String pCostCenterId, int[] pStates, java.util.Collection<java.lang.String> pSiteIds, RepositoryView pView)
          Generates a query to find all orders for a given cost center
 Query getOrderQueryForProfile(java.lang.String pProfileId, int[] pStates, java.util.Collection<java.lang.String> pSiteIds, RepositoryView pView)
          Returns the RQL query that can be executed to get the orders for the given profile in the given states for the given sites
 Query getOrderQueryForProfile(java.lang.String pProfileId, int[] pStates, RepositoryView pView)
          Returns the RQL query that can be executed to get the orders for the given profile in the given states
 java.util.List getOrdersForCostCenterInState(java.lang.String pCostCenterId, int pStartIndex, int pNumOrders, int[] pStates, java.lang.String pOrderByProperty, boolean pAscending, java.util.Collection<java.lang.String> pSiteIds)
          Returns all the orders for the given cost center id in any of the given states in any of the given sites, optionally ordered by the given property.
 java.util.List getOrdersForProfile(java.lang.String pProfileId)
          Returns all the orders for the given profile id.
 java.util.List getOrdersForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders)
          Returns pNumOrders of the orders for the given profile id, starting with the order at position pStartIndex
 java.util.List getOrdersForProfile(java.lang.String pProfileId, int pStartIndex, int pNumOrders, java.lang.String pOrderByProperty, boolean pAscending)
          Returns pNumOrders of the orders for the given profile id, starting with the order at position pStartIndex.
 java.util.List getOrdersForProfile(java.lang.String pProfileId, java.lang.String pOrderByProperty, boolean pAscending)
          Returns all the orders for the given profile id optionally ordered by the given property.
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pState)
          Returns all the orders for the given profile id in the given state.
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int[] pStates)
          Returns all the orders for the given profile id in any of the given states.
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int[] pStates, java.lang.String pOrderByProperty, boolean pAscending)
          Returns all the orders for the given profile id in any of the given states optionally ordered by the given property.
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int pState)
          Returns pNumOrders of the orders for the given profile id in the given state, starting at the order with index pStartIndex
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int[] pStates)
          Returns pNumOrders of the orders for the given profile id in any of the given states starting at index pStartIndex
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int[] pStates, java.lang.String pOrderByProperty, boolean pAscending)
          Returns all the orders for the given profile id in any of the given states optionally ordered by the given property.
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int[] pStates, java.lang.String pOrderByProperty, boolean pAscending, java.util.Collection<java.lang.String> pSiteIds)
          Returns all the orders for the given profile id in any of the given states in any of the given sites, optionally ordered by the given property.
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pStartIndex, int pNumOrders, int pState, java.lang.String pOrderByProperty, boolean pAscending)
          Returns pNumOrders of the orders for the given profile id in the given state optionally ordered by the given property.
 java.util.List getOrdersForProfileInState(java.lang.String pProfileId, int pState, java.lang.String pOrderByProperty, boolean pAscending)
          Returns all the orders for the given profile id in the given state optionally ordered by the given property.
 OrderTools getOrderTools()
          Returns property orderTools
protected  java.util.List loadOrdersForIds(java.util.List pOrderIds)
          Deprecated. Use OrderManager#loadOrders
 void setOrderManager(OrderManager pOrderManager)
          Sets property orderManager
 void setOrderTools(OrderTools pOrderTools)
          Sets property orderTools
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


sResourceBundle

protected static java.util.ResourceBundle sResourceBundle
Resource Bundle

Constructor Detail

OrderQueries

public OrderQueries()
Constructs an OrderQueries object.

Method Detail

getOrderTools

public OrderTools getOrderTools()
Returns property orderTools

Returns:
returns property orderTools

setOrderTools

public void setOrderTools(OrderTools pOrderTools)
Sets property orderTools

Parameters:
pOrderTools - the value to set for property orderTools

getOrderManager

public OrderManager getOrderManager()
Returns property orderManager

Returns:
returns property orderManager

setOrderManager

public void setOrderManager(OrderManager pOrderManager)
Sets property orderManager

Parameters:
pOrderManager - the value to set for property orderManager

getOrdersForProfile

public java.util.List getOrdersForProfile(java.lang.String pProfileId)
                                   throws CommerceException
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

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

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

getOrderCountForProfileInState

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

Parameters:
pProfileId - - the id of the profile whose orders are counted
pStates - - the list of states that are being queried for.
pSiteIds - - the sites the orders should belong to, null for all sites
Throws:
CommerceException

getOrderCountForCostCenterInState

public int getOrderCountForCostCenterInState(java.lang.String pCostCenterId,
                                             int[] pStates,
                                             java.util.Collection<java.lang.String> pSiteIds)
                                      throws CommerceException
Returns the count of orders whose state matches the pStates list for the given cost center id and sites.

Parameters:
pCostCenterId - - the id of the cost center whose orders are counted
pStates - - the list of states that are being queried for.
pSiteIds - - the sites the orders should belong to, null for all sites
Returns:
count of orders
Throws:
CommerceException

getOrdersForProfile

public java.util.List getOrdersForProfile(java.lang.String pProfileId,
                                          int pStartIndex,
                                          int pNumOrders)
                                   throws CommerceException
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

getOrdersForProfile

public java.util.List getOrdersForProfile(java.lang.String pProfileId,
                                          java.lang.String pOrderByProperty,
                                          boolean pAscending)
                                   throws CommerceException
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

getOrdersForProfile

public java.util.List getOrdersForProfile(java.lang.String pProfileId,
                                          int pStartIndex,
                                          int pNumOrders,
                                          java.lang.String pOrderByProperty,
                                          boolean pAscending)
                                   throws CommerceException
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

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pState)
                                          throws CommerceException
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

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pStartIndex,
                                                 int pNumOrders,
                                                 int pState)
                                          throws CommerceException
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

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pState,
                                                 java.lang.String pOrderByProperty,
                                                 boolean pAscending)
                                          throws CommerceException
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

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pStartIndex,
                                                 int pNumOrders,
                                                 int pState,
                                                 java.lang.String pOrderByProperty,
                                                 boolean pAscending)
                                          throws CommerceException
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

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int[] pStates)
                                          throws CommerceException
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

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pStartIndex,
                                                 int pNumOrders,
                                                 int[] pStates)
                                          throws CommerceException
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

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int[] pStates,
                                                 java.lang.String pOrderByProperty,
                                                 boolean pAscending)
                                          throws CommerceException
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

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pStartIndex,
                                                 int pNumOrders,
                                                 int[] pStates,
                                                 java.lang.String pOrderByProperty,
                                                 boolean pAscending)
                                          throws CommerceException
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

getOrdersForProfileInState

public java.util.List getOrdersForProfileInState(java.lang.String pProfileId,
                                                 int pStartIndex,
                                                 int pNumOrders,
                                                 int[] pStates,
                                                 java.lang.String pOrderByProperty,
                                                 boolean pAscending,
                                                 java.util.Collection<java.lang.String> pSiteIds)
                                          throws CommerceException
Returns all the orders for the given profile id in any of the given states in any of the given sites, 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
pSiteIds - specifies what sites the orders should belong to, null for all sites
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

getOrdersForCostCenterInState

public java.util.List getOrdersForCostCenterInState(java.lang.String pCostCenterId,
                                                    int pStartIndex,
                                                    int pNumOrders,
                                                    int[] pStates,
                                                    java.lang.String pOrderByProperty,
                                                    boolean pAscending,
                                                    java.util.Collection<java.lang.String> pSiteIds)
                                             throws CommerceException
Returns all the orders for the given cost center id in any of the given states in any of the given sites, optionally ordered by the given property.

Parameters:
pCostCenterId - the cost center 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
pSiteIds - specifies what sites the orders should belong to, null for all sites
Returns:
a List of all the orders for the given cost center id
Throws:
InvalidParameterException - thrown if any of the parameters are null or empty string
CommerceException - thrown if an exception occurs while accessing the repository

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId)
                                     throws CommerceException
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

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders)
                                     throws CommerceException
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

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pState)
                                     throws CommerceException
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

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders,
                                            int pState)
                                     throws CommerceException
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

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int[] pStates)
                                     throws CommerceException
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

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders,
                                            int[] pStates)
                                     throws CommerceException
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

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending)
                                     throws CommerceException
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

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending)
                                     throws CommerceException
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

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pState,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending)
                                     throws CommerceException
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

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders,
                                            int pState,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending)
                                     throws CommerceException
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

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int[] pStates,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending)
                                     throws CommerceException
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

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders,
                                            int[] pStates,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending)
                                     throws CommerceException
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

getOrderIdsForProfile

public java.util.List getOrderIdsForProfile(java.lang.String pProfileId,
                                            int pStartIndex,
                                            int pNumOrders,
                                            int[] pStates,
                                            java.lang.String pOrderByProperty,
                                            boolean pAscending,
                                            java.util.Collection<java.lang.String> pSiteIds)
                                     throws CommerceException
Returns pNumOrders of the order ids for the given profile id, in any of the given states, for any of the given sites, 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
pSiteIds - specifies what sites the orders should belong to, null for all sites
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

getOrderIdsForCostCenter

public java.util.List getOrderIdsForCostCenter(java.lang.String pCostCenterId,
                                               int pStartIndex,
                                               int pNumOrders,
                                               int[] pStates,
                                               java.lang.String pOrderByProperty,
                                               boolean pAscending,
                                               java.util.Collection<java.lang.String> pSiteIds)
                                        throws CommerceException
Returns pNumOrders of the order ids for the given cost center id, in any of the given states, for any of the given sites, optionally ordered by the given property, starting at pStartIndex.

Parameters:
pCostCenterId - the Cost Center 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
pSiteIds - specifies what sites the orders should belong to, null for all sites
Returns:
a List of all the order ids for the given cost center 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

getOrderQueryForProfile

public Query getOrderQueryForProfile(java.lang.String pProfileId,
                                     int[] pStates,
                                     RepositoryView pView)
                              throws RepositoryException
Returns the RQL query that can be executed to get the orders for the given profile in the given states

Parameters:
pProfileId - the Profile id
pStates - specifies what states the orders should be in
pView - the order RepositoryView
Returns:
a List of all the order ids for the given profile id and states
Throws:
CommerceException - thrown if an exception occurs while accessing the repository
RepositoryException

getOrderQueryForProfile

public Query getOrderQueryForProfile(java.lang.String pProfileId,
                                     int[] pStates,
                                     java.util.Collection<java.lang.String> pSiteIds,
                                     RepositoryView pView)
                              throws RepositoryException
Returns the RQL query that can be executed to get the orders for the given profile in the given states for the given sites

Parameters:
pProfileId - the Profile id
pStates - specifies what states the orders should be in
pSiteIds - specifies what sites the orders should belong to, null for all sites
pView - the order RepositoryView
Returns:
a List of all the order ids for the given profile id and states
Throws:
CommerceException - thrown if an exception occurs while accessing the repository
RepositoryException

getOrderQueryForCostCenter

public Query getOrderQueryForCostCenter(java.lang.String pCostCenterId,
                                        int[] pStates,
                                        java.util.Collection<java.lang.String> pSiteIds,
                                        RepositoryView pView)
                                 throws RepositoryException
Generates a query to find all orders for a given cost center

Parameters:
pCostCenterId - The cost center Id
pStates - Specifies what state the orders should be in
pSiteIds - Specifies what sites the orders should belong to
pView - the order repository view
Returns:
The query to find all orders for a given cost center
Throws:
RepositoryException

getOrderIdsWithinDateRange

public java.util.List getOrderIdsWithinDateRange(java.util.Date pFrom,
                                                 java.util.Date pTo)
                                          throws CommerceException
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

getOrderIdsForProfileWithinDateRange

public java.util.List getOrderIdsForProfileWithinDateRange(java.lang.String pProfileId,
                                                           java.util.Date pFrom,
                                                           java.util.Date pTo)
                                                    throws CommerceException
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

getDateRangeQuery

protected Query getDateRangeQuery(java.util.Date pFrom,
                                  java.util.Date pTo)
                           throws CommerceException
Given two dates, contructs a query constrained by the range of these dates

Parameters:
pFrom - the lower date limit
pTo - the upper 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

loadOrdersForIds

protected java.util.List loadOrdersForIds(java.util.List pOrderIds)
                                   throws CommerceException
Deprecated. Use OrderManager#loadOrders

Load all the orders with the given IDs.

Parameters:
pOrderIds - a List of order IDs
Returns:
a List of orders
Throws:
CommerceException - thrown if an exception occurs while accessing the repository