Reference Source
public class | source

RenderingBuilder

Extends:

LoggableRenderingBuilderAssets → RenderingBuilder

Rendering wrapper class.

Static Method Summary

Static Public Methods
public static

Get rendering function resolver.

Constructor Summary

Public Constructor
public

constructor(arg_runtime: RuntimeBase, arg_assets_styles: string, arg_assets_scripts: string, arg_assets_img: string, arg_assets_html: string, arg_application: TopologyDefineApplication): nothing

Create a rendering wrapper class.

Method Summary

Public Methods
public

get_content_description(arg_view_name: string, arg_menubar_name: string): object

Get application content description.

public

get_initial_state(arg_view_name: string, arg_menubar_name: string): string

Get application initial state as a JSON string.

public

Get name for loggers.

public

render_content(arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials, arg_assets_services: object): RenderingResult

Render page content (inside 'content' DIV element) with a menubar and a view.

public

render_html_page(arg_title: string | undefined, arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials, arg_assets_services: object): string

Render full page into HTML string.

public

render_json_content(arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials, arg_assets_services: object): object

Render page content (inside 'content' DIV element) with a menubar and a view and convert rendering result to JSON.

public

render_page(arg_title: string | undefined, arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials, arg_assets_services: object): RenderingResult

Render full page.

Private Methods
private

_render_content_common(arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials, arg_default_view_name: string, arg_default_menubar_name: string, arg_rendering_resolver: RenderingResolver): RenderingResult

Render page content helper on browser or server side.

private

_render_content_on_browser(arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials): RenderingResult

Render page content on browser side.

private

_render_content_on_server(arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials): RenderingResult

Render page content on server side.

Inherited Summary

From class Loggable
public

Log context.

public

Class type flag.

public

Trace is enabled for this flag.

private

Logger manager instance (default undefined)

public

debug(args: string | array): nothing

Trace DEBUG formatted message.

public

disable_trace(): nothing

Disable traces.

public

enable_trace(): nothing

Enable traces.

public

enter_group(arg_group: string): nothing

Trace INFO message on "enter trace group".

public

error(args: string | array): nothing

Trace ERROR formatted message.

public

Define get class name method for non Instance classes.

public

Get instance context.

public

Get logger manager.

public

Define get instance name method for non Instance classes.

public

Get trace flag.

public

info(args: string | array): nothing

Trace INFO formatted message.

public

leave_group(arg_group: string): nothing

Trace INFO message on "leave trace group".

public

separate_level_1(): nothing

Trace INFO trace level 1 separator.

public

separate_level_2(): nothing

Trace INFO trace level 2 separator.

public

separate_level_3(): nothing

Trace INFO trace level 3 separator.

public

set_trace(arg_value: boolean): nothing

Set trace flag.

public

should_trace(arg_traces_cfg: object): boolean

Calculate should trace flag.

public

should_trace_class(arg_traces_cfg: object): boolean

Calculate should trace flag for classes.

public

should_trace_collection_item(arg_traces_cfg: object, arg_collection_name: string, arg_this_item_accessor: string): boolean

Calculate should trace flag for given collection of names or patterns.

public

should_trace_module(arg_traces_cfg: object): boolean

Calculate should trace flag for modules.

public

should_trace_name(arg_traces_cfg: object): boolean

Calculate should trace flag for instances names.

public

Toggle trace flag.

public

Update trace enabled flag.

public

warn(args: string | array): nothing

Trace WARN formatted message.

From class RenderingBuilderAssets
public
public
public
public
public
public
public
public
public
private
private
public

Get an url to server the given static html asset.

public

Get an url to server the given image asset.

public

Get an url to server the given script asset.

public

Get an url to server the given style asset.

public

get_assets_url(arg_consumer: object, arg_svc_name: string, arg_url: string): string

Get an url to server the given image asset.

public

Get TopologyDefineApplication instance from registered application or from credentials.

public

Get an url to server the given image asset.

public

set_assets_services_names(arg_assets_styles: string, arg_assets_scripts: string, arg_assets_img: string, arg_assets_html: string): nothing

Set assets services names.

Static Public Methods

public static get_rendering_function_resolver(arg_credentials: Credentials): Function source

Get rendering function resolver.

Params:

NameTypeAttributeDescription
arg_credentials Credentials

credentials instance.

Return:

Function

rendering function resolver.

Public Constructors

public constructor(arg_runtime: RuntimeBase, arg_assets_styles: string, arg_assets_scripts: string, arg_assets_img: string, arg_assets_html: string, arg_application: TopologyDefineApplication): nothing source

Create a rendering wrapper class.

API: ->constructor(arg_runtime, arg_assets_styles, arg_assets_scripts, arg_assets_img, arg_assets_html, arg_application)

    ->get_content_description(arg_view_name, arg_menubar_name):object - Get application content description.
    ->get_initial_state(arg_view_name, arg_menubar_name):string - Get application initial state as a JSON string.

    ->render_html_page(arg_title, arg_view, arg_menubar, arg_credentials, arg_assets_services=undefined):string -  Render full page into HTML string.
    ->render_page(arg_title, arg_view, arg_menubar, arg_credentials, arg_assets_services=undefined):RenderingResult - Render full page.

    ->render_json_content(arg_view, arg_menubar, arg_credentials, arg_assets_services):object - Render page content (inside 'content' DIV element) with a menubar and a view and convert rendering result to JSON.
    ->render_content(arg_view, arg_menubar, arg_credentials, arg_assets_services):RenderingResult - Render page content (inside 'content' DIV element) with a menubar and a view.

