Class ExtensibilityContainer

    • Field Detail

      • MARKUP_DIRECTIVE_NAME

        public static final java.lang.String MARKUP_DIRECTIVE_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • ExtensibilityContainer

        public ExtensibilityContainer()
    • Method Detail

      • updateExtendingModuleDependencies

        public void updateExtendingModuleDependencies​(java.lang.String pathBeingProcessed,
                                                      java.util.Map<java.lang.String,​java.lang.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.

        Specified by:
        updateExtendingModuleDependencies in interface HandlesExtensibility
        Parameters:
        pathBeingProcessed - String
        model - Map
      • getCachedExtendedBundle

        public java.util.ResourceBundle getCachedExtendedBundle​(java.lang.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.

        Specified by:
        getCachedExtendedBundle in interface HandlesExtensibility
        Parameters:
        webScriptId - The id of the WebScript to retrieve the extended bundle for.
        Returns:
        A cached bundle or null if the bundle has not previously been cached.
      • addExtensionBundleToCache

        public void addExtensionBundleToCache​(java.lang.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.

        Specified by:
        addExtensionBundleToCache in interface HandlesExtensibility
        Parameters:
        webScriptId - The id of the WebScript to cache the extended bundle against.
        extensionBundle - The extended bundle to cache.
      • getFileBeingProcessed

        public java.lang.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.

        Specified by:
        getFileBeingProcessed in interface HandlesExtensibility
        Returns:
        The path of the file currently being processed.
      • setFileBeingProcessed

        public void setFileBeingProcessed​(java.lang.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.

        Specified by:
        setFileBeingProcessed in interface HandlesExtensibility
        Parameters:
        file - The path of the file currently being processed.
      • getExtendingModuleFiles

        public java.util.List<java.lang.String> getExtendingModuleFiles​(java.lang.String pathBeingProcessed)
        Description copied from interface: HandlesExtensibility

        Returns a List of the files that should be applied to an ExtensibilityModel being processed.

        Specified by:
        getExtendingModuleFiles in interface HandlesExtensibility
        Parameters:
        pathBeingProcessed - The path of the file being processed. This will typically be a FreeMarker template, JavaScript controller or NLS properties file.
        Returns:
        A List of the files that extend the current file being processed.
      • getEvaluatedModules

        public java.util.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.

        Returns:
        A list of ExtensionModule instances that are applicable to the current request.
      • getExtendedScriptConfigModel

        public ScriptConfigModel getExtendedScriptConfigModel​(java.lang.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.

        Specified by:
        getExtendedScriptConfigModel in interface HandlesExtensibility
        Parameters:
        xmlConfig - Optional additional XML configuration to include. This is typically provided by WebScripts.
        Returns:
        A new ExtendedScriptConfigModel or null if one could not be created.
      • getExtendedTemplateConfigModel

        public TemplateConfigModel getExtendedTemplateConfigModel​(java.lang.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.

        Specified by:
        getExtendedTemplateConfigModel in interface HandlesExtensibility
        Parameters:
        xmlConfig - Optional additional XML configuration to include. This is typically provided by WebScripts.
        Returns:
        A new ExtendedTemplateConfigModel or null if one could not be created.
      • addExtensibilityDirectives

        public void addExtensibilityDirectives​(java.util.Map<java.lang.String,​java.lang.Object> freeMarkerModel,
                                               ExtensibilityModel extModel)
        Description copied from interface: HandlesExtensibility

        Adds any custom FreeMarker directives required for rendering templates when being processed.

        Specified by:
        addExtensibilityDirectives in interface HandlesExtensibility
        Parameters:
        freeMarkerModel - The model to add the directives to.
        extModel - The current ExtensibilityModel being worked on.