Class RelatedPagePrepareInterceptor
- java.lang.Object
-
- de.hybris.platform.cms2.servicelayer.interceptor.impl.RelatedPagePrepareInterceptor
-
- All Implemented Interfaces:
Interceptor,PrepareInterceptor<ItemModel>
public class RelatedPagePrepareInterceptor extends java.lang.Object implements PrepareInterceptor<ItemModel>
Prepare interceptor to intercept all save/change operations related toItemModelperformed in the non-active catalog versions. The interceptor will reject pages, by updating their approval status attribute, that are related to the providedItemModel.- See Also:
RelatedPageRejectionService
-
-
Constructor Summary
Constructors Constructor Description RelatedPagePrepareInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.function.Predicate<ItemModel>getCmsItemTypePredicate()protected RelatedPageRejectionServicegetRelatedPageRejectionService()protected booleanisEnabled()protected booleanisFromActiveCatalogVersion(ItemModel item)Determines whether the given item resides in the active catalog version or not.voidonPrepare(ItemModel itemModel, InterceptorContext interceptorContext)Called in themodelService.saveAll()method.voidsetCmsItemTypePredicate(java.util.function.Predicate<ItemModel> cmsItemTypePredicate)voidsetEnabled(boolean isEnabled)voidsetRelatedPageRejectionService(RelatedPageRejectionService relatedPageRejectionService)
-
-
-
Method Detail
-
onPrepare
public void onPrepare(ItemModel itemModel, InterceptorContext interceptorContext) throws InterceptorException
Description copied from interface:PrepareInterceptorCalled in themodelService.saveAll()method. Prepares the values of the given model.- Specified by:
onPreparein interfacePrepareInterceptor<ItemModel>- Parameters:
itemModel- the model which values has to be preparedinterceptorContext- theInterceptorContext- Throws:
InterceptorException- if an error occured during the preparation
-
isFromActiveCatalogVersion
protected boolean isFromActiveCatalogVersion(ItemModel item)
Determines whether the given item resides in the active catalog version or not.
Note: the active catalog is also known as the Online catalog.- Returns:
- TRUE if the item is in the active catalog version, FALSE otherwise
-
getRelatedPageRejectionService
protected RelatedPageRejectionService getRelatedPageRejectionService()
-
setRelatedPageRejectionService
public void setRelatedPageRejectionService(RelatedPageRejectionService relatedPageRejectionService)
-
isEnabled
protected boolean isEnabled()
-
setEnabled
public void setEnabled(boolean isEnabled)
-
getCmsItemTypePredicate
protected java.util.function.Predicate<ItemModel> getCmsItemTypePredicate()
-
setCmsItemTypePredicate
public void setCmsItemTypePredicate(java.util.function.Predicate<ItemModel> cmsItemTypePredicate)
-
-