atg.commerce.pricing.priceLists
Class PriceListManager

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.pricing.priceLists.PriceListManager
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, PropertiesChangedListener, java.util.EventListener

public class PriceListManager
extends GenericService
implements PropertiesChangedListener

Helper class to ease creation and manipulation of PriceLists. It's main purpose is to retrieve a price for a given product/sku pair. Created: Thu Jan 29 10:50:58 2001


Field Summary
static java.lang.String BASE_PRICE_LIST_PROPERTY_NAME
           
static int BULK_PRICE
           
static java.lang.String BULK_PRICE_STRING
           
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String COMPLEX_PRICE_ITEM_TYPE
           
static java.lang.String COMPLEX_PRICE_LEVELS_PROPERTY_NAME
           
static java.lang.String COMPLEX_PRICE_PROPERTY_NAME
           
static java.lang.String LEVEL_PRICE_PROPERTY_NAME
           
static int LIST_PRICE
           
static java.lang.String LIST_PRICE_PROPERTY_NAME
           
static java.lang.String LIST_PRICE_STRING
           
static java.lang.String LOCALE_PROPERTY_NAME
           
protected  CommerceProfileTools mProfileTools
           
protected  TransientIdGenerator mTransientPriceLevelIdGenerator
           
static java.lang.String PARENT_SKU_ID_PROPERTY_NAME
           
static java.lang.String PRICE_ITEM_TYPE
           
static java.lang.String PRICE_LEVEL_ITEM_TYPE
           
static java.lang.String PRICE_LIST_ID_PROPERTY_NAME
           
static java.lang.String PRICE_LIST_ITEM_TYPE
           
static java.lang.String PRICE_LIST_PROPERTY_NAME
           
static java.lang.String PRICE_LIST_VIEW_NAME
           
static java.lang.String PRICE_VIEW_NAME
           
static java.lang.String PRICING_SCHEME_PROPERTY_NAME
           
static java.lang.String PRODUCT_ID_PROPERTY_NAME
           
static java.lang.String PROFILE_PRICE_LIST_PROPERTY_NAME
           
static java.lang.String QUANTITY_PROPERTY_NAME
           
static java.lang.String SALE_COMPLEX_PRICE_PROPERTY_NAME
          Deprecated. This property is not used anymore
static java.lang.String SALE_PRICE_LIST_PROPERTY_NAME
           
static java.lang.String SALE_PRICE_PROPERTY_NAME
          Deprecated. This property is not used anymore
static java.lang.String SKU_ID_PROPERTY_NAME
           
static int TIERED_PRICE
           
