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.
Configuration parameters:
-
Field Summary
FieldsFields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactivateCatalogVersions(javax.servlet.http.HttpSession httpSession) Sets the configured CatalogVersions as session catalogversions for the specified httpSession.voidStores the configured catalogVersions locally.voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain) Before the filterChain gets processed,activateCatalogVersions(HttpSession)gets called.voidsetActiveCatalogVersions(String activeCatalogVersions) voidsetCatalogVersionService(CatalogVersionService catalogVersionService) voidsetOnlySetOnce(boolean onlySetOnce) toString()Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Field Details
-
SESSION_CATALOG_VERSIONS_CONFIGURED
- See Also:
-
-
Constructor Details
-
SimpleCatalogVersionActivationFilter
public SimpleCatalogVersionActivationFilter()default constructor
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet() throws javax.servlet.ServletExceptionStores the configured catalogVersions locally. At this point no activation yet.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classorg.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 requestresponse- the responsefilterChain- the filterChain- Throws:
IOExceptionjavax.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
-
setOnlySetOnce
public void setOnlySetOnce(boolean onlySetOnce) -
setActiveCatalogVersions
-
toString
-