Class ElementComposer
java.lang.Object
com.aquima.interactions.portal.model.ElementComposer
- All Implemented Interfaces:
IElementComposer
IElementComposer implementation used by services and containers.
- Since:
- 5.0
- Author:
- o.kerpershoek
-
Constructor Summary
ConstructorsConstructorDescriptionElementComposer
(IComposerContext context, IComposerHandler handler, IComposer composer, IModule module) Constructs an element composer with the required arguments, based on an IComposerContext instance.ElementComposer
(InferenceContext context, IComposerHandler handler, IComposer composer, IModule module) Constructs an element composer with the required arguments, based on an InferenceContext. -
Method Summary
Modifier and TypeMethodDescriptionexpandAsset
(String assetName, String assetFormat) looks up a text (asset) for the specified name and returns the expanded content.expandButton
(String name) looks up a button with the specified name in the definition model and returns the expanded content.Element[]
expandChildren
(ContainerDefinition definition) This method will expand all the child elements of the container definition.expandContainer
(String name) looks up a container with the specified name in the definition model and returns the expanded content.expandContent
(String name) This method will expand a content using the current context.expandDocument
(String name) This method will expand an entire document using the current context.expandField
(String entityName, String attributeName) looks up a field with for the specified attribute and returns the expanded content.expandImage
(String imageName) looks up an image for the specified name and returns the expanded content.expandPage
(String name) This method will expand an entire page using the current context.Element[]
expandReference
(AbstractReference reference) This method will expand the elements indicated by the reference.expandText
(String name) This method will expand a text using the current context.expandText
(String assetName, String assetFormat) forInstance
(IEntityInstance instance) This method returns a new element composer in which the specified instance is active.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 container 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.getDynamicContainer
(String name) Looks up the dynamic container 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
-
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
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 interfaceIElementComposer
- 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
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 interfaceIElementComposer
- 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.
-
forInstance
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 interfaceIElementComposer
- 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:
-
expandButton
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 interfaceIElementComposer
- 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.
-
expandContainer
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 interfaceIElementComposer
- 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.
-
expandField
public Field expandField(String entityName, String attributeName) throws UnknownElementException, AppException 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 interfaceIElementComposer
- 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.
-
expandPage
Description copied from interface:IElementComposer
This method will expand an entire page using the current context.- Specified by:
expandPage
in interfaceIElementComposer
- 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
Description copied from interface:IElementComposer
This method will expand an entire document using the current context.- Specified by:
expandDocument
in interfaceIElementComposer
- 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
Description copied from interface:IElementComposer
This method will expand a text using the current context.- Specified by:
expandText
in interfaceIElementComposer
- 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.
-
expandText
public Asset expandText(String assetName, String assetFormat) throws UnknownElementException, AppException - Throws:
UnknownElementException
AppException
-
expandContent
Description copied from interface:IElementComposer
This method will expand a content using the current context.- Specified by:
expandContent
in interfaceIElementComposer
- 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.
-
expandAsset
public Asset expandAsset(String assetName, String assetFormat) throws UnknownElementException, AppException 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 interfaceIElementComposer
- 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
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 interfaceIElementComposer
- 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.
-
getDocument
Description copied from interface:IElementComposer
Looks up the document definition for the specified name and returns the definition model.- Specified by:
getDocument
in interfaceIElementComposer
- 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
Description copied from interface:IElementComposer
Looks up the image definition for the specified name and returns the definition model.- Specified by:
getImage
in interfaceIElementComposer
- 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
-
getButton
Description copied from interface:IElementComposer
Looks up the button definition for the specified name and returns the definition model.- Specified by:
getButton
in interfaceIElementComposer
- 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
-
getContainer
Description copied from interface:IElementComposer
looks up the container definition for the specified name and returns the definition model.- Specified by:
getContainer
in interfaceIElementComposer
- 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
Description copied from interface:IElementComposer
Looks up the page definition for the specified name and returns the definition model.- Specified by:
getPage
in interfaceIElementComposer
- 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
-
getField
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 interfaceIElementComposer
- 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
-
getAsset
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 interfaceIElementComposer
- 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
Description copied from interface:IElementComposer
Looks up the text definition for the specified name and returns the definition model.- Specified by:
getText
in interfaceIElementComposer
- 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
Description copied from interface:IElementComposer
Looks up the content definition for the specified name and returns the definition model.- Specified by:
getContent
in interfaceIElementComposer
- 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
-
getDynamicContainer
public ContainerExpanderDefinition getDynamicContainer(String name) throws UnknownDynamicContainerException, AppException Description copied from interface:IElementComposer
Looks up the dynamic container definition for the specified name and returns the definition model.- Specified by:
getDynamicContainer
in interfaceIElementComposer
- 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
-
getElementNames
Description copied from interface:IElementComposer
This method returns all the available names for a specified type.- Specified by:
getElementNames
in interfaceIElementComposer
- Parameters:
type
- The element type, may not be null.- Returns:
- The element names, never null.
-