static java.lang.String TIERED_PRICE_STRING
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
PriceListManager()
           
 
Method Summary
 RepositoryItem addPriceLevel(RepositoryItem pComplexPrice, long pQuantity, double pPrice)
          add a price level to the given complex price This could be intelligent and squeeze this into the list based on the quantity, but should probably leave that to the user, and just place it at the end.
 RepositoryItem addPriceLevel(RepositoryItem pComplexPrice, java.lang.Long pQuantity, java.lang.Double pPrice)
          add a price level to the given complex price This could be intelligent and squeeze this into the list based on the quantity, but should probably leave that to the user, and just place it at the end.
 RepositoryItem createComplexPrice()
          Creates an empty complex price in the repository The complexPriceItemType is used.
 RepositoryItem createComplexPrice(java.util.List pQuantities, java.util.List pLevelPrices)
          Creates an empty complex price in the repository The complexPriceItemType is used.
 RepositoryItem createListPrice(RepositoryItem pPriceList, java.lang.String pProductId, java.lang.String pSkuId, double pListPrice)
          Create a price for the given product/sku pair with a list price and store it in the price list.
 RepositoryItem createPrice(RepositoryItem pPriceList, java.lang.String pPricingScheme)
          create a new price with the given pricing scheme The price isn't actually set
 RepositoryItem createPrice(RepositoryItem pPriceList, java.lang.String pPricingScheme, java.lang.String pProductId, java.lang.String pSkuId)
          Create a new price with the given pricing scheme.
 MutableRepositoryItem createPriceLevel(java.lang.String pId, java.lang.String pType)
          creates a new transient price level repository with the given id and type.
 RepositoryItem createPriceList()
          Creates a new price list in the priceListRepository The priceListItemType is used.
 RepositoryItem createPriceWithComplexPrice(RepositoryItem pPriceList, java.lang.String pProductId, java.lang.String pSkuId, java.util.List pLevelQuantities, java.util.List pLevelPrices, java.lang.String pPricingScheme)
          Create a price for the given product/sku pair with a complex price and store it in the price list.
 RepositoryItem createSubSkuPrice(RepositoryItem pPriceList, java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pParentSkuId, double pListPrice)
          Create a price for the given product/sku/parentSku set with a list price and store it in the price list.
 RepositoryItem determinePriceList(atg.commerce.util.ContextValueRetrieverArguments pArguments, java.lang.String pPriceListPropertyName)
          Determines the appropriate price list to get based on properties stored in arguments object.
 RepositoryItem determinePriceList(RepositoryItem pProfile, RepositoryItem pSite, java.lang.String pPriceListPropertyName)
          Determines the appropriate price list to get based on profile and site.
 void doStartService()
          GenericService override
 RepositoryItem[] getAllPrices(java.lang.String pPriceListId)
          This will execute a query within a single priceList for all prices directly attached to this pricelist.
 java.util.List getAncestorPriceLists(RepositoryItem pPriceList)
          Given a price list, this method will return all the ancestor price lists.
 java.lang.String getBasePriceListPropertyName()
          The name of the property in priceList that contains the basePriceList
 atg.commerce.multisite.CommerceSitePropertiesManager getCommerceSitePropertiesManager()
          Set value of the commerce site properties Manager
 RepositoryItem getComplexPrice(java.lang.String pComplexPriceId)
          Get the repository item for the complex price with the given id
 java.lang.String getComplexPriceItemType()
          The name of the item-descriptor useb for complex prices
 java.lang.String getComplexPriceLevelsPropertyName()
          The name of the property in complex price that stores the list of levels
 java.lang.String getComplexPricePropertyName()
          The name of the property in price that identifies the complex price
 ContextValueRetriever getContextValueRetriever()
          Set value of the ContextValueRetriever
 RepositoryItem getDefaultPriceList()
          The default price list
 RepositoryItem getDefaultPriceList(java.lang.String pPropertyName)
          Returns the default price list from the given profile property name.
 java.lang.String getDefaultPriceListId()
          The id of the default price list
 RepositoryItem getDefaultSalePriceList()
          The default price list
 java.lang.String getDefaultSalePriceListId()
          The id of the default price list
 java.util.Collection getDescendantPriceLists(RepositoryItem pPriceList)
          Given a price list, this method will return all the descendant price lists.
 java.util.Collection getFirstDescendantPriceLists(RepositoryItem pPriceList)
          Given a price list, this method will return all the first level of descendant price lists.
 java.lang.String getLevelPricePropertyName()
          The name of the property in price levels for storing the price
 java.lang.String getListPricePropertyName()
          The name of the property in price that identifies the list price
 java.lang.String getLocalePropertyName()
          Getter for the localePropertyName property of a price list.
 java.lang.String getParentSkuIdPropertyName()
          The name of the property in price that identifies the sku id
 RepositoryItem getPrice(RepositoryItem pPriceList, RepositoryItem pProduct, RepositoryItem pSku)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
 RepositoryItem getPrice(RepositoryItem pPriceList, RepositoryItem pProduct, RepositoryItem pSku, boolean pUseCache)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
 RepositoryItem getPrice(RepositoryItem pPriceList, RepositoryItem pProduct, RepositoryItem pSku, RepositoryItem pParentSku)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
 RepositoryItem getPrice(RepositoryItem pPriceList, RepositoryItem pProduct, RepositoryItem pSku, RepositoryItem pParentSku, boolean pUseCache)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
 RepositoryItem getPrice(RepositoryItem pPriceList, java.lang.String pProductId, java.lang.String pSkuId)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
 RepositoryItem getPrice(RepositoryItem pPriceList, java.lang.String pProductId, java.lang.String pSkuId, boolean pUseCache)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
 RepositoryItem getPrice(RepositoryItem pPriceList, java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pParentSkuId)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
 RepositoryItem getPrice(RepositoryItem pPriceList, java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pParentSkuId, boolean pUseCache)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
 RepositoryItem getPrice(java.lang.String pPriceListId, java.lang.String pProductId, java.lang.String pSkuId)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
 RepositoryItem getPrice(java.lang.String pPriceListId, java.lang.String pProductId, java.lang.String pSkuId, boolean pUseCache)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
 RepositoryItem getPrice(java.lang.String pPriceListId, java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pParentSkuId)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
 RepositoryItem getPrice(java.lang.String pPriceListId, java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pParentSkuId, boolean pUseCache)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
 RepositoryItem getPriceAdmin(java.lang.String pPriceListId, java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pParentSkuId)
          This method is similar to LookForPrice except that it will continue to look in the base price list if the price is not found.
 Cache getPriceCache()
          This object caches price objects
 java.lang.Double getPriceFromItem(ItemPriceSource pItemPriceSource, RepositoryItem pPriceItem, long pQuantity)
          Gets the price from a price repository item.
 java.lang.String getPriceItemType()
          The name of the item-descriptor used for prices
 java.lang.String getPriceLevelItemType()
          The name of the item-descriptor used for price levels
 java.util.List<RepositoryItem> getPriceLevelsFromItem(ItemPriceSource pItemPriceSource, RepositoryItem pPriceItem)
          Gets the price levels from a complex price sorted by quantity.
 RepositoryItem getPriceList(RepositoryItem pProfile, java.lang.String pProfilePropertyName)
          Return the price list from the profile.
 RepositoryItem getPriceList(RepositoryItem pProfile, java.lang.String pProfilePropertyName, boolean pUseDefaultPriceList)
          Return the price list from the profile.
 RepositoryItem getPriceList(java.lang.String pId)
          Get the price list with the given id from the repository The priceListItemType is used as the item-descriptor name
 RepositoryItem getPriceListForSite(RepositoryItem pSite, java.lang.String pPriceListPropertyName)
          Obtains a price list for the passed site.
 RepositoryItem getPriceListForSite(java.lang.String pPriceListPropertyName)
          Obtains the price list for the current site.
 java.lang.String getPriceListIdPropertyName()
          The name of the property in priceList that contains the Id of the priceList.
 java.lang.String getPriceListItemType()
          The name of the item-descriptor used for price lists
 java.util.Locale getPriceListLocale(RepositoryItem pPriceList)
          Get the price list locale from the passed in price list repository item.
 java.lang.String getPriceListPropertyName()
          The name of the property in price that refers to the priceList
 MutableRepository getPriceListRepository()
          The repository that contains all the price lists
 java.util.Collection getPriceLists()
          Get all the price lists.
 java.util.Collection getPriceLists(int pStartingIndex, int pEndingIndex, SortDirectives pSortDirectives)
          Get all the price lists.
 int getPriceListsCount()
          Get count of all price lists.
 java.lang.String getPriceListViewName()
          The name of the view in the priceListRepository to use when searching for a price list
 java.lang.String getPriceViewName()
          The name of the view in the priceListRepository to use when searching for a price
 java.lang.String getPricingSchemePropertyName()
          The name of the property in price that identifies the pricing scheme
 java.lang.String getProductIdPropertyName()
          The name of the property in price that identifies the product id
 RepositoryItem getProductPrice(RepositoryItem pPriceList, java.lang.String pProductId)
          Return the price repository item for the given product id in the given priceList.
 java.util.Collection getProductPrices(java.lang.String pPriceListId, java.util.List pProductIds, boolean pIncludeSkuPrices)
          Return all the prices where the sku id is null, and the product id is in the given list, for the given priceList.
 java.util.Collection getProductPrices(java.lang.String pPriceListId, java.util.List pProductIds, boolean pIncludeSkuPrices, boolean pUseCache)
          Return all the prices where the sku id is null, and the product id is in the given list, for the given priceList.
 CommerceProfileTools getProfileTools()
           
 java.lang.String getQuantityPropertyName()
          The name of the property in price levels for the quantity
 java.lang.String getSaleComplexPricePropertyName()
          Deprecated. This property is not used anymore
 java.lang.String getSalePriceListPropertyName()
          Return name of the profile property for storing the assigned sale price list
 java.lang.String getSalePricePropertyName()
          Deprecated. This property is not used anymore
 java.lang.String getSkuIdPropertyName()
          The name of the property in price that identifies the sku id
 RepositoryItem getSkuPrice(RepositoryItem pPriceList, java.lang.String pSkuId)
          Return the price repository item for the given sku id in the given priceList.
 RepositoryItem getSkuPrice(RepositoryItem pPriceList, java.lang.String pProductId, java.lang.String pSkuId)
          Return the price repository item for the given product id and sku id in the given priceList.
 RepositoryItem getSkuPrice(RepositoryItem pPriceList, java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pParentSkuId)
          Return the price repository item for the given product id, sku id, and parent sku id in the given priceList.
 java.util.Collection getSkuPrices(java.lang.String pPriceListId, java.util.List pSkuIds, boolean pExpandConfigurableSkus)
          Return all the prices where the sku id is in the given list.
 java.util.Collection getSkuPrices(java.lang.String pPriceListId, java.util.List pSkuIds, boolean pExpandConfigurableSkus, boolean pUseCache)
          Return all the prices where the sku id is in the given list.
 TransientIdGenerator getTransientPriceLevelIdGenerator()
          Returns the id generator used to generate ids for the transient price level items that the calculator creates for a ItemPriceSource
protected  RepositoryItem getUncachedPrice(RepositoryItem pPriceList, java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pParentSkuId)
          According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried.
protected  RepositoryItem[] getUncachedProductPrices(java.lang.String pPriceListId, java.util.List pProductIds, boolean pIncludeSkuPrices)
          This will execute a query within a single priceList for product prices.
protected  RepositoryItem[] getUncachedSkuPrices(java.lang.String pPriceListId, java.util.List pSkuIds, boolean pExpandConfigurableSkus)
          This will execute a query within a single priceList for sku prices.
 boolean isAutomaticallyUseDefaultPriceList()
          If this is true, and the profiles price list is null, then the default price list is automatically used The default is true
 boolean isIgnoreProductFirst()
          This property controls the order that is used when looking for a price.
 boolean isItemInPriceList(java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pPriceListId)
          Determines if a product/sku can be priced using a specific price list.
 boolean isUseBasePriceList()
          If this is true, then the basePriceList will automatically be searched if the requested price is not found in the current price list.
 boolean isUseCache()
          If this is true, then the priceCache is used
 boolean isUseSkuOnly()
          This property controls whether or not a price is searched for using the sku only.
