Introduction
A connection is a mechanism to store files.
Each connection consists of three parts:
- Name
- Type
- Path (optional)
and the schema is:
blueriq.connection.<name>.<type>[.path = <path>]
1) Name
As a name you can enter whathever you like as name. The name of a connection is handled as a string.
2) Type
The type defines on which system the file is stored. The following systems are possible:
- Memory
- File system
1) Memory
The value is memory
. In case of a memory connection an example of the schema is:
blueriq.connection.system1.memory
2) File system
The value is filesystem
. In case of a file system connection an example of the schema is:
blueriq.connection.system2.filesystem.path=<path>
3) Path (optional)
In case the type is a filesystem
, also the path of the root folder must be specified, e.g.:
C:/Blueriq/Uploads
Note to use forward slashes '/' in the path; backward slashes as used in Windows will not work.
An example of the complete file system connection is:
blueriq.connection.filesystemconnection.filesystem.path=
C:/Blueriq/Uploads
It is also possible to use a relative path. In that case relative paths start in directory jboss/bin, so please use this as the starting point.
As soon as the first document is stored via the runtime, inside the root folder two sub folders are created:
- DATA
- METADATA
1) DATA
In this folder the real file is stored. Each file gets its id as file name, without extension. An example is:
0d80ebe2-73b2-482b-ae64-53ffe7d923fb
2) METADATA
For each file stored in DATA there is a metadata file. This file also gets the id as file name and is stored in xml format. An example is:
0d80ebe2-73b2-482b-ae64-53ffe7d923fb.xml
In this metadata file the following information is kept:
Name | Description | Example |
---|---|---|
ID | The Id of the file. | 0d80ebe2-73b2-482b-ae64-53ffe7d923fb |
Name | The file name as it is shown in the application (at runtime). | Test_Application.pdf |
ContentType | The type of the file. | application/pdf, image/jpeg |
CreationDate | The date when this file was stored. | 2015-06-18T11:52:08 |
CreatedByUserId | The user who stored the file. | anonymousUser |
CASE_ID | The corresponding case id. |
A metadata file is illustrated by the following example.
Step-by-step guide
In order to use a connection please take the following steps:
- Open the runtime properties file (
application.properties
). - Enter somewhere a line with the connection including the values in the schema
blueriq.connection.<name>.<type>[.path = <path>]
. - Save the file.
- Click on 'Reload Configuration' on the runtime dashboard.
- Runtime is now configured.
- Enter the connection name in your service or container (identified by the name
connection
as parameter). - You are ready to use the connection.