# Control panel is implemented so that it allows a user to open a screen with the form of a particular application service instance (installed on a particular hosting environment) configuration, where the user can specify new service settings.
# Controller is implemented so that it stores all the instance-related information in its internal database, including the values of service settings (defined during instantiating or the following reconfiguring).
Starting Point. User initiates opening the service configuration form.
Step 1. The Controller gathers all information necessary for generating the form:
Sub-step 1.1. Selects from the database the settings of the target service instance.
Sub-step 1.2. Processes the settings info (setting name, description, data type, grouping information, value), and generates the form: all settings in the form of particular form elements (drop-down lists, check boxes, etc.) with the old setting values filled in.
Step 2. The Controller passes the form code to CP, which processes it and presents the result to the user as the Service Configuration screen.
Step 3. As soon as the user fills in the form and submits it, the Controller validates the submitted data:
Sub-step 3.1. Validates each setting value basing on the settings type information and for those settings that have
uniq attribute ensures their values uniqueness. If an invalid value is set, the Controller adds a message about it to the error stack.
Sub-step 3.2. Checks the error stack status: If it's not empty, the Controller returns to Step 2 adding to the form the content of the error stack.
Step 4. The Controller prepares all the environment variables required by the service configuration script:
Sub-step 4.1. Prepares the settings variables
SETTINGS_<id> setting them to the entered settings values.
Sub-step 4.2. Reads the other instance-related information from the database and if any are found, prepares the rest of the variables (describing the full instance URL, and so on).
Step 5. The Controller invokes the service configuration script to configure the service instance with the new setting values.
Sub-step 5.1. Gathers all the information about environment variables prepared on the previous step, and prepares the variables basing on the rules defined by the Specification.
Sub-step 5.2. Runs the configuration script in the environment where all the environment variables prepared on the previous sub-step are defined.
Sub-step 5.3. If the script invocation succeeds, the Controller displays to the user the screen with the successful reconfiguration message and congratulations.
Step 6. The Controller stores the new settings in its database.
Please send us your feedback on this help page