protected  RepositoryItem lookForPrice(RepositoryItem pPriceList, java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pParentSkuId)
          Build the query that searches the priceList for the price.
 void propertiesChanged(PropertiesChangedEvent pEvent)
          Listen for changes to price items
 void setAutomaticallyUseDefaultPriceList(boolean pAutomaticallyUseDefaultPriceList)
           
 void setBasePriceListPropertyName(java.lang.String pBasePriceListPropertyName)
           
 void setCommerceSitePropertiesManager(atg.commerce.multisite.CommerceSitePropertiesManager pCommerceSitePropertiesManager)
          Retrieve the value of the CommerceSitePropertiesManager
 void setComplexPriceItemType(java.lang.String pComplexPriceItemType)
           
 void setComplexPriceLevelsPropertyName(java.lang.String pComplexPriceLevelsPropertyName)
           
 void setComplexPricePropertyName(java.lang.String pComplexPricePropertyName)
           
 void setContextValueRetriever(ContextValueRetriever pContextValueRetriever)
          Retrieve the value of the ContextValueRetriever
 void setDefaultPriceListId(java.lang.String pDefaultPriceListId)
           
 void setDefaultSalePriceListId(java.lang.String pDefaultSalePriceListId)
           
 void setIgnoreProductFirst(boolean pIgnoreProductFirst)
           
 void setLevelPricePropertyName(java.lang.String pLevelPricePropertyName)
           
 void setListPricePropertyName(java.lang.String pListPricePropertyName)
           
 void setLocalePropertyName(java.lang.String pLocalePropertyName)
          Setter for the localePropertyName property of a price list.
 void setParentSkuIdPropertyName(java.lang.String pParentSkuIdPropertyName)
           
 void setPriceCache(Cache pPriceCache)
           
 void setPriceItemType(java.lang.String pPriceItemType)
           
 void setPriceLevelItemType(java.lang.String pPriceLevelItemType)
           
 void setPriceListIdPropertyName(java.lang.String pPriceListIdPropertyName)
           
 void setPriceListItemType(java.lang.String pPriceListItemType)
           
 void setPriceListPropertyName(java.lang.String pPriceListPropertyName)
           
 void setPriceListRepository(MutableRepository pPriceListRepository)
           
 void setPriceListViewName(java.lang.String pPriceListViewName)
           
 void setPriceViewName(java.lang.String pPriceViewName)
           
 void setPricingSchemePropertyName(java.lang.String pPricingSchemePropertyName)
           
 void setProductIdPropertyName(java.lang.String pProductIdPropertyName)
           
 void setProfileTools(CommerceProfileTools pProfileTools)
          Sets the property ProfileTools.
 void setQuantityPropertyName(java.lang.String pQuantityPropertyName)
           
 void setSaleComplexPrice(MutableRepositoryItem pPrice, java.util.List pLevelQuantities, java.util.List pLevelPrices)
          Deprecated. This method should not be used anymore. See the docs for instructions on implementing sales pricing
 void setSaleComplexPrice(MutableRepositoryItem pPrice, RepositoryItem pComplexPrice)
          Deprecated. This method should not be used anymore. See the docs for instructions on implementing sales pricing
 void setSaleComplexPricePropertyName(java.lang.String pSaleComplexPricePropertyName)
          Deprecated. This property is not used anymore
 void setSaleListPrice(MutableRepositoryItem pPrice, double pSalePrice)
          Deprecated. This method should not be used anymore. See the docs for instructions on implementing sales pricing
 void setSalePriceListPropertyName(java.lang.String pSalePriceListPropertyName)
          Set the sale price list property name.
 void setSalePricePropertyName(java.lang.String pSalePricePropertyName)
          Deprecated. This property is not used anymore
 void setSaleSubSkuPrice(MutableRepositoryItem pPrice, double pSalePrice)
          Deprecated. This method should not be used anymore. See the docs for instructions on implementing sales pricing
 void setSkuIdPropertyName(java.lang.String pSkuIdPropertyName)
           
 void setTransientPriceLevelIdGenerator(TransientIdGenerator pTransientIdGenerator)
           
 void setUseBasePriceList(boolean pUseBasePriceList)
           
 void setUseCache(boolean pUseCache)
           
 void setUseSkuOnly(boolean pUseSkuOnly)
           
 
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

LIST_PRICE

public static int LIST_PRICE

BULK_PRICE

public static int BULK_PRICE

TIERED_PRICE

public static int TIERED_PRICE

LIST_PRICE_STRING

public static java.lang.String LIST_PRICE_STRING

BULK_PRICE_STRING

public static java.lang.String BULK_PRICE_STRING

TIERED_PRICE_STRING

public static java.lang.String TIERED_PRICE_STRING

PROFILE_PRICE_LIST_PROPERTY_NAME

public static java.lang.String PROFILE_PRICE_LIST_PROPERTY_NAME

PRICE_LIST_ITEM_TYPE

public static java.lang.String PRICE_LIST_ITEM_TYPE

PRICE_ITEM_TYPE

public static java.lang.String PRICE_ITEM_TYPE

COMPLEX_PRICE_ITEM_TYPE

public static java.lang.String COMPLEX_PRICE_ITEM_TYPE

PRICE_LEVEL_ITEM_TYPE

public static java.lang.String PRICE_LEVEL_ITEM_TYPE

PRICE_LIST_ID_PROPERTY_NAME

public static java.lang.String PRICE_LIST_ID_PROPERTY_NAME

BASE_PRICE_LIST_PROPERTY_NAME

public static java.lang.String BASE_PRICE_LIST_PROPERTY_NAME

PRICE_LIST_PROPERTY_NAME

public static java.lang.String PRICE_LIST_PROPERTY_NAME

SALE_PRICE_LIST_PROPERTY_NAME

public static java.lang.String SALE_PRICE_LIST_PROPERTY_NAME

PRICING_SCHEME_PROPERTY_NAME

public static java.lang.String PRICING_SCHEME_PROPERTY_NAME

PRODUCT_ID_PROPERTY_NAME

public static java.lang.String PRODUCT_ID_PROPERTY_NAME

SKU_ID_PROPERTY_NAME

public static java.lang.String SKU_ID_PROPERTY_NAME

PARENT_SKU_ID_PROPERTY_NAME

public static java.lang.String PARENT_SKU_ID_PROPERTY_NAME

LIST_PRICE_PROPERTY_NAME

public static java.lang.String LIST_PRICE_PROPERTY_NAME

COMPLEX_PRICE_PROPERTY_NAME

public static java.lang.String COMPLEX_PRICE_PROPERTY_NAME

LOCALE_PROPERTY_NAME

public static java.lang.String LOCALE_PROPERTY_NAME

SALE_PRICE_PROPERTY_NAME

public static java.lang.String SALE_PRICE_PROPERTY_NAME
Deprecated. This property is not used anymore

SALE_COMPLEX_PRICE_PROPERTY_NAME

public static java.lang.String SALE_COMPLEX_PRICE_PROPERTY_NAME
Deprecated. This property is not used anymore

COMPLEX_PRICE_LEVELS_PROPERTY_NAME

public static java.lang.String COMPLEX_PRICE_LEVELS_PROPERTY_NAME

QUANTITY_PROPERTY_NAME

public static java.lang.String QUANTITY_PROPERTY_NAME

LEVEL_PRICE_PROPERTY_NAME

public static java.lang.String LEVEL_PRICE_PROPERTY_NAME

PRICE_VIEW_NAME

