> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Project configuration

## Configuration Properties and property files

For details, see [Properties](../../../properties)

Location: mr-application/src/main/resources

<table><thead><tr><th>File</th><th>Purpose</th></tr></thead><tbody><tr><td>application.yaml</td><td>Sets port and context for the application.</td></tr><tr><td>dee.export.properties</td><td>Configures the DEE service tool that is intended to perform data extractions.</td></tr><tr><td>logback-spring.xml</td><td>Defines the logging configuration for testing the MR application.</td></tr><tr><td>logback-spring-file.xml</td><td>Defines the logback configuration for the MR application in production.</td></tr><tr><td>mr-jaxb-mapping.xml</td><td>Defines the configuration of the Java Architecture for XML Binding (JAXB) for context values defined in the MR application.</td></tr><tr><td>serializer-jaxb-cfg.xml</td><td>Configures all the JAXB mapping resources needed by the application.</td></tr></tbody></table>

## Spring annotations

<table><thead><tr><th>Annotation</th><th>Meaning</th><th>Value</th></tr></thead><tbody><tr><td>@ConditionalOnAdjustmentsWithDirectQuery</td><td>Adjustments activated as read-only for DirectQuery.</td><td>directquery.with-adjustments <em>AND</em> starter.deployment.type=direct-query <em>AND</em> configuration.sign-off.enabled</td></tr><tr><td>@ConditionalOnClickHouse</td><td>DirectQuery uses ClickHouse.</td><td>directquery.database.type=clickhouse <em>AND</em> starter.deployment.type=direct-query</td></tr><tr><td>@ConditionalOnDirectQueryDatabase</td><td>DirectQuery is activated.</td><td>starter.deployment.type=direct-query</td></tr><tr><td>@ConditionalOnInMemoryDatabase</td><td>InMemory mode is activated, DirectQuery is disabled.</td><td>starter.deployment.type=in-memory</td></tr><tr><td>@ConditionalOnMSSQL</td><td>DirectQuery uses MSSQL (not implemented).</td><td>directquery.database.type=mssql <em>AND</em> starter.deployment.type=direct-query</td></tr><tr><td>@ConditionalOnNoAdjustmentsWithDirectQuery</td><td>Sign-Off is activated but DirectQuery has no information about adjustments.</td><td><em>NOT</em> directquery.with-adjustments <em>AND</em> starter.deployment.type=direct-query <em>AND</em> configuration.sign-off.enabled</td></tr><tr><td>@ConditionalOnSignOffDisabled</td><td>Sign-Off is not used.</td><td><em>NOT</em> configuration.sign-off.enabled</td></tr><tr><td>@ConditionalOnSignOffEnabled</td><td>Sign-Off is fully enabled on an InMemory setup.</td><td>configuration.sign-off.enabled <em>AND</em><em>NOT</em> starter.deployment.type=direct-query</td></tr><tr><td>@ConditionalOnSignOffHierarchy</td><td>The Sign-Off hierarchy is displayed for InMemory or DirectQuery Cubes.</td><td>configuration.sign-off.enabled</td></tr><tr><td>@ConditionalOnSnowflake</td><td>DirectQuery uses SnowFlake.</td><td>directquery.database.type=snowflake <em>AND</em> starter.deployment.type=direct-query</td></tr><tr><td>@ConditionalOnAggregatedDataDisabled</td><td>The summary data are not aggregated.</td><td><em>NOT</em> mr.enable.data-model.aggregated</td></tr><tr><td>@ConditionalOnAggregatedDataEnabled</td><td>The summary data are aggregated.</td><td>mr.enable.data-model.aggregated</td></tr><tr><td>@ConditionalOnAnyCubeEnabled</td><td>Any non-summary Cubes are activated</td><td>mr.enable.cubes.var <em>OR</em> mr.enable.cubes.pln <em>OR</em> mr.enable.cubes.sensi <em>OR</em> mr.enable.cubes.market</td></tr><tr><td>@ConditionalOnAnyPnLCubeEnabled</td><td>PnL Cube or PnL Summary Cube is activated.</td><td>mr.enable.cubes.pln <em>OR</em> mr.enable.cubes.pnl-summary</td></tr><tr><td>@ConditionalOnAnySensitivityCubeEnabled</td><td>Sensitivity Cube or Sensitivity Summary Cube is activated.</td><td>mr.enable.cubes.sensi <em>OR</em> mr.enable.cubes.sensi-summary</td></tr><tr><td>@ConditionalOnAnyVaRCubeEnabled</td><td>VaR Cube or VaR Summary Cube is activated.</td><td>mr.enable.cubes.var <em>OR</em> mr.enable.cubes.var-summary</td></tr><tr><td>@ConditionalOnCommonCubeEnabled</td><td>The common query Cube is activated.</td><td>mr.enable.cubes.common</td></tr><tr><td>@ConditionalOnHasDataCube</td><td>The server contains data Cubes.</td><td>starter.deployment.type != query-node</td></tr><tr><td>@ConditionalOnHasQueryCube</td><td>The server contains a query Cube.</td><td>mr.enable.cubes.common or any other query cube</td></tr><tr><td>@ConditionalOnHasSource</td><td>The data needs to be fetched from a source (Azure, Local, etc.)</td><td>dlc.enabled <em>AND</em><em>NOT</em> directquery.enabled</td></tr><tr><td>@ConditionalOnHasSourceAndDirectQuery</td><td>A in-memory data source is defined and DirectQuery is enabled.</td><td>dlc.enabled</td></tr><tr><td>@ConditionalOnLocalBus</td><td>The server uses the internal bus to communicate between data Cubes and query Cube.</td><td>starter.deployment.transport == local</td></tr><tr><td>@ConditionalOnLocalContentService</td><td>The content server is hosted locally</td><td>spring.profiles.active <em>HAS</em> local-content</td></tr><tr><td>@ConditionalOnMarketDataCubeEnabled</td><td>The Market Data Cube is activated.</td><td>mr.enable.cubes.market</td></tr><tr><td>@ConditionalOnMissingSource</td><td>There is no source set or no DirectQuery (it’s an error case).</td><td><em>NOT</em> dlc.enabled <em>AND</em><em>NOT</em> starter.deployment.type=direct-query</td></tr><tr><td>@ConditionalOnNettyBus</td><td>The server uses the Netty bus to communicate between data Cubes and query Cube.</td><td>starter.deployment.transport == netty</td></tr><tr><td>@ConditionalOnPnLCubeEnabled</td><td>The PnL Cube is activated.</td><td>mr.enable.cubes.pln</td></tr><tr><td>@ConditionalOnPnLSummaryCubeDisabled</td><td>The PnL Summary Cube is disabled.</td><td><em>NOT</em> mr.enable.cubes.pnl-summary</td></tr><tr><td>@ConditionalOnPnLSummaryCubeEnabled</td><td>The PnL Summary Cube is activated.</td><td>mr.enable.cubes.pnl-summary</td></tr><tr><td>@ConditionalOnQueryNode</td><td>The server node contains only the query Cube.</td><td>starter.deployment.type == query-node</td></tr><tr><td>@ConditionalOnRemoteContentService</td><td>The content service instance is remote.</td><td>spring.profiles.active <em>HAS</em> remote-content</td></tr><tr><td>@ConditionalOnSensitivityCubeEnabled</td><td>The Sensitivity Cube is activated.</td><td>mr.enable.cubes.sensi</td></tr><tr><td>@ConditionalOnSensitivitySummaryCubeDisabled</td><td>The Sensitivity Summary Cube is disabled.</td><td><em>NOT</em> mr.enable.cubes.sensi-summary</td></tr><tr><td>@ConditionalOnSensitivitySummaryCubeEnabled</td><td>The Sensitivity Summary Cube is activated.</td><td>mr.enable.cubes.sensi-summary</td></tr><tr><td>@ConditionalOnVaRCubeEnabled</td><td>The VaR/ES Cube is activated.</td><td>mr.enable.cubes.var</td></tr><tr><td>@ConditionalOnVaRSummaryCubeDisabled</td><td>The VaR/ES Summary Cube is disabled.</td><td><em>NOT</em> mr.enable.cubes.var-summary</td></tr><tr><td>@ConditionalOnVaRSummaryCubeEnabled</td><td>The VaR/ES Summary Cube is activated.</td><td>mr.enable.cubes.var-summary</td></tr><tr><td>@ConditionalNotOnDirectQueryDatabase</td><td>If DirectQuery is not enabled</td><td>starter.deployment.type != direct-query</td></tr></tbody></table>

