Interface HandlesExtensibility

All Known Implementing Classes:
ExtensibilityContainer

public interface HandlesExtensibility

Author:
David Draper
  • 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 ExtensibilityModel if one is currently being built. If a model is not being built then this should return null.

      Returns:
      ExtensibilityModel
    • openExtensibilityModel

      ExtensibilityModel openExtensibilityModel()

      One ExtensibilityModel can 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 new ExtensibilityModel within the model currently being processed.

      Returns:
      A reference to a new nested ExtensibilityModel.
    • closeExtensibilityModel

      void closeExtensibilityModel(ExtensibilityModel model, Writer out)

      One ExtensibilityModel can 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 supplied Writer when the model is closed.

      Parameters:
      model - The model to close.
      out - The Writer to render the output of the closed model to.
    • updateExtendingModuleDependencies

      void updateExtendingModuleDependencies(String pathBeingProcessed, Map<String,Object> model)

      Returns an HTML Spring defining the JavaScript and CSS resource dependencies defined by extending modules.

      Parameters:
      pathBeingProcessed - String
      model - Map<String, Object>
    • getExtendingModuleFiles

      List<String> getExtendingModuleFiles(String pathBeingProcessed)

      Returns a List of the files that should be applied to an ExtensibilityModel being 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 List of 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

      void setFileBeingProcessed(String file)

      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

      ResourceBundle getCachedExtendedBundle(String webScriptId)

      Checks the container 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.

      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

      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.

      Parameters:
      webScriptId - The id of the WebScript to cache the extended bundle against.
      extensionBUndle - The extended bundle to cache.
    • getExtendedScriptConfigModel

      ScriptConfigModel getExtendedScriptConfigModel(String xmlConfig)

      Creates a new ExtendedScriptConfigModel instance which contains configuration provided by the extensions that have been evaluated to be processed. This method will return null if 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 ExtendedScriptConfigModel or null if one could not be created.
    • getExtendedTemplateConfigModel

      TemplateConfigModel getExtendedTemplateConfigModel(String xmlConfig)

      Creates a new ExtendedTemplateConfigModel instance which contains configuration provided by the extensions that have been evaluated to be processed. This method will return null if 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 ExtendedTemplateConfigModel or null if one could not be created.
    • addExtensibilityDirectives

      void addExtensibilityDirectives(Map<String,Object> freeMarkerModel, ExtensibilityModel extModel)

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

      Parameters:
      freeMarkerModel - The model to add the directives to.
      extModel - The current ExtensibilityModel being worked on.