Storing settings and resources in a database

Storing settings and resources in a database

Storing settings and resources in a database:

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:

 

Settings in a database

Users in a database


Settings in a database :

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

 

Afterwards the InterFormNG2 service should to be restarted.

Users in a 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.

 

Please note that the original users and tenants will not be transferred to the database.

Resources in a database :

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:

 

NG2DatabaseResources0001

 

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:

 

NG2DatabaseResources0002

 

Finally you should restart the InterFormNG2 service.









    • Related Articles

    • Versioning of resources

      One optional feature in InterFormNG2 is versioning of resources. The versioning features makes it possible to maintain a version history on resources in the library. Versioning of resources is a way to keep track of changes to resources and this can ...
    • Global system settings

      This section concerns advanced system setup for InterFormNG2. In order to setup the global system settings, you first need to sign in as described here. Then you click System on the left below Other: Then you see this: The options are: Environment ...
    • To database

      This component writes the current workflow payload to a blob column in a database table. You have to specify the name of the database that the output should be saved to. The use of this is primarily intended for workflows that are initiated by the ...
    • From database

      A workflow can be initiated by a job record in a database table. Only relational databases are supported. Please notice, that this input only supports the very specific table layout as described in the section, Database configuration, where in input ...
    • Database configuration

      The section below describes the database configuration for the From database workflow input, which is very seldomly used. For most you should consider the alternative: From database with custom SQL. To use the database input component, database ...