Class SappricingManager
- java.lang.Object
-
- de.hybris.platform.jalo.Manager
-
- de.hybris.platform.jalo.extension.Extension
-
- de.hybris.platform.sap.sappricing.jalo.GeneratedSappricingManager
-
- de.hybris.platform.sap.sappricing.jalo.SappricingManager
-
- All Implemented Interfaces:
ItemLifecycleListener,PriceFactory,java.io.Serializable
public class SappricingManager extends GeneratedSappricingManager implements PriceFactory
This is the extension manager of the Sappricing extension.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.extension.Extension
Extension.RestrictedLanguagesProvider, Extension.RightsProvider
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.Manager
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.sap.sappricing.jalo.GeneratedSappricingManager
DEFAULT_INITIAL_ATTRIBUTES
-
-
Constructor Summary
Constructors Constructor Description SappricingManager()Never call the constructor of any manager directly, call getInstance() You can place your business logic here - like registering a jalo session listener.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateEssentialData(java.util.Map<java.lang.String,java.lang.String> params, JspContext jspc)Implement this method to create initial objects.voidcreateProjectData(java.util.Map<java.lang.String,java.lang.String> params, JspContext jspc)Implement this method to create data that is used in your project.voiddestroy()Use this method as a callback when the manager instance is being destroyed (this happens before system initialization, at redeployment or if you shutdown your VM).ProductPriceInformationsgetAllPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)Implement this to calculates a product price quote containing all applicable prices, discounts and taxes for the given product and net/gross state.PriceValuegetBasePrice(AbstractOrderEntry entry)Implement this to define thebase priceof an order entryjava.util.ListgetDiscountValues(AbstractOrder order)Implement this to define(global) discount valuesfor an order.java.util.ListgetDiscountValues(AbstractOrderEntry entry)Implement this to definediscount valuesfor an order entry.static SappricingManagergetInstance()Get the valid instance of this manager.java.util.ListgetProductDiscountInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)Implement this to show all discounts which may apply to the given productjava.util.ListgetProductPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)Implement this to show all prices available for the given productjava.util.ListgetProductTaxInformations(SessionContext ctx, Product product, java.util.Date date)Implement this to show all taxes which apply to the given productjava.util.CollectiongetTaxValues(AbstractOrderEntry entry)Implement this to definetax valuesfor an order entry.voidinit()Use this method to do some basic work only ONCE in the lifetime of a tenant resp.booleanisNetUser(User user)Implement this to define whether a user should be treated as net or gross customer.-
Methods inherited from class de.hybris.platform.sap.sappricing.jalo.GeneratedSappricingManager
getDefaultAttributeModes, getName
-
Methods inherited from class de.hybris.platform.jalo.extension.Extension
checkBeforeItemRemoval, createSampleData, getCreatorDescription, getCreatorName, getCreatorParameterDefault, getCreatorParameterNames, getCreatorParameterPossibleValues, getRemote, isCreatorDisabled, notifyInitializationEnd, notifyInitializationStart, notifyItemRemoval, onFirstSessionCreation, writeReplace
-
Methods inherited from class de.hybris.platform.jalo.Manager
afterItemCreation, beforeItemCreation, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, setAttribute, setTenant, setTransientObject, wrap
-
-
-
-
Method Detail
-
getInstance
public static SappricingManager getInstance()
Get the valid instance of this manager.- Returns:
- the current instance of this manager
-
init
public void init()
Use this method to do some basic work only ONCE in the lifetime of a tenant resp. "deployment". This method is called after manager creation (for example within startup of a tenant). Note that if you have more than one tenant you have a manager instance for each tenant.
-
destroy
public void destroy()
Use this method as a callback when the manager instance is being destroyed (this happens before system initialization, at redeployment or if you shutdown your VM). Note that if you have more than one tenant you have a manager instance for each tenant.
-
createEssentialData
public void createEssentialData(java.util.Map<java.lang.String,java.lang.String> params, JspContext jspc)Implement this method to create initial objects. This method will be called by system creator during initialization and system update. Be sure that this method can be called repeatedly. An example usage of this method is to create required cronjobs or modifying the type system (setting e.g some default values)- Overrides:
createEssentialDatain classExtension- Parameters:
params- the parameters provided by user for creation of objects for the extensionjspc- the jsp context; you can use it to write progress information to the jsp page during creation
-
createProjectData
public void createProjectData(java.util.Map<java.lang.String,java.lang.String> params, JspContext jspc)Implement this method to create data that is used in your project. This method will be called during the system initialization. An example use is to import initial data like currencies or languages for your project from an csv file.- Overrides:
createProjectDatain classExtension- Parameters:
params- the parameters provided by user for creation of objects for the extensionjspc- the jsp context; you can use it to write progress information to the jsp page during creation
-
getAllPriceInformations
public ProductPriceInformations getAllPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to calculates a product price quote containing all applicable prices, discounts and taxes for the given product and net/gross state.This default implementation just calls
PriceFactory.getProductPriceInformations(SessionContext, Product, Date, boolean),PriceFactory.getProductTaxInformations(SessionContext, Product, Date)andPriceFactory.getProductDiscountInformations(SessionContext, Product, Date, boolean)and wraps the results inside aProductPriceInformationsobject.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
PriceFactory.getProductPriceInformations(SessionContext, Product, Date, boolean),PriceFactory.getProductTaxInformations(SessionContext, Product, Date)andPriceFactory.getProductDiscountInformations(SessionContext, Product, Date, boolean)since these methods are called byProductdirectly.- Specified by:
getAllPriceInformationsin interfacePriceFactory- Throws:
JaloPriceFactoryException- if a calculation error occured
-
getProductPriceInformations
public java.util.List getProductPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to show all prices available for the given product- Specified by:
getProductPriceInformationsin interfacePriceFactoryproduct- the productnet- the net/gross state of the requested prices- Returns:
- a list of
PriceInformationobjects - Throws:
JaloPriceFactoryException- if price calculation error occured
-
getProductTaxInformations
public java.util.List getProductTaxInformations(SessionContext ctx, Product product, java.util.Date date) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to show all taxes which apply to the given product- Specified by:
getProductTaxInformationsin interfacePriceFactoryproduct- the product- Returns:
- a list of
TaxInformationobjects - Throws:
JaloPriceFactoryException- if price calculation error occured
-
getProductDiscountInformations
public java.util.List getProductDiscountInformations(SessionContext ctx, Product product, java.util.Date date, boolean net) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to show all discounts which may apply to the given product- Specified by:
getProductDiscountInformationsin interfacePriceFactoryproduct- the product- Returns:
- a list of
DiscountInformationobjects - Throws:
JaloPriceFactoryException- if price calculation error occured
-
isNetUser
public boolean isNetUser(User user)
Description copied from interface:PriceFactoryImplement this to define whether a user should be treated as net or gross customer.- Specified by:
isNetUserin interfacePriceFactory- Returns:
- true, if the given user is treated as a net customer
-
getTaxValues
public java.util.Collection getTaxValues(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to definetax valuesfor an order entry.- Specified by:
getTaxValuesin interfacePriceFactory- Returns:
- the Collection of TaxValues assigned to the given AbstractOrderEntry
- Throws:
JaloPriceFactoryException
-
getBasePrice
public PriceValue getBasePrice(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to define thebase priceof an order entry- Specified by:
getBasePricein interfacePriceFactory- Returns:
- a price with the order's currency iso code, 0.0 as value and the order's net status
- Throws:
JaloPriceFactoryException
-
getDiscountValues
public java.util.List getDiscountValues(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to definediscount valuesfor an order entry.- Specified by:
getDiscountValuesin interfacePriceFactory- Returns:
- the Collection of DiscountValues assigned to the given AbstractOrderEntry
- Throws:
JaloPriceFactoryException
-
getDiscountValues
public java.util.List getDiscountValues(AbstractOrder order) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to define(global) discount valuesfor an order.These discount values are applied to the whole order, not just to one entry like
PriceFactory.getDiscountValues(AbstractOrderEntry)- Specified by:
getDiscountValuesin interfacePriceFactory- Returns:
- the Collection of DiscountValues applicable to the given AbstractOrder
- Throws:
JaloPriceFactoryException
-
-