Class ZoneDeliveryMode
- java.lang.Object
-
- de.hybris.platform.util.BridgeAbstraction
-
- de.hybris.platform.jalo.Item
-
- de.hybris.platform.jalo.ExtensibleItem
-
- de.hybris.platform.jalo.c2l.LocalizableItem
-
- de.hybris.platform.jalo.GenericItem
-
- de.hybris.platform.jalo.order.delivery.GeneratedDeliveryMode
-
- de.hybris.platform.jalo.order.delivery.DeliveryMode
-
- de.hybris.platform.deliveryzone.jalo.GeneratedZoneDeliveryMode
-
- de.hybris.platform.deliveryzone.jalo.ZoneDeliveryMode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable
public class ZoneDeliveryMode extends GeneratedZoneDeliveryMode
Represents a delivery mode, which values depend upon a minimum property, the requested currency and the requested country. Since one value may match multiple countries it is called 'zone' dependent instead of 'country' dependent.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.Item
Item.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_NAME
Deprecated.since ages-
Fields inherited from class de.hybris.platform.deliveryzone.jalo.GeneratedZoneDeliveryMode
DEFAULT_INITIAL_ATTRIBUTES, NET, PROPERTYNAME, VALUES, VALUESHANDLER
-
Fields inherited from class de.hybris.platform.jalo.order.delivery.GeneratedDeliveryMode
ACTIVE, CODE, DESCRIPTION, NAME, SUPPORTEDPAYMENTMODES, SUPPORTEDPAYMENTMODESINTERNAL
-
Fields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLED
-
Fields inherited from class de.hybris.platform.jalo.Item
_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, HJMPTS, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPE
-
Fields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant
-
-
Constructor Summary
Constructors Constructor Description ZoneDeliveryMode()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ZoneDeliveryModeValue
addNewDeliveryModeValue(Zone zone, Currency curr, double minimum, double value)
Deprecated.since ages - usesetCost(Currency, double, double, Zone)
directlyprotected Item
createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes)
Has to be implemented for each concrete subtype of item.protected ZoneDeliveryModeValue
createValue(Zone zone, double value, Currency currency, double min)
protected java.util.Map<Country,java.util.Set<Zone>>
getAmbigousZones(java.util.Set<Zone> zones)
protected double
getCalculationBaseValue(SessionContext ctx, AbstractOrder order, java.lang.String propName)
PriceValue
getCost(SessionContext ctx, AbstractOrder order)
Deprecated.{@link de.hybris.platform.order.strategies.calculation.FindDeliveryCostStrategy.getDeliveryCost(AbstractOrderModel)} when the Hybris Platform is configured to use the service-layer based (the 'pdt.calculation.mode' is set to the 'sl' value) cart calculation (prices, tax & discounts) processing strategy.java.util.Collection<Currency>
getCurrencies(Zone zone)
Returns all currencies for which values are defined in this delivery mode.java.util.Collection<ZoneDeliveryModeValue>
getDeliveryModeValues()
Deprecated.since ages - useGeneratedZoneDeliveryMode.getValues()
directlyZoneDeliveryModeValue
getValue(Zone zone, Currency currency, double min)
Finds a specific value for a given zone, currency and minimum.java.util.Map<java.lang.Double,java.lang.Double>
getValues(Currency curr, Zone zone)
Method getValuesjava.util.Collection<Zone>
getZones()
Returns all zones for which price values are defined in this delivery mode.boolean
isModeUsingPrice()
Tells whether or not this mode is using the order subtotal as calculation base.boolean
isZoneAllowed(Zone toCheck)
Tells whether or not a zone is allowed to be used for adding new values to this delivery mode.protected java.lang.Double
parseItemProperty(SessionContext ctx, Item item, java.lang.String propertyName)
boolean
removeCost(Currency curr, double min, Zone zone)
Method removeCostZoneDeliveryModeValue
setCost(Currency curr, double min, double value, Zone zone)
Method setCostvoid
setModeIsUsingPrice()
Convenience method for setting the special price property name.void
setPropertyName(SessionContext ctx, java.lang.String name)
Generated method - Setter of theZoneDeliveryMode.propertyName
attribute.-
Methods inherited from class de.hybris.platform.deliveryzone.jalo.GeneratedZoneDeliveryMode
addToValues, addToValues, getDefaultAttributeModes, getPropertyName, getPropertyName, getValues, getValues, isNet, isNet, isNetAsPrimitive, isNetAsPrimitive, removeFromValues, removeFromValues, setNet, setNet, setNet, setNet, setPropertyName, setValues, setValues
-
Methods inherited from class de.hybris.platform.jalo.order.delivery.DeliveryMode
addSupportedPaymentMode, checkRemovable, getAllDescriptions, getAllNames, getCost, getSupportedPaymentModes, isSupportedPaymentMode, removeSupportedPaymentMode, setAllDescriptions, setAllNames, setCode, setCode, setSupportedPaymentModes
-
Methods inherited from class de.hybris.platform.jalo.order.delivery.GeneratedDeliveryMode
getAllDescription, getAllDescription, getAllName, getAllName, getCode, getCode, getDescription, getDescription, getName, getName, getSupportedPaymentModes, isActive, isActive, isActiveAsPrimitive, isActiveAsPrimitive, setActive, setActive, setActive, setActive, setAllDescription, setAllDescription, setAllName, setAllName, setDescription, setDescription, setName, setName, setSupportedPaymentModes
-
Methods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getNonInitialAttributes, getRelatedItems, setRelatedItems
-
Methods inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedProperty
-
Methods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setProperty
-
Methods inherited from class de.hybris.platform.jalo.Item
addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isMarkModifiedDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, toString, useTA, writeReplace
-
Methods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
-
-
-
Field Detail
-
PROPERTY_NAME
@Deprecated public static final java.lang.String PROPERTY_NAME
Deprecated.since ages- See Also:
- Constant Field Values
-
-
Method Detail
-
createItem
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
Description copied from class:Item
Has to be implemented for each concrete subtype of item. This method is responsible for creating a new item instance ( by calling managers, ejb homes, etc. ) duringComposedType.newInstance(Map)
.In case this method uses any of the attribute values during creation it is required to override
Item.getNonInitialAttributes(SessionContext, ItemAttributeMap)
too.
Sn example:public static final String MY_ATTRIBUTE = "someAttribute"; ... protected Item createItem(SessionContext ctx, ComposedType type, Map allAttributes ) throws JaloBusinessException { MyManager man = ... return man.createMyItem( (String)allAttributes.get(MY_ATTRIBUTE) ); // here MY_ATTRIBUTE is used for creation, so it must not be set again } protected Map getNonInitialAttributes( SessionContext ctx, Map allAttributes ) { // let superclass remove its own initial attributes Map ret = super.getNonInitialAttributes( ctx, allAttributes ); // remove MY_ATTRIBUTE from all attributes since if has already been set ret.remove(MY_ATTRIBUTE); return ret; }
- Overrides:
createItem
in classDeliveryMode
- Parameters:
ctx
- the current session context which this item is created withintype
- the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )- Returns:
- the new item instance
- Throws:
JaloBusinessException
- indicates an error during creation - any changes will be rollbacked
-
createValue
protected ZoneDeliveryModeValue createValue(Zone zone, double value, Currency currency, double min) throws JaloDeliveryModeException
- Throws:
JaloDeliveryModeException
-
setPropertyName
public void setPropertyName(SessionContext ctx, java.lang.String name)
Description copied from class:GeneratedZoneDeliveryMode
Generated method - Setter of theZoneDeliveryMode.propertyName
attribute.- Overrides:
setPropertyName
in classGeneratedZoneDeliveryMode
name
- the propertyName
-
setModeIsUsingPrice
public void setModeIsUsingPrice()
Convenience method for setting the special price property name.
-
isModeUsingPrice
public boolean isModeUsingPrice()
Tells whether or not this mode is using the order subtotal as calculation base.
-
setCost
public ZoneDeliveryModeValue setCost(Currency curr, double min, double value, Zone zone) throws JaloDeliveryModeException
Method setCost- Throws:
JaloDeliveryModeException
-
removeCost
public boolean removeCost(Currency curr, double min, Zone zone) throws JaloDeliveryModeException
Method removeCost- Throws:
JaloDeliveryModeException
-
getZones
public java.util.Collection<Zone> getZones()
Returns all zones for which price values are defined in this delivery mode.
-
getCurrencies
public java.util.Collection<Currency> getCurrencies(Zone zone) throws JaloDeliveryModeException
Returns all currencies for which values are defined in this delivery mode.- Throws:
JaloDeliveryModeException
-
getValues
public java.util.Map<java.lang.Double,java.lang.Double> getValues(Currency curr, Zone zone) throws JaloDeliveryModeException
Method getValues- Throws:
JaloDeliveryModeException
-
getValue
public ZoneDeliveryModeValue getValue(Zone zone, Currency currency, double min)
Finds a specific value for a given zone, currency and minimum.- Returns:
- the value with the specified settings or null if no such value exists
-
getCost
@Deprecated public PriceValue getCost(SessionContext ctx, AbstractOrder order) throws JaloDeliveryModeException
Deprecated.{@link de.hybris.platform.order.strategies.calculation.FindDeliveryCostStrategy.getDeliveryCost(AbstractOrderModel)} when the Hybris Platform is configured to use the service-layer based (the 'pdt.calculation.mode' is set to the 'sl' value) cart calculation (prices, tax & discounts) processing strategy.Description copied from class:DeliveryMode
Calculates the delivery cost of this mode for a given order. This is called when the specified order is calculated the first time or recalculated.This default implementation always returns 0 costs. each subtype may override this method to implement its own cost model.
- Overrides:
getCost
in classDeliveryMode
- Parameters:
ctx
- session contextorder
- the order to calculate costs for- Throws:
JaloDeliveryModeException
-
getCalculationBaseValue
protected double getCalculationBaseValue(SessionContext ctx, AbstractOrder order, java.lang.String propName) throws JaloDeliveryModeException
- Throws:
JaloDeliveryModeException
-
parseItemProperty
protected java.lang.Double parseItemProperty(SessionContext ctx, Item item, java.lang.String propertyName)
-
getAmbigousZones
protected java.util.Map<Country,java.util.Set<Zone>> getAmbigousZones(java.util.Set<Zone> zones)
-
isZoneAllowed
public boolean isZoneAllowed(Zone toCheck)
Tells whether or not a zone is allowed to be used for adding new values to this delivery mode. This is necessary because two zones may share countries so the delivery mode can no longer calculate distinct prices for a given country.If a new
ZoneDeliveryModeValue
is tried to be created with such a disallowed zone aConsistencyCheckException
is thrown!
-
getDeliveryModeValues
@Deprecated public java.util.Collection<ZoneDeliveryModeValue> getDeliveryModeValues()
Deprecated.since ages - useGeneratedZoneDeliveryMode.getValues()
directly
-
addNewDeliveryModeValue
@Deprecated public ZoneDeliveryModeValue addNewDeliveryModeValue(Zone zone, Currency curr, double minimum, double value) throws JaloDeliveryModeException
Deprecated.since ages - usesetCost(Currency, double, double, Zone)
directly- Throws:
JaloDeliveryModeException
-
-