The InterFormNG2 settings and resources are as default stored in files in the file system, but it is possible to store the settings and resources in a database instead.
This is covered in the sections referenced below:
It is possible to have the InterFormNG2 settings stored in a database.
In order to switch to settings in a database, the database have to be added to the application-default.properties file.
This file is covered here for the IBM i platform and here for Windows.
Example: Adding a MySQL database as the location for the settings needs the following lines added:
ng2db.settingsDatasource.url=jdbc:mysql://localhost:3306/settings{TENANTID}?serverTimezone=UTC&createDatabaseIfNotExist=true
ng2db.settingsDatasource.username=root
ng2db.settingsDatasource.password=root
ng2db.settingsDatasource.driver=com.mysql.jdbc.Driver
ng2db.settingsDatasource.hibernateDialect=org.hibernate.dialect.MySQL5InnoDBDialect
and settings needs to be told that a database is now being used, meaning the settings= line needs to be changed to:
settings=database
Its possible to change the user configuration to use a database instead of the file system. To enable this, first setup a database for settings (Since this piggybacks on the settings database). Then add the following line to the application-default.properties:
userRepository=database
- and restart the InterFormNG2 service.
It is possible to use a database for resources in NG2, which might be convenient if multiple servers or tenants needs to share the same resources.
It “should” work with most types of databases.
To enable resources to be placed in a database, it first needs to be added in the admin settings.
The setup below is an example of adding a MySQL database:
For MySQL, be sure that the dialect is MySQL5InnoDBDialect (Make sure, that the 5 is included).
The database URL for MySQL can be something like:
jdbc:mysql://localhost:3306/resources{TENANTID}?serverTimezone=UTC&createDatabaseIfNotExist=true
TENANTID is replaced by the actual tenantId that uses the resources. Notice that multiple tenants can use the same database resources.
The new resource location then needs to be added (or set) at the Tenant, Edit tenant home: