Class CmsContentPagePrepareInterceptor
java.lang.Object
de.hybris.platform.cms2.servicelayer.interceptor.impl.CmsContentPagePrepareInterceptor
- All Implemented Interfaces:
Interceptor,PrepareInterceptor
This interceptor is invoked before model is saved to the database and before it is validated.
Note:
We check whether the label was changed on the primary content page: if
We check whether the label was changed on the primary content page: if
true then we have to fetched all
variation pages and change their label accordingly; otherwise do nothing- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchangeLabelForPersonalizedPages(Collection<AbstractPageModel> contentPages, ContentPageModel currentContentPage, String oldLabelValue, InterceptorContext ctx) Fetches all associated content pages (personalized content pages) for current content page and changes a label property tocurrentContentPage.getLabel()protected ItemModelContextImplgetContext(AbstractItemModel model) protected Predicate<ContentPageModel>isNotCurrentPage(ContentPageModel currentContentPage) voidonPrepare(Object model, InterceptorContext ctx) Called in themodelService.saveAll()method.protected voidresetHomepageFlag(Collection<AbstractPageModel> contentPages, ContentPageModel currentPageModel, InterceptorContext ctx) voidsetCmsAdminPageService(CMSAdminPageService cmsAdmiPageService)
-
Constructor Details
-
CmsContentPagePrepareInterceptor
public CmsContentPagePrepareInterceptor()
-
-
Method Details
-
changeLabelForPersonalizedPages
protected void changeLabelForPersonalizedPages(Collection<AbstractPageModel> contentPages, ContentPageModel currentContentPage, String oldLabelValue, InterceptorContext ctx) Fetches all associated content pages (personalized content pages) for current content page and changes a label property tocurrentContentPage.getLabel()Note:
Important!: We change label property only for non default associated content pages!- Parameters:
contentPages- content pages that will be modifiedcurrentContentPage- current content pageoldLabelValue- old label valuectx- interceptor context
-
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
-
resetHomepageFlag
protected void resetHomepageFlag(Collection<AbstractPageModel> contentPages, ContentPageModel currentPageModel, InterceptorContext ctx) -
isNotCurrentPage
-
getCmsAdminPageService
-
setCmsAdminPageService
-
getContext
-