public static java.lang.String PRICE_VIEW_NAME

PRICE_LIST_VIEW_NAME

public static java.lang.String PRICE_LIST_VIEW_NAME

mTransientPriceLevelIdGenerator

protected TransientIdGenerator mTransientPriceLevelIdGenerator

mProfileTools

protected CommerceProfileTools mProfileTools
Constructor Detail

PriceListManager

public PriceListManager()
Method Detail

getTransientPriceLevelIdGenerator

public TransientIdGenerator getTransientPriceLevelIdGenerator()
Returns the id generator used to generate ids for the transient price level items that the calculator creates for a ItemPriceSource

This id generate must generate ids that do not conflict with the persisted price level items that might be deployed.

Returns:
TransientIdGenerator

setTransientPriceLevelIdGenerator

public void setTransientPriceLevelIdGenerator(TransientIdGenerator pTransientIdGenerator)

setProfileTools

public void setProfileTools(CommerceProfileTools pProfileTools)
Sets the property ProfileTools.


getProfileTools

public CommerceProfileTools getProfileTools()
Returns:
The value of the property ProfileTools.

setPriceCache

public void setPriceCache(Cache pPriceCache)

getPriceCache

public Cache getPriceCache()
This object caches price objects


setUseCache

public void setUseCache(boolean pUseCache)

isUseCache

public boolean isUseCache()
If this is true, then the priceCache is used


setAutomaticallyUseDefaultPriceList

public void setAutomaticallyUseDefaultPriceList(boolean pAutomaticallyUseDefaultPriceList)

isAutomaticallyUseDefaultPriceList

public boolean isAutomaticallyUseDefaultPriceList()
If this is true, and the profiles price list is null, then the default price list is automatically used The default is true


getDefaultPriceListId

public java.lang.String getDefaultPriceListId()
The id of the default price list


setDefaultPriceListId

public void setDefaultPriceListId(java.lang.String pDefaultPriceListId)

getDefaultPriceList

public RepositoryItem getDefaultPriceList()
The default price list


getDefaultPriceList

public RepositoryItem getDefaultPriceList(java.lang.String pPropertyName)
Returns the default price list from the given profile property name.

Parameters:
pPropertyName -
Returns:
price list item
See Also:
getDefaultPriceList(), getDefaultSalePriceList()

getDefaultSalePriceListId

public java.lang.String getDefaultSalePriceListId()
The id of the default price list


setDefaultSalePriceListId

public void setDefaultSalePriceListId(java.lang.String pDefaultSalePriceListId)

getDefaultSalePriceList

public RepositoryItem getDefaultSalePriceList()
The default price list


setPriceListRepository

public void setPriceListRepository(MutableRepository pPriceListRepository)

getPriceListRepository

public MutableRepository getPriceListRepository()
The repository that contains all the price lists


setPriceListItemType

public void setPriceListItemType(java.lang.String pPriceListItemType)

getPriceListItemType

public java.lang.String getPriceListItemType()
The name of the item-descriptor used for price lists


setPriceItemType

public void setPriceItemType(java.lang.String pPriceItemType)

getPriceItemType

public java.lang.String getPriceItemType()
The name of the item-descriptor used for prices


setComplexPriceItemType

public void setComplexPriceItemType(java.lang.String pComplexPriceItemType)

getComplexPriceItemType

public java.lang.String getComplexPriceItemType()
The name of the item-descriptor useb for complex prices


setPriceLevelItemType

public void setPriceLevelItemType(java.lang.String pPriceLevelItemType)

getPriceLevelItemType

public java.lang.String getPriceLevelItemType()
The name of the item-descriptor used for price levels


setUseBasePriceList

public void setUseBasePriceList(boolean pUseBasePriceList)

isUseBasePriceList

public boolean isUseBasePriceList()
If this is true, then the basePriceList will automatically be searched if the requested price is not found in the current price list. if this is false, then it is up to the user of PriceListManager to check the basePriceList. The default is true.


setIgnoreProductFirst

public void setIgnoreProductFirst(boolean pIgnoreProductFirst)

isIgnoreProductFirst

public boolean isIgnoreProductFirst()
This property controls the order that is used when looking for a price. if true Look for a price with the sku and a null product if that returns null, look for a price with the sku and the product if that returns null, look for a price with the product if that returns null, look for a price with the sku if false, Look for a price with the sku and the product if that returns null, look for a price with the sku and a null product if that returns null, look for a price with the product if that returns null, look for a price with the sku The default is true.


setUseSkuOnly

public void setUseSkuOnly(boolean pUseSkuOnly)

isUseSkuOnly

public boolean isUseSkuOnly()
This property controls whether or not a price is searched for using the sku only. The default is false.


setPriceListIdPropertyName

public void setPriceListIdPropertyName(java.lang.String pPriceListIdPropertyName)

getPriceListIdPropertyName

public java.lang.String getPriceListIdPropertyName()
The name of the property in priceList that contains the Id of the priceList.


setBasePriceListPropertyName

public void setBasePriceListPropertyName(java.lang.String pBasePriceListPropertyName)

getBasePriceListPropertyName

public java.lang.String getBasePriceListPropertyName()
The name of the property in priceList that contains the basePriceList


setPriceListPropertyName

public void setPriceListPropertyName(java.lang.String pPriceListPropertyName)

getPriceListPropertyName

public java.lang.String getPriceListPropertyName()
The name of the property in price that refers to the priceList


setSalePriceListPropertyName

public void setSalePriceListPropertyName(java.lang.String pSalePriceListPropertyName)
Set the sale price list property name.

Parameters:
pSalePriceListPropertyName - The name of the profile property for storing the assigned sale price list

getSalePriceListPropertyName

public java.lang.String getSalePriceListPropertyName()
Return name of the profile property for storing the assigned sale price list

Returns:
The name of the profile property for storing the assigned sale price list. Default salePriceList.

setPricingSchemePropertyName

public void setPricingSchemePropertyName(java.lang.String pPricingSchemePropertyName)

getPricingSchemePropertyName

public java.lang.String getPricingSchemePropertyName()
The name of the property in price that identifies the pricing scheme


setProductIdPropertyName

public void setProductIdPropertyName(java.lang.String pProductIdPropertyName)

getProductIdPropertyName

public java.lang.String getProductIdPropertyName()
The name of the property in price that identifies the product id


setSkuIdPropertyName

public void setSkuIdPropertyName(java.lang.String pSkuIdPropertyName)

getSkuIdPropertyName

public java.lang.String getSkuIdPropertyName()
The name of the property in price that identifies the sku id


setParentSkuIdPropertyName

public void setParentSkuIdPropertyName(java.lang.String pParentSkuIdPropertyName)

getParentSkuIdPropertyName

public java.lang.String getParentSkuIdPropertyName()
The name of the property in price that identifies the sku id


setListPricePropertyName

public void setListPricePropertyName(java.lang.String pListPricePropertyName)

getListPricePropertyName

public java.lang.String getListPricePropertyName()
The name of the property in price that identifies the list price


setComplexPricePropertyName

public void setComplexPricePropertyName(java.lang.String pComplexPricePropertyName)

getComplexPricePropertyName

public java.lang.String getComplexPricePropertyName()
The name of the property in price that identifies the complex price


setSalePricePropertyName

public void setSalePricePropertyName(java.lang.String pSalePricePropertyName)
Deprecated. This property is not used anymore


getSalePricePropertyName

public java.lang.String getSalePricePropertyName()
Deprecated. This property is not used anymore

