Class ResourcesRequest

java.lang.Object
org.broadleafcommerce.common.web.request.ResourcesRequest

@RequestScope @Component("blResourcesRequest") public class ResourcesRequest extends Object
Keeps track of the resources needed for <blc:bundle> and <blc:bundlepreload> tags so that the list of files does not need to be duplicated across both tags.
Author:
Jacob Mitash
  • Field Details

  • Constructor Details

    • ResourcesRequest

      public ResourcesRequest()
  • Method Details

    • getBundle

      public ResourcesRequestBundle getBundle(@Nonnull String name, String mappingPrefix, List<String> files)
      Gets the bundle for the bundle name, prefix, and file list if previously used on this request.

      Note that the mapping prefix and file list will be assumed to be the same if not provided.

      Parameters:
      name - the name of the bundle to search for
      mappingPrefix - the mapping prefix of the bundle request, or null if not provided
      files - the list of files of the bundle request, or null if not provided
      Returns:
      the bundle request if found, otherwise null
    • saveBundle

      public void saveBundle(String name, String mappingPrefix, List<String> files, String bundlePath)
      Saves the bundled file to the request so it can be recalled later in the template
      Parameters:
      name - the name of the bundle
      mappingPrefix - the mapping prefix of the bundle
      files - the list of files in the bundle
      bundlePath - the path of the resulting bundle
    • saveBundle

      public void saveBundle(String name, String mappingPrefix, List<String> files, List<String> bundledFilePaths)
      Saves the bundled file to the request so it can be recalled later in the template
      Parameters:
      name - the name of the bundle
      mappingPrefix - the mapping prefix of the bundle
      files - the list of files in the bundle
      bundledFilePaths - the list of unbundled file paths to include in the template