The idea is to have an extension (I don’t think it likely makes sense in this form in core) that is able to add data to the database on app (re)-load - especially useful on initial load. It should be possible to easily fill the database with relevant and required settings as well as initial - more or less static - data.
It would use an interceptor that performs the processing postPresideReload.
The following properties file would hold the settings and data (see below).
Custom importers (for complex settings as well as data imports) can be used. It will ship with one custom importer to deal with multilingual settings as well as one data importer for setting up initial security groups. For the settings a generic default importer will be created that can deal with all simple value settings (which most of them are anyway). It would be easily extendable also for custom imports by creating additional importers to be used.
general processing instructions can be defined to globally enable/disable the processing as well as make sure that only data is written once but never overwritten.
It is also imaginable to use a JSON file rather than a properties file. I just find it odd that it’s not possible to add comments to a JSON file which in this case might make sense. Other file formats may fit as well (YAML, …)
# PROCESSING INSTRUCTIONS processing.enabled=true processing.overwrite=false # ADMIN CONFIG SETTINGS (Preside Admin > System > Settings) settings.email.server=127.0.0.1 [email protected] # you can use all other settings which are simple values here, core ones as well as your own defined ones # custom import: creation of internal language objects and referencing the IDs settings.multilingual.default_language=en settings.multilingual.additional_languages=de,fr settings.multilingual.urls_enabled=true settings.multilingual.importer=MultilingualSettingsImporter # DATA IMPORT data.1.importer=SecurityGroupDataImporter data.1.args.groups.1.name=System Administrators data.1.args.groups.1.roles=sysadmin data.1.args.groups.2.name=Content Administrators data.1.args.groups.2.roles=contentadmin data.1.args.groups.3.name=Content Editors data.1.args.groups.3.roles=contenteditor data.1.args.groups.4.name=Formbuilder Managers data.1.args.groups.4.roles=formbuildermanager
Would this be useful to have? Any ideas for improving it?