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 java.lang.Object implements ValidateInterceptor, PrepareInterceptor
Checks (PrepareInterceptorandValidateInterceptor) 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 Classes Modifier and Type Class Description protected static classUniqueCatalogItemInterceptor.ModifiedCatalogItem
-
Constructor Summary
Constructors Constructor Description UniqueCatalogItemInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CatalogVersionModelgetDefaultCatalogVersion(InterceptorContext ctx, java.lang.Object model)protected java.util.Collection<UniqueCatalogItemInterceptor.ModifiedCatalogItem>getModifiedCatalogItemModels(InterceptorContext ctx)voidonPrepare(java.lang.Object model, InterceptorContext ctx)Called in themodelService.saveAll()method.voidonValidate(java.lang.Object model, InterceptorContext ctx)Called in themodelService.saveAll()method.voidsetCatalogTypeService(CatalogTypeService catalogTypeService)voidsetInterceptorRegistry(InterceptorRegistry interceptorRegistry)voidsetTypeService(TypeService typeService)
-
-
-
Method Detail
-
setInterceptorRegistry
public void setInterceptorRegistry(InterceptorRegistry interceptorRegistry)
-
setCatalogTypeService
public void setCatalogTypeService(CatalogTypeService catalogTypeService)
-
setTypeService
public void setTypeService(TypeService typeService)
-
onValidate
public void onValidate(java.lang.Object model, InterceptorContext ctx) throws InterceptorExceptionDescription 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
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- Parameters:
model- the model which values has to be preparedctx- theInterceptorContext- Throws:
InterceptorException- if an error occured during the preparation
-
getModifiedCatalogItemModels
protected java.util.Collection<UniqueCatalogItemInterceptor.ModifiedCatalogItem> getModifiedCatalogItemModels(InterceptorContext ctx) throws InterceptorException
- Throws:
InterceptorException
-
getDefaultCatalogVersion
protected CatalogVersionModel getDefaultCatalogVersion(InterceptorContext ctx, java.lang.Object model)
-
-