public class ExtensibilityContainer extends PresentationContainer implements HandlesExtensibility
A simple extensibility Container for processing WebScripts. This extends the PresentationContainer and
implements the HandlesExtensibility interface so that a standalone WebScript runtime (i.e. one that is not
used within Surf) can process extensions.
| Modifier and Type | Field and Description |
|---|---|
static String |
MARKUP_DIRECTIVE_NAME |
applicationContext| Constructor and Description |
|---|
ExtensibilityContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addExtensibilityDirectives(Map<String,Object> freeMarkerModel,
ExtensibilityModel extModel)
Adds any custom FreeMarker directives required for rendering templates when being processed.
|
void |
addExtensionBundleToCache(String webScriptId,
WebScriptPropertyResourceBundle extensionBundle)
Adds a new extended bundle to the cache.
|
void |
closeExtensibilityModel(ExtensibilityModel model,
Writer out)
Flushes the
ExtensibilityModel provided and sets its parent as the current ExtensibilityModel
for the current thread. |
ResourceBundle |
getCachedExtendedBundle(String webScriptId)
Checks the cache to see if it has cached an extended bundle (that is a basic
ResourceBundle that
has had extension modules applied to it. |
ExtensibilityModel |
getCurrentExtensibilityModel()
Returns the
ExtensibilityModel for the current thread. |
List<BasicExtensionModule> |
getEvaluatedModules()
Retrieve the list of
ExtensionModule instances that have been evaluated as applicable
for the current request. |
ScriptConfigModel |
getExtendedScriptConfigModel(String xmlConfig)
Creates a new
ExtendedScriptConfigModel instance using the local configuration generated for this request. |
TemplateConfigModel |
getExtendedTemplateConfigModel(String xmlConfig)
Creates a new
TemplateConfigModel instance using the local configuration generated for this request. |
List<String> |
getExtendingModuleFiles(String pathBeingProcessed)
Returns a
List of the files that should be applied to an ExtensibilityModel
being processed. |
String |
getFileBeingProcessed()
Returns the path of the file currently being processed in the model by the current thread.
|
boolean |
isExtensibilitySuppressed()
This indicates that although extensibility is handled it has been temporarily suppressed
|
ExtensibilityModel |
openExtensibilityModel()
Creates a new
ExtensibilityModel and sets it on the current thread |
void |
setExtensibilityModuleHandler(WebScriptExtensibilityModuleHandler extensibilityModuleHandler)
Sets the
WebScriptExtensibilityModuleHandler for this Container. |
void |
setFileBeingProcessed(String file)
Sets the path of the file currently being processed in the model by the current thread.
|
void |
updateExtendingModuleDependencies(String pathBeingProcessed,
Map<String,Object> model)
This method is implemented to perform no action as it is not necessary for a standalone WebScript
container to add dependencies for processing.
|
executeScript, getDescription, getUrlModelFactory, reset, setBeanNameallowCallbacks, authenticate, getApplicationContext, getConfigService, getFormatRegistry, getName, getRegistry, getRequiredAuthentication, getScriptParameterFactoryRegistry, getScriptParameters, getScriptProcessorRegistry, getSearchPath, getTemplateParameters, getTemplateProcessorRegistry, onApplicationEvent, setAllowCallbacks, setApplicationContext, setConfigService, setFormatRegistry, setName, setRegistry, setScriptObjects, setScriptParameterFactoryRegistry, setScriptProcessorRegistry, setSearchPath, setTemplateObjects, setTemplateProcessorRegistrypublic static final String MARKUP_DIRECTIVE_NAME
public void setExtensibilityModuleHandler(WebScriptExtensibilityModuleHandler extensibilityModuleHandler)
Sets the WebScriptExtensibilityModuleHandler for this Container.
extensibilityModuleHandler - WebScriptExtensibilityModuleHandlerpublic ExtensibilityModel openExtensibilityModel()
Creates a new ExtensibilityModel and sets it on the current thread
openExtensibilityModel in interface HandlesExtensibilityExtensibilityModel.public void closeExtensibilityModel(ExtensibilityModel model, Writer out)
Flushes the ExtensibilityModel provided and sets its parent as the current ExtensibilityModel
for the current thread.
closeExtensibilityModel in interface HandlesExtensibilitymodel - The model to close.out - The Writer to render the output of the closed model to.public ExtensibilityModel getCurrentExtensibilityModel()
Returns the ExtensibilityModel for the current thread.
getCurrentExtensibilityModel in interface HandlesExtensibilitypublic void updateExtendingModuleDependencies(String pathBeingProcessed, Map<String,Object> model)
This method is implemented to perform no action as it is not necessary for a standalone WebScript container to add dependencies for processing.
updateExtendingModuleDependencies in interface HandlesExtensibilitypathBeingProcessed - Stringmodel - Mappublic ResourceBundle getCachedExtendedBundle(String webScriptId)
Checks the cache to see if it has cached an extended bundle (that is a basic ResourceBundle that
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.
getCachedExtendedBundle in interface HandlesExtensibilitywebScriptId - The id of the WebScript to retrieve the extended bundle for.null if the bundle has not previously been cached.public void addExtensionBundleToCache(String webScriptId, WebScriptPropertyResourceBundle extensionBundle)
Adds a new extended bundle to the cache. An extended bundle is a WebScript ResourceBundle that has had
ResourceBundle instances 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.
addExtensionBundleToCache in interface HandlesExtensibilitywebScriptId - The id of the WebScript to cache the extended bundle against.extensionBundle - The extended bundle to cache.public String getFileBeingProcessed()
Returns the path of the file currently being processed in the model by the current thread. This information is primarily provided for the purposes of generating debug information.
getFileBeingProcessed in interface HandlesExtensibilitypublic void setFileBeingProcessed(String file)
Sets the path of the file currently being processed in the model by the current thread. This information should be collected to assist with providing debug information.
setFileBeingProcessed in interface HandlesExtensibilityfile - The path of the file currently being processed.public List<String> getExtendingModuleFiles(String pathBeingProcessed)
HandlesExtensibilityReturns a List of the files that should be applied to an ExtensibilityModel
being processed.
getExtendingModuleFiles in interface HandlesExtensibilitypathBeingProcessed - The path of the file being processed. This will typically be a FreeMarker
template, JavaScript controller or NLS properties file.List of the files that extend the current file being processed.public List<BasicExtensionModule> getEvaluatedModules()
Retrieve the list of ExtensionModule instances that have been evaluated as applicable
for the current request. If this list has not yet been populated then use the ExtensibilityModuleHandler
configured in the Spring application context to evaluate them.
ExtensionModule instances that are applicable to the current request.public ScriptConfigModel getExtendedScriptConfigModel(String xmlConfig)
Creates a new ExtendedScriptConfigModel instance using the local configuration generated for this request.
If configuration for the request will be generated if it does not yet exist. It is likely that this method will be
called multiple times within the context of a single request and although the configuration containers will always
be the same a new ExtendedScriptConfigModel instance will always be created as the the supplied xmlConfig
string could be different for each call (because each WebScript invoked in the request will supply different
configuration.
getExtendedScriptConfigModel in interface HandlesExtensibilityxmlConfig - Optional additional XML configuration to include. This is typically provided by WebScripts.ExtendedScriptConfigModel or null if one could not be created.public TemplateConfigModel getExtendedTemplateConfigModel(String xmlConfig)
Creates a new TemplateConfigModel instance using the local configuration generated for this request.
If configuration for the request will be generated if it does not yet exist. It is likely that this method will be
called multiple times within the context of a single request and although the configuration containers will always
be the same a new TemplateConfigModel instance will always be created as the the supplied xmlConfig
string could be different for each call (because each WebScript invoked in the request will supply different
configuration.
getExtendedTemplateConfigModel in interface HandlesExtensibilityxmlConfig - Optional additional XML configuration to include. This is typically provided by WebScripts.ExtendedTemplateConfigModel or null if one could not be created.public void addExtensibilityDirectives(Map<String,Object> freeMarkerModel, ExtensibilityModel extModel)
HandlesExtensibilityAdds any custom FreeMarker directives required for rendering templates when being processed.
addExtensibilityDirectives in interface HandlesExtensibilityfreeMarkerModel - The model to add the directives to.extModel - The current ExtensibilityModel being worked on.public boolean isExtensibilitySuppressed()
HandlesExtensibilityThis indicates that although extensibility is handled it has been temporarily suppressed
isExtensibilitySuppressed in interface HandlesExtensibilityCopyright © 2005–2017 Alfresco Software. All rights reserved.