Class CmsContentPagePrepareInterceptor

  • All Implemented Interfaces:
    Interceptor, PrepareInterceptor

    public class CmsContentPagePrepareInterceptor
    extends java.lang.Object
    implements 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 true then we have to fetched all variation pages and change their label accordingly; otherwise do nothing

    See Also:
    PrepareInterceptor
    • Constructor Detail

      • CmsContentPagePrepareInterceptor

        public CmsContentPagePrepareInterceptor()
    • Method Detail

      • changeLabelForPersonalizedPages

        protected void changeLabelForPersonalizedPages​(java.util.Collection<AbstractPageModel> contentPages,
                                                       ContentPageModel currentContentPage,
                                                       java.lang.String oldLabelValue,
                                                       InterceptorContext ctx)
        Fetches all associated content pages (personalized content pages) for current content page and changes a label property to currentContentPage.getLabel()

        Note:
        Important!: We change label property only for non default associated content pages!

        Parameters:
        contentPages - content pages that will be modified
        currentContentPage - current content page
        oldLabelValue - old label value
        ctx - interceptor context
      • setCmsAdminPageService

        public void setCmsAdminPageService​(CMSAdminPageService cmsAdmiPageService)