Class ElementComposer

java.lang.Object
com.aquima.interactions.portal.model.ElementComposer
All Implemented Interfaces:
IElementComposer

public class ElementComposer extends Object implements IElementComposer
IElementComposer implementation used by services and containers.
Since:
5.0
Author:
o.kerpershoek
  • Constructor Details

    • ElementComposer

      public ElementComposer(InferenceContext context, IComposerHandler handler, IComposer composer, IModule module)
      Constructs an element composer with the required arguments, based on an InferenceContext.
      Parameters:
      context - The inference context that should be used.
      handler - Handler for container expanders.
      module - The portal module.
    • ElementComposer

      public ElementComposer(IComposerContext context, IComposerHandler handler, IComposer composer, IModule module)
      Constructs an element composer with the required arguments, based on an IComposerContext instance.
      Parameters:
      context - The inference context that should be used.
      handler - Handler for container expanders.
      module - The portal module.
  • Method Details

    • expandReference

      public Element[] expandReference(AbstractReference reference)
      Description copied from interface: IElementComposer

      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.

      Specified by:
      expandReference in interface IElementComposer
      Parameters:
      reference - The reference to the element that should be expanded.
      Returns:
      The expanded elements indicated by the reference.
    • expandChildren

      public Element[] expandChildren(ContainerDefinition definition)
      Description copied from interface: IElementComposer
      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.
      Specified by:
      expandChildren in interface IElementComposer
      Parameters:
      definition - The container definition whose references should be expanded.
      Returns:
      Array containing the expanded child elements of the container.
    • forInstance

      public IElementComposer forInstance(IEntityInstance instance)
      Description copied from interface: IElementComposer
      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.

      Specified by:
      forInstance in interface IElementComposer
      Parameters:
      instance - The instance that should be active in the new composer.
      Returns:
      An element composer in which the provided instance is active.
      See Also:
    • expandButton

      public Button expandButton(String name)
      Description copied from interface: IElementComposer
      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.
      Specified by:
      expandButton in interface IElementComposer
      Parameters:
      name - The Name of the button as defined in studio.
      Returns:
      A button object with empty event values, which is never null
    • expandContainer

      public Container expandContainer(String name)
      Description copied from interface: IElementComposer
      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
      Specified by:
      expandContainer in interface IElementComposer
      Parameters:
      name - The Name of the container as defined in studio.
      Returns:
      A container object which is never null
    • expandField

      public Field expandField(String entityName, String attributeName)
      Description copied from interface: IElementComposer
      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.
      Specified by:
      expandField in interface IElementComposer
      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
    • expandPage

      public Page expandPage(String name)
      Description copied from interface: IElementComposer
      This method will expand an entire page using the current context.
      Specified by:
      expandPage in interface IElementComposer
      Parameters:
      name - The name of the page that should be expanded.
      Returns:
      The expanded page.
    • expandDocument

      public Document expandDocument(String name)
      Description copied from interface: IElementComposer
      This method will expand an entire document using the current context.
      Specified by:
      expandDocument in interface IElementComposer
      Parameters:
      name - The name of the document that should be expanded.
      Returns:
      The expanded document.
    • expandText

      public TextItem expandText(String name)
      Description copied from interface: IElementComposer
      This method will expand a text using the current context.
      Specified by:
      expandText in interface IElementComposer
      Parameters:
      name - The name of the text that should be expanded.
      Returns:
      The expanded text.
    • expandText

      public Asset expandText(String assetName, String assetFormat)
    • expandContent

      public ContentItem expandContent(String name)
      Description copied from interface: IElementComposer
      This method will expand a content using the current context.
      Specified by:
      expandContent in interface IElementComposer
      Parameters:
      name - The name of the content that should be expanded.
      Returns:
      The expanded content.
    • expandAsset

      public Asset expandAsset(String assetName, String assetFormat)
      Description copied from interface: IElementComposer
      looks up a text (asset) for the specified name and returns the expanded content. In case of an unknown element an exception is thrown
      Specified by:
      expandAsset in interface IElementComposer
      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
    • expandImage

      public Image expandImage(String imageName)
      Description copied from interface: IElementComposer
      looks up an image for the specified name and returns the expanded content. In case of an unknown element an exception is thrown
      Specified by:
      expandImage in interface IElementComposer
      Parameters:
      imageName - The name of the image as defined in studio.
      Returns:
      An image object which is never null
    • getDocument

      public DocumentDefinition getDocument(String name)
      Description copied from interface: IElementComposer
      Looks up the document definition for the specified name and returns the definition model.
      Specified by:
      getDocument in interface IElementComposer
      Parameters:
      name - The name of the document as defined in studio.
      Returns:
      A document definition model which is never null
    • getImage

      public ImageDefinition getImage(String name)
      Description copied from interface: IElementComposer
      Looks up the image definition for the specified name and returns the definition model.
      Specified by:
      getImage in interface IElementComposer
      Parameters:
      name - The name of the image as defined in studio.
      Returns:
      A document definition model which is never null
    • getButton

      public ButtonDefinition getButton(String name)
      Description copied from interface: IElementComposer
      Looks up the button definition for the specified name and returns the definition model.
      Specified by:
      getButton in interface IElementComposer
      Parameters:
      name - The name of the button as defined in studio.
      Returns:
      A button definition model which is never null
    • getContainer

      public ContainerDefinition getContainer(String name)
      Description copied from interface: IElementComposer
      looks up the container definition for the specified name and returns the definition model.
      Specified by:
      getContainer in interface IElementComposer
      Parameters:
      name - The name of the container as defined in studio.
      Returns:
      A container definition model which is never null
    • getPage

      public PageDefinition getPage(String name)
      Description copied from interface: IElementComposer
      Looks up the page definition for the specified name and returns the definition model.
      Specified by:
      getPage in interface IElementComposer
      Parameters:
      name - The name of the page as defined in studio.
      Returns:
      A page definition model which is never null
    • getField

      public FieldDefinition getField(String name)
      Description copied from interface: IElementComposer
      Looks up the field definition for the specified entity name and attribute name and returns the definition model.
      Specified by:
      getField in interface IElementComposer
      Parameters:
      name - The full attribute name (entity.attribute) of the field requested.
      Returns:
      A field definition model which is never null
    • getAsset

      public AssetDefinition getAsset(String name)
      Description copied from interface: IElementComposer
      Looks up the text definition (also called an asset) for the specified name and returns the definition model.
      Specified by:
      getAsset in interface IElementComposer
      Parameters:
      name - The name of the text as defined in studio.
      Returns:
      A text definition model which is never null
    • getText

      public TextDefinition getText(String name)
      Description copied from interface: IElementComposer
      Looks up the text definition for the specified name and returns the definition model.
      Specified by:
      getText in interface IElementComposer
      Parameters:
      name - The name of the text as defined in studio.
      Returns:
      A text definition model which is never null
    • getContent

      public ContentDefinition getContent(String name)
      Description copied from interface: IElementComposer
      Looks up the content definition for the specified name and returns the definition model.
      Specified by:
      getContent in interface IElementComposer
      Parameters:
      name - The name of the content as defined in studio.
      Returns:
      A content definition model which is never null
    • getDynamicContainer

      public ContainerExpanderDefinition getDynamicContainer(String name)
      Description copied from interface: IElementComposer
      Looks up the dynamic container definition for the specified name and returns the definition model.
      Specified by:
      getDynamicContainer in interface IElementComposer
      Parameters:
      name - The name of the dynamic container requested.
      Returns:
      A dynamic container definition model which is never null
    • getElementNames

      public String[] getElementNames(ElementType type)
      Description copied from interface: IElementComposer
      This method returns all the available names for a specified type.
      Specified by:
      getElementNames in interface IElementComposer
      Parameters:
      type - The element type, may not be null.
      Returns:
      The element names, never null.