Class ApplicationAssetProcessor

java.lang.Object
org.thymeleaf.processor.AbstractProcessor
org.thymeleaf.processor.element.AbstractElementModelProcessor
com.broadleafcommerce.auth.user.web.dialect.processor.ApplicationAssetProcessor
All Implemented Interfaces:
org.thymeleaf.processor.element.IElementModelProcessor, org.thymeleaf.processor.element.IElementProcessor, org.thymeleaf.processor.IProcessor

@Component public class ApplicationAssetProcessor extends org.thymeleaf.processor.element.AbstractElementModelProcessor
Thymeleaf processor that handles the <blc:application-asset /> tag. This tag will be replaced with an img tag containing the logo asset URL for the application associated with the given client id. If no application is found, any content within the tag be used as fallback content.

Example:

 
 <blc:application-asset />
 
 
Will be replaced with:
 
 <img src="https://example.com/path/to/logo.png"/>
 
 
Since:
Authentication Service 2.3.0, Release Train 2.3.0
Author:
Jon Fleschler (jfleschler)
  • Constructor Details

  • Method Details

    • doProcess

      protected void doProcess(org.thymeleaf.context.ITemplateContext context, org.thymeleaf.model.IModel model, org.thymeleaf.processor.element.IElementModelStructureHandler structureHandler)
      Specified by:
      doProcess in class org.thymeleaf.processor.element.AbstractElementModelProcessor
    • getApplicationForClient

      protected Optional<Application> getApplicationForClient(AuthorizedClient authorizedClient)
      Get the application associated with the given authorized client. If there is no application associated, return an empty optional.
      Parameters:
      authorizedClient - the authorized client
      Returns:
      the application, if found
    • insertApplicationAssetTag

      protected void insertApplicationAssetTag(org.thymeleaf.context.ITemplateContext context, org.thymeleaf.model.IModel model, Application value)
      Insert an img tag with the logo asset URL into the model.
      Parameters:
      context - the template context
      model - the model to modify
      value - the application containing the logo asset
    • getApplicationService

      protected ApplicationService<Application> getApplicationService()
    • getClientService

      protected AuthorizedClientService<AuthorizedClient> getClientService()
    • getContentUrlResolver

      protected com.broadleafcommerce.asset.consumer.jackson.AssetContentUrlResolver getContentUrlResolver()