Class DefinitionStore

java.lang.Object
com.aquima.interactions.composer.model.definition.DefinitionStore

public class DefinitionStore extends Object

The definition store holds all the static definitions of various content types.

Note: Since 7.0 it contains page and document elements (definition store of the page composer and document engine have been merged).

Since:
5.0
Author:
O. Kerpershoek
  • Constructor Details

    • DefinitionStore

      public DefinitionStore(IProject project, IMetaModel metaModel, IParserFactory parser, IComposerDS composerDataSource)
      Constructs a definition store with all the element definitions provided by the data-source.
      Parameters:
      project - Project containing various global definitions.
      metaModel - Meta model containing the entity and attribute definitions (for the fields).
      parser - The expression parser that should be used when parsing expressions.
      composerDataSource - Data source that provides the element definitions that should be added.
      Throws:
      InitializationException - This exception is raised when the definitions provided by the data-source are invalid.
  • Method Details

    • acquireFieldMap

      protected FieldMap acquireFieldMap(IEntityDefinition entityDefinition)
    • updateExitEvents

      protected void updateExitEvents()
    • updateFieldDefinitions

      protected void updateFieldDefinitions()
    • validateReferences

      protected void validateReferences(IReportingDS report, Map<String,Object> containers)
    • validateNonCircularContainerReferences

      protected void validateNonCircularContainerReferences(IReportingDS report, ContainerDefinition container, Stack<ContainerDefinition> referenceStack)
    • getPage

      public PageDefinition getPage(String name)
      This method returns the page definition with the specified name. When no definition can be found for the specified name, an exception is thrown.
      Parameters:
      name - The name of the page for which the definition is requested.
      Returns:
      The page definition of the page with the specified name (never null).
      Throws:
      UnknownElementException - This exception is raised when no definition could be found for the specified page name.
    • getContainer

      public ContainerDefinition getContainer(String name)
    • getButton

      public ButtonDefinition getButton(String name)
    • getAsset

      public AssetDefinition getAsset(String name)
    • getField

      public FieldDefinition getField(String name)
    • addFieldDefinition

      protected void addFieldDefinition(FieldDefinition definition)
    • getTypeMap

      protected Map<String,Object> getTypeMap(ElementType elementType)
    • getDefinition

      public ElementDefinition getDefinition(ElementType type, String name)
      This method returns an element definition for a specified name and type combination.
      Parameters:
      type - The type of the requested definition.
      name - The name for which a definition is requested.
      Returns:
      The definition matching the specified name.
      Throws:
      UnknownElementException - This exception is thrown when no definition could be found for the specified name.
      UnknownTypeException - This exception is thrown when the specified type is invalid.
    • getDefinition

      public IElementDefinition getDefinition(AbstractReference reference)
      This method returns the definition of a reference.
      Parameters:
      reference - The reference, may not be null
      Returns:
      The element defintion, never null.
      Throws:
      UnknownElementException - Is thrown when the reference refers to an unknown element.
      UnknownTypeException - Is thrown when the reference refers to an unknown element type.
    • getDocument

      public DocumentDefinition getDocument(String name)
      This method returns the document definition for the specified name.
      Parameters:
      name - The name of the requested document definition.
      Returns:
      The document definition matching the specified name.
      Throws:
      UnknownElementException - This exception is thrown when no definition could be found for the specified name.
    • addDocument

      protected boolean addDocument(DocumentDefinition definition)
    • getContent

      public ContentDefinition getContent(String name)
      This method returns the content definition for the specified name.
      Parameters:
      name - The name of the requested content definition.
      Returns:
      The content definition for the specified name.
      Throws:
      UnknownElementException - This exception is thrown when no definition could be found for the specified name.
    • addContent

      protected boolean addContent(ContentDefinition definition)
    • getText

      public TextDefinition getText(String name)
    • getImage

      public ImageDefinition getImage(String name)
    • addText

      protected boolean addText(TextDefinition definition)
    • addImage

      protected boolean addImage(ImageDefinition definition)
    • getDefaultStyle

      public ContentStyleDefinition getDefaultStyle()
    • getContentStyle

      protected ContentStyleDefinition getContentStyle(String name)
    • getLanguages

      public ILanguage[] getLanguages()
    • getElementNames

      public String[] getElementNames(ElementType type)