public class Europe1PriceFactory extends GeneratedEurope1PriceFactory
Modifier and Type | Class and Description |
---|---|
protected static class |
Europe1PriceFactory.CachedTax |
protected static class |
Europe1PriceFactory.CachedTaxValue |
protected class |
Europe1PriceFactory.DiscountRowMatchComparator
Used for ordering discount rows in discount priority order.
|
protected class |
Europe1PriceFactory.PriceRowInfoComparator
Used for ordering price rows in best match order.
|
protected class |
Europe1PriceFactory.PriceRowMatchComparator
Used for ordering price rows in best match order.
|
protected class |
Europe1PriceFactory.TaxRowMatchComparator
Used for ordering discount rows in discount priority order.
|
Extension.RestrictedLanguagesProvider, Extension.RightsProvider
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator
Modifier and Type | Field and Description |
---|---|
static long |
MATCH_ANY |
static long |
MATCH_BY_PRODUCT_ID |
static String |
USE_FAST_ALGORITHMS
Enables/disabled fast query mode for getting product price, tax and discount rows.
|
DEFAULT_INITIAL_ATTRIBUTES
Constructor and Description |
---|
Europe1PriceFactory() |
Modifier and Type | Method and Description |
---|---|
protected Date |
adjustDate(Date date)
Cut (set to zero) specific parts of a Date field to allow caching of time based pricing.
|
protected void |
appendProductConditions(StringBuilder query,
String alias,
Product product,
EnumerationValue productGroup,
Map values,
String pgConstant) |
protected void |
appendUserConditions(StringBuilder query,
String alias,
User user,
EnumerationValue userGroup,
Map values,
String ugConst) |
void |
beforeItemCreation(SessionContext ctx,
ComposedType type,
Item.ItemAttributeMap attributes)
This method will be called before an item is created BUT AFTER the default values of this type are assigned
|
void |
checkAllDiscountRows()
Deprecated.
|
void |
checkAllDiscountRows(SessionContext ctx)
Deprecated.
|
void |
checkAllGlobalDiscountRows()
Deprecated.
|
void |
checkAllGlobalDiscountRows(SessionContext ctx)
Deprecated.
|
void |
checkAllPriceRows()
Deprecated.
|
void |
checkAllPriceRows(SessionContext ctx)
Deprecated.
|
void |
checkAllTaxRows()
Deprecated.
|
void |
checkAllTaxRows(SessionContext ctx)
Deprecated.
|
protected void |
checkBeforeItemRemoval(SessionContext ctx,
Item item)
Superclass method overridden to avoid call to EJB layer
|
DiscountRow |
createDiscountRow(Product product,
EnumerationValue productPriceGroup,
User user,
EnumerationValue userPriceGroup,
Currency currency,
Double value,
DateRange dateRange,
Discount discount)
Creates a new DiscountRow.
|
DiscountRow |
createDiscountRow(SessionContext ctx,
Product product,
EnumerationValue productPriceGroup,
User user,
EnumerationValue userPriceGroup,
Currency currency,
Double value,
DateRange dateRange,
Discount discount)
Same as createDiscountRow(Product,String,User,String,Currency,boolean,double,DateRange,Discount)} but for a
specific SessionContext.
|
void |
createEssentialData(Map params,
JspContext jspc) |
GlobalDiscountRow |
createGlobalDiscountRow(SessionContext ctx,
User user,
EnumerationValue userPriceGroup,
Currency currency,
Double value,
DateRange dateRange,
Discount discount)
Same as createGlobalDiscountRow(User,String,Currency,boolean,double,DateRange,Discount)} but for a specific
SessionContext.
|
GlobalDiscountRow |
createGlobalDiscountRow(User user,
EnumerationValue userPriceGroup,
Currency currency,
Double value,
DateRange dateRange,
Discount discount)
Creates a new global DiscountRow.
|
PriceRow |
createPriceRow(Product product,
EnumerationValue productPriceGroup,
User user,
EnumerationValue userPriceGroup,
long minQuantity,
Currency currency,
Unit unit,
int unitFactor,
boolean net,
DateRange dateRange,
double price)
Creates a new PriceRow.
|
PriceRow |
createPriceRow(Product product,
EnumerationValue productPriceGroup,
User user,
EnumerationValue userPriceGroup,
long minQuantity,
Currency currency,
Unit unit,
int unitFactor,
boolean net,
DateRange dateRange,
double price,
EnumerationValue channel)
Overloaded method to support Channel dimension to PriceRow.
|
PriceRow |
createPriceRow(SessionContext ctx,
Product product,
EnumerationValue productPriceGroup,
User user,
EnumerationValue userPriceGroup,
long minQuantity,
Currency currency,
Unit unit,
int unitFactor,
boolean net,
DateRange dateRange,
double price)
Same as
createPriceRow(Product,EnumerationValue,User,EnumerationValue,long,Currency,Unit,int,boolean,DateRange,double)
but with specific SessionContext. |
PriceRow |
createPriceRow(SessionContext ctx,
Product product,
EnumerationValue productPriceGroup,
User user,
EnumerationValue userPriceGroup,
long minQuantity,
Currency currency,
Unit unit,
int unitFactor,
boolean net,
DateRange dateRange,
double price,
EnumerationValue channel)
Same as
createPriceRow(Product,EnumerationValue,User,EnumerationValue,long,Currency,Unit,int,boolean,DateRange,double,EnumerationValue)
but with specific SessionContext. |
EnumerationValue |
createProductTaxGroup(String code) |
void |
createProjectData(Map params,
JspContext jspc) |
TaxRow |
createTaxRow(Product product,
EnumerationValue productPriceGroup,
User user,
EnumerationValue userPriceGroup,
Tax tax)
Deprecated.
please use
createTaxRow(Product,EnumerationValue,User,EnumerationValue,Tax,DateRange,Double)
to specify all values ( here DateRange and Value are set to null ) |
TaxRow |
createTaxRow(Product product,
EnumerationValue productPriceGroup,
User user,
EnumerationValue userPriceGroup,
Tax tax,
DateRange dateRange,
Double value)
Creates a new TaxRow.
|
TaxRow |
createTaxRow(SessionContext ctx,
Product product,
EnumerationValue productPriceGroup,
User user,
EnumerationValue userPriceGroup,
Tax tax,
DateRange dateRange,
Double value)
Same as createTaxRow(Product,String,User,String,Tax,boolean)} but for a specific SessionContext.
|
EnumerationValue |
createUserPriceGroup(String code) |
EnumerationValue |
createUserTaxGroup(String code) |
protected String |
extractProductId(Product product) |
protected String |
extractProductId(SessionContext ctx,
Product product) |
protected void |
fillTaxCache()
Fills private cache with catalog version aware tax entries
|
protected List<? extends AbstractDiscountRow> |
filterDiscountRows4Price(Collection<? extends AbstractDiscountRow> rows,
Date date)
Filters discount rows which do not match the given parameters.
|
protected List<PriceRow> |
filterPriceRows(List<PriceRow> priceRows)
Removes price rows from set of matching rows if they will never be applicable.
|
protected List<PriceRow> |
filterPriceRows4Info(Collection<PriceRow> rows,
Currency curr,
Date date,
PriceRowChannel channel)
Filters price rows which do not match the given parameters.
|
protected List<PriceRow> |
filterPriceRows4Price(Collection<PriceRow> rows,
long _quantity,
Unit unit,
Currency curr,
Date date,
boolean giveAwayMode,
PriceRowChannel channel)
Filters price rows which do not match the given parameters.
|
protected List<TaxRow> |
filterTaxRows4Price(Collection<TaxRow> rows,
Date date)
Filters tax rows which do not match the given parameters.
|
ProductPriceInformations |
getAllPriceInformations(SessionContext ctx,
Product product,
Date date,
boolean net)
Calculates a product price quote containing all applicable prices, discounts and taxes for the given product and
net/gross state.
|
PriceValue |
getBasePrice(AbstractOrderEntry entry)
override to define the base price of an order entry
|
protected Collection<Europe1PriceFactory.CachedTaxValue> |
getCachedTaxes(Product product,
EnumerationValue productTaxGroup,
User user,
EnumerationValue userTaxGroup,
Date date)
Reads the private cache of catalog version aware tax entries.
|
protected DiscountRow |
getCounterpartItem(SessionContext ctx,
DiscountRow discountrow,
CatalogVersion targetVersion) |
protected PriceRow |
getCounterpartItem(SessionContext ctx,
PriceRow pricerow,
CatalogVersion targetVersion) |
protected TaxRow |
getCounterpartItem(SessionContext ctx,
TaxRow taxrow,
CatalogVersion targetVersion) |
protected List |
getDiscountInformations(Product product,
EnumerationValue productGroup,
User user,
EnumerationValue userGroup,
Currency curr,
Date date) |
List |
getDiscountValues(AbstractOrder order)
override to define (global) discounts for an order.
|
List |
getDiscountValues(AbstractOrderEntry entry)
override to define discount values for an order entry.
|
protected EnumerationValue |
getEnumFromContextOrItem(SessionContext ctx,
ExtensibleItem item,
String qualifier)
Helper method to fetch a (price)group enumeration value from context and as fallback from the provided item.
|
protected EnumerationValue |
getEnumFromGroups(User user,
String attribute) |
Collection<DiscountRow> |
getEurope1Discounts(SessionContext ctx,
Product product)
Attribute getter for Product.europe1discounts.
|
Collection<GlobalDiscountRow> |
getEurope1Discounts(SessionContext ctx,
User user)
Attribute getter for User.europe1discounts.
|
Collection<PriceRow> |
getEurope1Prices(SessionContext ctx,
Product product)
Attribute getter for Product.europe1prices.
|
Collection<TaxRow> |
getEurope1Taxes(SessionContext ctx,
Product product)
Attribute getter for Product.europe1taxes.
|
static Europe1PriceFactory |
getInstance() |
protected EnumerationValue |
getPDG(SessionContext ctx,
AbstractOrderEntry entry) |
EnumerationValue |
getPDG(SessionContext ctx,
Product product) |
protected PDTRowsQueryBuilder |
getPDTRowsQueryBuilderFor(String type)
Creates query builder for given PDT row type
|
protected EnumerationValue |
getPPG(SessionContext ctx,
AbstractOrderEntry entry) |
EnumerationValue |
getPPG(SessionContext ctx,
Product product) |
protected List |
getPriceInformations(SessionContext ctx,
Product product,
EnumerationValue productGroup,
User user,
EnumerationValue userGroup,
Currency curr,
boolean net,
Date date,
Collection taxValues) |
List |
getProductDiscountInformations(SessionContext ctx,
Product product,
Date date,
boolean net)
override this to show all discounts which may apply to the given product
|
Collection |
getProductDiscountRows(Product product,
EnumerationValue productGroup) |
Collection |
getProductDiscountRows(SessionContext ctx,
Product product,
EnumerationValue productGroup) |
Collection |
getProductDiscountRowsFast(SessionContext ctx,
Product product,
EnumerationValue productGroup) |
List |
getProductPriceInformations(SessionContext ctx,
Product product,
Date date,
boolean net)
Override this to show all prices available for the given product
|
Collection |
getProductPriceRows(Product product,
EnumerationValue productGroup)
Returns collection of all price rows for the specified product and price group.
|
Collection |
getProductPriceRows(SessionContext ctx,
Product product,
EnumerationValue productGroup)
Returns collection of all price rows for the specified product and price group.
|
Collection |
getProductPriceRowsFast(SessionContext ctx,
Product product,
EnumerationValue productGroup)
Returns collection of all price rows for the specified product and price group.
|
EnumerationValue |
getProductTaxGroup(String code) |
List |
getProductTaxInformations(SessionContext ctx,
Product product,
Date date)
override this to show all taxes which apply to the given product
|
Collection |
getProductTaxRows(Product product,
EnumerationValue productGroup) |
Collection |
getProductTaxRows(SessionContext ctx,
Product product,
EnumerationValue productGroup) |
Collection |
getProductTaxRowsFast(SessionContext ctx,
Product product,
EnumerationValue productGroup) |
protected EnumerationValue |
getPTG(SessionContext ctx,
AbstractOrderEntry entry) |
EnumerationValue |
getPTG(SessionContext ctx,
Product product) |
Collection<PriceRow> |
getRealPartOfPriceRows(SessionContext ctx,
Product product,
EnumerationValue productGroup)
Returns collection of all price rows for the specified product and price group.
|
protected Collection<Europe1PriceFactory.CachedTaxValue> |
getSuperCachedTaxes(Product product,
EnumerationValue productTaxGroup,
User user,
EnumerationValue userTaxGroup,
Date date) |
protected List |
getTaxInformations(Product product,
EnumerationValue productGroup,
User user,
EnumerationValue userGroup,
Date date) |
Collection |
getTaxValues(AbstractOrderEntry entry)
override to define tax values for an order entry.
|
protected EnumerationValue |
getUDG(SessionContext ctx,
AbstractOrder order) |
protected EnumerationValue |
getUDG(SessionContext ctx,
AbstractOrderEntry entry) |
EnumerationValue |
getUDG(SessionContext ctx,
User user) |
protected EnumerationValue |
getUPG(SessionContext ctx,
AbstractOrder order) |
protected EnumerationValue |
getUPG(SessionContext ctx,
AbstractOrderEntry entry) |
EnumerationValue |
getUPG(SessionContext ctx,
User user) |
Collection |
getUserGlobalDiscountRows(User user,
EnumerationValue userGroup) |
EnumerationValue |
getUserPriceGroup(String code) |
EnumerationValue |
getUserTaxGroup(String code) |
protected EnumerationValue |
getUTG(SessionContext ctx,
AbstractOrder order) |
protected EnumerationValue |
getUTG(SessionContext ctx,
AbstractOrderEntry entry) |
EnumerationValue |
getUTG(SessionContext ctx,
User user) |
void |
init()
called once for each tenant, so this method fits best to perform some initialization stuff
|
protected void |
invalidateTaxCache() |
protected boolean |
isCachingTaxes() |
boolean |
isCreatorDisabled()
Part of
DataCreator interface. |
List |
matchDiscountRows(Product product,
EnumerationValue productGroup,
User user,
EnumerationValue userGroup,
Currency curr,
Date date,
int maxCount) |
PriceRow |
matchPriceRowForPrice(SessionContext ctx,
Product product,
EnumerationValue productGroup,
User user,
EnumerationValue userGroup,
long qtd,
Unit unit,
Currency currency,
Date date,
boolean net,
boolean giveAwayMode)
matches price rows by product or product group, user or user group, min quantity, currency and daterange.
|
List<PriceRow> |
matchPriceRowsForInfo(SessionContext ctx,
Product product,
EnumerationValue productGroup,
User user,
EnumerationValue userGroup,
Currency currency,
Date date,
boolean net) |
List |
matchTaxRows(Product product,
EnumerationValue productGroup,
User user,
EnumerationValue userGroup,
Date date,
int maxCount) |
protected void |
notifyItemRemoval(SessionContext ctx,
Item item)
Avoids calls to ejb layer except
|
protected Collection<? extends AbstractDiscountRow> |
queryDiscounts4Price(SessionContext ctx,
Product product,
EnumerationValue productGroup,
User user,
EnumerationValue userGroup)
Runs database query for fetching discount rows for calculating entry and order discount values.
|
protected Collection<PriceRow> |
queryPriceRows4Price(SessionContext ctx,
Product product,
EnumerationValue productGroup,
User user,
EnumerationValue userGroup)
Runs database query for fetching price rows for calculating base prices.
|
protected Collection<TaxRow> |
queryTax4Price(SessionContext ctx,
Product product,
EnumerationValue productGroup,
User user,
EnumerationValue userGroup) |
protected void |
removeRowsFor(SessionContext ctx,
Currency currency) |
protected void |
removeRowsFor(SessionContext ctx,
Discount discount) |
protected void |
removeRowsFor(SessionContext ctx,
EnumerationValue enumerationValue) |
protected void |
removeRowsFor(SessionContext ctx,
Product product) |
protected void |
removeRowsFor(SessionContext ctx,
Tax tax) |
protected void |
removeRowsFor(SessionContext ctx,
Unit unit) |
protected void |
removeRowsFor(SessionContext ctx,
User user) |
void |
setEurope1Discounts(SessionContext ctx,
Product item,
Collection discounts)
Attribute setter for Product.europe1discounts.
|
void |
setEurope1Discounts(SessionContext ctx,
User user,
Collection discounts)
Attribute setter for User.europe1discounts.
|
void |
setEurope1Prices(SessionContext ctx,
Product item,
Collection prices)
Attribute setter for Product.europe1prices.
|
void |
setEurope1Taxes(SessionContext ctx,
Product item,
Collection taxes)
Attribute setter for Product.europe1taxes.
|
void |
setRetrieveChannelStrategy(RetrieveChannelStrategy retrieveChannelStrategy) |
protected Collection<TaxRow> |
superQueryTax4Price(SessionContext ctx,
Product product,
EnumerationValue productGroup,
User user,
EnumerationValue userGroup)
Runs database query for fetching tax rows for calculating entry and order discount values.
|
createDiscountRow, createDiscountRow, createGlobalDiscountRow, createGlobalDiscountRow, createPriceRow, createPriceRow, createTaxRow, createTaxRow, getDefaultAttributeModes, getEurope1Discounts, getEurope1Discounts, getEurope1PriceFactory_PDG, getEurope1PriceFactory_PDG, getEurope1PriceFactory_PPG, getEurope1PriceFactory_PPG, getEurope1PriceFactory_PTG, getEurope1PriceFactory_PTG, getEurope1PriceFactory_UDG, getEurope1PriceFactory_UDG, getEurope1PriceFactory_UPG, getEurope1PriceFactory_UPG, getEurope1PriceFactory_UTG, getEurope1PriceFactory_UTG, getEurope1Prices, getEurope1Taxes, getName, getUserDiscountGroup, getUserDiscountGroup, getUserPriceGroup, getUserPriceGroup, getUserTaxGroup, getUserTaxGroup, setEurope1Discounts, setEurope1Discounts, setEurope1PriceFactory_PDG, setEurope1PriceFactory_PDG, setEurope1PriceFactory_PPG, setEurope1PriceFactory_PPG, setEurope1PriceFactory_PTG, setEurope1PriceFactory_PTG, setEurope1PriceFactory_UDG, setEurope1PriceFactory_UDG, setEurope1PriceFactory_UPG, setEurope1PriceFactory_UPG, setEurope1PriceFactory_UTG, setEurope1PriceFactory_UTG, setEurope1Prices, setEurope1Taxes, setUserDiscountGroup, setUserDiscountGroup, setUserPriceGroup, setUserPriceGroup, setUserTaxGroup, setUserTaxGroup
getAllPriceInformations, getProductDiscountInformations, getProductPriceInformations, getProductTaxInformations, isNetUser
createSampleData, getCreatorDescription, getCreatorName, getCreatorParameterDefault, getCreatorParameterNames, getCreatorParameterPossibleValues, getRemote, notifyInitializationEnd, notifyInitializationStart, onFirstSessionCreation, writeReplace
afterItemCreation, destroy, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, setAttribute, setTenant, setTransientObject, unwrap, unwrap, wrap
public static final long MATCH_ANY
public static final long MATCH_BY_PRODUCT_ID
public static final String USE_FAST_ALGORITHMS
true
public static Europe1PriceFactory getInstance()
public void init()
Manager
protected void invalidateTaxCache()
protected void checkBeforeItemRemoval(SessionContext ctx, Item item) throws ConsistencyCheckException
checkBeforeItemRemoval
in class Extension
ctx
- the current session contextitem
- the item which should be removedConsistencyCheckException
- thrown to abort removal due to consistency errorsprotected void notifyItemRemoval(SessionContext ctx, Item item)
notifyItemRemoval
in class Extension
ctx
- the currency session contextitem
- the item which is going to be removedprotected void removeRowsFor(SessionContext ctx, Product product) throws ConsistencyCheckException
ConsistencyCheckException
protected void removeRowsFor(SessionContext ctx, User user) throws ConsistencyCheckException
ConsistencyCheckException
protected void removeRowsFor(SessionContext ctx, Currency currency) throws ConsistencyCheckException
ConsistencyCheckException
protected void removeRowsFor(SessionContext ctx, Unit unit) throws ConsistencyCheckException
ConsistencyCheckException
protected void removeRowsFor(SessionContext ctx, Tax tax) throws ConsistencyCheckException
ConsistencyCheckException
protected void removeRowsFor(SessionContext ctx, Discount discount) throws ConsistencyCheckException
ConsistencyCheckException
protected void removeRowsFor(SessionContext ctx, EnumerationValue enumerationValue) throws ConsistencyCheckException
ConsistencyCheckException
public PriceRow createPriceRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, long minQuantity, Currency currency, Unit unit, int unitFactor, boolean net, DateRange dateRange, double price) throws JaloPriceFactoryException
null
values mean all resp. allways. Please note that either
user or userPriceGroup will be applied but never both. So it makes no sense to specify a group is the user is
already present. Same thing with product and productPriceGroup.product
- the product which will be priced by this row (may be null)productPriceGroup
- the product price group which will be priced by this row (may be null)user
- the user whose special price is represented by this row (may be null)userPriceGroup
- the user price group which special price is represented by this row (may be null)minQuantity
- the minimum quantity for which this price is applicable ( > 0 )currency
- the Currency for which this price is applicable (not null)unit
- the Unit for which this price is applicable (not null)unitFactor
- parameter to handle small prices: baseprice = price / unitFactor
net
- defines if this price should be seen as including or excluding taxesdateRange
- the DateRange when this price is applicable (may be null)price
- the price (may contain more digits than actually possible with this currency)PriceRow
JaloPriceFactoryException
public PriceRow createPriceRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, long minQuantity, Currency currency, Unit unit, int unitFactor, boolean net, DateRange dateRange, double price, EnumerationValue channel) throws JaloPriceFactoryException
null
values mean all resp. allways. Please note that either
user or userPriceGroup will be applied but never both. So it makes no sense to specify a group is the user is
already present. Same thing with product and productPriceGroup.product
- the product which will be priced by this row (may be null)productPriceGroup
- the product price group which will be priced by this row (may be null)user
- the user whose special price is represented by this row (may be null)userPriceGroup
- the user price group which special price is represented by this row (may be null)minQuantity
- the minimum quantity for which this price is applicable ( > 0 )currency
- the Currency for which this price is applicable (not null)unit
- the Unit for which this price is applicable (not null)unitFactor
- parameter to handle small prices: baseprice = price / unitFactor
net
- defines if this price should be seen as including or excluding taxesdateRange
- the DateRange when this price is applicable (may be null)price
- the price (may contain more digits than actually possible with this currency)channel
- the channel which special price is represented by this row (may be null)PriceRow
JaloPriceFactoryException
public PriceRow createPriceRow(SessionContext ctx, Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, long minQuantity, Currency currency, Unit unit, int unitFactor, boolean net, DateRange dateRange, double price, EnumerationValue channel) throws JaloPriceFactoryException
createPriceRow(Product,EnumerationValue,User,EnumerationValue,long,Currency,Unit,int,boolean,DateRange,double,EnumerationValue)
but with specific SessionContext.ctx
- product
- productPriceGroup
- user
- userPriceGroup
- minQuantity
- currency
- unit
- unitFactor
- net
- dateRange
- price
- channel
- PriceRow
JaloPriceFactoryException
public PriceRow createPriceRow(SessionContext ctx, Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, long minQuantity, Currency currency, Unit unit, int unitFactor, boolean net, DateRange dateRange, double price) throws JaloPriceFactoryException
createPriceRow(Product,EnumerationValue,User,EnumerationValue,long,Currency,Unit,int,boolean,DateRange,double)
but with specific SessionContext.ctx
- product
- productPriceGroup
- user
- userPriceGroup
- minQuantity
- currency
- unit
- unitFactor
- net
- dateRange
- price
- PriceRow
JaloPriceFactoryException
@Deprecated public TaxRow createTaxRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Tax tax) throws JaloPriceFactoryException
createTaxRow(Product,EnumerationValue,User,EnumerationValue,Tax,DateRange,Double)
to specify all values ( here DateRange and Value are set to null
)null
values mean all resp. allways. Please note that either
user or userPriceGroup will be applied but never both. So it makes no sense to specify a group if the user is
already present. Same thing with product and productPriceGroup.
product
- the product which will be priced by this row (may be null)productPriceGroup
- the product price group which will be priced by this row (may be null)user
- the user whose special price is represented by this row (may be null)userPriceGroup
- the user price group which special price is represented by this row (may be null)tax
- the Tax for this rule (not null>)JaloPriceFactoryException
public TaxRow createTaxRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Tax tax, DateRange dateRange, Double value) throws JaloPriceFactoryException
null
values mean all resp. allways. Please note that either
user or userPriceGroup will be applied but never both. So it makes no sense to specify a group is the user is
already present. Same thing with product and productPriceGroup.
product
- the product which will be priced by this row (may be null)productPriceGroup
- the product price group which will be priced by this row (may be null)user
- the user whose special price is represented by this row (may be null)userPriceGroup
- the user price group which special price is represented by this row (may be null)tax
- the Tax for this rule (not null>)dateRange
- (optional) the timeframe which the new row is valid withinvalue
- (optional) overrides the value of the tax objectTaxRow
JaloPriceFactoryException
public TaxRow createTaxRow(SessionContext ctx, Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Tax tax, DateRange dateRange, Double value) throws JaloPriceFactoryException
ctx
- product
- the product which will be priced by this row (may be null)productPriceGroup
- the product price group which will be priced by this row (may be null)user
- the user whose special price is represented by this row (may be null)userPriceGroup
- the user price group which special price is represented by this row (may be null)tax
- the Tax for this rule (not null>)dateRange
- the timeframe which the new row is valid within; null
means allways value
- (optional) overrides the value of the tax objectTaxRow
JaloPriceFactoryException
public DiscountRow createDiscountRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Currency currency, Double value, DateRange dateRange, Discount discount) throws JaloPriceFactoryException
null
values mean all resp. allways. Please note that
either user or userPriceGroup will be applied but never both. So it makes no sense to specify a group is the user
is already present. Same thing with product and productPriceGroup.product
- the product which will be priced by this row (may be null)productPriceGroup
- the product price group which will be priced by this row (may be null)user
- the user whose special price is represented by this row (may be null)userPriceGroup
- the user price group which special price is represented by this row (may be null)currency
- the Currency for which this price is applicable (not null)value
- a optional value which overrides the value provieded by discountdateRange
- the DateRange when this price is applicable (may be null)discount
- the Discount object which defines the value of this rule (not null)DiscountRow
JaloPriceFactoryException
public DiscountRow createDiscountRow(SessionContext ctx, Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Currency currency, Double value, DateRange dateRange, Discount discount) throws JaloPriceFactoryException
ctx
- product
- productPriceGroup
- user
- userPriceGroup
- currency
- value
- dateRange
- discount
- DiscountRow
JaloPriceFactoryException
public GlobalDiscountRow createGlobalDiscountRow(User user, EnumerationValue userPriceGroup, Currency currency, Double value, DateRange dateRange, Discount discount) throws JaloPriceFactoryException
null
values mean all resp. allways. Please note
that either user or userPriceGroup will be applied but never both. So it makes no sense to specify a group is the
user is already present. Same thing with product and productPriceGroup.user
- the user whose special price is represented by this row (may be null)userPriceGroup
- the user price group which special price is represented by this row (may be null)currency
- the Currency for which this price is applicable (not null)value
- a optional value which overrides the value provieded by discountdateRange
- the DateRange when this price is applicable (may be null)discount
- the Discount object which defines the value of this rule (not null)DiscountRow
JaloPriceFactoryException
public GlobalDiscountRow createGlobalDiscountRow(SessionContext ctx, User user, EnumerationValue userPriceGroup, Currency currency, Double value, DateRange dateRange, Discount discount) throws JaloPriceFactoryException
ctx
- user
- userPriceGroup
- currency
- value
- dateRange
- discount
- DiscountRow
JaloPriceFactoryException
@Deprecated public void checkAllPriceRows() throws JaloPriceFactoryException
PriceRows
for consistency errors.JaloRowConsistencyCheckException
- if two or more rows clashJaloPriceFactoryException
@Deprecated public void checkAllPriceRows(SessionContext ctx) throws JaloPriceFactoryException
checkAllPriceRows()
but for a specific SessionContext.ctx
- JaloRowConsistencyCheckException
- if two or more rows clashJaloPriceFactoryException
@Deprecated public void checkAllTaxRows() throws JaloPriceFactoryException
TaxRows
for consistency errors.JaloRowConsistencyCheckException
- if two or more rows clashJaloPriceFactoryException
@Deprecated public void checkAllTaxRows(SessionContext ctx) throws JaloPriceFactoryException
checkAllTaxRows()
but for a specific SessionContext.ctx
- JaloRowConsistencyCheckException
- if two or more rows clashJaloPriceFactoryException
@Deprecated public void checkAllDiscountRows() throws JaloPriceFactoryException
DiscountRows
for consistency errors.JaloRowConsistencyCheckException
- if two or more rows clashJaloPriceFactoryException
@Deprecated public void checkAllDiscountRows(SessionContext ctx) throws JaloPriceFactoryException
checkAllDiscountRows()
but for a specific SessionContext.ctx
- JaloRowConsistencyCheckException
- if two or more rows clashJaloPriceFactoryException
@Deprecated public void checkAllGlobalDiscountRows() throws JaloPriceFactoryException
DiscountRows
for consistency errors.JaloRowConsistencyCheckException
- if two or more rows clashJaloPriceFactoryException
@Deprecated public void checkAllGlobalDiscountRows(SessionContext ctx) throws JaloPriceFactoryException
checkAllGlobalDiscountRows()
but for a specific SessionContext.ctx
- JaloRowConsistencyCheckException
- if two or more rows clashJaloPriceFactoryException
public Collection<PriceRow> getEurope1Prices(SessionContext ctx, Product product)
getEurope1Prices
in class GeneratedEurope1PriceFactory
public Collection<PriceRow> getRealPartOfPriceRows(SessionContext ctx, Product product, EnumerationValue productGroup)
product
- the productproductGroup
- the price grouppublic void setEurope1Prices(SessionContext ctx, Product item, Collection prices)
setEurope1Prices
in class GeneratedEurope1PriceFactory
prices
- the europe1Pricespublic Collection<TaxRow> getEurope1Taxes(SessionContext ctx, Product product)
getEurope1Taxes
in class GeneratedEurope1PriceFactory
public void setEurope1Taxes(SessionContext ctx, Product item, Collection taxes)
setEurope1Taxes
in class GeneratedEurope1PriceFactory
taxes
- the europe1Taxespublic Collection<DiscountRow> getEurope1Discounts(SessionContext ctx, Product product)
getEurope1Discounts
in class GeneratedEurope1PriceFactory
public void setEurope1Discounts(SessionContext ctx, Product item, Collection discounts)
setEurope1Discounts
in class GeneratedEurope1PriceFactory
discounts
- the europe1Discountspublic Collection<GlobalDiscountRow> getEurope1Discounts(SessionContext ctx, User user)
getEurope1Discounts
in class GeneratedEurope1PriceFactory
public void setEurope1Discounts(SessionContext ctx, User user, Collection discounts)
setEurope1Discounts
in class GeneratedEurope1PriceFactory
discounts
- the europe1Discountspublic Collection getTaxValues(AbstractOrderEntry entry) throws JaloPriceFactoryException
AbstractPriceFactory
getTaxValues
in interface PriceFactory
getTaxValues
in class AbstractPriceFactory
JaloPriceFactoryException
public PriceValue getBasePrice(AbstractOrderEntry entry) throws JaloPriceFactoryException
AbstractPriceFactory
getBasePrice
in interface PriceFactory
getBasePrice
in class AbstractPriceFactory
JaloPriceFactoryException
public List getDiscountValues(AbstractOrderEntry entry) throws JaloPriceFactoryException
AbstractPriceFactory
getDiscountValues
in interface PriceFactory
getDiscountValues
in class AbstractPriceFactory
JaloPriceFactoryException
public List getDiscountValues(AbstractOrder order) throws JaloPriceFactoryException
AbstractPriceFactory
AbstractPriceFactory.getDiscountValues(AbstractOrderEntry)
getDiscountValues
in interface PriceFactory
getDiscountValues
in class AbstractPriceFactory
JaloPriceFactoryException
public ProductPriceInformations getAllPriceInformations(SessionContext ctx, Product product, Date date, boolean net) throws JaloPriceFactoryException
AbstractPriceFactory
This default implementation just calls AbstractPriceFactory.getProductPriceInformations(Product, Date, boolean)
,
AbstractPriceFactory.getProductTaxInformations(Product, Date)
and
AbstractPriceFactory.getProductDiscountInformations(Product, Date, boolean)
and wraps the results inside a
ProductPriceInformations
object.
Override to define the prices, taxes and discounts for all occasions when no order or order entry is available,
e.g. for product lists. Please take care also to override
AbstractPriceFactory.getProductPriceInformations(Product, Date, boolean)
, AbstractPriceFactory.getProductTaxInformations(Product, Date)
and AbstractPriceFactory.getProductDiscountInformations(Product, Date, boolean)
since these methods are called by
Product
directly.
getAllPriceInformations
in interface PriceFactory
getAllPriceInformations
in class AbstractPriceFactory
JaloPriceFactoryException
- if a calculation error occuredpublic List getProductDiscountInformations(SessionContext ctx, Product product, Date date, boolean net) throws JaloPriceFactoryException
AbstractPriceFactory
getProductDiscountInformations
in interface PriceFactory
getProductDiscountInformations
in class AbstractPriceFactory
product
- the productDiscountInformation
objectsJaloPriceFactoryException
- if price calculation error occuredpublic List getProductPriceInformations(SessionContext ctx, Product product, Date date, boolean net) throws JaloPriceFactoryException
AbstractPriceFactory
getProductPriceInformations
in interface PriceFactory
getProductPriceInformations
in class AbstractPriceFactory
product
- the productnet
- the net/gross state of the requested pricesPriceInformation
objectsJaloPriceFactoryException
- if price calculation error occuredpublic List getProductTaxInformations(SessionContext ctx, Product product, Date date) throws JaloPriceFactoryException
AbstractPriceFactory
getProductTaxInformations
in interface PriceFactory
getProductTaxInformations
in class AbstractPriceFactory
product
- the productTaxInformation
objectsJaloPriceFactoryException
- if price calculation error occuredprotected List getDiscountInformations(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency curr, Date date) throws JaloPriceFactoryException
JaloPriceFactoryException
protected List getPriceInformations(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency curr, boolean net, Date date, Collection taxValues) throws JaloPriceFactoryException
JaloPriceFactoryException
protected List getTaxInformations(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Date date) throws JaloPriceFactoryException
JaloPriceFactoryException
protected List<PriceRow> filterPriceRows(List<PriceRow> priceRows)
public List matchDiscountRows(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency curr, Date date, int maxCount) throws JaloPriceFactoryException
JaloPriceFactoryException
protected List<? extends AbstractDiscountRow> filterDiscountRows4Price(Collection<? extends AbstractDiscountRow> rows, Date date)
rows
- the query result rowsdate
- the requested dateprotected Collection<? extends AbstractDiscountRow> queryDiscounts4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup)
ctx
- product
- the product to get discounts forproductGroup
- the product group to get discounts foruser
- the user to get discounts foruserGroup
- the user price group to get discounts forJaloPriceFactoryException
public PriceRow matchPriceRowForPrice(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, long qtd, Unit unit, Currency currency, Date date, boolean net, boolean giveAwayMode) throws JaloPriceFactoryException
match value - greates at top ( currency - requested currency on top ; only if requested currency is not base currency ) net - requested net state is on top ( unit - requested unit at top ; only if convertible units exists for requested unit ) min quantity - greatest quantity at top daterange - non-null dateranges at top
product
- the product which the rows have to match; rows without product and group match too !productGroup
- the product group which the rows have to match; rows without product and group match too !user
- the user which the rows have to match; rows without user and user match too !userGroup
- the user group which the rows have to match; rows without user and user match too !qtd
- the quantity which rows must not exceedunit
- the unit which the rows have to match, its convertible units are included in the search toocurrency
- the currency which the rows have to match, the base currency is included toodate
- the date to match; rows without daterange always matchnet
- JaloPriceFactoryException
- if any of the parameters is null
protected List<PriceRow> filterPriceRows4Price(Collection<PriceRow> rows, long _quantity, Unit unit, Currency curr, Date date, boolean giveAwayMode, PriceRowChannel channel)
rows
- the query result rowsunit
- the requested unitcurr
- the requested currencydate
- the requested dategiveAwayMode
- the requested give-away modechannel
- the requested channelprotected Collection<PriceRow> queryPriceRows4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup)
ctx
- product
- the product to get prices forproductGroup
- the product group to get prices foruser
- the user to get prices foruserGroup
- the user price group to get prices forJaloPriceFactoryException
protected PDTRowsQueryBuilder getPDTRowsQueryBuilderFor(String type)
type
- PDT row typepublic List<PriceRow> matchPriceRowsForInfo(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency currency, Date date, boolean net) throws JaloPriceFactoryException
JaloPriceFactoryException
protected List<PriceRow> filterPriceRows4Info(Collection<PriceRow> rows, Currency curr, Date date, PriceRowChannel channel)
rows
- the query result rowscurr
- the requested currencydate
- the requested datechannel
- the requested channelpublic Collection getProductPriceRows(Product product, EnumerationValue productGroup)
product
- the productproductGroup
- the price grouppublic Collection getProductPriceRows(SessionContext ctx, Product product, EnumerationValue productGroup)
product
- the productproductGroup
- the price grouppublic Collection getProductPriceRowsFast(SessionContext ctx, Product product, EnumerationValue productGroup)
product
- the productproductGroup
- the price grouppublic Collection getProductTaxRows(Product product, EnumerationValue productGroup)
public Collection getProductTaxRows(SessionContext ctx, Product product, EnumerationValue productGroup)
public Collection getProductTaxRowsFast(SessionContext ctx, Product product, EnumerationValue productGroup)
public Collection getProductDiscountRows(Product product, EnumerationValue productGroup)
public Collection getProductDiscountRows(SessionContext ctx, Product product, EnumerationValue productGroup)
public Collection getProductDiscountRowsFast(SessionContext ctx, Product product, EnumerationValue productGroup)
protected String extractProductId(SessionContext ctx, Product product)
public Collection getUserGlobalDiscountRows(User user, EnumerationValue userGroup) throws JaloInvalidParameterException
JaloInvalidParameterException
public List matchTaxRows(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Date date, int maxCount) throws JaloPriceFactoryException
JaloPriceFactoryException
protected List<TaxRow> filterTaxRows4Price(Collection<TaxRow> rows, Date date)
rows
- the query result rowsdate
- the requested dateprotected Collection<TaxRow> superQueryTax4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup)
ctx
- product
- the product to get taxes forproductGroup
- the product group to get taxes foruser
- the user to get taxes foruserGroup
- the user price group to get taxes forJaloPriceFactoryException
protected Collection<TaxRow> queryTax4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup)
protected void appendProductConditions(StringBuilder query, String alias, Product product, EnumerationValue productGroup, Map values, String pgConstant)
protected void appendUserConditions(StringBuilder query, String alias, User user, EnumerationValue userGroup, Map values, String ugConst)
protected EnumerationValue getEnumFromContextOrItem(SessionContext ctx, ExtensibleItem item, String qualifier)
protected EnumerationValue getPTG(SessionContext ctx, AbstractOrderEntry entry)
public EnumerationValue getPTG(SessionContext ctx, Product product)
protected EnumerationValue getPDG(SessionContext ctx, AbstractOrderEntry entry)
public EnumerationValue getPDG(SessionContext ctx, Product product)
protected EnumerationValue getPPG(SessionContext ctx, AbstractOrderEntry entry)
public EnumerationValue getPPG(SessionContext ctx, Product product)
protected EnumerationValue getUTG(SessionContext ctx, AbstractOrderEntry entry) throws JaloPriceFactoryException
JaloPriceFactoryException
protected EnumerationValue getUTG(SessionContext ctx, AbstractOrder order) throws JaloPriceFactoryException
JaloPriceFactoryException
public EnumerationValue getUTG(SessionContext ctx, User user) throws JaloPriceFactoryException
JaloPriceFactoryException
public EnumerationValue getUDG(SessionContext ctx, User user) throws JaloPriceFactoryException
JaloPriceFactoryException
protected EnumerationValue getUDG(SessionContext ctx, AbstractOrderEntry entry) throws JaloPriceFactoryException
JaloPriceFactoryException
protected EnumerationValue getUDG(SessionContext ctx, AbstractOrder order) throws JaloPriceFactoryException
JaloPriceFactoryException
public EnumerationValue getUPG(SessionContext ctx, User user) throws JaloPriceFactoryException
JaloPriceFactoryException
protected EnumerationValue getUPG(SessionContext ctx, AbstractOrderEntry entry) throws JaloPriceFactoryException
JaloPriceFactoryException
protected EnumerationValue getUPG(SessionContext ctx, AbstractOrder order) throws JaloPriceFactoryException
JaloPriceFactoryException
protected EnumerationValue getEnumFromGroups(User user, String attribute) throws JaloPriceFactoryException
JaloPriceFactoryException
public EnumerationValue getUserPriceGroup(String code)
code
- public EnumerationValue createUserPriceGroup(String code) throws ConsistencyCheckException
code
- the code of the new user price groupConsistencyCheckException
public EnumerationValue getProductTaxGroup(String code)
public EnumerationValue createProductTaxGroup(String code) throws ConsistencyCheckException
ConsistencyCheckException
public EnumerationValue getUserTaxGroup(String code)
public EnumerationValue createUserTaxGroup(String code) throws ConsistencyCheckException
ConsistencyCheckException
public boolean isCreatorDisabled()
Extension
DataCreator
interface. This default implementation returns
false
isCreatorDisabled
in class Extension
false
public void createProjectData(Map params, JspContext jspc)
createProjectData
in class Extension
protected Date adjustDate(Date date)
date
- the input dateprotected Collection<Europe1PriceFactory.CachedTaxValue> getSuperCachedTaxes(Product product, EnumerationValue productTaxGroup, User user, EnumerationValue userTaxGroup, Date date)
protected boolean isCachingTaxes()
protected void fillTaxCache()
protected Collection<Europe1PriceFactory.CachedTaxValue> getCachedTaxes(Product product, EnumerationValue productTaxGroup, User user, EnumerationValue userTaxGroup, Date date)
public void createEssentialData(Map params, JspContext jspc) throws Exception
createEssentialData
in class Extension
Exception
protected PriceRow getCounterpartItem(SessionContext ctx, PriceRow pricerow, CatalogVersion targetVersion)
protected TaxRow getCounterpartItem(SessionContext ctx, TaxRow taxrow, CatalogVersion targetVersion)
protected DiscountRow getCounterpartItem(SessionContext ctx, DiscountRow discountrow, CatalogVersion targetVersion)
public void beforeItemCreation(SessionContext ctx, ComposedType type, Item.ItemAttributeMap attributes) throws JaloBusinessException
Manager
beforeItemCreation
in class Manager
ctx
- the currency session contexttype
- the type of the item which will be createdattributes
- the attribute values to be used for creationJaloBusinessException
This method does nothing and may be overridden.
CAUTION: This method will be called inside a transaction !!!
public void setRetrieveChannelStrategy(RetrieveChannelStrategy retrieveChannelStrategy)
Copyright © 2000-2016 hybris AG. All Rights Reserved.