Interface ExtensibilityModel

All Known Implementing Classes:
ExtensibilityModelImpl

public interface ExtensibilityModel
  • Method Details

    • isModelStarted

      boolean isModelStarted()

      Indicates whether or not the has been started.

      Returns:
      boolean
    • switchToExtensionProcessing

      void switchToExtensionProcessing()

      Switches from defining the base model to processing extensions. When extension processing the "merge" action can no longer be used but the "remove", "replace", "modify", "before" and "after" actions can be.

    • isExtensionProcessing

      boolean isExtensionProcessing()

      Indicates whether the base model is complete and extensions are now being processed. Extension processing commences once the switchToExtensionProcessing method has been called. When extension processing the "merge" action can no longer be used but the "remove", "replace", "modify", "before" and "after" actions can be.

      Returns:
      boolean
    • getParentModel

      ExtensibilityModel getParentModel()

      Gets the ExtensibilityModel enclosing this model (assuming that this model is nested within a parent).

      Returns:
      The enclosing ExtensibilityModel if the current model is nested and null otherwise.
    • getWriter

      ModelWriter getWriter()

      Gets the ModelWriter being used by this instance.

      Returns:
      ModelWriter
    • flushModel

      void flushModel(Writer out)

      Flushes the entire content of the model to the supplied Writer. Once this has been done it will no longer be possible to update the model.

      Parameters:
      out - A Writer to render the model to.
    • addUnboundContent

      void addUnboundContent()

      Add a new UnboundContentModelElementImpl into the model so that when content is rendered it will be kept but will not be available to extensions to modify. This is used when processing the content in base files that is not provided by an ExtensibilityDirective.

    • addDiscardContent

      void addDiscardContent()

      Add a new DiscardUnboundContentModelElementImpl into the model so that when content is rendered it will be discarded. This is used when extension files are processed that contain "unbounded" content (that is content that is not provided by an ExtensibilityDirective).

    • getDeferredContent

      DeferredContentTargetModelElement getDeferredContent(String directiveId, String directiveName)
    • clearRelocatedContent

      boolean clearRelocatedContent(String id, String directiveName)
    • remove

      void remove(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, IOException

      Removes content from the model.

      Parameters:
      directive - ExtensibilityDirectiveData
      Throws:
      freemarker.template.TemplateException
      IOException
    • replace

      void replace(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, IOException

      Replaces content in the model.

      Parameters:
      directive - ExtensibilityDirectiveData
      Throws:
      freemarker.template.TemplateException
      IOException
    • merge

      void merge(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, IOException

      Places new content in the base model.

      Parameters:
      directive - ExtensibilityDirectiveData
      Throws:
      freemarker.template.TemplateException
      IOException
    • before

      void before(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, IOException

      Places content in the model before some base content.

      Parameters:
      directive - ExtensibilityDirectiveData
      Throws:
      freemarker.template.TemplateException
      IOException
    • after

      void after(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, IOException

      Places content in the modell after some base content.

      Parameters:
      directive - ExtensibilityDirectiveData
      Throws:
      freemarker.template.TemplateException
      IOException
    • findContentModelElement

      ContentModelElement findContentModelElement(String id)

      Finds a specific ContentModelElement (with the supplied identifier) in the model.

      Parameters:
      id - String
      Returns:
      ContentModelElement
    • getDebugData

      ExtensibilityDebugData getDebugData()
      Returns:
      The ExtensibilityDebugData associated with the ExtensibilityModel.
    • getChildDebugData

      ExtensibilityDebugData getChildDebugData()
      Returns:
      The ExtensibilityDebugData associated with the nested child ExtensibilityModel.
    • setChildDebugData

      void setChildDebugData(ExtensibilityDebugData childData)

      Sets the ExtensibilityDebugData associated with the nested child ExtensibilityModel.

    • getAdditionalContentElements

      List<ExtensibilityModelElement> getAdditionalContentElements()

      Retrieves the list of elements being generated as part of extension processing.

      Returns:
      List
    • insertDeferredContentTarget

      void insertDeferredContentTarget(int index, OpenModelElement open, DeferredContentTargetModelElement target, CloseModelElement close)

      Allows DeferredContentTargetModelElement instances (along with their associated OpenModelElement and CloseModelElement instances) to be inserted at a requested point in the model. This facility should be used with extreme care and was provided to allow WebScripts run outside of the context of a page to process dependencies.

      Parameters:
      index - The index within the model to insert the elements
      open - The OpenModelElement that identifies the start of the content
      target - The DeferredContentTargetModelElement for adding deferred content into
      close - The CloseModelElement that identifies the end of the content