Package de.hybris.platform.product.impl
Class PriceRowPrepareInterceptor
- java.lang.Object
-
- de.hybris.platform.product.impl.PDTRowPrepareInterceptor
-
- de.hybris.platform.product.impl.PriceRowPrepareInterceptor
-
- All Implemented Interfaces:
Interceptor,PrepareInterceptor
public class PriceRowPrepareInterceptor extends PDTRowPrepareInterceptor
PrepareInterceptorfor thePriceRowModel. Sets the fallbackUnitModelif no unit is provided for the pricerow. The fallback is the unit fromProductModel.UNIT. If thePriceRowModelANDProductModel.UNITcontains no unit aInterceptorExceptionis thrown.Besides - takes care of updating the matchValue depending on Product/Pg and User/Ug values. The PDtRow common logic is executed as well - see (
PDTRowPrepareInterceptor
-
-
Constructor Summary
Constructors Constructor Description PriceRowPrepareInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcalculateMatchValue(PriceRowModel price)Value 9 : P + C 10 10 : 10 8 : PG + C 01 10 : 6 !!! 7 : P + CG 10 01 : 9 6 : PG + CG 01 01 : 5 !!! 5 : P + 10 00 : 8 4 : PG + 01 00 : 4 3 : + C 00 10 : 2 2 : + CG 00 01 : 1 1 : + 00 00 : 0voidonPrepare(java.lang.Object model, InterceptorContext ctx)Called in themodelService.saveAll()method.protected voidupdateCatalogVersion(PDTRowModel pdtModel)-
Methods inherited from class de.hybris.platform.product.impl.PDTRowPrepareInterceptor
getCatalogTypeService, handleProductAndProductGroup, handleUserAndUserGroup, setCatalogTypeService, setPdtProductModificationMarker, setTypeService, updateProductMatchQualifier, updateUserMatchQualifier
-
-
-
-
Method Detail
-
onPrepare
public void onPrepare(java.lang.Object model, InterceptorContext ctx) throws InterceptorExceptionDescription copied from interface:PrepareInterceptorCalled in themodelService.saveAll()method. Prepares the values of the given model.- Specified by:
onPreparein interfacePrepareInterceptor- Overrides:
onPreparein classPDTRowPrepareInterceptor- Parameters:
model- the model which values has to be preparedctx- theInterceptorContext- Throws:
InterceptorException- if an error occured during the preparation
-
calculateMatchValue
protected int calculateMatchValue(PriceRowModel price)
Value 9 : P + C 10 10 : 10 8 : PG + C 01 10 : 6 !!! 7 : P + CG 10 01 : 9 6 : PG + CG 01 01 : 5 !!! 5 : P + 10 00 : 8 4 : PG + 01 00 : 4 3 : + C 00 10 : 2 2 : + CG 00 01 : 1 1 : + 00 00 : 0r1 > r2 -> value(r1) > value(r2)
-
updateCatalogVersion
protected void updateCatalogVersion(PDTRowModel pdtModel)
- Specified by:
updateCatalogVersionin classPDTRowPrepareInterceptor
-
-