The name of the property in price that represents the sale price


setSaleComplexPricePropertyName

public void setSaleComplexPricePropertyName(java.lang.String pSaleComplexPricePropertyName)
Deprecated. This property is not used anymore


getSaleComplexPricePropertyName

public java.lang.String getSaleComplexPricePropertyName()
Deprecated. This property is not used anymore

The name of the property in price that identifies the sale complex price


setComplexPriceLevelsPropertyName

public void setComplexPriceLevelsPropertyName(java.lang.String pComplexPriceLevelsPropertyName)

getComplexPriceLevelsPropertyName

public java.lang.String getComplexPriceLevelsPropertyName()
The name of the property in complex price that stores the list of levels


setQuantityPropertyName

public void setQuantityPropertyName(java.lang.String pQuantityPropertyName)

getQuantityPropertyName

public java.lang.String getQuantityPropertyName()
The name of the property in price levels for the quantity


setLevelPricePropertyName

public void setLevelPricePropertyName(java.lang.String pLevelPricePropertyName)

getLevelPricePropertyName

public java.lang.String getLevelPricePropertyName()
The name of the property in price levels for storing the price


setPriceListViewName

public void setPriceListViewName(java.lang.String pPriceListViewName)

getPriceListViewName

public java.lang.String getPriceListViewName()
The name of the view in the priceListRepository to use when searching for a price list


setPriceViewName

public void setPriceViewName(java.lang.String pPriceViewName)

getPriceViewName

public java.lang.String getPriceViewName()
The name of the view in the priceListRepository to use when searching for a price


setLocalePropertyName

public void setLocalePropertyName(java.lang.String pLocalePropertyName)
Setter for the localePropertyName property of a price list.

Parameters:
pLocalePropertyName - String property name for the locale property

getLocalePropertyName

public java.lang.String getLocalePropertyName()
Getter for the localePropertyName property of a price list.

Returns:
String property name for the locale property of a price list

getContextValueRetriever

public ContextValueRetriever getContextValueRetriever()
Set value of the ContextValueRetriever


setContextValueRetriever

public void setContextValueRetriever(ContextValueRetriever pContextValueRetriever)
Retrieve the value of the ContextValueRetriever


getCommerceSitePropertiesManager

public atg.commerce.multisite.CommerceSitePropertiesManager getCommerceSitePropertiesManager()
Set value of the commerce site properties Manager


setCommerceSitePropertiesManager

public void setCommerceSitePropertiesManager(atg.commerce.multisite.CommerceSitePropertiesManager pCommerceSitePropertiesManager)
Retrieve the value of the CommerceSitePropertiesManager


createPriceList

public RepositoryItem createPriceList()
                               throws PriceListException
Creates a new price list in the priceListRepository The priceListItemType is used. if there is an error, null is returned.

Returns:
The new repositoryItem
Throws:
PriceListException

getPriceList

public RepositoryItem getPriceList(RepositoryItem pProfile,
                                   java.lang.String pProfilePropertyName)
                            throws PriceListException
Return the price list from the profile. If it's null and automaticallyUseDefaultPriceList is true, then return the default price list.

Parameters:
pProfile - the profile to use
pProfilePropertyName - The name of the property in the profile that contains the price list
Returns:
The priceList
Throws:
PriceListException

getPriceList

public RepositoryItem getPriceList(RepositoryItem pProfile,
                                   java.lang.String pProfilePropertyName,
                                   boolean pUseDefaultPriceList)
                            throws PriceListException
Return the price list from the profile. If it's null and pUseDefaultPriceList is true, then return the default price list.

Parameters:
pProfile - the profile to use
pProfilePropertyName - The name of the property in the profile that contains the price list
pUseDefaultPriceList - If true, use the default price list, if the profile contains null.
Returns:
The priceList
Throws:
PriceListException

getPriceLists

public java.util.Collection getPriceLists()
                                   throws PriceListException
Get all the price lists.

Returns:
The Collection of price list repository items
Throws:
PriceListException

getPriceLists

public java.util.Collection getPriceLists(int pStartingIndex,
                                          int pEndingIndex,
                                          SortDirectives pSortDirectives)
                                   throws PriceListException
Get all the price lists.

Returns:
The Collection of price list repository items
Throws:
PriceListException

getPriceListsCount

public int getPriceListsCount()
                       throws PriceListException
Get count of all price lists.

Returns:
count of all price lists
Throws:
PriceListException

getPriceList

public RepositoryItem getPriceList(java.lang.String pId)
                            throws PriceListException
Get the price list with the given id from the repository The priceListItemType is used as the item-descriptor name

Parameters:
pId - the id of the price list
Returns:
The RepositoryItem for the priceList
Throws:
PriceListException

createPrice

public RepositoryItem createPrice(RepositoryItem pPriceList,
                                  java.lang.String pPricingScheme)
                           throws PriceListException
create a new price with the given pricing scheme The price isn't actually set

Parameters:
pPriceList - The price lists containing this price.
pPricingScheme - the type of price (LIST_PRICE_STRING, BULK_PRICE_STRING, or TIERED_PRICE_STRING)
Throws:
PriceListException

createPrice

public RepositoryItem createPrice(RepositoryItem pPriceList,
                                  java.lang.String pPricingScheme,
                                  java.lang.String pProductId,
                                  java.lang.String pSkuId)
                           throws PriceListException
Create a new price with the given pricing scheme. Also set its product id and sku id properties.

Parameters:
pPriceList - The price list containing this price.
pProductId - The product id that this price applies to
pSkuId - The sku id that this price applies to
pPricingScheme - the type of price (LIST_PRICE_STRING, BULK_PRICE_STRING, or TIERED_PRICE_STRING)
Throws:
PriceListException

createListPrice

public RepositoryItem createListPrice(RepositoryItem pPriceList,
                                      java.lang.String pProductId,
                                      java.lang.String pSkuId,
                                      double pListPrice)
                               throws PriceListException
Create a price for the given product/sku pair with a list price and store it in the price list.

Parameters:
pPriceList - The price list containing this price
pProductId - The product id that this price applies to
pSkuId - The sku id that this price applies to
pListPrice - The list price
Returns:
The new price repository item
Throws:
PriceListException

createSubSkuPrice

public RepositoryItem createSubSkuPrice(RepositoryItem pPriceList,
                                        java.lang.String pProductId,
                                        java.lang.String pSkuId,
                                        java.lang.String pParentSkuId,
                                        double pListPrice)
                                 throws PriceListException
Create a price for the given product/sku/parentSku set with a list price and store it in the price list.

Parameters:
pPriceList - The price list containing this price
pProductId - The product id that this price applies to
pSkuId - The sku id that this price applies to
pParentSkuId - The sku id of the parent item that this price applies to
pListPrice - The list price
Returns:
The new price repository item
Throws:
PriceListException

createPriceWithComplexPrice

public RepositoryItem createPriceWithComplexPrice(RepositoryItem pPriceList,
                                                  java.lang.String pProductId,
                                                  java.lang.String pSkuId,
                                                  java.util.List pLevelQuantities,
                                                  java.util.List pLevelPrices,
                                                  java.lang.String pPricingScheme)
                                           throws PriceListException
Create a price for the given product/sku pair with a complex price and store it in the price list. This also creates a list of price levels with the given quantities and prices.