Override:

RenderingBuilderAssets#constructor

Params:

NameTypeAttributeDescription
arg_runtime RuntimeBase

runtime instance.

arg_assets_styles string

application service name to provide style assets.

arg_assets_scripts string

application service name to provide script assets.

arg_assets_img string

application service name to provide image assets.

arg_assets_html string

application service name to provide html assets.

arg_application TopologyDefineApplication

application.

Return:

nothing

Public Methods

public get_content_description(arg_view_name: string, arg_menubar_name: string): object source

Get application content description.

Params:

NameTypeAttributeDescription
arg_view_name string

main view name.

arg_menubar_name string

main menubar name.

Return:

object

content description object as { name:..., type:..., state:..., settings:..., children:... }.

public get_initial_state(arg_view_name: string, arg_menubar_name: string): string source

Get application initial state as a JSON string.

Params:

NameTypeAttributeDescription
arg_view_name string

main view name.

arg_menubar_name string

main menubar name.

Return:

string

state JSON string.

public get_name(): string source

Get name for loggers.

Override:

Loggable#get_name

Return:

string

public render_content(arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials, arg_assets_services: object): RenderingResult source

Render page content (inside 'content' DIV element) with a menubar and a view.

Params:

NameTypeAttributeDescription
arg_view string | Component | undefined

main view name or instance (optional) (default application view name).

arg_menubar string | Component | undefined

main menubar name or instance (optional) (default application menubar name).

arg_credentials Credentials

credentials instance.

arg_assets_services object

assets record (optional).

Return:

RenderingResult

rendering result instance.

public render_html_page(arg_title: string | undefined, arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials, arg_assets_services: object): string source

Render full page into HTML string.

Params:

NameTypeAttributeDescription
arg_title string | undefined

page title, application title (optional).

arg_view string | Component | undefined

main view name or instance (optional) (default application view name).

arg_menubar string | Component | undefined

main menubar name or instance (optional) (default application menubar name).

arg_credentials Credentials

credentials instance.

arg_assets_services object

assets record (optional).

Return:

string

rendering HTML code.

public render_json_content(arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials, arg_assets_services: object): object source

Render page content (inside 'content' DIV element) with a menubar and a view and convert rendering result to JSON.

Params:

NameTypeAttributeDescription
arg_view string | Component | undefined

main view name or instance (optional) (default application view name).

arg_menubar string | Component | undefined

main menubar name or instance (optional) (default application menubar name).

arg_credentials Credentials

credentials instance.

arg_assets_services object

assets record (optional).

Return:

object

rendering result converted to JSON object.

public render_page(arg_title: string | undefined, arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials, arg_assets_services: object): RenderingResult source

Render full page.

Params:

NameTypeAttributeDescription
arg_title string | undefined

page title, application title (optional).

arg_view string | Component | undefined

main view name or instance (optional) (default application view name).

arg_menubar string | Component | undefined

main menubar name or instance (optional) (default application menubar name).

arg_credentials Credentials

credentials instance.

arg_assets_services object

assets record (optional).

Return:

RenderingResult

rendering result instance.

Private Methods

private _render_content_common(arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials, arg_default_view_name: string, arg_default_menubar_name: string, arg_rendering_resolver: RenderingResolver): RenderingResult source

Render page content helper on browser or server side.

Params:

NameTypeAttributeDescription
arg_view string | Component | undefined

main view name or instance (optional) (default application view name).

arg_menubar string | Component | undefined

main menubar name or instance (optional) (default application menubar name).

arg_credentials Credentials

credentials instance.

arg_default_view_name string

default view name.

arg_default_menubar_name string

default menubar name.

arg_rendering_resolver RenderingResolver

object with 'find_rendering_function(type name)' method.

Return:

RenderingResult

rendering result instance.

private _render_content_on_browser(arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials): RenderingResult source

Render page content on browser side.

Params:

NameTypeAttributeDescription
arg_view string | Component | undefined

main view name or instance (optional) (default application view name).

arg_menubar string | Component | undefined

main menubar name or instance (optional) (default application menubar name).

arg_credentials Credentials

credentials instance.

Return:

RenderingResult

rendering result instance.

private _render_content_on_server(arg_view: string | Component | undefined, arg_menubar: string | Component | undefined, arg_credentials: Credentials): RenderingResult source

Render page content on server side.

Params:

NameTypeAttributeDescription
arg_view string | Component | undefined

main view name or instance (optional) (default application view name).

arg_menubar string | Component | undefined

main menubar name or instance (optional) (default application menubar name).

arg_credentials Credentials

credentials instance.

Return:

RenderingResult

rendering result instance.