Package de.hybris.platform.product.impl
Class UniqueCatalogItemInterceptor
java.lang.Object
de.hybris.platform.product.impl.UniqueCatalogItemInterceptor
- All Implemented Interfaces:
Interceptor,PrepareInterceptor,ValidateInterceptor
- Direct Known Subclasses:
UniqueClassificationSystemItemInterceptor
public class UniqueCatalogItemInterceptor
extends Object
implements ValidateInterceptor, PrepareInterceptor
Checks (
PrepareInterceptor and ValidateInterceptor) if a product code is unique within its catalog
version. Additionally it also assigns a default catalog version to any model lacking it before creation.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CatalogVersionModelgetDefaultCatalogVersion(InterceptorContext ctx, Object model) voidonPrepare(Object model, InterceptorContext ctx) Called in themodelService.saveAll()method.voidonValidate(Object model, InterceptorContext ctx) Called in themodelService.saveAll()method.voidsetCatalogTypeService(CatalogTypeService catalogTypeService) voidsetInterceptorRegistry(InterceptorRegistry interceptorRegistry) voidsetTypeService(TypeService typeService)
-
Constructor Details
-
UniqueCatalogItemInterceptor
public UniqueCatalogItemInterceptor()
-
-
Method Details
-
setInterceptorRegistry
-
setCatalogTypeService
-
setTypeService
-
onValidate
Description copied from interface:ValidateInterceptorCalled in themodelService.saveAll()method. Validates the values of the given model.- Specified by:
onValidatein interfaceValidateInterceptor- Parameters:
model- the model which values has to be validatedctx- theInterceptorContext- Throws:
InterceptorException- if any values of the model are not valid.
-
onPrepare
Description copied from interface:PrepareInterceptorCalled in themodelService.saveAll()method. Prepares the values of the given model.- Specified by:
onPreparein interfacePrepareInterceptor- Parameters:
model- the model which values has to be preparedctx- theInterceptorContext- Throws:
InterceptorException- if an error occured during the preparation
-
getModifiedCatalogItemModels
protected Collection<UniqueCatalogItemInterceptor.ModifiedCatalogItem> getModifiedCatalogItemModels(InterceptorContext ctx) throws InterceptorException - Throws:
InterceptorException
-
getDefaultCatalogVersion
-