Parameters:
pPriceList - The price list containing this price.
pProductId - The product id that this price applies to
pSkuId - The sku id that this price applies to
pLevelQuantities - An array with the list of quantities for each level.
pLevelPrices - An array of the same length as pLevelQuantities with the list of prices for each level.
pPricingScheme - the type of price (LIST_PRICE_STRING, BULK_PRICE_STRING, or TIERED_PRICE_STRING)
Returns:
The new price repository item
Throws:
PriceListException - if pPricingScheme is not bulk or tiered

createComplexPrice

public RepositoryItem createComplexPrice()
                                  throws PriceListException
Creates an empty complex price in the repository The complexPriceItemType is used.

Returns:
The new repository item
Throws:
PriceListException

createComplexPrice

public RepositoryItem createComplexPrice(java.util.List pQuantities,
                                         java.util.List pLevelPrices)
                                  throws PriceListException
Creates an empty complex price in the repository The complexPriceItemType is used. This also creates a list of PriceLevels with the given quantities and prices.

Parameters:
pQuantities - The list of quantities for each level
pLevelPrice - The list of prices for each level
Returns:
The new repository item
Throws:
PriceListException

setSaleListPrice

public void setSaleListPrice(MutableRepositoryItem pPrice,
                             double pSalePrice)
                      throws PriceListException
Deprecated. This method should not be used anymore. See the docs for instructions on implementing sales pricing

Set the sale list price of the repository item pPrice

Parameters:
pPrice - the price repository item
pSalePrice - The sale price
Throws:
PriceListException

setSaleSubSkuPrice

public void setSaleSubSkuPrice(MutableRepositoryItem pPrice,
                               double pSalePrice)
                        throws PriceListException
Deprecated. This method should not be used anymore. See the docs for instructions on implementing sales pricing

Set the sale list price of the repository item pPrice

Parameters:
pPrice - the price repository item
pSalePrice - The sale price
Throws:
PriceListException

setSaleComplexPrice

public void setSaleComplexPrice(MutableRepositoryItem pPrice,
                                RepositoryItem pComplexPrice)
                         throws PriceListException
Deprecated. This method should not be used anymore. See the docs for instructions on implementing sales pricing

Set the sale complex (bulk or tiered) price of the repository item pPrice

Parameters:
pPrice - the price repository item
pComplexPrice - The sale complex price
Throws:
PriceListException

setSaleComplexPrice

public void setSaleComplexPrice(MutableRepositoryItem pPrice,
                                java.util.List pLevelQuantities,
                                java.util.List pLevelPrices)
                         throws PriceListException
Deprecated. This method should not be used anymore. See the docs for instructions on implementing sales pricing

Set the sale complex price of the repository item pPrice with a newly create complex price with the given information

Parameters:
pPrice - the price repository item
pLevelQuantities - the quantities for each of the levels in the complex price
pLevelPrices - the prices for each of the levels in the complex price
pSalePrice - The sale price
Throws:
PriceListException

addPriceLevel

public RepositoryItem addPriceLevel(RepositoryItem pComplexPrice,
                                    long pQuantity,
                                    double pPrice)
                             throws PriceListException
add a price level to the given complex price This could be intelligent and squeeze this into the list based on the quantity, but should probably leave that to the user, and just place it at the end.

Parameters:
pComplexPrice - The repository item to add the level to
pQuantity - the quantity for the level
pPrice - the price of the level
Returns:
The newly created PriceLevel repositoryItem
Throws:
PriceListException

addPriceLevel

public RepositoryItem addPriceLevel(RepositoryItem pComplexPrice,
                                    java.lang.Long pQuantity,
                                    java.lang.Double pPrice)
                             throws PriceListException
add a price level to the given complex price This could be intelligent and squeeze this into the list based on the quantity, but should probably leave that to the user, and just place it at the end.

Parameters:
pComplexPrice - The repository item to add the level to
pQuantity - the quantity for the level
pPrice - the price of the level
Returns:
The newly created PriceLevel repositoryItem
Throws:
PriceListException

createPriceLevel

public MutableRepositoryItem createPriceLevel(java.lang.String pId,
                                              java.lang.String pType)
                                       throws RepositoryException
creates a new transient price level repository with the given id and type.

Parameters:
pId - the optional id to use for the new item
pType - the optional type to create. if null, the configurable priceLevelItemType is used.
Returns:
new transient price level item
Throws:
RepositoryException

getPrice

public RepositoryItem getPrice(java.lang.String pPriceListId,
                               java.lang.String pProductId,
                               java.lang.String pSkuId)
                        throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceListId - The if of the priceList to look in
pProductId - The id of the product we are interested in. Can be null
pSkuId - The id of the sku we are interested in. Can be null.
Throws:
PriceListException

getPrice

public RepositoryItem getPrice(java.lang.String pPriceListId,
                               java.lang.String pProductId,
                               java.lang.String pSkuId,
                               boolean pUseCache)
                        throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceListId - The if of the priceList to look in
pProductId - The id of the product we are interested in. Can be null
pSkuId - The id of the sku we are interested in. Can be null.
pUseCache - If this is true, get the cached value.
Throws:
PriceListException

getPrice

public RepositoryItem getPrice(java.lang.String pPriceListId,
                               java.lang.String pProductId,
                               java.lang.String pSkuId,
                               java.lang.String pParentSkuId)
                        throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceListId - The if of the priceList to look in
pProductId - The id of the product we are interested in. Can be null
pSkuId - The id of the sku we are interested in. Can be null.
pParentSkuId - The id of the parent sku we are interested in. Can be null.
Throws:
PriceListException

getPrice

public RepositoryItem getPrice(java.lang.String pPriceListId,
                               java.lang.String pProductId,
                               java.lang.String pSkuId,
                               java.lang.String pParentSkuId,
                               boolean pUseCache)
                        throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceListId - The if of the priceList to look in
pProductId - The id of the product we are interested in. Can be null
pSkuId - The id of the sku we are interested in. Can be null.
pParentSkuId - The id of the parent sku we are interested in. Can be null.
pUseCache - If this is true, get the cached value.
Throws:
PriceListException

getPrice

public RepositoryItem getPrice(RepositoryItem pPriceList,
                               RepositoryItem pProduct,
                               RepositoryItem pSku)
                        throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceList - The priceList to look in
pProduct - The product we are interested in. Can be null
pSku - The sku we are interested in. Can be null.
Throws:
PriceListException

getPrice

public RepositoryItem getPrice(RepositoryItem pPriceList,
                               RepositoryItem pProduct,
                               RepositoryItem pSku,
                               boolean pUseCache)
                        throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceList - The priceList to look in
pProduct - The product we are interested in. Can be null
pSku - The sku we are interested in. Can be null.
pUseCache - If this is true, get the cached value.
Throws:
PriceListException

getPrice

public RepositoryItem getPrice(RepositoryItem pPriceList,
                               RepositoryItem pProduct,
                               RepositoryItem pSku,
                               RepositoryItem pParentSku)
                        throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceList - The priceList to look in
pProduct - The product we are interested in. Can be null
pSku - The sku we are interested in. Can be null.
pParentSku - The sku of the parent we are interested in. Can be null.
Throws:
PriceListException

getPrice

public RepositoryItem getPrice(RepositoryItem pPriceList,
                               RepositoryItem pProduct,
                               RepositoryItem pSku,
                               RepositoryItem pParentSku,
                               boolean pUseCache)
                        throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceList - The priceList to look in
pProduct - The product we are interested in. Can be null
pSku - The sku we are interested in. Can be null.
pParentSku - The sku of the parent we are interested in. Can be null.
pUseCache - If this is true, get the cached value.
Throws:
PriceListException

