Interface HandlesExtensibility
- All Known Implementing Classes:
ExtensibilityContainer
- Author:
- David Draper
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtensibilityDirectives(Map<String, Object> freeMarkerModel, ExtensibilityModel extModel) Adds any custom FreeMarker directives required for rendering templates when being processed.voidaddExtensionBundleToCache(String webScriptId, WebScriptPropertyResourceBundle extensionBUndle) Adds a new extended bundle to the cache.voidcloseExtensibilityModel(ExtensibilityModel model, Writer out) OneExtensibilityModelcan be nested within another.getCachedExtendedBundle(String webScriptId) Checks the container to see if it has cached an extended bundle (that is a basicResourceBundlethat has had extension modules applied to it.Should be implemented to return anExtensibilityModelif one is currently being built.getExtendedScriptConfigModel(String xmlConfig) Creates a newExtendedScriptConfigModelinstance which contains configuration provided by the extensions that have been evaluated to be processed.getExtendedTemplateConfigModel(String xmlConfig) Creates a newExtendedTemplateConfigModelinstance which contains configuration provided by the extensions that have been evaluated to be processed.getExtendingModuleFiles(String pathBeingProcessed) Returns aListof the files that should be applied to anExtensibilityModelbeing processed.Returns the path of the file currently being processed in the model.booleanThis indicates that although extensibility is handled it has been temporarily suppressedOneExtensibilityModelcan be nested within another.voidsetFileBeingProcessed(String file) Sets the path of the file currently being processed in the model.voidupdateExtendingModuleDependencies(String pathBeingProcessed, Map<String, Object> model) Returns an HTML Spring defining the JavaScript and CSS resource dependencies defined by extending modules.
-
Method Details
-
isExtensibilitySuppressed
boolean isExtensibilitySuppressed()This indicates that although extensibility is handled it has been temporarily suppressed
- Returns:
- boolean
-
getCurrentExtensibilityModel
ExtensibilityModel getCurrentExtensibilityModel()Should be implemented to return an
ExtensibilityModelif one is currently being built. If a model is not being built then this should return null.- Returns:
- ExtensibilityModel
-
openExtensibilityModel
ExtensibilityModel openExtensibilityModel()One
ExtensibilityModelcan be nested within another. This may occur where it is necessary to render the output of an entire child model as an element of the current model. Calling this method will effectively nest a newExtensibilityModelwithin the model currently being processed.- Returns:
- A reference to a new nested
ExtensibilityModel.
-
closeExtensibilityModel
One
ExtensibilityModelcan be nested within another. This may occur where it is necessary to render the output of an entire child model as an element of the current model. Calling this method will close the current model so that an enclosing parent model will become the current model. The current model should also be flushed to the suppliedWriterwhen the model is closed.- Parameters:
model- The model to close.out- TheWriterto render the output of the closed model to.
-
updateExtendingModuleDependencies
Returns an HTML Spring defining the JavaScript and CSS resource dependencies defined by extending modules.
- Parameters:
pathBeingProcessed- Stringmodel- Map<String, Object>
-
getExtendingModuleFiles
Returns a
Listof the files that should be applied to anExtensibilityModelbeing processed.- Parameters:
pathBeingProcessed- The path of the file being processed. This will typically be a FreeMarker template, JavaScript controller or NLS properties file.- Returns:
- A
Listof the files that extend the current file being processed.
-
getFileBeingProcessed
String getFileBeingProcessed()Returns the path of the file currently being processed in the model. This information is primarily provided for the purposes of generating debug information.
- Returns:
- The path of the file currently being processed.
-
setFileBeingProcessed
Sets the path of the file currently being processed in the model. This information should be collected to assist with providing debug information.
- Parameters:
file- The path of the file currently being processed.
-
getCachedExtendedBundle
Checks the container to see if it has cached an extended bundle (that is a basic
ResourceBundlethat has had extension modules applied to it. Extended bundles can only be safely cached once per request as the modules applied can vary for each request.- Parameters:
webScriptId- The id of the WebScript to retrieve the extended bundle for.- Returns:
- A cached bundle or
nullif the bundle has not previously been cached.
-
addExtensionBundleToCache
Adds a new extended bundle to the cache. An extended bundle is a WebScript
ResourceBundlethat has hadResourceBundleinstances merged into it from extension modules that have been applied. These can only be cached for the lifetime of the request as different modules may be applied to the same WebScript for different requests.- Parameters:
webScriptId- The id of the WebScript to cache the extended bundle against.extensionBUndle- The extended bundle to cache.
-
getExtendedScriptConfigModel
Creates a new
ExtendedScriptConfigModelinstance which contains configuration provided by the extensions that have been evaluated to be processed. This method will returnnullif it is not possible to create a new instance which may be the case for many reasons.- Parameters:
xmlConfig- Optional additional XML configuration to include. This is typically provided by WebScripts.- Returns:
- A new
ExtendedScriptConfigModelornullif one could not be created.
-
getExtendedTemplateConfigModel
Creates a new
ExtendedTemplateConfigModelinstance which contains configuration provided by the extensions that have been evaluated to be processed. This method will returnnullif it is not possible to create a new instance which may be the case for many reasons.- Parameters:
xmlConfig- Optional additional XML configuration to include. This is typically provided by WebScripts.- Returns:
- A new
ExtendedTemplateConfigModelornullif one could not be created.
-
addExtensibilityDirectives
Adds any custom FreeMarker directives required for rendering templates when being processed.
- Parameters:
freeMarkerModel- The model to add the directives to.extModel- The currentExtensibilityModelbeing worked on.
-