Class Composer
java.lang.Object
com.aquima.interactions.composer.model.Composer
- All Implemented Interfaces:
IComposer
Composer implementation that contains the logic to expand definitions to runtime elements.
- Since:
- 7.0
- Author:
- O. Kerpershoek, Jon van Leuven
-
Constructor Summary
ConstructorsConstructorDescriptionComposer
(DefinitionStore definitions) Constructs the composer using the definitions object. -
Method Summary
Modifier and TypeMethodDescriptioncomposeDocument
(IComposerHandler handler, InferenceContext context, String documentName) Composes a document model which can be transformed to other formats at a later stage.composeElement
(IComposerHandler handler, InferenceContext context, String elementName) 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.composeText
(InferenceContext context, String textName) protected Asset[]
expandAssetRef
(ComposerContext context, AbstractReference elementReference) protected Button[]
expandButtonRef
(ComposerContext context, AbstractReference reference) protected Element[]
expandContainerRef
(IComposerHandler handler, ComposerContext context, AbstractReference reference) protected List
<ContentItem> expandContentRef
(IComposerHandler handler, AbstractReference reference, ComposerContext context) protected Field[]
expandFieldRef
(IComposerHandler handler, ComposerContext context, AbstractReference reference) protected Image[]
expandImageRef
(AbstractReference reference, ComposerContext context) protected Page[]
expandPageRef
(IComposerHandler handler, ComposerContext context, AbstractReference reference) Element[]
expandReference
(IComposerHandler handler, IComposerContext context, AbstractReference reference) This method will expand the elements referenced by the abstract reference.Element[]
expandReference
(IComposerHandler handler, InferenceContext context, AbstractReference reference) This method will expand the elements referenced by the abstract reference.protected TextItem[]
expandTextRef
(IComposerHandler handler, AbstractReference reference, ComposerContext context) Looks up the text definition (also called an asset) for the specified name and returns the definition model.Looks up the button definition for the specified name and returns the definition model.getContainer
(String name) looks up the text definition for the specified name and returns the definition model.getContent
(String name) Looks up the content definition for the specified name and returns the definition model.getDocument
(String name) looks up the document definition for the specified name and returns the definition model.String[]
getElementNames
(ElementType type) This method returns all the available names for a specified type.Looks up the field definition for the specified entity name and attribute name and returns the definition model.looks up the image definition for the specified name and returns the definition model.Looks up the page definition for the specified name and returns the definition model.Looks up the text definition for the specified name and returns the definition model.
-
Constructor Details
-
Composer
Constructs the composer using the definitions object.- Parameters:
definitions
- Object containing all the element definitions.
-
-
Method Details
-
getElementNames
Description copied from interface:IComposer
This method returns all the available names for a specified type.- Specified by:
getElementNames
in interfaceIComposer
- Parameters:
type
- The element type, may not be null.- Returns:
- The element names, never null.
-
composePage
Description copied from interface:IComposer
This method will expand the page with the specified name, and add all the values and messages to the expanded page.- Specified by:
composePage
in interfaceIComposer
- 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.
-
composeDocument
public IDocument composeDocument(IComposerHandler handler, InferenceContext context, String documentName) Description copied from interface:IComposer
Composes a document model which can be transformed to other formats at a later stage.- Specified by:
composeDocument
in interfaceIComposer
- 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.
-
composeElement
public Element composeElement(IComposerHandler handler, InferenceContext context, String elementName) - Specified by:
composeElement
in interfaceIComposer
-
composeText
- Specified by:
composeText
in interfaceIComposer
-
expandReference
public Element[] expandReference(IComposerHandler handler, InferenceContext context, AbstractReference reference) Description copied from interface:IComposer
This method will expand the elements referenced by the abstract reference.- Specified by:
expandReference
in interfaceIComposer
- 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
-
expandReference
public Element[] expandReference(IComposerHandler handler, IComposerContext context, AbstractReference reference) Description copied from interface:IComposer
This method will expand the elements referenced by the abstract reference.- Specified by:
expandReference
in interfaceIComposer
- 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
-
getButton
Description copied from interface:IComposer
Looks up the button definition for the specified name and returns the definition model. -
getField
Description copied from interface:IComposer
Looks up the field definition for the specified entity name and attribute name and returns the definition model. -
getContainer
Description copied from interface:IComposer
looks up the text definition for the specified name and returns the definition model.- Specified by:
getContainer
in interfaceIComposer
- Parameters:
name
- The name of the container as defined in studio.- Returns:
- A container definition model which is never null
-
getPage
Description copied from interface:IComposer
Looks up the page definition for the specified name and returns the definition model. -
getAsset
Description copied from interface:IComposer
Looks up the text definition (also called an asset) for the specified name and returns the definition model. -
getContent
Description copied from interface:IComposer
Looks up the content definition for the specified name and returns the definition model.- Specified by:
getContent
in interfaceIComposer
- Parameters:
name
- The name of the content as defined in studio.- Returns:
- A content definition model which is never null
-
getText
Description copied from interface:IComposer
Looks up the text definition for the specified name and returns the definition model. -
getDocument
Description copied from interface:IComposer
looks up the document definition for the specified name and returns the definition model.- Specified by:
getDocument
in interfaceIComposer
- Parameters:
name
- The name of the document as defined in studio.- Returns:
- A document definition model which is never null
-
getImage
Description copied from interface:IComposer
looks up the image definition for the specified name and returns the definition model. -
expandFieldRef
protected Field[] expandFieldRef(IComposerHandler handler, ComposerContext context, AbstractReference reference) -
expandButtonRef
-
expandContainerRef
protected Element[] expandContainerRef(IComposerHandler handler, ComposerContext context, AbstractReference reference) -
expandPageRef
protected Page[] expandPageRef(IComposerHandler handler, ComposerContext context, AbstractReference reference) -
expandAssetRef
-
expandTextRef
protected TextItem[] expandTextRef(IComposerHandler handler, AbstractReference reference, ComposerContext context) -
expandImageRef
-
expandContentRef
protected List<ContentItem> expandContentRef(IComposerHandler handler, AbstractReference reference, ComposerContext context)
-