Interface IComposer

All Known Implementing Classes:
Composer

public interface IComposer
This object holds the information on all existing pages/containers/buttons/documents etc. within the system. This class is not serializable. Note: pre 7.0 this functionality was accessible via the IPageComposer and IDocumentEngine
Since:
7.0
Author:
O. Kerpershoek, Jon van Leuven
  • Method Details

    • composePage

      IPage composePage(IComposerHandler handler, InferenceContext context, String pageName)
      This method will expand the page with the specified name, and add all the values and messages to the expanded page.
      Parameters:
      handler - The page handler that should be used.
      context - The context that should be used during expansion.
      pageName - The name of the page that should be composed.
      Returns:
      Full page model containing values and messages for all the fields on the page.
      Throws:
      AppException - This exception is thrown when the page could not be expanded.
    • composeDocument

      IDocument composeDocument(IComposerHandler handler, InferenceContext context, String documentName)
      Composes a document model which can be transformed to other formats at a later stage.
      Parameters:
      handler - The handler that should be used to evaluate context specific information.
      context - The context that should be used to generate the document with.
      documentName - The name of the document that should be composed.
      Returns:
      The composed document, should never be null.
      Throws:
      AppException - This exception is thrown when the document could not be expanded.
    • composeElement

      Element composeElement(IComposerHandler handler, InferenceContext context, String elementName)
    • composeText

      IMultilingualText composeText(InferenceContext context, String textName)
    • expandReference

      Element[] expandReference(IComposerHandler handler, InferenceContext context, AbstractReference reference)
      This method will expand the elements referenced by the abstract reference.
      Parameters:
      handler - The page handler that should be used.
      context - The context that should be used during expansion.
      reference - The reference to the elements that should be expanded.
      Returns:
      The expanded elements, never null
      Throws:
      AppException - This exception is thrown when the element could not be expanded.
    • expandReference

      Element[] expandReference(IComposerHandler handler, IComposerContext context, AbstractReference reference)
      This method will expand the elements referenced by the abstract reference.
      Parameters:
      handler - The page handler that should be used.
      context - The context that should be used during expansion.
      reference - The reference to the elements that should be expanded.
      Returns:
      The expanded elements, never null
      Throws:
      AppException - This exception is thrown when the element could not be expanded.
    • getPage

      PageDefinition getPage(String name)
      Looks up the page definition for the specified name and returns the definition model.
      Parameters:
      name - The name of the page as defined in studio.
      Returns:
      A page definition model which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the name.
    • getContainer

      ContainerDefinition getContainer(String name)
      looks up the text definition for the specified name and returns the definition model.
      Parameters:
      name - The name of the container as defined in studio.
      Returns:
      A container definition model which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the name.
    • getDocument

      DocumentDefinition getDocument(String name)
      looks up the document definition for the specified name and returns the definition model.
      Parameters:
      name - The name of the document as defined in studio.
      Returns:
      A document definition model which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the name.
    • getImage

      ImageDefinition getImage(String name)
      looks up the image definition for the specified name and returns the definition model.
      Parameters:
      name - The name of the image as defined in studio.
      Returns:
      An image definition model which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the name.
    • getButton

      ButtonDefinition getButton(String name)
      Looks up the button definition for the specified name and returns the definition model.
      Parameters:
      name - The name of the button as defined in studio.
      Returns:
      A button definition model which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the name.
    • getField

      FieldDefinition getField(String name)
      Looks up the field definition for the specified entity name and attribute name and returns the definition model.
      Parameters:
      name - The full attribute name (entity.attribute) of the field requested.
      Returns:
      A field definition model which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the name.
    • getAsset

      AssetDefinition getAsset(String name)
      Looks up the text definition (also called an asset) for the specified name and returns the definition model.
      Parameters:
      name - The name of the text as defined in studio.
      Returns:
      A text definition model which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the name.
    • getText

      TextDefinition getText(String name)
      Looks up the text definition for the specified name and returns the definition model.
      Parameters:
      name - The name of the text as defined in studio.
      Returns:
      A text definition model which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the name.
    • getContent

      ContentDefinition getContent(String name)
      Looks up the content definition for the specified name and returns the definition model.
      Parameters:
      name - The name of the content as defined in studio.
      Returns:
      A content definition model which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the name.
    • getElementNames

      String[] getElementNames(ElementType type)
      This method returns all the available names for a specified type.
      Parameters:
      type - The element type, may not be null.
      Returns:
      The element names, never null.