Class SimpleCatalogVersionActivationFilter

java.lang.Object
org.springframework.web.filter.GenericFilterBean
de.hybris.platform.servicelayer.web.SimpleCatalogVersionActivationFilter
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 SimpleCatalogVersionActivationFilter extends org.springframework.web.filter.GenericFilterBean
SimpleCatalogVersionActivationFilter assures that the configured catalog versions are set as session catalog versions.
Configuration parameters:
  • activeCatalogVersions: String specifying the catalog version which should be set as session catalogversion, format is : catalogId:catalogVersion,catalogId2:catalogVersion2. (E.g.hwcatalog:Online,clothescatalog:Online in order to activate the online versions of HWCatalog and ClothesCatalog)
  • onlySetOnce: Set to true if order to set the session catalogVersions only once for a http session.
    • Field Details

    • Constructor Details

      • SimpleCatalogVersionActivationFilter

        public SimpleCatalogVersionActivationFilter()
        default constructor
    • Method Details

      • afterPropertiesSet

        public void afterPropertiesSet() throws javax.servlet.ServletException
        Stores the configured catalogVersions locally. At this point no activation yet.
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Overrides:
        afterPropertiesSet in class org.springframework.web.filter.GenericFilterBean
        Throws:
        javax.servlet.ServletException
      • doFilter

        public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain) throws IOException, javax.servlet.ServletException
        Before the filterChain gets processed, activateCatalogVersions(HttpSession) gets called.
        Parameters:
        request - the request
        response - the response
        filterChain - the filterChain
        Throws:
        IOException
        javax.servlet.ServletException
      • activateCatalogVersions

        protected void activateCatalogVersions(javax.servlet.http.HttpSession httpSession)
        Sets the configured CatalogVersions as session catalogversions for the specified httpSession. Before trying to set the configured session catalogversions this methods checks if there is at least one catalogversion configured and if the onlySetOnce flag is set to true, if the catalogversions have not been set for this httpSession.
        Parameters:
        httpSession - the httpSession which is used to set the marker for the onlySetOnce flag to ensure the session catalogversions are only set once for the specified httpSession
      • setCatalogVersionService

        public void setCatalogVersionService(CatalogVersionService catalogVersionService)
      • setOnlySetOnce

        public void setOnlySetOnce(boolean onlySetOnce)
      • setActiveCatalogVersions

        public void setActiveCatalogVersions(String activeCatalogVersions)
      • toString

        public String toString()
        Overrides:
        toString in class Object