A base class for implementing a web console renderer. The renderer creates the DOM for the SPA, usually based on some initial DOM from the console page. It also provides methods for the management of the conlets' representations in the DOM tree.

Constructors

Accessors

Methods

  • Called from the Console when a new conlet type is added.

    Parameters

    • conletType: string

      the conlet type

    • displayNames: Map<string, string>

      the display names for the conlet type by lang

    • renderModes: RenderMode[]

      the render modes

    • pageComponents: PageComponentSpecification[]

      of components to be added to the page

    Returns void

  • Called by the Console to close a modal dialog when a corrsponding request is received from the server.

    Parameters

    • container: HTMLElement

      the container for the dialog

    Returns void

  • Called by the console instance when the connection to the server is lost. The default implementation logs a warning message.
    Should be overridden by a method that displays a notification.

    Returns void

  • Called from the console when the connection to the server is restored. The default implementation logs a warning message. Should be overridden by a method that displays a notification.

    Returns void

  • Called from the console when the connection to the server is suspended. The default implementation logs a warning message. Should be overridden by a method that displays a modal dialog.

    The connection can be resumed by invoking the function passed as argument.

    Parameters

    • resume: (() => void)

      called when resuming

        • (): void
        • Returns void

    Returns void

  • Called from the console when the consoleConfigured notification is received from the server.

    The default implementation logs a warning message. Should be overridden by a method that displays a modal dialog.

    Returns void

  • Find the conlet representations that display content. The default implementation wraps all nodes that match body .conlet.conlet-content. If a conletId is specified, the the result set is restricted to conlets with this id.

    Parameters

    • OptionalconletId: string

      the conlet id

    Returns Conlet[]

    the conlets found

  • Find the conlet representation that displays the preview of the conlet with the given id. The default implementation wraps the node with .conlet-preview[data-conlet-id='<conletId>'.

    Parameters

    • conletId: string

      the conlet id

    Returns null | Conlet

    the conlet or null

  • Find the conlet representation that displays the view of the conlet with the given id. The default implementation returns all nodes with .conlet-view[data-conlet-id='<conletId>'.

    Parameters

    • conletId: string

      the conlet id

    Returns null | Conlet

    the conlet

  • Find the conlets that display the preview, view or content of the conlet with the given id. The default implementation wraps all nodes with .conlet[data-conlet-id='<conletId>' in DefaultConlets.

    Parameters

    • conletId: string

      the conlet id

    Returns Conlet[]

    the conlets found

  • Find conlet representations that display content and are embedded in the given conlet (which is most likely a view or preview, but may also be a content representation). The default implementation wraps all nodes (with the exception of the argument's element) that match .conlet.conlet-content and returns them in a depth first order.

    Parameters

    • conlet: Conlet

      the containing conlet

    Returns Conlet[]

    the conlets found

  • Find the HTML element that displays a modal dialog associated with the conlet with the given id. The default implementation returns all nodes with .conlet-modal-dialog[data-conlet-id='<conletId>'.

    Parameters

    • conletId: string

      the conlet id

    Returns null | HTMLElement

    the HTML element or null

  • Return all conlet preview representations. The default implementation wraps all elements with .conlet-preview[data-conlet-id].

    Returns Conlet[]

  • Return all conlet view representations. The default implementation wraps all nodes with .conlet-view[data-conlet-id].

    Returns Conlet[]

  • Called from the Console when the console layout is received from the server.

    Parameters

    • previewLayout: string[]

      the conlet ids from top left to bottom right

    • tabsLayout: string[]

      the ids of the conlets viewable in tabs

    • xtraInfo: Object

      extra information spcific to the console implementation

    Returns void

  • Called by the Console to open a modal dialog.

    The container has a generated dialog id and attributes data-conlet-type and data-conlet-id. If ModalDialogOptions.useSubmit is true, the submit button generated by the console must be linked to the form in the content. By convention, this is done using the dialog's id with "-form" appended (i.e. used as the form's id ans the button's form attribute).

    Parameters

    • container: HTMLElement

      the container for the dialog

    • options: ModalDialogOptions

      the options

    • content: string

      the content as HTML

    Returns void

  • Called by the Console to remove the given conlet representations, which may be preview or view containers, from the DOM.

    Parameters

    • conlets: Conlet[]

      the conlets to remove

    Returns void

  • Called from the Console to update a conlet that is used to provide content. The default implementation removes all children from the container and inserts the new content.

    Parameters

    • conlet: Conlet

      the conlet as returned from e.g. Renderer.findConletContents

    • content: HTMLElement[]

      the component content as DOM received from the server, usually inserted into the container

    Returns void

  • Called by the Console to update the modes of the conlet with the given id.

    Parameters

    • conletId: string

      the conlet id

    • modes: RenderMode[]

      the modes

    Returns void

  • Called from the Console to update the preview of the given conlet. If the preview is new (no preview with the given conlet id exists), the console provides DOM for the container as a convenience. Implementations of this method are free to extract the data from the container argument and provide their own markup for a new container.

    Parameters

    • isNew: boolean

      true if it is a new (not yet existing) conlet preview

    • conlet: Conlet

      the container for the preview representation. Either the result from Renderer.findConletPreview, if an existing preview is updated, or a prepared container for the preview, provided as:

      <section class='conlet conlet-preview' 
      data-conlet-type='...' data-conlet-id='...'
      data-conlet-grid-columns='...' data-conlet-grid-rows=' '></section>
    • modes: RenderMode[]

      the supported conlet modes

    • content: HTMLElement[]

      the preview content as DOM received from the server, usually inserted into the container

    • foreground: boolean

      true if the preview (i.e. the overview plane) is to be made the active tab

    Returns void

  • Called bythe Console to update the title of the conlet with the given id.

    Parameters

    • conletId: string

      the conlet id

    • title: string

      the new title

    Returns void

  • Called from the Console when a conlet type is removed.

    The expected action of the renderer is to remove the conlet type from e.g. a menu that allows adding conlets. However, front-ends can also force a reload of the application.

    Parameters

    • conletType: string

      the conlet type

    • renderModes: RenderMode[]

      the render modes

    Returns void

  • Called from the Console to update the view of the given conlet. If the view is new (no view with the given conlet id exists), the console provides DOM for the container as a convenience. Implementations of this method are free to extract the data from the conatiner argument and provide their own markup for a new container

    Parameters

    • isNew: boolean

      true if it is a new conlet view

    • conlet: Conlet

      the container for the view representation. Either the result from Renderer.findConletView, if an existing preview is updated, or a new container provided as:

      <article class="conlet conlet-view
      data-conlet-type='...' data-conlet-id='...'"></article>"
    • modes: RenderMode[]

      the supported conlet modes

    • content: HTMLElement[]

      the view content, usually inserted into the container

    • foreground: boolean

      true if the view is to be made the active tab

    Returns void

  • Wraps a node (HTMLElement) in a Conlets. If the argumnet is null, returns null.

    Parameters

    • node: null | HTMLElement

    Returns null | Conlet