/
Developer Documentation: Configuration Initializer

Developer Documentation: Configuration Initializer

Version:
Date: 2024-09-25
Author: Caleb Steele-Lane


1. Introduction

1.1 Feature Overview

Allows the setting and changing of basic OpenELIS-Global configuration options at startup via property files.

1.2 Audience

Developers that need an understanding of how the Configuration Initializer works


2. Technical Specifications

2.1 Expected Behaviour

2.1.1 Configuration Override Order (lowest priority to highest priority)

  1. Default value in code

  2. Default property file (src/main/resources/SystemConfiguration.properties)

  3. Database value (at startup time)

  4. Total property file (/var/lib/openelis-global/properties/TotalSystemConfiguration.properties)

  5. Change property file (/var/lib/openelis-global/properties/SystemConfiguration.properties)

  6. Runtime updates in Admin Section

2.1.2 Values Stored

The values that get stored are all the enum values in ConfigurationProperties.Property along with all the values that already existed in src/main/resources/SystemConfiguration.properties and the values in the site_information table (using site_information.name as a property name).

2.1.3 Value Storage

All values get stored in the “Total property file” (/var/lib/openelis-global/properties/TotalSystemConfiguration.properties) once startup has completed. If a site_information entry also exists with the same name, it will also be stored there. This means that at startup, the Configuration Override Order is used when reading the values. Once all sources have been read from, the values are persisted to the Total property file, overwriting any values that were there and the values are also written to the database. The “Change property file “ is then moved from it’s location to /var/lib/openelis-global/properties/ChangedSystemConfiguration.properties in the docker container to maintain the properties that have been changed via this method.

2.2 API Specifications

2.2.1 Endpoints

TODO

  • Endpoint: [URL]

  • Method: [GET/POST/PUT/DELETE]

  • Description: [Brief description]

  • Request Parameters:

    • [Parameter Name] (Type, Required/Optional, Description)

  • Response Format:

    • [Description of the response structure]


3. Code Implementation

3.1 Directory Structure

OpenELIS standard directory structure

3.2 Key Files

3.2.1 Java Classes

  • org.openelisglobal.common.util.ConfigurationProperties.java

  • org.openelisglobal.common.util.DefaultConfigurationProperties.java

  • org.openelisglobal.config.ApConfig.java

3.2.2 Java Resource Files

  • SystemConfiguration.properties

3.2.3 System Files (In docker container)

  • /var/lib/openelis-global/properties/SystemConfiguration.properties

  • /var/lib/openelis-global/properties/ChangedSystemConfiguration.properties

  • /var/lib/openelis-global/properties/TotalSystemConfiguration.properties


 

 

Related content

Configure the property files to connect to the Consolidated Server
Configure the property files to connect to the Consolidated Server
More like this
Database Profile Mass Facility and Test Catalog Updates
Database Profile Mass Facility and Test Catalog Updates
More like this
Install OpenELIS Global
Install OpenELIS Global
Read with this
Configuration Initializer Overview
Configuration Initializer Overview
More like this
ASTM Bi-Directional Analyzer Setup
ASTM Bi-Directional Analyzer Setup
Read with this
Administrator Documentation: Configuration Initializer
Administrator Documentation: Configuration Initializer
More like this