getPrice

public RepositoryItem getPrice(RepositoryItem pPriceList,
                               java.lang.String pProductId,
                               java.lang.String pSkuId)
                        throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceList - The priceList to look in
pProductId - The id of the product we are interested in. Can be null
pSkuId - The id of the sku we are interested in. Can be null.
Throws:
PriceListException

getPrice

public RepositoryItem getPrice(RepositoryItem pPriceList,
                               java.lang.String pProductId,
                               java.lang.String pSkuId,
                               boolean pUseCache)
                        throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceList - The priceList to look in
pProductId - The id of the product we are interested in. Can be null
pSkuId - The id of the sku we are interested in. Can be null.
pUseCache - If this is true, get the cached value.
Throws:
PriceListException

getPrice

public RepositoryItem getPrice(RepositoryItem pPriceList,
                               java.lang.String pProductId,
                               java.lang.String pSkuId,
                               java.lang.String pParentSkuId)
                        throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceList - The priceList to look in
pProductId - The id of the product we are interested in. Can be null
pSkuId - The id of the sku we are interested in. Can be null.
pParentSku - The sku of the parent we are interested in.
Throws:
PriceListException

getPrice

public RepositoryItem getPrice(RepositoryItem pPriceList,
                               java.lang.String pProductId,
                               java.lang.String pSkuId,
                               java.lang.String pParentSkuId,
                               boolean pUseCache)
                        throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceList - The priceList to look in
pProductId - The id of the product we are interested in. Can be null
pSkuId - The id of the sku we are interested in. Can be null.
pParentSku - The sku of the parent we are interested in.
pUseCache - If this is true, get the cached value.
Throws:
PriceListException

getUncachedPrice

protected RepositoryItem getUncachedPrice(RepositoryItem pPriceList,
                                          java.lang.String pProductId,
                                          java.lang.String pSkuId,
                                          java.lang.String pParentSkuId)
                                   throws PriceListException
According to the value of ignoreProductFirst calls the various getPrice methods until a price is found or all the methods have been tried. If useBasePriceList is true then the basePriceList is searched if a price is not found in the current priceList.

Parameters:
pPriceList - The priceList to look in
pProductId - The id of the product we are interested in. Can be null
pSkuId - The id of the sku we are interested in. Can be null.
pParentSku - The sku of the parent we are interested in.
Throws:
PriceListException
See Also:
lookForPrice(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String)

getSkuPrice

public RepositoryItem getSkuPrice(RepositoryItem pPriceList,
                                  java.lang.String pSkuId)
                           throws PriceListException
Return the price repository item for the given sku id in the given priceList. To be returned the product must have a null product Id. The basePriceList is not consulted.

Parameters:
pPriceList - The priceList to search in
pSkuId - The sku id to search for
Returns:
The price repositoryItem
Throws:
PriceListException

getSkuPrice

public RepositoryItem getSkuPrice(RepositoryItem pPriceList,
                                  java.lang.String pProductId,
                                  java.lang.String pSkuId)
                           throws PriceListException
Return the price repository item for the given product id and sku id in the given priceList. The basePriceList is not consulted.

Parameters:
pPriceList - The priceList to search in
pProductId - The product id to search for
pSkuId - The sku id to search for
Returns:
The price repositoryItem
Throws:
PriceListException

getProductPrice

public RepositoryItem getProductPrice(RepositoryItem pPriceList,
                                      java.lang.String pProductId)
                               throws PriceListException
Return the price repository item for the given product id in the given priceList. To be returned the product must have a null sku Id. The basePriceList is not consulted.

Parameters:
pPriceList - The priceList to search in
pProductId - The product id to search for
Returns:
The price repositoryItem
Throws:
PriceListException

getSkuPrice

public RepositoryItem getSkuPrice(RepositoryItem pPriceList,
                                  java.lang.String pProductId,
                                  java.lang.String pSkuId,
                                  java.lang.String pParentSkuId)
                           throws PriceListException
Return the price repository item for the given product id, sku id, and parent sku id in the given priceList. The basePriceList is not consulted.

Parameters:
pPriceList - The priceList to search in
pProductId - The product id to search for
pSkuId - The sku id to search for
pParentSkuId - The parent sku id to search for
Returns:
The price repositoryItem
Throws:
PriceListException

lookForPrice

protected RepositoryItem lookForPrice(RepositoryItem pPriceList,
                                      java.lang.String pProductId,
                                      java.lang.String pSkuId,
                                      java.lang.String pParentSkuId)
                               throws PriceListException
Build the query that searches the priceList for the price. If pProduct, pSku, or pParentSku is null, it is not ignored. The corresponding property in the price must also be null to be returned by the query. The query is then executed and the result is returned. An error is logged if the query returns more than one price. In that case, the first price in the result set is returned.

Parameters:
pPriceList - The pricelist to search in
pProductId - The product value to use. May be null
pSkuId - The sku value to use. May be null
pParentSkuId - The parent sku value to use. May be null
Returns:
A price repository item
Throws:
PriceListException

getComplexPrice

public RepositoryItem getComplexPrice(java.lang.String pComplexPriceId)
                               throws PriceListException
Get the repository item for the complex price with the given id

Throws:
PriceListException

getProductPrices

public java.util.Collection getProductPrices(java.lang.String pPriceListId,
                                             java.util.List pProductIds,
                                             boolean pIncludeSkuPrices)
                                      throws PriceListException
Return all the prices where the sku id is null, and the product id is in the given list, for the given priceList. Prices will NOT be sorted.

Parameters:
pPriceListId - The priceList whose prices will be returned
pProductIds - The list of product ids whose prices are returned
pIncudeSkuPrices - If false, then only prices with a null skuId are returned
Returns:
A list of price repository items
Throws:
PriceListException

getProductPrices

public java.util.Collection getProductPrices(java.lang.String pPriceListId,
                                             java.util.List pProductIds,
                                             boolean pIncludeSkuPrices,
                                             boolean pUseCache)
                                      throws PriceListException
Return all the prices where the sku id is null, and the product id is in the given list, for the given priceList. Prices will NOT be sorted.

Parameters:
pPriceListId - The priceList whose prices will be returned
pProductIds - The list of product ids whose prices are returned
pIncudeSkuPrices - If false, then only prices with a null skuId are returned
pUseCache - If this is true, get the cached value.
Returns:
A list of price repository items
Throws:
PriceListException

getPriceAdmin

public RepositoryItem getPriceAdmin(java.lang.String pPriceListId,
                                    java.lang.String pProductId,
                                    java.lang.String pSkuId,
                                    java.lang.String pParentSkuId)
                             throws PriceListException
This method is similar to LookForPrice except that it will continue to look in the base price list if the price is not found.

Parameters:
pPriceListId - The priceList whose price will be returned (or its base price)
pProductId - The product id whose price is returned
pSkuId - The sku id whose price is returned
pParentSkuId - The parent sku id for the price returned.
Returns:
A price repository item
Throws:
PriceListException

getUncachedProductPrices

protected RepositoryItem[] getUncachedProductPrices(java.lang.String pPriceListId,
                                                    java.util.List pProductIds,
                                                    boolean pIncludeSkuPrices)
                                             throws PriceListException
This will execute a query within a single priceList for product prices. It will not search the basePriceList. If pIncludeSkuPrices is false then the sku of each price will be null.

