Interface IElementComposer

All Known Implementing Classes:
ElementComposer

public interface IElementComposer
This factory knows how to create elements which are usable on the page during expand calls. This object will take into account contexts regarding active instances for rendering (expanding) the elements.
Since:
5.1
Author:
O. Kerpershoek, F. van der Meer
  • Method Details

    • forInstance

      IElementComposer forInstance(IEntityInstance instance)
      This method returns a new element composer in which the specified instance is active.

      Note: Although the instance will be active in the new element composer, certain elements created by the composer may also need the instance to be active on the page. Usually the elements generated by a composer having an active instance will be put on the page in a container activating the same instance.
      Use the setEntityContext method of a container to activate the instance in the page.

      Parameters:
      instance - The instance that should be active in the new composer.
      Returns:
      An element composer in which the provided instance is active.
      Throws:
      AppException - This exception is thrown when the instance could not be activated.
      See Also:
    • expandReference

      Element[] expandReference(AbstractReference reference)

      This method will expand the elements indicated by the reference. The context information contained in the reference, like the read-only condition, will also be applied to the expanded element.

      This method can return multiple elements, due to the support for a repeat expression on a reference.

      Parameters:
      reference - The reference to the element that should be expanded.
      Returns:
      The expanded elements indicated by the reference.
      Throws:
      AppException - This exception is thrown when the element could not be expanded.
    • expandChildren

      Element[] expandChildren(ContainerDefinition definition)
      This method will expand all the child elements of the container definition. The method is equivalent to calling the expandReference for each containment of the container definition.
      Parameters:
      definition - The container definition whose references should be expanded.
      Returns:
      Array containing the expanded child elements of the container.
      Throws:
      AppException - This exception is thrown when the child elements could not be expanded.
    • expandPage

      Page expandPage(String name)
      This method will expand an entire page using the current context.
      Parameters:
      name - The name of the page that should be expanded.
      Returns:
      The expanded page.
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the specified name.
      AppException - This exception is thrown when the element could not be created.
    • expandDocument

      Document expandDocument(String name)
      This method will expand an entire document using the current context.
      Parameters:
      name - The name of the document that should be expanded.
      Returns:
      The expanded document.
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the specified name.
      AppException - This exception is thrown when the element could not be created.
    • expandText

      TextItem expandText(String name)
      This method will expand a text using the current context.
      Parameters:
      name - The name of the text that should be expanded.
      Returns:
      The expanded text.
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the specified name.
      AppException - This exception is thrown when the element could not be created.
    • expandContent

      ContentItem expandContent(String name)
      This method will expand a content using the current context.
      Parameters:
      name - The name of the content that should be expanded.
      Returns:
      The expanded content.
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the specified name.
      AppException - This exception is thrown when the element could not be created.
    • expandContainer

      Container expandContainer(String name)
      looks up a container with the specified name in the definition model and returns the expanded content. In case of an unknown element an exception is thrown
      Parameters:
      name - The Name of the container as defined in studio.
      Returns:
      A container object which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the specified name.
      AppException - This exception is thrown when the element could not be created.
    • expandButton

      Button expandButton(String name)
      looks up a button with the specified name in the definition model and returns the expanded content. In case of an unknown element an exception is thrown The returned button can be changed and events can be added as needed.
      Parameters:
      name - The Name of the button as defined in studio.
      Returns:
      A button object with empty event values, which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the specified name.
      AppException - This exception is thrown when the element could not be created.
    • expandField

      Field expandField(String entityName, String attributeName)
      looks up a field with for the specified attribute and returns the expanded content. In case of an unknown element an exception is thrown The returned field can be changed and refresh, readonly, required can be settings changed accordingly.
      Parameters:
      entityName - The name of the entity as defined in studio.
      attributeName - The name of the attribute as defined in studio.
      Returns:
      A field object which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the specified name.
      AppException - This exception is thrown when the element could not be created.
    • expandAsset

      Asset expandAsset(String assetName, String assetFormat)
      looks up a text (asset) for the specified name and returns the expanded content. In case of an unknown element an exception is thrown
      Parameters:
      assetName - The name of the text asset as defined in studio.
      assetFormat - The asset format that should be used to locate the correct text content.
      Returns:
      A asset object which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the specified name.
      AppException - This exception is thrown when the element could not be created.
    • expandImage

      Image expandImage(String imageName)
      looks up an image for the specified name and returns the expanded content. In case of an unknown element an exception is thrown
      Parameters:
      imageName - The name of the image as defined in studio.
      Returns:
      An image object which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the specified name.
      AppException - This exception is thrown when the element could not be created.
    • getContainer

      ContainerDefinition getContainer(String name)
      looks up the container 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.
      AppException - This exception is thrown when the element could not be created
    • 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.
      AppException - This exception is thrown when the element could not be created
    • 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.
      AppException - This exception is thrown when the element could not be created
    • 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.
      AppException - This exception is thrown when the element could not be created
    • getDynamicContainer

      ContainerExpanderDefinition getDynamicContainer(String name)
      Looks up the dynamic container definition for the specified name and returns the definition model.
      Parameters:
      name - The name of the dynamic container requested.
      Returns:
      A dynamic container definition model which is never null
      Throws:
      UnknownDynamicContainerException - This exception is thrown when there is no element defined with the name.
      AppException - This exception is thrown when the element could not be created
    • 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.
      AppException - This exception is thrown when the element could not be created
    • 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.
      AppException - This exception is thrown when the element could not be created
    • 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.
      AppException - This exception is thrown when the element could not be created
    • 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.
      AppException - This exception is thrown when the element could not be created
    • 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:
      A document definition model which is never null
      Throws:
      UnknownElementException - This exception is thrown when there is no element defined with the name.
      AppException - This exception is thrown when the element could not be created
    • 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.