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
PrepareInterceptor for the PriceRowModel. Sets the fallback UnitModel if no unit is provided
for the pricerow. The fallback is the unit from ProductModel.UNIT. If the PriceRowModel AND
ProductModel.UNIT contains no unit a InterceptorException is 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected 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(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
-
Constructor Details
-
PriceRowPrepareInterceptor
public PriceRowPrepareInterceptor()
-
-
Method Details
-
onPrepare
Description 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
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
- Specified by:
updateCatalogVersionin classPDTRowPrepareInterceptor
-