Global ViewModel
The global ViewModel is available in many places in the application and can be used in XTemplates, among other things. It contains important information such as data on the user session, the global date range filter, the selected language, the active module, the user’s roles and rights and the maintenance mode. This centrally managed data enables consistent and efficient handling of application-wide settings and user information
Structure of the ViewModel
| Name | Description |
|---|---|
|
Contains information about the currently active module, including ID, name, etc. |
|
Defines the global date range for data filtering with properties such as value, global mode and activity status. |
|
Saves the currently selected language of the user interface (e.g. "de" for German). |
|
Contains information on various license aspects of the application, modules and services. |
|
A Boolean value that indicates whether the application is in maintenance mode. |
|
Configuration settings of the monitor module. |
|
Defines the user’s access rights to various modules and functions. |
|
Contains the roles assigned to the user (e.g. administrator, normal user). |
|
The status attribute includes various sub-attributes that provide information about the current status of the application, including CRUD status, active user sessions and license details. These attributes help to monitor the system status and identify problems to ensure smooth functionality. |
|
Stores information about the current user session, such as login credentials and session duration validity. |
|
A unique identification number for the current instance or session. |
|
This overview represents the main components of the global ViewModel, but additional attributes and data structures may be present depending on the configuration, application context and specific implementations. |
Access via the browser console
To view the current content of the global ViewModel, you can perform the following steps in the browser console:
-
Open the developer tools of your browser (F12 in most browsers)
-
Switch to the console
-
Enter the following command:
BpcCommon.Api.getGlobalViewModel().get("global")
This shows the current state of the global ViewModel.