import RenderingBuilder from 'devapt-core-common/js/rendering/rendering_builder.js'
RenderingBuilder
Extends:
Rendering wrapper class.
Static Method Summary
Static Public Methods | ||
public static |
get_rendering_function_resolver(arg_credentials: Credentials): Function 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 |
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 |
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 |
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 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(): nothing Update trace enabled flag. |
|
public |
Trace WARN formatted message. |
From class RenderingBuilderAssets | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
private |
_application: * |
|
private |
_runtime: * |
|
public |
get_assets_html_url(arg_url: string): string Get an url to server the given static html asset. |
|
public |
get_assets_image_url(arg_url: string): string Get an url to server the given image asset. |
|
public |
get_assets_script_url(arg_url: string): string Get an url to server the given script asset. |
|
public |
get_assets_style_url(arg_url: string): string 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_topology_defined_application(arg_credentials: Credentials): TopologyDefineApplication Get TopologyDefineApplication instance from registered application or from credentials. |
|
public |
get_url_with_credentials(arg_url: string): string 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:
Name | Type | Attribute | Description |
arg_credentials | Credentials | credentials instance. |
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#constructorParams:
Name | Type | Attribute | Description |
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.
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.
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:
Name | Type | Attribute | Description |
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). |
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:
Name | Type | Attribute | Description |
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). |
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:
Name | Type | Attribute | Description |
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). |
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:
Name | Type | Attribute | Description |
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). |
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:
Name | Type | Attribute | Description |
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. |
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:
Name | Type | Attribute | Description |
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. |
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:
Name | Type | Attribute | Description |
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. |