Class ComposerHandler

java.lang.Object
com.aquima.interactions.portal.model.session.ComposerHandler
All Implemented Interfaces:
IComposerHandler

public class ComposerHandler extends Object implements 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 Details

  • Method Details

    • getPortalContext

      protected IInternalPortalContext getPortalContext()
    • getEventErrors

      protected EventErrors getEventErrors()
    • getActiveChannel

      public Channel 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 interface IComposerHandler
      Returns:
      the channel that is currently active for the client.
    • getActiveUser

      public IUserData getActiveUser()
      Description copied from interface: IComposerHandler
      This method returns the user of the client.
      Specified by:
      getActiveUser in interface IComposerHandler
      Returns:
      the user of the client.
    • getCurrentLanguage

      public ILanguage getCurrentLanguage()
      Description copied from interface: IComposerHandler
      Returns the language currently in use.
      Specified by:
      getCurrentLanguage in interface IComposerHandler
      Returns:
      the current language, may be null.
    • getDefaultLanguage

      public ILanguage getDefaultLanguage()
      Description copied from interface: IComposerHandler
      Returns the default language of the current application.
      Specified by:
      getDefaultLanguage in interface IComposerHandler
      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 interface IComposerHandler
      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 interface IComposerHandler
      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

      public Element handleExpandFailure(AppException error, String elementName, ElementType elementType)
      Description copied from interface: IComposerHandler
      This method handles error handling when an element failed expanding.
      Specified by:
      handleExpandFailure in interface IComposerHandler
      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.