@Service(value="blResourceBundlingService") public class ResourceBundlingServiceImpl extends Object implements ResourceBundlingService
ResourceBundlingService
Modifier and Type | Field and Description |
---|---|
protected Map<String,List<String>> |
additionalBundleFiles |
protected org.springframework.web.servlet.resource.ResourceHttpRequestHandler |
cssResourceHandler |
protected BroadleafFileService |
fileService |
protected org.springframework.web.servlet.resource.ResourceHttpRequestHandler |
jsResourceHandler |
protected static org.apache.commons.logging.Log |
LOG |
protected StatisticsService |
statisticsService |
Constructor and Description |
---|
ResourceBundlingServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected String |
addVersion(String requestPath,
String version)
Copied from Spring 4.1 AbstractVersionStrategy
|
boolean |
checkForRegisteredBundleFile(String versionedBundleName)
Returns true if the passed in name represents a versionedBundle
|
protected org.springframework.core.io.Resource |
createBundle(String versionedBundleName,
List<String> filePaths,
org.springframework.web.servlet.resource.ResourceResolverChain resolverChain,
List<org.springframework.core.io.Resource> locations) |
protected void |
createBundleIfNeeded(String versionedBundleName,
List<String> filePaths,
org.springframework.web.servlet.resource.ResourceResolverChain resolverChain,
List<org.springframework.core.io.Resource> locations) |
protected org.springframework.web.servlet.resource.ResourceHttpRequestHandler |
findResourceHttpRequestHandler(String resourceName) |
List<String> |
getAdditionalBundleFiles(String bundleName)
Through configuration, you can provide additional files that will be automatically included
for any bundle.
|
protected org.springframework.core.io.Resource |
getBundledResource(String versionedBundleName) |
protected String |
getBundleName(String bundleName,
String version) |
protected String |
getBundleVersion(LinkedHashMap<String,org.springframework.core.io.Resource> foundResources) |
protected String |
getCacheKey(String unversionedBundleName,
List<String> files) |
protected String |
getResourcePath(String name)
Returns the resource path for the given name in URL-format (meaning, / separators)
|
protected boolean |
isCSSResource(String resourceName) |
protected boolean |
isJavaScriptResource(String resourceName) |
protected String |
lookupBundlePath(String requestPath) |
protected org.springframework.core.io.Resource |
readBundle(String versionedBundleName) |
org.springframework.core.io.Resource |
rebuildBundledResource(String requestedBundleName)
Returns a newly rebuilt bundled resource given that the passed requestedBundleName had previously been built and cached/persisted via
the
resolveBundleResourceName method |
org.springframework.core.io.Resource |
resolveBundleResource(String versionedBundleResourceName)
Returns a Resource for passed in versionedBundleResourceName.
|
String |
resolveBundleResourceName(String requestedBundleName,
String mappingPrefix,
List<String> files)
Returns a file name representing a versioned copy of the bundle.
|
protected void |
saveBundle(org.springframework.core.io.Resource resource) |
void |
setAdditionalBundleFiles(Map<String,List<String>> additionalBundleFiles) |
protected static final org.apache.commons.logging.Log LOG
protected BroadleafFileService fileService
@Autowired(required=false) @Qualifier(value="blJsResources") protected org.springframework.web.servlet.resource.ResourceHttpRequestHandler jsResourceHandler
@Autowired(required=false) @Qualifier(value="blCssResources") protected org.springframework.web.servlet.resource.ResourceHttpRequestHandler cssResourceHandler
protected StatisticsService statisticsService
public org.springframework.core.io.Resource rebuildBundledResource(String requestedBundleName)
ResourceBundlingService
resolveBundleResourceName
methodrebuildBundledResource
in interface ResourceBundlingService
public String resolveBundleResourceName(String requestedBundleName, String mappingPrefix, List<String> files)
ResourceBundlingService
First computes the bundle version by checking examining the files in the bundle.
If the bundle does not exist, this method will make a call to create it.
resolveBundleResourceName
in interface ResourceBundlingService
public org.springframework.core.io.Resource resolveBundleResource(String versionedBundleResourceName)
ResourceBundlingService
#getBundleResourceName(String, List)
resolveBundleResource
in interface ResourceBundlingService
public boolean checkForRegisteredBundleFile(String versionedBundleName)
ResourceBundlingService
checkForRegisteredBundleFile
in interface ResourceBundlingService
protected org.springframework.core.io.Resource getBundledResource(String versionedBundleName)
protected void createBundleIfNeeded(String versionedBundleName, List<String> filePaths, org.springframework.web.servlet.resource.ResourceResolverChain resolverChain, List<org.springframework.core.io.Resource> locations)
protected org.springframework.core.io.Resource createBundle(String versionedBundleName, List<String> filePaths, org.springframework.web.servlet.resource.ResourceResolverChain resolverChain, List<org.springframework.core.io.Resource> locations)
protected void saveBundle(org.springframework.core.io.Resource resource)
protected String getBundleVersion(LinkedHashMap<String,org.springframework.core.io.Resource> foundResources) throws IOException
IOException
public List<String> getAdditionalBundleFiles(String bundleName)
ResourceBundlingService
getAdditionalBundleFiles
in interface ResourceBundlingService
public void setAdditionalBundleFiles(Map<String,List<String>> additionalBundleFiles)
protected String addVersion(String requestPath, String version)
requestPath
- version
- protected org.springframework.core.io.Resource readBundle(String versionedBundleName)
protected org.springframework.web.servlet.resource.ResourceHttpRequestHandler findResourceHttpRequestHandler(String resourceName)
protected boolean isJavaScriptResource(String resourceName)
protected boolean isCSSResource(String resourceName)
Copyright © 2017. All rights reserved.