Class CMSPreviewTicketFilter

java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
de.hybris.platform.cmsocc.filter.CMSPreviewTicketFilter
All Implemented Interfaces:
javax.servlet.Filter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.EnvironmentAware, org.springframework.core.env.EnvironmentCapable, org.springframework.web.context.ServletContextAware

public class CMSPreviewTicketFilter extends org.springframework.web.filter.OncePerRequestFilter
Filter that resolves the preview ticket id from the requested url and activates it.
  • Constructor Details

    • CMSPreviewTicketFilter

      public CMSPreviewTicketFilter()
  • Method Details

    • doFilterInternal

      protected void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) throws javax.servlet.ServletException, IOException
      Specified by:
      doFilterInternal in class org.springframework.web.filter.OncePerRequestFilter
      Throws:
      javax.servlet.ServletException
      IOException
    • redirectRequest

      protected boolean redirectRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, PreviewDataModel previewData)
      Verifies whether a request needs to be redirected when the preview ticket provides a pageId that would override the pageId value defined in the request url. If the request needs to be redirected, it will build the redirect url and perform the redirection.
      Parameters:
      request - - the http servlet request
      response - - the http servlet response
      previewData - - the preview data
      Returns:
      true when the request needs to be redirected, otherwise false
    • getPreviewDataModel

      protected PreviewDataModel getPreviewDataModel(String previewTicketId)
      Retrieves preview data for a given preview ticket id
      Parameters:
      previewTicketId - - preview ticket id
      Returns:
      preview data model
    • sendRedirect

      protected void sendRedirect(javax.servlet.http.HttpServletResponse response, String redirectUrl)
      Sends the redirect request given the redirect url
      Parameters:
      response - - the current response
      redirectUrl - - the redirect url
    • setLanguageInSession

      protected void setLanguageInSession(LanguageModel language)
      Sets the current language in the session
      Parameters:
      language - - the language to be set as the current language
    • setTimeInSession

      protected void setTimeInSession(Date time)
      Sets the current time in the session
      Parameters:
      time - - the time to be set as the current time
    • setSiteInSession

      protected void setSiteInSession(CMSSiteModel site)
      Sets the current site in the session
      Parameters:
      site - - the site to be set as the current site
    • getCmsPreviewService

      protected CMSPreviewService getCmsPreviewService()
    • setCmsPreviewService

      public void setCmsPreviewService(CMSPreviewService cmsPreviewService)
    • getCommerceCommonI18NService

      public CommerceCommonI18NService getCommerceCommonI18NService()
    • setCommerceCommonI18NService

      public void setCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService)
    • getBaseSiteService

      protected BaseSiteService getBaseSiteService()
    • setBaseSiteService

      public void setBaseSiteService(BaseSiteService baseSiteService)
    • getCatalogVersionService

      protected CatalogVersionService getCatalogVersionService()
    • setCatalogVersionService

      public void setCatalogVersionService(CatalogVersionService catalogVersionService)
    • getSessionService

      protected SessionService getSessionService()
    • setSessionService

      public void setSessionService(SessionService sessionService)
    • getTimeService

      protected TimeService getTimeService()
    • setTimeService

      public void setTimeService(TimeService timeService)
    • getPageRedirectStrategy

      protected PageRedirectStrategy getPageRedirectStrategy()
    • setPageRedirectStrategy

      public void setPageRedirectStrategy(PageRedirectStrategy pageRedirectStrategy)