Class BroadleafProcessURLFilter

java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.broadleafcommerce.cms.web.BroadleafProcessURLFilter
All Implemented Interfaces:
jakarta.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

@Deprecated public class BroadleafProcessURLFilter extends org.springframework.web.filter.OncePerRequestFilter
Deprecated.
In favor of org.broadleafcommerce.common.web.BroadleafRequestFilter. formally component name "blProcessURLFilter"

This filter sets up the CMS system by setting the current sandbox, locale, time of day, and languageCode that used by content items.

After setting up content variables, it checks to see if a request can be processed by an instance of URLProcessor and if so, delegates the request to that processor.

This filter creates an internal cache to quickly determine if the request should be processed by an instance of URLProcessor or be passed to the next filter in the filter chain. The cache settings (including expiration seconds, maximum elements, and concurrency) can be configured via Spring at startup. See com.google.common.cache.CacheBuilder for more information on these parameters.

Author:
bpolster
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
    Deprecated.
    Parameter/Attribute name for the current language
    static String
    Deprecated.
    Parameter/Attribute name for the current language
    static String
    Deprecated.
    Parameter/Attribute name for the current language
    static String
    Deprecated.
    Request attribute to store the current sandbox
    protected Boolean
    Deprecated.
     

    Fields inherited from class org.springframework.web.filter.OncePerRequestFilter

    ALREADY_FILTERED_SUFFIX

    Fields inherited from class org.springframework.web.filter.GenericFilterBean

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doFilterInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain)
    Deprecated.
    (non-Javadoc)
    int
    Deprecated.
     
    protected Set
    Deprecated.
    Returns a set of suffixes that can be ignored by content processing.
    int
    Deprecated.
     
    int
    Deprecated.
     
    Deprecated.
     
    Deprecated.
     
    void
    setCacheExpirationSeconds(int cacheExpirationSeconds)
    Deprecated.
     
    protected void
    setContentTime(jakarta.servlet.http.HttpServletRequest request)
    Deprecated.
     
    void
    setMaxCacheConcurrency(int maxCacheConcurrency)
    Deprecated.
     
    void
    setMaxCacheElements(int maxCacheElements)
    Deprecated.
     
    void
    setSandBoxPreviewEnabled(Boolean sandBoxPreviewEnabled)
    Deprecated.
     
    void
    Deprecated.
     
    protected boolean
    shouldProcessURL(jakarta.servlet.http.HttpServletRequest request, String requestURI)
    Deprecated.
    Determines if the passed in URL should be processed by the content management system.

    Methods inherited from class org.springframework.web.filter.OncePerRequestFilter

    doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch

    Methods inherited from class org.springframework.web.filter.GenericFilterBean

    addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOCALE_VAR

      public static String LOCALE_VAR
      Deprecated.
      Parameter/Attribute name for the current language
    • LOCALE_CODE_PARAM

      public static String LOCALE_CODE_PARAM
      Deprecated.
      Parameter/Attribute name for the current language
    • REQUEST_DTO

      public static String REQUEST_DTO
      Deprecated.
      Parameter/Attribute name for the current language
    • SANDBOX_VAR

      public static String SANDBOX_VAR
      Deprecated.
      Request attribute to store the current sandbox
    • sandBoxPreviewEnabled

      protected Boolean sandBoxPreviewEnabled
      Deprecated.
  • Constructor Details

    • BroadleafProcessURLFilter

      public BroadleafProcessURLFilter()
      Deprecated.
  • Method Details

    • doFilterInternal

      public void doFilterInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain) throws IOException, jakarta.servlet.ServletException
      Deprecated.
      (non-Javadoc)
      Specified by:
      doFilterInternal in class org.springframework.web.filter.OncePerRequestFilter
      Throws:
      IOException
      jakarta.servlet.ServletException
      See Also:
      • Filter.doFilter(jakarta.servlet.ServletRequest, jakarta.servlet.ServletResponse, jakarta.servlet.FilterChain)
    • shouldProcessURL

      protected boolean shouldProcessURL(jakarta.servlet.http.HttpServletRequest request, String requestURI)
      Deprecated.
      Determines if the passed in URL should be processed by the content management system.

      By default, this method returns false for any BLC-Admin URLs and service calls and for all common image/digital mime-types (as determined by an internal call to getIgnoreSuffixes.

      This check is called with the doFilterInternal method to short-circuit the content processing which can be expensive for requests that do not require it.

      Parameters:
      requestURI - - the HttpServletRequest.getRequestURI
      Returns:
      true if the HttpServletRequest should be processed
    • setContentTime

      protected void setContentTime(jakarta.servlet.http.HttpServletRequest request)
      Deprecated.
    • getIgnoreSuffixes

      protected Set getIgnoreSuffixes()
      Deprecated.
      Returns a set of suffixes that can be ignored by content processing. The following are returned:

      List of suffixes ignored:

      ".aif", ".aiff", ".asf", ".avi", ".bin", ".bmp", ".doc", ".eps", ".gif", ".hqx", ".jpg", ".jpeg", ".mid", ".midi", ".mov", ".mp3", ".mpg", ".mpeg", ".p65", ".pdf", ".pic", ".pict", ".png", ".ppt", ".psd", ".qxd", ".ram", ".ra", ".rm", ".sea", ".sit", ".stk", ".swf", ".tif", ".tiff", ".txt", ".rtf", ".vob", ".wav", ".wmf", ".xls", ".zip";

      Returns:
      set of suffixes to ignore.
    • getMaxCacheElements

      public int getMaxCacheElements()
      Deprecated.
    • setMaxCacheElements

      public void setMaxCacheElements(int maxCacheElements)
      Deprecated.
    • getCacheExpirationSeconds

      public int getCacheExpirationSeconds()
      Deprecated.
    • setCacheExpirationSeconds

      public void setCacheExpirationSeconds(int cacheExpirationSeconds)
      Deprecated.
    • getMaxCacheConcurrency

      public int getMaxCacheConcurrency()
      Deprecated.
    • setMaxCacheConcurrency

      public void setMaxCacheConcurrency(int maxCacheConcurrency)
      Deprecated.
    • getUrlProcessorList

      public List<URLProcessor> getUrlProcessorList()
      Deprecated.
    • setUrlProcessorList

      public void setUrlProcessorList(List<URLProcessor> urlProcessorList)
      Deprecated.
    • getSandBoxPreviewEnabled

      public Boolean getSandBoxPreviewEnabled()
      Deprecated.
    • setSandBoxPreviewEnabled

      public void setSandBoxPreviewEnabled(Boolean sandBoxPreviewEnabled)
      Deprecated.