Class ComposerHandler
java.lang.Object
com.aquima.interactions.portal.model.session.ComposerHandler
- All Implemented Interfaces:
IComposerHandler
The composer handler is used by the composer to render dynamic containers and masks. This handler will also keep
track of the call-back functions that are added during page composition.
- Since:
- 5.0
- Author:
- O. Kerpershoek
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ComposerHandler
(IInternalPortalContext context, EventErrors errors) -
Method Summary
Modifier and TypeMethodDescriptionapplyMask
(IPrimitiveValue primitiveValue, String maskCallName) This method is called for every text value node with a linked mask.expand
(IComposerContext composerContext, ContainerDefinition definition, Container container) This method will be invoked for dynamic containers to allow the client to forward the actual implementation to the object actually implementing the dynamic container.This method returns the channel that is currently active for the client.This method returns the user of the client.Returns the language currently in use.Returns the default language of the current application.protected EventErrors
protected IInternalPortalContext
handleExpandFailure
(AppException error, String elementName, ElementType elementType) This method handles error handling when an element failed expanding.
-
Constructor Details
-
ComposerHandler
-
-
Method Details
-
getPortalContext
-
getEventErrors
-
getActiveChannel
Description copied from interface:IComposerHandler
This method returns the channel that is currently active for the client. The channel is optional, so this method may return null when no specific channel has been chosen in the client.- Specified by:
getActiveChannel
in interfaceIComposerHandler
- Returns:
- the channel that is currently active for the client.
-
getActiveUser
Description copied from interface:IComposerHandler
This method returns the user of the client.- Specified by:
getActiveUser
in interfaceIComposerHandler
- Returns:
- the user of the client.
-
getCurrentLanguage
Description copied from interface:IComposerHandler
Returns the language currently in use.- Specified by:
getCurrentLanguage
in interfaceIComposerHandler
- Returns:
- the current language, may be null.
-
getDefaultLanguage
Description copied from interface:IComposerHandler
Returns the default language of the current application.- Specified by:
getDefaultLanguage
in interfaceIComposerHandler
- Returns:
- the default language, never null.
-
expand
public Container expand(IComposerContext composerContext, ContainerDefinition definition, Container container) throws Exception Description copied from interface:IComposerHandler
This method will be invoked for dynamic containers to allow the client to forward the actual implementation to the object actually implementing the dynamic container.- Specified by:
expand
in interfaceIComposerHandler
- Parameters:
composerContext
- The composer context to use for expanding the container.definition
- The definition of the dynamic container.container
- The container that was created from the definition.- Returns:
- The actual container that should be placed in the page model.
- Throws:
Exception
- This exception may be thrown by the object implementing the dynamic container.
-
applyMask
public IMultilingualText applyMask(IPrimitiveValue primitiveValue, String maskCallName) throws Exception Description copied from interface:IComposerHandler
This method is called for every text value node with a linked mask. It should return a mask to render a value to its string representations.- Specified by:
applyMask
in interfaceIComposerHandler
- Parameters:
primitiveValue
- The value to apply the mask to (never null)maskCallName
- Call name of the current mask (never null)- Returns:
- The mask implementation, should never return null
- Throws:
Exception
- When the mask could not be returned.
-
handleExpandFailure
Description copied from interface:IComposerHandler
This method handles error handling when an element failed expanding.- Specified by:
handleExpandFailure
in interfaceIComposerHandler
- Parameters:
error
- The error that caused the failure, may not be null.elementName
- The name of the element that failed expanding, may not be null or empty.elementType
- The type of the element that failed expanding, may not be null.- Returns:
- Could return an element that should replace the element that failed expanding.
-