public class RelocateJavaScriptOutputDirective extends AbstractDependencyExtensibilityDirective
Allows the JavaScript content generated by the OutputJavaScriptDirective to be relocated within the context of a model.
The reason this directive is required is that the OutputJavaScriptDirective needs to be initially placed in the model before
any directives that use its DefaultContentModelElement approach (such as the AggregateJavaScriptDependencyDirective and
the CreateWebScriptWidgetsDirective) can add content for it to render. However, the proper location for JavaScript is at the
end of an HTML page so this directive can be used to move the generated JavaScript to another location on the page before the
model is flushed.
AbstractDependencyExtensibilityDirective.ProcessedDependencydependencyAggregator, dependencyHandler| Constructor and Description |
|---|
RelocateJavaScriptOutputDirective(String directiveName,
org.springframework.extensions.surf.extensibility.ExtensibilityModel model) |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.extensions.surf.extensibility.ExtensibilityDirectiveData |
createExtensibilityDirectiveData(String id,
String action,
String target,
Map params,
freemarker.template.TemplateDirectiveBody body,
freemarker.core.Environment env)
Attempts to retrieve a
OutputJavaScriptContentModelElement that has been added to the ExtensibilityModel by through
the use of a OutputJavaScriptDirective directive. |
void |
execute(freemarker.core.Environment env,
Map params,
freemarker.template.TemplateModel[] loopVars,
freemarker.template.TemplateDirectiveBody body) |
getModelObject, getRequestContext, getResourceControllerMapping, getToInsert, getUpdatedSrc, getWebFrameworkConfig, processDependency, setDependencyAggregator, setDependencyHandler, setModelObject, setRequestContext, setWebFrameworkConfigafter, before, getId, getModel, merge, remove, replacepublic RelocateJavaScriptOutputDirective(String directiveName, org.springframework.extensions.surf.extensibility.ExtensibilityModel model)
public void execute(freemarker.core.Environment env,
Map params,
freemarker.template.TemplateModel[] loopVars,
freemarker.template.TemplateDirectiveBody body)
throws freemarker.template.TemplateException,
IOException
execute in interface freemarker.template.TemplateDirectiveModelexecute in class org.springframework.extensions.surf.extensibility.impl.AbstractExtensibilityDirectivefreemarker.template.TemplateExceptionIOExceptionpublic org.springframework.extensions.surf.extensibility.ExtensibilityDirectiveData createExtensibilityDirectiveData(String id, String action, String target, Map params, freemarker.template.TemplateDirectiveBody body, freemarker.core.Environment env)
Attempts to retrieve a OutputJavaScriptContentModelElement that has been added to the ExtensibilityModel by through
the use of a OutputJavaScriptDirective directive. However, if this ContentModelElement cannot be found then it will be
substituted by an DiscardUnboundContentModelElementImpl which whilst not generating any error in processing may cause unexpected
behaviour in the HTML page because no JavaScript relocation will take place.
createExtensibilityDirectiveData in class org.springframework.extensions.surf.extensibility.impl.AbstractExtensibilityDirectiveCopyright © 2005–2016 Alfresco Software. All rights reserved.