Class StaticAssetViewController

java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.AbstractController
org.broadleafcommerce.cms.web.file.StaticAssetViewController
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller

public class StaticAssetViewController extends org.springframework.web.servlet.mvc.AbstractController
Created by jfischer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.springframework.context.ApplicationContext
     
    protected String
     
    protected org.springframework.core.env.Environment
     
     
     
     
    protected String
     

    Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator

    HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST

    Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Map<String,String>
    Converts the given request parameter map into a single key-value map.
    boolean
     
     
     
    protected org.springframework.web.servlet.ModelAndView
    handleRequestInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
    Process the static asset request by determining the asset name.
    protected void
     
    protected boolean
     
    protected String
     
    void
    setAssetServerUrlPrefix(String assetServerUrlPrefix)
     
    void
    setViewResolverName(String viewResolverName)
     

    Methods inherited from class org.springframework.web.servlet.mvc.AbstractController

    handleRequest, isSynchronizeOnSession, setSynchronizeOnSession

    Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator

    applyCacheControl, applyCacheSeconds, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isRequireSession, prepareResponse, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setVaryByRequestHeaders

    Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

    getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext

    Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

    getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext

    Methods inherited from class java.lang.Object

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

    • assetServerUrlPrefix

      protected String assetServerUrlPrefix
    • viewResolverName

      protected String viewResolverName
    • staticAssetStorageService

      protected StaticAssetStorageService staticAssetStorageService
    • siteResolver

      protected BroadleafSiteResolver siteResolver
    • namedOperationManager

      protected NamedOperationManager namedOperationManager
    • env

      @Autowired protected org.springframework.core.env.Environment env
    • appCtx

      @Autowired protected org.springframework.context.ApplicationContext appCtx
  • Constructor Details

    • StaticAssetViewController

      public StaticAssetViewController()
  • Method Details

    • init

      @PostConstruct protected void init()
    • convertParameterMap

      protected Map<String,String> convertParameterMap(Map<String,String[]> parameterMap)
      Converts the given request parameter map into a single key-value map. This will also strip parameters that do not conform to existing application-configured named operations according to #allowUnnamedImageManipulation that appear in NamedOperationManager.getNamedOperationComponents()
      Parameters:
      parameterMap -
      Returns:
    • isAllowedUrlParameter

      protected boolean isAllowedUrlParameter(String parameter)
    • handleRequestInternal

      protected org.springframework.web.servlet.ModelAndView handleRequestInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws Exception
      Process the static asset request by determining the asset name. Checks the current sandbox for a matching asset. If not found, checks the production sandbox.

      The view portion will be handled by a component with the name "blStaticAssetView" This is intended to be the specific class StaticAssetView.

      Specified by:
      handleRequestInternal in class org.springframework.web.servlet.mvc.AbstractController
      Throws:
      Exception
      See Also:
      • StaticAssetView
      • AbstractController.handleRequest(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse)
    • removeAssetPrefix

      protected String removeAssetPrefix(String requestURI)
    • getAllowUnnamedImageManipulation

      public boolean getAllowUnnamedImageManipulation()
    • getAssetServerUrlPrefix

      public String getAssetServerUrlPrefix()
    • setAssetServerUrlPrefix

      public void setAssetServerUrlPrefix(String assetServerUrlPrefix)
    • getViewResolverName

      public String getViewResolverName()
    • setViewResolverName

      public void setViewResolverName(String viewResolverName)