Package de.hybris.platform.voucher.jalo
Class VoucherManager
java.lang.Object
de.hybris.platform.jalo.Manager
de.hybris.platform.jalo.extension.Extension
de.hybris.platform.voucher.jalo.GeneratedVoucherManager
de.hybris.platform.voucher.jalo.VoucherManager
- All Implemented Interfaces:
ItemLifecycleListener,Serializable
The manager for voucher items.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.jalo.extension.Extension
Extension.RestrictedLanguagesProvider, Extension.RightsProviderNested classes/interfaces inherited from class de.hybris.platform.jalo.Manager
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator -
Field Summary
Fields inherited from class de.hybris.platform.voucher.jalo.GeneratedVoucherManager
DEFAULT_INITIAL_ATTRIBUTES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterOrderCreation(Order order, Cart cart) Transfers vouchers form cart to newly created order.voidafterOrderCreation(SessionContext ctx, Order order, Cart cart) Transfers vouchers form cart to newly created order.voidcreateEssentialData(Map params, JspContext jspc) Creates essential data for the voucher extension.getAppliedVoucherCodes(Cart item) getAppliedVoucherCodes(Order order) getAppliedVoucherCodes(SessionContext ctx, Cart item) getAppliedVoucherCodes(SessionContext ctx, Order order) getAppliedVouchers(AbstractOrder anOrder) static VoucherManagerstatic VoucherManagergetInstance(JaloSession jaloSession) Gets the Instance of the VoucherManagergetPromotionVouchers(String voucherCode) getSerialVouchers(String aVoucherCode) getVoucher(String voucherCode) booleanredeemVoucher(String aVoucherCode, Cart aCart) redeemVoucher(String aVoucherCode, Order anOrder) voidreleaseVoucher(String aVoucherCode, Cart aCart) voidreleaseVoucher(String aVoucherCode, Order anOrder) reserveVoucher(String aVoucherCode, Order anOrder) Methods inherited from class de.hybris.platform.voucher.jalo.GeneratedVoucherManager
createDateRestriction, createDateRestriction, createNewCustomerRestriction, createNewCustomerRestriction, createOrderRestriction, createOrderRestriction, createProductCategoryRestriction, createProductCategoryRestriction, createProductQuantityRestriction, createProductQuantityRestriction, createProductRestriction, createProductRestriction, createPromotionVoucher, createPromotionVoucher, createRegularCustomerOrderQuantityRestriction, createRegularCustomerOrderQuantityRestriction, createRegularCustomerOrderTotalRestriction, createRegularCustomerOrderTotalRestriction, createRestriction, createRestriction, createSerialVoucher, createSerialVoucher, createUserRestriction, createUserRestriction, createVoucherInvalidation, createVoucherInvalidation, getDefaultAttributeModes, getNameMethods inherited from class de.hybris.platform.jalo.extension.Extension
checkBeforeInitialization, checkBeforeItemRemoval, createProjectData, createSampleData, getCreatorDescription, getCreatorName, getCreatorParameterDefault, getCreatorParameterNames, getCreatorParameterPossibleValues, getRemote, isCreatorDisabled, notifyInitializationEnd, notifyInitializationStart, notifyItemRemoval, onFirstSessionCreation, writeReplaceMethods inherited from class de.hybris.platform.jalo.Manager
afterItemCreation, beforeItemCreation, destroy, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, init, setAttribute, setTenant, setTransientObject, wrap
-
Constructor Details
-
VoucherManager
public VoucherManager()
-
-
Method Details
-
createEssentialData
Creates essential data for the voucher extension.- Overrides:
createEssentialDatain classExtension
-
afterOrderCreation
Transfers vouchers form cart to newly created order. Please make sure to call this always afterOrderManager.createOrder(AbstractOrder).- Parameters:
order- the newly created ordercart- the cart which this order has been created from
-
afterOrderCreation
Transfers vouchers form cart to newly created order. Please make sure to call this always afterOrderManager.createOrder(AbstractOrder).- Parameters:
ctx- the session contextorder- the newly created ordercart- the cart which this order has been created from
-
getAllVouchers
- Returns:
- a Collection with all found
Vouchers
-
getAppliedVoucherCodes
-
getAppliedVoucherCodes
-
getAppliedVoucherCodes
-
getAppliedVoucherCodes
-
getAppliedVouchers
- Parameters:
anOrder- the given order- Returns:
- a Collection with all applied
Vouchers for this order
-
getInstance
Gets the Instance of the VoucherManager- Parameters:
jaloSession- the Jalo Session- Returns:
- the Instance of the VoucherManager
-
getInstance
- Returns:
- instance of this manager
-
getVoucher
- Parameters:
voucherCode- the code- Returns:
- the first
Voucherfor the given code. This includesPromotionVoucherandSerialVoucher.
-
getPromotionVouchers
- Parameters:
voucherCode- the code- Returns:
- a Collection of
PromotionVouchers
-
getSerialVouchers
- Parameters:
aVoucherCode- the code- Returns:
- a Collection of
SerialVouchers
-
redeemVoucher
For the givenCartthe givenVoucherwill be redeem.WARNING!
If some methods for checking voucher availability are called before this method, all these methods have to be in one synchronize block! Suggested synchronization object is cart.- Parameters:
aVoucherCode- code of the VoucheraCart- the cart- Returns:
- true if the redemption was successful
- Throws:
JaloPriceFactoryException
-
redeemVoucher
-
releaseVoucher
- Throws:
JaloPriceFactoryException
-
releaseVoucher
- Throws:
ConsistencyCheckException
-
reserveVoucher
-