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:
Serializable,Comparable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImplNested 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
FieldsFields inherited from class de.hybris.platform.deliveryzone.jalo.GeneratedZoneDeliveryMode
DEFAULT_INITIAL_ATTRIBUTES, NET, PROPERTYNAME, VALUES, VALUESHANDLERFields inherited from class de.hybris.platform.jalo.order.delivery.GeneratedDeliveryMode
ACTIVE, CODE, DESCRIPTION, NAME, SUPPORTEDPAYMENTMODES, SUPPORTEDPAYMENTMODESINTERNALFields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLEDFields 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, TYPEFields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddNewDeliveryModeValue(Zone zone, Currency curr, double minimum, double value) Deprecated.since ages - usesetCost(Currency, double, double, Zone)directlyprotected ItemcreateItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) Has to be implemented for each concrete subtype of item.protected ZoneDeliveryModeValuecreateValue(Zone zone, double value, Currency currency, double min) getAmbigousZones(Set<Zone> zones) protected doublegetCalculationBaseValue(SessionContext ctx, AbstractOrder order, String propName) 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.getCurrencies(Zone zone) Returns all currencies for which values are defined in this delivery mode.Deprecated.since ages - useGeneratedZoneDeliveryMode.getValues()directlyFinds a specific value for a given zone, currency and minimum.Method getValuesgetZones()Returns all zones for which price values are defined in this delivery mode.booleanTells whether or not this mode is using the order subtotal as calculation base.booleanisZoneAllowed(Zone toCheck) Tells whether or not a zone is allowed to be used for adding new values to this delivery mode.protected DoubleparseItemProperty(SessionContext ctx, Item item, String propertyName) booleanremoveCost(Currency curr, double min, Zone zone) Method removeCostMethod setCostvoidConvenience method for setting the special price property name.voidsetPropertyName(SessionContext ctx, String name) Generated method - Setter of theZoneDeliveryMode.propertyNameattribute.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, setValuesMethods inherited from class de.hybris.platform.jalo.order.delivery.DeliveryMode
addSupportedPaymentMode, checkRemovable, getAllDescriptions, getAllNames, getCost, getSupportedPaymentModes, isSupportedPaymentMode, removeSupportedPaymentMode, setAllDescriptions, setAllNames, setCode, setCode, setSupportedPaymentModesMethods 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, setSupportedPaymentModesMethods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getNonInitialAttributes, getRelatedItems, getRelatedItems, setRelatedItemsMethods 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, setLocalizedPropertyMethods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyMethods 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, getPartOfRemovedSessionMarker, 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, suppressRelation, toString, useTA, writeReplaceMethods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
Field Details
-
PROPERTY_NAME
Deprecated.since ages- See Also:
-
-
Constructor Details
-
ZoneDeliveryMode
public ZoneDeliveryMode()
-
-
Method Details
-
createItem
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException Description copied from class:ItemHas 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:
createItemin 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
Description copied from class:GeneratedZoneDeliveryModeGenerated method - Setter of theZoneDeliveryMode.propertyNameattribute.- Overrides:
setPropertyNamein classGeneratedZoneDeliveryModename- 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
Method removeCost- Throws:
JaloDeliveryModeException
-
getZones
Returns all zones for which price values are defined in this delivery mode. -
getCurrencies
Returns all currencies for which values are defined in this delivery mode.- Throws:
JaloDeliveryModeException
-
getValues
Method getValues- Throws:
JaloDeliveryModeException
-
getValue
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(since="ages", forRemoval=false) 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:DeliveryModeCalculates 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:
getCostin classDeliveryMode- Parameters:
ctx- session contextorder- the order to calculate costs for- Throws:
JaloDeliveryModeException
-
getCalculationBaseValue
protected double getCalculationBaseValue(SessionContext ctx, AbstractOrder order, String propName) throws JaloDeliveryModeException - Throws:
JaloDeliveryModeException
-
parseItemProperty
-
getAmbigousZones
-
isZoneAllowed
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
ZoneDeliveryModeValueis tried to be created with such a disallowed zone aConsistencyCheckExceptionis thrown! -
getDeliveryModeValues
@Deprecated(since="ages", forRemoval=false) public Collection<ZoneDeliveryModeValue> getDeliveryModeValues()Deprecated.since ages - useGeneratedZoneDeliveryMode.getValues()directly -
addNewDeliveryModeValue
@Deprecated(since="ages", forRemoval=false) public ZoneDeliveryModeValue addNewDeliveryModeValue(Zone zone, Currency curr, double minimum, double value) throws JaloDeliveryModeException Deprecated.since ages - usesetCost(Currency, double, double, Zone)directly- Throws:
JaloDeliveryModeException
-