Changes to the class Settings 2.5
The new Settings class should be used for managing and retrieving information about the settings (e.g. Default language, Default resolution, Status Configuration Xml, Translation Management Configuration Xml,...)
Validation of configuration xmls
One of the major changes of the new Settings class is that the configuration xmls in the database should always be valid. In order to ensure this, the incoming xmls are validated, but we also update the xmls whenever a referenced value is updated/deleted. In the past the configuration xmls were checked and corrected upon retrieval
- What happens during an update of a configuration xml?
-
The validation of all configuration xmls starts with a schema validation. When the incoming xml is valid according to the schema, some extra checks are executed to validate the values which are used.
The following table gives an overview of those extra checks.Configuration Xml Extra checks Status Configuration XML
- Check that all statuses exist
- Check that all user roles exist
Translation Configuration XML
- Check that all languages exist
- Check that all resolutions exist
- Check that all user groups exist
- Check that the conditions are valid
Plugin Configuration XML
- Check that the conditions are valid
Inbox Configuration XML
- Check that all statuses exist
- Check that all user roles exist
Report Configuration XML
- Check that all resolutions exist
- Check that all statuses exist
- What happens when creating, updating or deleting a referenced value?
-
In order to keep the configuration xmls valid, some extra actions are required when a referenced value is updated or deleted.
For most values, these extra actions are limited to updating the label inside the configuration xml and blocking the delete of the value if the value is used in one of the configuration xmls.
However, for some of the values an extra element is added during creation and removed during deletion. For example:- When creating a new user role, an initial status placeholder is created. Of course, this initial status is removed again when that user role is deleted.
- Something similar happens during the creation of a new status. Each status has a status definition inside the
Status Configuration Xmlwhich is automatically created and removed.