Class UrlRewriteProcessor

java.lang.Object
org.broadleafcommerce.presentation.dialect.AbstractBroadleafAttributeModifierProcessor
org.broadleafcommerce.cms.web.processor.UrlRewriteProcessor
All Implemented Interfaces:
org.broadleafcommerce.presentation.dialect.BroadleafAttributeModifierProcessor, org.broadleafcommerce.presentation.dialect.BroadleafProcessor
Direct Known Subclasses:
HrefUrlRewriteProcessor

@Component("blUrlRewriteProcessor") @ConditionalOnTemplating public class UrlRewriteProcessor extends org.broadleafcommerce.presentation.dialect.AbstractBroadleafAttributeModifierProcessor
A Thymeleaf processor that processes the given url through the StaticAssetService's StaticAssetService.convertAssetPath(String, String, boolean) method to determine the appropriate URL for the asset to be served from.
Author:
apazzolini
  • Field Details

    • staticAssetPathService

      protected org.broadleafcommerce.common.file.service.StaticAssetPathService staticAssetPathService
  • Constructor Details

    • UrlRewriteProcessor

      public UrlRewriteProcessor()
  • Method Details

    • getName

      public String getName()
    • getPrecedence

      public int getPrecedence()
      Specified by:
      getPrecedence in interface org.broadleafcommerce.presentation.dialect.BroadleafProcessor
      Overrides:
      getPrecedence in class org.broadleafcommerce.presentation.dialect.AbstractBroadleafAttributeModifierProcessor
    • getModifiedAttributes

      public org.broadleafcommerce.presentation.model.BroadleafAttributeModifier getModifiedAttributes(String tagName, Map<String,String> tagAttributes, String attributeName, String attributeValue, org.broadleafcommerce.presentation.model.BroadleafTemplateContext context)
    • getFullAssetPath

      protected String getFullAssetPath(String tagName, String attributeValue, org.broadleafcommerce.presentation.model.BroadleafTemplateContext context)
    • isRequestSecure

      protected boolean isRequestSecure(jakarta.servlet.http.HttpServletRequest request)
      Returns:
      true if the current request.scheme = HTTPS or if the request.isSecure value is true.
    • isImageTag

      protected boolean isImageTag(String tagName)
    • isAdminRequest

      protected boolean isAdminRequest()
    • isImageExtension

      protected Boolean isImageExtension(String extension)
    • parsePath

      protected String parsePath(String attributeValue, org.broadleafcommerce.presentation.model.BroadleafTemplateContext context)
    • getFileExtension

      protected String getFileExtension(String assetPath)
    • getDefaultFileTypeImagePath

      protected String getDefaultFileTypeImagePath(String extension)
    • getQueryString

      protected String getQueryString(String assetPath)