public class CssDependencyDirective extends JavaScriptDependencyDirective
This directive is used to address the problem of browsers caching stale CSS resources. It modifies the source file requested to include a checksum generated from the file contents to ensure that when a file is updated the browser will be forced to request the updated version (because the browser cached version will be stored against a different URL).
AbstractDependencyExtensibilityDirective.ProcessedDependencyFORCE_AGGREGATED_OUTPUT_PARAMdependencyAggregator, dependencyHandler| Constructor and Description |
|---|
CssDependencyDirective(String directiveName,
org.springframework.extensions.surf.extensibility.ExtensibilityModel model) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addLegacyDependencyRequest(Map params)
Overrides the default implementation to add a CSS dependency to the
RequestContext. |
protected DependencyDirectiveData |
createDependencyDirectiveData(String id,
String action,
String target,
Map params,
freemarker.template.TemplateDirectiveBody body,
freemarker.core.Environment env,
String dependencyToAdd,
String group)
Overrides the default implementation to instantiate and returns a
CssDependencyDirectiveData instance. |
protected String |
getDependencySource(Map params)
Overrides the default to return the "href" parameter.
|
protected org.springframework.extensions.surf.extensibility.DeferredContentTargetModelElement |
getTargetElement()
Overrides the default to return the
OutputCSSContentModelElement. |
createExtensibilityDirectiveData, executegetModelObject, getRequestContext, getResourceControllerMapping, getToInsert, getUpdatedSrc, getWebFrameworkConfig, processDependency, setDependencyAggregator, setDependencyHandler, setModelObject, setRequestContext, setWebFrameworkConfigafter, before, getId, getModel, merge, remove, replacepublic CssDependencyDirective(String directiveName, org.springframework.extensions.surf.extensibility.ExtensibilityModel model)
protected void addLegacyDependencyRequest(Map params) throws freemarker.template.TemplateModelException
Overrides the default implementation to add a CSS dependency to the RequestContext.
addLegacyDependencyRequest in class JavaScriptDependencyDirectiveparams - Mapfreemarker.template.TemplateModelExceptionprotected String getDependencySource(Map params) throws freemarker.template.TemplateModelException
Overrides the default to return the "href" parameter.
getDependencySource in class JavaScriptDependencyDirectiveparams - The map of parameters to search through.freemarker.template.TemplateModelException - When the target parameter cannot be found.protected org.springframework.extensions.surf.extensibility.DeferredContentTargetModelElement getTargetElement()
Overrides the default to return the OutputCSSContentModelElement.
getTargetElement in class JavaScriptDependencyDirectiveprotected DependencyDirectiveData createDependencyDirectiveData(String id, String action, String target, Map params, freemarker.template.TemplateDirectiveBody body, freemarker.core.Environment env, String dependencyToAdd, String group) throws freemarker.template.TemplateModelException
Overrides the default implementation to instantiate and returns a CssDependencyDirectiveData instance.
createDependencyDirectiveData in class JavaScriptDependencyDirectiveid - Stringaction - Stringtarget - Stringparams - Mapbody - TemplateDirectiveBodyenv - EnvironmentdependencyToAdd - Stringgroup - Stringfreemarker.template.TemplateModelExceptionCopyright © 2005–2016 Alfresco Software. All rights reserved.