Interface IComposerHandler

All Known Implementing Classes:
ComposerHandler

public interface IComposerHandler
The handler is used to evaluate context specific information, such as mask implementations and is used by the composer to query for context specific information like the current role and channel of the client, but also to allow the client to modify containers that were marked as dynamic.
Since:
7.0
Author:
Jon van Leuven
  • Method Details

    • getActiveChannel

      Channel getActiveChannel()
      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.
      Returns:
      the channel that is currently active for the client.
    • getActiveUser

      IUserData getActiveUser()
      This method returns the user of the client.
      Returns:
      the user of the client.
    • getCurrentLanguage

      ILanguage getCurrentLanguage()
      Returns the language currently in use.
      Returns:
      the current language, may be null.
    • getDefaultLanguage

      ILanguage getDefaultLanguage()
      Returns the default language of the current application.
      Returns:
      the default language, never null.
    • expand

      Container expand(IComposerContext context, ContainerDefinition definition, Container container) throws Exception
      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.
      Parameters:
      context - 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

      IMultilingualText applyMask(IPrimitiveValue primitiveValue, String maskCallName) throws Exception
      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.
      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

      Element handleExpandFailure(AppException error, String elementName, ElementType elementType)
      This method handles error handling when an element failed expanding.
      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.
      Throws:
      AppException - Could be thrown if the error handling should result in an exception.
      Since:
      7.3