org.broadleafcommerce.common.resource.service
Interface ResourceBundlingService

All Known Implementing Classes:
ResourceBundlingServiceImpl

public interface ResourceBundlingService

This service is responsible for interaction with the ResourceBundleProcessor to generate versioned names for bundles as well as the bundle content.

Author:
Andre Azzolini (apazzolini)

Method Summary
 List<String> getAdditionalBundleFiles(String bundleName)
           
 org.springframework.core.io.Resource getBundle(String versionedBundleName)
          For the given versioned bundle name, returns a Resource that holds the contents of the combined, and possibly minified (if enabled) bundle.
 String getVersionedBundleName(String unversionedBundleName)
          For a given unversioned bundle name, such as "global.js", returns the currently known versioned bundle name, such as "global12345.js".
 boolean hasBundle(String versionedBundle)
           
 String registerBundle(String bundleName, List<String> files, BroadleafResourceHttpRequestHandler handler)
          Registers a new bundle with the given name to its files.
 

Method Detail

getBundle

org.springframework.core.io.Resource getBundle(String versionedBundleName)
For the given versioned bundle name, returns a Resource that holds the contents of the combined, and possibly minified (if enabled) bundle.

Parameters:
versionedBundleName -
Returns:
the Resource

getVersionedBundleName

String getVersionedBundleName(String unversionedBundleName)
For a given unversioned bundle name, such as "global.js", returns the currently known versioned bundle name, such as "global12345.js".

Parameters:
unversionedBundleName -
Returns:
the versioned bundle name

registerBundle

String registerBundle(String bundleName,
                      List<String> files,
                      BroadleafResourceHttpRequestHandler handler)
                      throws IOException
Registers a new bundle with the given name to its files. Will utilize the locations map in handler as well as any configured generated resource handlers in the handler to determine legitimate paths for each of the files in the list.

Parameters:
bundleName -
files -
handler -
Returns:
the versioned bundle name
Throws:
IOException

hasBundle

boolean hasBundle(String versionedBundle)
Parameters:
versionedBundle -
Returns:
whether or not the given versioned bundle name is currently registered in the system

getAdditionalBundleFiles

List<String> getAdditionalBundleFiles(String bundleName)
Parameters:
bundleName -
Returns:
a list of additional files that are registered for the given bundle name


Copyright © 2013. All Rights Reserved.