## Data Files

You will need to specify where your CSV files are placed. In the default
implementation, the CSV files are required to provide Atoti Server with
the necessary data and configuration to do the calculations in Atoti Market Risk.

All the files need to be kept under one directory of your choice
anywhere on the file system. The path to this directory needs to be
specified with the `mr.data-load.csv.dataset` [property](../../../properties/config-properties/mr-common-config). The below property needs to be updated to
specify an accessible directory containing the necessary files.

**Sample files** can be found in
the mr-application/src/main/resources/data folder.

<Note>
  Files in this folder are excluded from the mr-application JAR.
</Note>

```
mr.data-load.csv.dataset=data
```

To get started with deployment (e.g. if you are not running the
application directly from the IDE) you can easily copy/paste the whole
sample data folder (from source zip) into somewhere accessible by your
deployed runtime, and change the configuration in `application.yaml`
accordingly to point to that data.

## Local Content Server

When using the `local-content` Spring profile automatically activated in the `application.yaml` file, Atoti Market Risk defaults to an in-memory content server with an H2 database. The core Atoti Market Risk bookmarks are imported to this server at startup. To set different bookmarks, please see the section below.

To use a different local database for the content server, modify the following properties in the [application.yaml](../../../properties/property-files/application-yaml) file:

* To connect to an H2 database, set the `mr.application.content-server.db.file.name` property, specifying the path to the database file, relative to the classpath.
* To connect to a database that is not H2, set the `mr.application.content-server.db.url` property, specifying the JDBC URL of your database.

