# The Control Panel is implemented so that it allows user to open a screen with an application Global Configuration form where the user can specify global settings of the application.
# The Controller is implemented so that it stores all instance-specific data in the database. The data includes a copy of
APP-META.xml file, information about the instance specific URL, settings, and so on.
Starting Point. User initiates opening the Global Configuration screen of an application.
Step 1. The Controller gathers all information necessary for generating the form:
Sub-step 1.1. Finds the required application package, and reads the settings info from the basic metadata selecting descriptions of global settings (
Sub-step 1.2. Processes the global settings info (setting name, description, data type, default value, grouping information), and makes the form skeleton - the global settings grouped as specified in the metadata.
Sub-step 1.3. Finds the saved values of global settings and fills them in the form skeleton. If finds no previous configuration, uses the default values from the package metadata.
Step 2. The Controller transforms the form skeleton to the form code using the set of rules that define how the setting information must be reflected in GUI, and displays the Global Configuration screen.
Step 3. After user fills in the Global Configuration form and submits it, the Controller processes the submitted data:
Sub-step 3.1. Validates the submitted data using the settings type information and for those settings that have
uniq attribute ensures their values uniqueness. If the validation fails, the Controller displays the configuration screen form where the settings that failed validation are marked, then goes to the beginning of the Step 3.
Sub-step 3.2. Saves the global settings.
Sub-step 3.3. Selects all settings elements which lack the
installation-only="true" attribute, and prepares for each such setting an environment variable
SETTINGS_<id>, where <id> replaces the value of the setting's
id attribute ("
Step 4. The Controller reconfigures all instances associated with the package according to the new global settings. It goes through the list of the instances, and performs the following actions with each instance:
Sub-step 4.1. Reads the instance metadata, particularly, the info on instance URL, settings, satisfied requirements, etc., and prepares all possible environment variables.
Sub-step 4.2. Runs the application configuration script in the environment where all the environment variables prepared on the previous sub-step are defined.
Sub-step 4.3. As the script returns an exit code, the Controller proceeds to reconfiguring the next instance (goes to Sub-step 4.1.). If the script invocation fails, the Controller adds a message about it to the error stack.
Note: For details on invocations of application configuration scripts, refer to the Implementing Operations on Application Instances and Configuring Application Instances sections in the current document, and section 5.3.2. Configuration script in the Specification.
Step 5. As soon as the Controller finishes processing all instances, it displays the operation results screen adding to it the error stack content.
Please send us your feedback on this help page