The application configuration is stored in the app-config.json
file and describes:
Application Preferences: all the values of the web client, such as the application title, and other web client elements. For more details, refer to Section Setting Application Preferences. This includes entity hint colors, which can be set from a dedicated view. For more details, refer to Section Understanding the Custom Colors View.
Views and Dashboards: all the views and dashboards and the widgets they contain, including Custom Views and Dashboards. For more details, refer to Sections Understanding the Views and Dashboards Management View and Using the Default Widgets.
Workspaces and Folders: workspaces and folders are the containers for scenarios. For more details, refer to Sections Using the Workspace List Widget and Using the Scenario List Widget.
Permissions Rules: rules that control how application users can interact with different application elements. For more details, refer to Section Defining Permissions.
Note that the application configuration can be processed along with other elements in a backup and restore process. For more details, refer to Section Backing Up and Restoring the Application. |
Application Configuration can be exported to a JSON file to replicate the application on a new instance, as a backup, or as a way to automatically deploy changes on a running instance.
Here are some of the use cases allowed by this feature:
"I have configured the application with dashboards showing strategical-level KPIs for management and, for a demo, I need to configure operational-level views without losing the previous setup."
"I have configured my application on the integration environment with views, dashboards, workspaces, and permissions, and I want to back up this configuration to deploy other instances of the application with the same configuration without requiring any other operation."
"I have worked on dashboards, but I'm not happy with the modifications I did. I want to restore their previous states by using the reset feature."
"As a business analyst, I updated the widgets of a project that was already deployed and I need to make sure the next release will update the configuration on the production deployment."
This section describes importing application configuration parts using the web client.
Note that the selected application elements of the current application will be replaced by those coming from the file. Therefore, it is recommended to back up the current application configuration before importing an application configuration file. That way the current configuration is easier to restore if any issues should arise from importing an external application configuration file. For more details, refer to Section Exporting an Application Configuration File |
The app-config.json
file can be used in a deployment to load application configuration automatically. For more details, refer to Section Deploying the Application.
After the import elements were selected, if the application has no workspaces or permission rules, the Application Initialization Bean is called. For more details, refer to Section Setting Advanced Initialization.
Connect to the web client as a user with sufficient permissions to proceed. For more details, refer to Section Accessing the Web Client and Part Securing.
In the Topbar Menu Settings, click on Settings > Application Configuration > Reset from File. A dialog opens.
![]() |
Select the JSON configuration file to import and click on NEXT. The next page opens.
![]() |
By default, all the options are checked. Untick the elements for which you do not want to reset the configuration. At least one should be selected.
Note that:
|
Tick the confirmation checkbox.
Click on RESET to replace the current element configuration with the one from the imported file. The dialog closes.
The web client reloads to reflect updated settings, workspaces, and permissions. In some cases, you may need to refresh the web page.
The current application configuration can be exported in a .json
file that can be analyzed, edited, and reimported. For more details, refer to Section Importing an Application Configuration File. The file structure defines all application elements and their internal structure, such as the settings, views, dashboards, workspaces, and folders.
The Permission Rules, Rulesets, and Groups are also stored in the exported structure. For more details, refer to Section Defining Permission Rules and Rulesets.
Connect to the web client as a user with sufficient permissions to proceed. For more details, refer to Section Accessing the Web Client and Part Securing.
In the Topbar Menu Settings, click on Settings > Application Configuration > Export to File. The application configuration is exported in a .json
file on the user machine.
DOC
allows discarding changes made on the application to come back to the application default configuration.
Connect to the web client as a user with sufficient permissions to proceed. For more details, refer to Section Accessing the Web Client and Part Securing.
In the Topbar Menu Settings, click on Settings > Application Configuration > Reset Default Configuration. A dialog opens.
![]() |
Tick the confirmation box and click on RESET. The dialog closes. If an app-config.json
file is deployed with the application, it is used and the effect is the same as if the file was imported using the Reset from file functionality. Otherwise, all elements are deleted and the application initialization code is called. For more details, refer to Section Setting Advanced Initialization.
The web client reloads to reflect updated settings, workspaces, and permissions. In some cases, you may need to refresh the web page.
Scenario data is never affected when you reset the application configuration, i.e. existing scenarios are always preserved in the application.
Note that "Existing" scenarios refer to scenarios that have not been deleted, for instance, using the options Move to Trash and Empty Trash. For more details, refer to Section Using the Scenario List Widget. |
However, in some cases, users can no longer see existing scenarios in the web client after resetting the application configuration, as described in Sections Importing an Application Configuration File or Resetting the Application Configuration to Default. This happens when workspaces are deleted by the reset and the scenarios in them become "orphans".
Orphan scenarios are moved to a workspace called Lost and found. It is automatically created, if necessary, with the scenario-service
user as the owner and default permission rules.
For example, importing a configuration file can lead to this situation as follows:
Initially, the application has workspace W1 with scenario S1 in it.
The user exports app-config.json
.
The user creates workspace W2 and scenario S2 in it.
The user reimports app-config.json
and leaves the option Workspaces and Folders ticked (default).
The result is that:
Since workspace W1 was exported in app-config.json
, it continues to exist with its scenario S1 as scenarios are always preserved in the application database.
Scenario S2 is placed in workspace Lost and found as an orphan.
When this happens, the user performing the reset needs to use the Permissions view to change the permissions on workspace Lost and found.
For more details, refer to Section Understanding the "Application Elements Override" Tab.
Note that , to prevent moving all scenarios to workspace Lost & Found, users can untick the option Workspaces and Folders when Importing an Application Configuration File. |
Connect to the web client as a user with sufficient permissions to proceed. For more details, refer to Section Accessing the Web Client and Part Securing.
In the Topbar Menu Settings, click on Settings > Application Configuration > Permissions. The Permissions management view opens.
![]() |
Click on the tab Application Elements Overrides. The page refreshes.
In the left panel Application Elements, click on Lost and found. The page refreshes.
In the middle panel, click on Everybody or only the users impacted. The page refreshes.
In the right panel, tick the Access and Modify checkboxes for the Workspaces and Scenarios.
In the toolbar, click on the button Save. The configuration is updated. This way, the selected users can move the orphan scenarios from the Lost and found workspace to the desired one(s). For more details, refer to Chapter Managing the Application Data.
Application preferences allow defining the default settings of the web client and various customization parameters.
They come in addition to dedicated views, which allow managing custom views and dashboards, permissions, workspaces, or entity color hints. For more details, refer to Section Understanding the Management Views.
Application Preferences can be accessed from the Topbar Settings Menu in Settings > Application Configuration > Preferences. For more details, refer to Section Understanding the Topbar Settings Menu.
Visibility of the application elements depends on: |
Application controllers can be implemented to manage the application custom behavior, look and feel. For more details, refer to Section Using a Web Application Controller.
![]() |
The following table lists all the default settings that can be modified.
Settings Name | Component | Description | Default Value |
---|---|---|---|
APPLICATION_TITLE | NAVIGATION_BAR | The title of the application displayed in the Navigation Bar | DOC sample project |
COMPARISON_DATA_ROWS_LIMIT | DATA | The maximum number of rows allowed in the selected and reference scenario to fetch comparison data | 50000 |
DATA_ROWS_LIMIT | DATA | The maximum number of rows the web client fetches in any query | 10000 |
DEFAULT_DBRF_EXPORT_TASK_ID | TASK | Id of the DBRF Export Task to use when clicking Export DBRF | DbrfExportTask |
DEFAULT_EXCEL_EXPORT_TASK_ID | TASK | Id of the Excel Export Task to use when clicking Export Excel | SimpleExcelExportTask |
DEFAULT_EXCEL_IMPORT_TASK_ID | TASK | Id of the Excel Import Task to use when clicking Import Excel | ScenarioImportTask |
DEFAULT_SCENARIO_IMPORT_TASK_ID | TASK | Id of the DBRF Import Task to use when clicking Import DBRF | DbrfImportTask |
FILTER_BUTTON_SHOW | VIEW_TOOLBAR | Show or hide the filter Button | true |
FILTER_SCOPE | FILTER | Defines the filters scope in views and dashboards. When scope is set to "GLOBAL" (default) filters are shared between views and dashboards, when set to "VIEW", filters scope is limited to the view from which they have been set. | GLOBAL |
GENE_COLOR_PALETTE_INTERPOLATE | COLOR | Color Palette Interpolation (use more colors when true) | true |
GENE_COLOR_PALETTE_INTERPOLATION_BOOST | COLOR | Boost the color over the pivot color. Must be > 0, 1 is neutral | 4 |
GENE_COLOR_PALETTE_INTERPOLATION_PIVOT_COLOR | COLOR | Pivot color used for interpolation. Impacts darkness/lightness of the colors | #E0E0E0 |
GENE_CONFLICTS_DETECTION | TABLE | When set to true, the Table Widget uses conflict detection when saving changes | true |
GENE_DASHBOARD_COLUMNS | DASHBOARD | The Dashboard Component Layout Columns | 20 |
GENE_DASHBOARD_MARGIN | DASHBOARD | The Dashboard Component margins in pixels (EXPERIMENTAL) | 20 |
GENE_DASHBOARD_ROWS | DASHBOARD | The Dashboard Component Layout Rows | 20 |
GENE_DAY_COLORS_SETTING_NAME | COLOR | Background colors based on week day used for the time axis option. Must be a seven string array, the first value is Monday. | ["#FAFAFA", "#FAFAFA", "#FAFAFA", "#FAFAFA", "#FAFAFA", "#EAEAEA", "#EAEAEA"] |
GENE_DEFAULT_COLOR_PALETTE | COLOR | Default Color Palette (material or default) | default |
GENE_DEFAULT_PALETTE_LIGHTNESS_LEVEL | COLOR | Lightness range for colors generated with the default palette (one of low, medium and high) | medium |
GENE_DEFAULT_PALETTE_SATURATION_LEVEL | COLOR | Saturation range for colors generated with the default palette (one of low, medium and high) | medium |
GENE_DISABLE_COLOR_HINTS | COLOR | Remove all color hints from table and instance pickers if true | false |
GENE_THEME | DASHBOARD | The CSS classname of DOC Theme, default is unset, use 'gene-theme-compact' for compact theme | APPLICATION |
ISSUES_LIST_LIMIT | ISSUES_LIST_WIDGET | The maximum number issues of each Type (i.e. data and schema) displayed in the Issues List Widget | 5000 |
HOME_VIEW_ID | HOME | ID of the View used as Home | 49ea8f74-6e9e-4dcc-9878-df8c164ed593 |
JOBS_FILE_RESULTS_AUTO_DOWNLOAD | TASK | When a current user Job Completes and has File Result, the download starts automatically | true |
JOBS_FILE_RESULTS_AUTO_DOWNLOAD_IGNORED_TASKS | TASK | Comma-separated list of Task Identifiers, ignored by JOBS_FILE_RESULTS_AUTO_DOWNLOAD setting | ScenarioImportTask |
JOBS_VIEW_SHOW_NEW_JOB_BUTTON | JOBS_VIEW | Show the "Run New Job" (magic wand) button in the Job List | true |
MAP_MAPBOX_API_KEY | MAP_WIDGET | Mapbox direction API token necessary for the Map Widget, available at mapbox.com | |
MAP_MAPBOX_DIRECTION_API_URL | MAP_WIDGET | Mapbox direction API url necessary for the Map Widget, available at mapbox.com | |
MAP_MAPTILER_API_KEY | MAP_WIDGET | Maptiler API token necessary for the Map Widget, available at maptiler.com | |
NAVIGATION_BAR_SHOW_APPLICATION_NAME | NAVIGATION_BAR | Show the application name in the top navigation bar | true |
NOTIFICATIONS_SHOW_JOB_PROGRESS | NOTIFICATIONS | Notify the progress of a job | false |
NOTIFICATIONS_SHOW_JOB_RESULT | NOTIFICATIONS | Notify the completion of a job | true |
NOTIFICATIONS_SHOW_JOB_STATUS_CHANGE | NOTIFICATIONS | Notify status changes (before completion) of a job | false |
PIVOT_SHOW_CUSTOM_TYPES | PIVOT | When set to true, the Pivot Table Widget can be used with Custom Types (EXPERIMENTAL) | false |
RUN_SCHEMA_CHECKERS_ON_MODIFICATIONS | TABLE | When set to true, the Table Widget automatically runs checkers upon data modification | true |
SCENARIO_COMPARISON_TOGGLE_SHOW | SCENARIO_COMPARISON | Show or hide the Scenario comparison toggle Button | true |
SCENARIO_IMPORT_DIALOG_PRESERVE_FILE_NAME | IMPORT_SCENARIO_MODAL | Controls the behavior of scenario import dialog, if true the title is the file name without extension, humanized version otherwise | true |
SCENARIO_PICKER_SHOW | SCENARIO_PICKER | Show or hide the Scenario Picker | true |
SCENARIO_PICKER_SHOW_CLEAR_BTN | SCENARIO_PICKER | Show or hide the Scenario Picker "Clear" Button | true |
SCENARIO_PICKER_SHOW_CREATE_BTN | SCENARIO_PICKER | Show or hide the Scenario Picker "Create" Button | true |
SCENARIO_PICKER_SHOW_VIEW_ALL_BTN | SCENARIO_PICKER | Show or hide the Scenario Picker "View All" Button | true |
SETTINGS_MENU_SHOW_APPLICATION_CONFIGURATION | SETTINGS_MENU | Show or hide Application Configuration entry in the top right Settings Menu | true |
SETTINGS_MENU_SHOW_GLOBAL_PREFERENCES | SETTINGS_MENU | Show or hide Global Preferences entry in the top right Settings Menu | true |
SETTINGS_MENU_SHOW_NEW_DASHBOARD | SETTINGS_MENU | Show the "Create New Dashboard" entry in the top-right Settings menu | true |
SETTINGS_MENU_SHOW_NEW_VIEW | SETTINGS_MENU | Show the "Create New View" entry in the top-right Settings menu | true |
SETTINGS_MENU_SHOW_WORKSPACES | SETTINGS_MENU | Show the Workspace menu in the top-right Settings menu | true |
SETTINGS_MENU_VIEW_DASHBOARD_MANAGE | SETTINGS_MENU | Show the "Configure" entry in the Views and Dashboards sub menu | true |
SETTINGS_MENU_WORKSPACES_CREATE_NEW | SETTINGS_MENU | Show the "Create New Workspace" entry in the top-right Settings menu | true |
SETTINGS_MENU_WORKSPACES_MANAGE | SETTINGS_MENU | Show the "Manage Workspaces" entry in the top-right Settings menu | true |
SIDEBAR_SHOW_HOME | SIDEBAR | Show the Home entry in the sidebar | true |
SYSTEM_MENU_SHOW_CUSTOM_COLORS | COLOR | Show the color configuration link in the system menu | true |
TABLE_SHOW_CUSTOM_TYPES | TABLE | When set to true, the Table Widget can be used with Custom Types | false |
TASK_MENU_SHOW_EXPORT_DBRF | TASK_MENU | Show the "Export Data To DBRF File" entry in the top-right Jobs menu | true |
TASK_MENU_SHOW_EXPORT_EXCEL | TASK_MENU | Show the "Export Data To Excel File" entry in the top-right Jobs menu | true |
TASK_MENU_SHOW_IMPORT_FILE | TASK_MENU | Show the "Import Data from DBRF File" entry in the top-right Jobs menu | true |
TASK_MENU_SHOW_MENU | TASK_MENU | Show the top-right Jobs menu | true |
TASK_MENU_SHOW_NEW_TASK | TASK_MENU | Show the "Run New Job" entry in the top-right Jobs menu | true |
TASK_MENU_SHOW_RUNNING_JOBS | TASK_MENU | Show a badge and the number of running Jobs | true |
TASK_MENU_SHOW_JUPYTERLAB | TASK_MENU | Show the "JupyterLab" entry in the top-right Jobs menu | false |
TASK_MENU_SHOW_TASK_MONITOR | TASK_MENU | Show the "Job List" entry in the top-right Jobs menu | true |
WORKSPACE_PICKER_SHOW | WORKSPACE_PICKER | Show or hide the Workspace Picker | true |
WORKSPACE_PICKER_SHOW_CREATE_BTN | WORKSPACE_PICKER | Show or hide the Workspace Picker "Create" Button | true |
WORKSPACE_PICKER_SHOW_VIEW_ALL_BTN | WORKSPACE_PICKER | Show or hide the Workspace Picker "View All" Button | true |
In addition to the list above, users can add any of the following parameters to precisely configure the look and feel of the web client by customizing the page title, colors, logo, font and other CSS variables.
Settings Name | Description | Default Value |
---|---|---|
GENE_DISABLE_COLOR_HINTS | Flag to disable color hints in Data Grids, Data Explorer and instance picker. For more details, refer to Sections Using the Data Grid Widget and Using the Data Explorer Widget. | false |
GENE_COLOR_PALETTE | The default color palette used in widgets (charts, tables,...), must be an array of css colors, e.g. ["#54011", "#fa8489", "#ff0000"]. For more details, refer to Section Understanding the Custom Colors View. | - |
--gene-logo-background | The top left corner logo in Base64 format as follows: url(“data:image/XX;base64,XX=”) . For more details, refer to Section Understanding the Application Logo. | - |
--gene-font-family | The default application font | - |
--gene-text-color | CSS Variable | - |
--gene-selected-row-background-color | CSS Variable | - |
--gene-hover-row-background-color | CSS Variable | - |
--gene-error-color | CSS Variable | - |
--gene-warning-color | CSS Variable | - |
--gene-error-text-color | CSS Variable | - |
--main-color-lightest | CSS Variable | - |
--main-color-lighter | CSS Variable | - |
--main-color-light | CSS Variable | - |
--main-color | CSS Variable | - |
--main-color-dark | CSS Variable | - |
--main-color-darker | CSS Variable | - |
--main-color-darkest | CSS Variable | - |
--secondary-color-light | CSS Variable | - |
--secondary-color | CSS Variable | - |
--secondary-color-dark | CSS Variable | - |
--secondary-color-darker | CSS Variable | - |
--cool-grey-lightest | CSS Variable | - |
--cool-grey-lighter | CSS Variable | - |
--cool-grey-light | CSS Variable | - |
--cool-grey | CSS Variable | - |
--cool-grey-dark | CSS Variable | - |
--cool-grey-darker | CSS Variable | - |
--cool-grey-darkest | CSS Variable | - |
--alert-info | CSS Variable | - |
--alert-info-lighten-10 | CSS Variable | - |
--alert-error | CSS Variable | - |
--alert-error-lighten-10 | CSS Variable | - |
--alert-warning | CSS Variable | - |
--alert-warning-lighten-10 | CSS Variable | - |
--alert-success | CSS Variable | - |
--alert-success-lighten-10 | CSS Variable | - |
--default-view-padding | CSS Variable | - |
--default-widget-border-radius | CSS Variable | - |
![]() |
At the very first Scenario Service startup, when the MongoDB database is empty, a check is made on the existence of a configuration file which name is defined by the scenario-management.app-config.file
property (default value is app-config.json
).
If this file is found, the application configuration elements it contains are loaded in the application.
This behavior reflects the default values scenario-service-base
that the Spring Boot application uses by default.
scenario-management: app-config: file: /app-config.json # Configuration file to use for reset # Following parameters configure the application reset on startup. # If a scenario-management.app-config.file is defined and exists it will be # used to reset the application, otherwise reset will erase existing elements # and reinitialize through the application initializers. # reset: mode: always # init (default) | always | never views-dashboards: true # reset views and dashboard (default true) workspaces: true # reset workspaces (default true) permissions: true # reset permissions (default true) app-preferences: true # reset Application Preferences (default true)
It is possible to override scenario-management
properties by adding them in application.yml
of the scenario-service-extension
module.
The possible values for the scenario-management.app-config.reset.mode
property are :
init
: if present, the file is loaded at the first startup of Scenario Service, when application database is empty.
always
: if present, the file is reloaded at every Scenario Service startup.
never
: the is never loaded.
Note that,when a user calls the interactive "Reset Default Configuration" feature, all the elements of the |
In addition, an initialization bean is looked for and invoked if found. This gives you the opportunity to define some global initialization of the application, such as creating global workspaces or installing general permission rules. You can consider the code in this bean to be responsible for creating workspaces, and permissions always needed in your application.
To do so, define a class that implements WorkspaceAndPermissionRulesInitializer
(Javadoc) in the scenario-service-extension
, and annotate it with @Component
to make it a bean class. In this class, you will override three methods:
initWorkspaces(String applicationId, InitWorkspaceApi initWorkspaceApi)
initPermissionRules(String applicationId, PermissionRulesApi permissionRulesApi)
initUser(String applicationId, GeneUser user, InitUserApi initUserApi)
The first two methods are called when the application starts or after a reset from a configuration file. The first one receives an InitWorkspaceApi
(Javadoc) instance as argument, which contains the necessary API to create a workspace, etc. The second one receives a PermissionRulesApi
(Javadoc) instance as argument, which contains the necessary API to add permission rules. For more details, refer to Section Defining Permissions.
Finally, the third method is called when a user cannot access any workspace, typically when they log in for the first time. This is where a private workspace for the user can be created, for example.
Note that a freshly generated application contains an implementation of this bean, provided as an example, that duplicates the default behavior. You are free to modify it at will, or even remove it if you want to keep the default behavior and save some code.
The user initialization attaches a gene_user_initialized
flag to each Keycloak user once the initialization is completed. The user initialization can be disabled by setting the property scenario-management.users.initialize
to false
in the default.yml
configuration file of the scenario-service-extention
module. This can be useful, for example, if your keycloak is configured with users in read-only mode.
If you provide a bean class that implements ApplicationElementCreationHandler
(Javadoc), its methods are called whenever a workspace, a scenario, or a view/dashboard is created. This interface defines three methods, named onWorkspaceCreation
, onScenarioCreation
, and onViewDashboardCreation
.
These three methods take as argument:
the user who created the application element;
the application element (workspace, scenario, view/dashboard) just created;
an ApplicationElementPropertiesApi
and a PermissionRulesApi
instance that provide methods to set properties on the application element and to add permission rules. For more details, refer to Section Defining Permissions.
You could, for example, use one of these methods to set specific properties on a just-created scenario.
Here also, a freshly generated application contains an implementation of this bean, provided as an example, that duplicates the default behavior, that is, do nothing. You are free to modify it at will, or even remove it if you want to keep the default behavior and save some code.
Developers can create custom application controllers to use in the Application Preferences. For more details, refer to Section Setting Application Preferences.
This feature lets the user configure the visibility of all the existing elements according to contextual information and introduce further customizations.
This means that each time one of these elements changes, for instance when the user selects a different scenario, or navigate to another view, the web client is updated according to the new context.
All of these customizations and extensions are linked to the application context. For more details, refer to Section Understanding Widget Context. |
Note that there are several parts of the application that can be customized through a custom application controller.
The typical use cases the application controller addresses are the following:
Hide some existing default elements (e.g. " Hide the Tasks menu for some users")
Extend the Existing elements with custom ones (e.g. " Add a new menu" or " Customize the toolbar")
Here is an exhaustive list of all configurable and extensible elements through the Web Application Controller mechanism.
Configuring the View and Dashboard Title allows to override the current view or dashboard title.
Configuring the Header Bar Menus allows to set the:
Header Bar visibility
Task Menu and items visibility
System Menu and items visibility
Custom Application Menus
Configuring the Side Navigation Items allows to set the:
Sidebar visibility
Workspace Selector visibility
Home page link visibility
Views and Dashboards List visibility
Configuring the Views and Dashboards Toolbar allows to set the:
Toolbar visibility
Scenario picker visibility
Default buttons visibility
Custom Toolbar Elements (Buttons, Labels, Progress, Searchbar)
To implement a custom web application controller, you first need to create a class that implements the interface GeneApplicationController
.
/** * Implementing a GeneApplicationController allows to override some common patterns of the defaultDOC
Web Application * such as the header, menus, sidebar, toolbars and titles. * * Note that GeneApplicationController does not provide extension APIs to override widget behavior. To do so * you have to use GeneWidgetController API. */ export interface GeneApplicationController { /** * When provided, the component will replace the default Gene component for the header bar */ header?: { component?: Type<any>; }, /** * When provided, the component will replace the default Gene component for the sidebar */ sidenav?: { component?: Type<any>; } /** * This method allows to override and add additional Menus in the top bar. * This method is being called by GeneFramework each time current ViewDashboard or GeneContext * change. * * @param view current displayed view * @param context current context */ customizeMenus?: (context: GeneContext, view: ViewDashboard) => Observable<GeneApplicationMenu[]>; /** * This method allows to override and add additional GeneToolbarElement in the current ViewDashboard * toolbar. * This method is being called by GeneFramework each time current ViewDashboard or GeneContext * change. * * @param view current displayed view * @param context current context */ customizeViewDashboardToolbar?: (context: GeneContext, view: ViewDashboard) => Observable<GeneToolbarElement[]>; /** * This method allows to override the View and Dashboard titles. * This method is being called by GeneFramework each time current ViewDashboard or GeneContext * change. * * @param view current displayed view * @param context current context */ customizeViewDashboardTitle?: (context: GeneContext, view: ViewDashboard) => Observable<string>; /** * This method allows to overrideDOC
default configuration. * This method is being called by GeneFramework each time current ViewDashboard or GeneContext * change. * * Note that it is safe to modify the configuration received as a parameter and return it. * * @param view current displayed view * @param context current context * @param configuration default application configuration * @return Observable of the partial configuration to override */ customizeDefaultConfiguration?: (context: GeneContext, view: ViewDashboard) => Observable<GeneApplicationConfiguration>; }
Here is an example of a custom controller that adds a new Menu in the Header Bar and hides the default Task Menu. Note that this controller is available as a sample:
export class SampleApplicationController implements GeneApplicationController { // Customize Header menu by adding a 'Factory Menu' // With two Menu Items customizeMenus(context: GeneContext, view: ViewDashboard): Observable<GeneApplicationMenu[]> { return of([ { icon: 'factory', id: 'factory-menu', title: 'Factory Menu', menuGroups: [ { title: 'Menu Group 1', menuItems: [ { label: 'Menu Element 1', icon: 'employee', clickHandler: () => alert('Menu Element 1 Clicked !') }, { label: 'Menu Element 2', icon: 'employee', clickHandler: () => alert('Menu Element 2 Clicked !') } ] } ] } ]); } // Customize default Application Configuration // - Hide the Task menu (always) customizeDefaultConfiguration(context: GeneContext, view: ViewDashboard, configuration: GeneApplicationConfiguration): Observable<Partial<GeneApplicationConfiguration>> { return of({ header: { taskMenu: { hide: true } } }); } }
In the first component that is started, which is the app.component.ts
, DOC
can register multiple application controllers through GeneApplicationService
.
export class AppComponent { constructor(translate: TranslateService, settingsService: GeneSettingsService, applicationService: GeneApplicationService) { // ... // Register a custom app controller sample applicationService.registerApplicationController('Sample Custom Menu', () => new SampleCustomMenusApplicationController()); // ... } }