Skip to content

Configuration

Roberto Rosselli Del Turco edited this page Oct 20, 2024 · 6 revisions

There are several configuration options, ranging from setting the folders where edition data is stored to choosing the User Interface layout and the tools to be made available for the final user, that can be set by editing the configuration files in the assets/config directory. To facilitate the configuration work, configuration options are divided into three macro groups:

  • File Configuration (file_config.json), where to set the path(s) to the file(s) of the digital edition. See details here. This is the "configuration hub" for EVT 3 because all the other files are linked from this one, so that you can have specific configurations for different editions just using a different file_config.json.
  • Edition Configuration (edition_config.json), where to set the configurations closely related to the digital edition, such as the title, the edition level(s), etc. See details here.
  • UI Configuration (ui_config.json), where to set the configuration closely related to the UI, such as the default language, the default/available theme(s), etc. See details here.

It is also possible to configure the style of editorial phenomena (e.g. addition, deletion, etc), in order to override the EVT default layouts. This particular configuration should be defined in the file editorial_conventions_config.json. See details here


Technical details for development

Configuration is defined as a AppConfig provider and is injected into the main app module. It is loaded during app initialization, so that it will be immediately available for every component. The three groups are gathered (although they will be kept divided) in a single EVTConfig object.

interface EVTConfig {
    ui: UiConfig;
    edition: EditionConfig;
    files: FileConfig;
}

If you want to use a parameter from configuration in your component, you just need to import AppConfig and directly use its properties:

import { AppConfig } from '../app.config';
@Component({
  selector: 'my-component',
  templateUrl: './my-component.component.html',
  styleUrls: ['./my-component.component.scss']
})
export class MyComponent {
    private editionTitle: string;
    constructor() {
        this.editionTitle = AppConfig.evtSettings.edition.title;
    }
}