Parameters:
pPriceListId - The priceList whose prices will be returned
pProductIds - The list of product ids whose prices are returned
pIncudeSkuPrices - If false, then only prices with a null skuId are returned
Returns:
An array of price repository items
Throws:
PriceListException

getSkuPrices

public java.util.Collection getSkuPrices(java.lang.String pPriceListId,
                                         java.util.List pSkuIds,
                                         boolean pExpandConfigurableSkus)
                                  throws PriceListException
Return all the prices where the sku id is in the given list. Prices will NOT be sorted. Prices must have a null product id to be returned.

Parameters:
pPriceListId - The priceList whose prices will be returned
pSkuIds - The list of sku ids whose prices are returned
pExpandConfigurableSkus - If true, then prices with a parent sku in the list are also returned
Returns:
A list of price repository items
Throws:
PriceListException

getSkuPrices

public java.util.Collection getSkuPrices(java.lang.String pPriceListId,
                                         java.util.List pSkuIds,
                                         boolean pExpandConfigurableSkus,
                                         boolean pUseCache)
                                  throws PriceListException
Return all the prices where the sku id is in the given list. Prices will NOT be sorted. Prices must have a null product id to be returned.

Parameters:
pPriceListId - The priceList whose prices will be returned
pSkuIds - The list of sku ids whose prices are returned
pExpandConfigurableSkus - If true, then prices with a parent sku in the list are also returned
pUseCache - If this is true, get the cached value.
Returns:
A list of price repository items
Throws:
PriceListException

getUncachedSkuPrices

protected RepositoryItem[] getUncachedSkuPrices(java.lang.String pPriceListId,
                                                java.util.List pSkuIds,
                                                boolean pExpandConfigurableSkus)
                                         throws PriceListException
This will execute a query within a single priceList for sku prices. It will not search the basePriceList. If pExpandConfigurableSkus is true then prices where the parentSkuId is in the list will also be returned. Only prices with a null product id are returned.

Parameters:
pPriceListId - The priceList whose prices will be returned
pSkuIds - The list of sku ids whose prices are returned
pExpandConfigurableSkus - If true, then prices with a parent sku in the list are also returned
Returns:
An array of price repository items
Throws:
PriceListException

getAllPrices

public RepositoryItem[] getAllPrices(java.lang.String pPriceListId)
                              throws PriceListException
This will execute a query within a single priceList for all prices directly attached to this pricelist. It will not search the basePriceList.

Parameters:
pPriceListId - The priceList whose prices will be returned
Returns:
An array of price repository items
Throws:
PriceListException

getDescendantPriceLists

public java.util.Collection getDescendantPriceLists(RepositoryItem pPriceList)
                                             throws PriceListException
Given a price list, this method will return all the descendant price lists. (These are price lists whose basePriceList is the given price list, or whose basePriceList's basePriceList is the given priceList, etc.

Parameters:
pPriceList - The priceList whose descendants will be returned
Returns:
a Collection of the descendant priceLists.
Throws:
PriceListException

getFirstDescendantPriceLists

public java.util.Collection getFirstDescendantPriceLists(RepositoryItem pPriceList)
                                                  throws PriceListException
Given a price list, this method will return all the first level of descendant price lists. (These are price lists whose basePriceList is the given price list)

Parameters:
pPriceList - The priceList whose descendants will be returned
Returns:
a Collection of the descendant priceLists.
Throws:
PriceListException

getAncestorPriceLists

public java.util.List getAncestorPriceLists(RepositoryItem pPriceList)
                                     throws PriceListException
Given a price list, this method will return all the ancestor price lists. (The given pricelist's base price list, the base price list's base price list, etc.

Parameters:
pPriceList - The priceList whose ancestors will be returned
Returns:
a Collection of the ancestor priceLists.
Throws:
PriceListException

propertiesChanged

public void propertiesChanged(PropertiesChangedEvent pEvent)
Listen for changes to price items

Specified by:
propertiesChanged in interface PropertiesChangedListener

doStartService

public void doStartService()
                    throws ServiceException
GenericService override

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

isItemInPriceList

public boolean isItemInPriceList(java.lang.String pProductId,
                                 java.lang.String pSkuId,
                                 java.lang.String pPriceListId)
Determines if a product/sku can be priced using a specific price list.

Parameters:
pProductId -
pSkuId -
pPriceListId -
Returns:
true if a price was found

getPriceListLocale

public java.util.Locale getPriceListLocale(RepositoryItem pPriceList)
Get the price list locale from the passed in price list repository item.

Parameters:
pPriceList - RepositoryItem price list
Returns:
Locale of the passed in price list

getPriceListForSite

public RepositoryItem getPriceListForSite(java.lang.String pPriceListPropertyName)
                                   throws RepositoryException
Obtains the price list for the current site.

Parameters:
pPriceLisPropertyName - the name of the price list property to get from the site
Returns:
The price list for the current site
Throws:
RepositoryException
PriceListException

getPriceListForSite

public RepositoryItem getPriceListForSite(RepositoryItem pSite,
                                          java.lang.String pPriceListPropertyName)
                                   throws RepositoryException
Obtains a price list for the passed site.

Parameters:
pSite - site to obtain the price list from
pPriceLisPropertyName - the name of the price list property to get from the site
Returns:
The price list for the given site
Throws:
PriceListException
RepositoryException

determinePriceList

public RepositoryItem determinePriceList(RepositoryItem pProfile,
                                         RepositoryItem pSite,
                                         java.lang.String pPriceListPropertyName)
                                  throws RepositoryException
Determines the appropriate price list to get based on profile and site. The determination is made by the configured ContextValueRetriever component.

Parameters:
pProfile - Profile to get the price list for
pSite - Site to get the price list from
pPriceLisPropertyName - the name of the profile price list property to determine
Returns:
The proper price list to use for the given parameters
Throws:
RepositoryException

determinePriceList

public RepositoryItem determinePriceList(atg.commerce.util.ContextValueRetrieverArguments pArguments,
                                         java.lang.String pPriceListPropertyName)
                                  throws RepositoryException
Determines the appropriate price list to get based on properties stored in arguments object. The determination is made by the configured ContextValueRetriever component.

Parameters:
pContext - an object containing properties, such as site and profile, needed to determine what catalog to use
pPriceLisPropertyName - the name of the profile price list property to determine
Returns:
The proper price list to use for the given parameters.
Throws:
RepositoryException

getPriceFromItem

public java.lang.Double getPriceFromItem(ItemPriceSource pItemPriceSource,
                                         RepositoryItem pPriceItem,
                                         long pQuantity)
                                  throws PricingException
Gets the price from a price repository item. If the pricing scheme is volume based then the price levels are looked up for the given quantity. For tiered pricing the price returned is the price at the quantity level.

Parameters:
pItemPriceSource - ItemPriceSource to use if specified
pPriceItem - RepositoryItem price
pQuantity - long quantity to use for volume prices, -1 to get the price for the maximum quantity level
Returns:
Double price if found or null
Throws:
PricingException

getPriceLevelsFromItem

public java.util.List<RepositoryItem> getPriceLevelsFromItem(ItemPriceSource pItemPriceSource,
                                                             RepositoryItem pPriceItem)
                                                      throws PricingException
Gets the price levels from a complex price sorted by quantity.

Parameters:
pItemPriceSource - ItemPriceSource to use if specified
pPriceItem - RepositoryItem price item containing a complex price item
Returns:
List of RepositoryItem price items sorted in quantity order.
Throws:
PricingException - if null complex price item or no levels