public class ExtensibilityContainer extends RepositoryContainer implements org.springframework.extensions.surf.extensibility.HandlesExtensibility
A simple extensibility Container
for processing WebScripts. This extends the RepositoryContainer
and
implements the HandlesExtensibility
interface to provide extensibility capabilities.
Constructor and Description |
---|
ExtensibilityContainer() |
Modifier and Type | Method and Description |
---|---|
void |
addExtensibilityDirectives(Map<String,Object> freeMarkerModel,
org.springframework.extensions.surf.extensibility.ExtensibilityModel extModel)
Adds the <@markup> directive to the container which allows FreeMarker templates to be extended.
|
void |
addExtensionBundleToCache(String webScriptId,
org.springframework.extensions.webscripts.WebScriptPropertyResourceBundle extensionBundle)
Adds a new extended bundle to the cache.
|
void |
closeExtensibilityModel(org.springframework.extensions.surf.extensibility.ExtensibilityModel model,
Writer out)
Flushes the
ExtensibilityModel provided and sets its parent as the current ExtensibilityModel
for the current thread. |
void |
executeScript(org.springframework.extensions.webscripts.WebScriptRequest scriptReq,
org.springframework.extensions.webscripts.WebScriptResponse scriptRes,
org.springframework.extensions.webscripts.Authenticator auth)
Opens a new
ExtensibilityModel , defers execution to the extended RepositoryContainer and
then closes the ExtensibilityModel . |
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. |
org.springframework.extensions.surf.extensibility.ExtensibilityModel |
getCurrentExtensibilityModel()
Returns the
ExtensibilityModel for the current thread. |
List<org.springframework.extensions.surf.extensibility.BasicExtensionModule> |
getEvaluatedModules()
Retrieve the list of
org.springframework.extensions.surf.types.ExtensionModule instances that have been evaluated as applicable
for the current request. |
org.springframework.extensions.webscripts.ScriptConfigModel |
getExtendedScriptConfigModel(String xmlConfig)
Creates a new
ExtendedScriptConfigModel instance using the local configuration generated for this request. |
org.springframework.extensions.webscripts.TemplateConfigModel |
getExtendedTemplateConfigModel(String xmlConfig)
Creates a new
TemplateConfigModel instance using the local configuration generated for this request. |
List<String> |
getExtendingModuleFiles(String pathBeingProcessed)
Retrieves an files for the evaluated modules that are extending the WebScript files being processed.
|
String |
getFileBeingProcessed()
Returns the path of the file currently being processed in the model by the current thread.
|
boolean |
isExtensibilitySuppressed() |
org.springframework.extensions.surf.extensibility.ExtensibilityModel |
openExtensibilityModel()
Creates a new
ExtensibilityModel and sets it on the current thread |
void |
setExtensibilityModuleHandler(org.springframework.extensions.surf.extensibility.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.
|
authenticate, executeScriptInternal, getDescription, getNotPublicExceptions, getPublicExceptions, getRequiredAuthentication, getScriptParameters, getTemplateParameters, onApplicationEvent, reset, setAuthorityService, setDescriptorService, setEncryptTempFiles, setFallbackTransactionHelper, setMaxContentSize, setMemoryThreshold, setNotPublicExceptions, setPublicExceptions, setRepository, setRepositoryImageResolver, setTempDirectoryName, setTransactionService, setup, transactionedExecute
allowCallbacks, getApplicationContext, getConfigService, getFormatRegistry, getName, getRegistry, getScriptParameterFactoryRegistry, getScriptProcessorRegistry, getSearchPath, getTemplateProcessorRegistry, setAllowCallbacks, setApplicationContext, setConfigService, setFormatRegistry, setName, setRegistry, setScriptObjects, setScriptParameterFactoryRegistry, setScriptProcessorRegistry, setSearchPath, setTemplateObjects, setTemplateProcessorRegistry
public boolean isExtensibilitySuppressed()
isExtensibilitySuppressed
in interface org.springframework.extensions.surf.extensibility.HandlesExtensibility
public void executeScript(org.springframework.extensions.webscripts.WebScriptRequest scriptReq, org.springframework.extensions.webscripts.WebScriptResponse scriptRes, org.springframework.extensions.webscripts.Authenticator auth) throws IOException
Opens a new ExtensibilityModel
, defers execution to the extended RepositoryContainer
and
then closes the ExtensibilityModel
.
executeScript
in interface org.springframework.extensions.webscripts.RuntimeContainer
executeScript
in class RepositoryContainer
IOException
public void setExtensibilityModuleHandler(org.springframework.extensions.surf.extensibility.WebScriptExtensibilityModuleHandler extensibilityModuleHandler)
Sets the WebScriptExtensibilityModuleHandler
for this Container
.
extensibilityModuleHandler
- WebScriptExtensibilityModuleHandlerpublic org.springframework.extensions.surf.extensibility.ExtensibilityModel openExtensibilityModel()
Creates a new ExtensibilityModel
and sets it on the current thread
openExtensibilityModel
in interface org.springframework.extensions.surf.extensibility.HandlesExtensibility
public void closeExtensibilityModel(org.springframework.extensions.surf.extensibility.ExtensibilityModel model, Writer out)
Flushes the ExtensibilityModel
provided and sets its parent as the current ExtensibilityModel
for the current thread.
closeExtensibilityModel
in interface org.springframework.extensions.surf.extensibility.HandlesExtensibility
public org.springframework.extensions.surf.extensibility.ExtensibilityModel getCurrentExtensibilityModel()
Returns the ExtensibilityModel
for the current thread.
getCurrentExtensibilityModel
in interface org.springframework.extensions.surf.extensibility.HandlesExtensibility
public 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 org.springframework.extensions.surf.extensibility.HandlesExtensibility
public 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 org.springframework.extensions.surf.extensibility.HandlesExtensibility
webScriptId
- 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, org.springframework.extensions.webscripts.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 org.springframework.extensions.surf.extensibility.HandlesExtensibility
webScriptId
- 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 org.springframework.extensions.surf.extensibility.HandlesExtensibility
public 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 org.springframework.extensions.surf.extensibility.HandlesExtensibility
file
- The path of the file currently being processed.public List<String> getExtendingModuleFiles(String pathBeingProcessed)
Retrieves an files for the evaluated modules that are extending the WebScript files being processed.
getExtendingModuleFiles
in interface org.springframework.extensions.surf.extensibility.HandlesExtensibility
public List<org.springframework.extensions.surf.extensibility.BasicExtensionModule> getEvaluatedModules()
Retrieve the list of org.springframework.extensions.surf.types.ExtensionModule
instances that have been evaluated as applicable
for the current request. If this list has not yet been populated then use the org.springframework.extensions.surf.extensibility.ExtensibilityModuleHandler
configured in the Spring application context to evaluate them.
org.springframework.extensions.surf.types.ExtensionModule
instances that are applicable to the current request.public org.springframework.extensions.webscripts.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 org.springframework.extensions.surf.extensibility.HandlesExtensibility
public org.springframework.extensions.webscripts.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 org.springframework.extensions.surf.extensibility.HandlesExtensibility
public void addExtensibilityDirectives(Map<String,Object> freeMarkerModel, org.springframework.extensions.surf.extensibility.ExtensibilityModel extModel)
Adds the <@markup> directive to the container which allows FreeMarker templates to be extended.
addExtensibilityDirectives
in interface org.springframework.extensions.surf.extensibility.HandlesExtensibility
Copyright © 2005–2017 Alfresco Software. All rights reserved.