public class AddInlineJavaScriptDirective extends JavaScriptDependencyDirective
This FreeMarker directive should be used to add raw JavaScript. As well as ensuring that the correct script blocks are output
it also allows JavaScript to be relocated to other locations within the ExtensibilityModel via the RelocateJavaScriptOutputDirective
which enables WebScripts to ensure that all JavaScript appears at the end of an HTML page as is recommended for optimum performance.
It also ensures that raw JavaScript inserts are placed correctly within aggregated JavaScript resource files (generated by the
DependencyAggregator service) via the group attribute.
AbstractDependencyExtensibilityDirective.ProcessedDependencyFORCE_AGGREGATED_OUTPUT_PARAMdependencyAggregator, dependencyHandler| Constructor and Description |
|---|
AddInlineJavaScriptDirective(String directiveName,
org.springframework.extensions.surf.extensibility.ExtensibilityModel model) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addLegacyDependencyRequest(Map params)
Overridden to prevent the "src" attribute not specified when running in legacy mode.
|
org.springframework.extensions.surf.extensibility.ExtensibilityDirectiveData |
createExtensibilityDirectiveData(String id,
String action,
String target,
Map params,
freemarker.template.TemplateDirectiveBody body,
freemarker.core.Environment env) |
createDependencyDirectiveData, execute, getDependencySource, getTargetElementgetModelObject, getRequestContext, getResourceControllerMapping, getToInsert, getUpdatedSrc, getWebFrameworkConfig, processDependency, setDependencyAggregator, setDependencyHandler, setModelObject, setRequestContext, setWebFrameworkConfigafter, before, getId, getModel, merge, remove, replacepublic AddInlineJavaScriptDirective(String directiveName, org.springframework.extensions.surf.extensibility.ExtensibilityModel model)
protected void addLegacyDependencyRequest(Map params) throws freemarker.template.TemplateModelException
addLegacyDependencyRequest in class JavaScriptDependencyDirectiveparams - Mapfreemarker.template.TemplateModelExceptionpublic org.springframework.extensions.surf.extensibility.ExtensibilityDirectiveData createExtensibilityDirectiveData(String id, String action, String target, Map params, freemarker.template.TemplateDirectiveBody body, freemarker.core.Environment env) throws freemarker.template.TemplateException
createExtensibilityDirectiveData in class JavaScriptDependencyDirectivefreemarker.template.TemplateExceptionCopyright © 2005–2016 Alfresco Software. All rights reserved.