## Bookmarks

If you want to replace the bookmarks you have persisted in your content
server, there are several options for overriding the content of the
content server with the core Atoti Market Risk bookmarks at startup.

The behavior of the bookmark reset is driven by the
contentServer.factory-reset group of properties in the `application.yaml`
file.

The `mr.application.content-server.reset` property determines whether the
reset is performed, and from which persistence type. Available options
are:

* `true`: Imports data from a single JSON file
* `file`: Same as for `true`
* `folder`: Imports the bookmarks from a folder-based hierarchical
  representation of the Atoti UI bookmark tree.
* `false`: Does not reset the bookmarks. The bookmarks are loaded directly from the content server without any modification.

The location from which Atoti Market Risk will attempt to load the various
options is determined by the factory reset filename
(mr.application.content-server.factory-reset.filename) and folder name
(mr.application.content-server.factory-reset.folder-name) properties. The default values
point to sample files on the classpath.

Due to the inability to load classpath files or folders from a JAR file,
running the application via the SpringBoot JAR will require overriding
the property via the CLI argument:

```
mr.application.content-server.factory-reset.folder-name="file:full\example\path\mr-content-server"
```

The bookmark samples for Atoti Market Risk can be found within the UI release files, containing bookmarks for the VaR-ES, Sensitivities, PnL, and MRCombined Cubes.

## Atoti UI

You will need to specify in the Atoti UI configuration file where the
Atoti Server project is running. Please note, the end-user’s browser will
be connecting to the URL you specify here, so you should specify the
exact host name as opposed to localhost.

The standalone application contains an *mr\_env.js* file which will
need to be updated with the correct server URL:

```
# The URL to use to connect to Atoti Server
activePivotServerUrl: 'http://localhost:10010/mr-application',
```
