# Module: chiefData

Contains all the functions to manage the loading and processing of data, such as XML files, CSV files or JSON files. Additional file type processing should be added in this module.

Author:
  - Seth Hollingsead
Copyright:
  - Copyright © 2022-… by Seth Hollingsead. All rights reserved
Source:
  - controllers/chiefData.js, line 1

### Requires

- module:dataBroker
- module:configurator
- module:loggers
- @haystacks/constants
- path

### Methods

#### (inner) addConstantsValidationData(arrayValidationData) → {void}

Calls the dataBroker to ad constants validation data to the constants validation data structure.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arrayValidationData` | array.<array.<string, object>> | An array of arrays that contains all of the constants library validation names and data objects.

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefData.js, line 247

##### Returns:

Type
  void

#### (inner) determineThemeDebugConfigFilesToLoad(themeConfigPathName) → {array.<string>}

If the debugSettings flag is already set, then look up the specified path name and scan the path to determine all of the theme debug config files that should be loaded.

##### Parameters:

Name | Type | Description
--- | --- | ---
`themeConfigPathName` | string | The configuration name of the path that should be looked up for scaning purposes.

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefData.js, line 66

##### Returns:

An array of file names and paths that should be used when loading the theme debug configuration files.

Type
  array.<string>

#### (inner) getAndProcessCsvData(pathAndFilename, contextName) → {object}

Loads the specified file, parses it and converts all the data to the appropriate format.

##### Parameters:

Name | Type | Description
--- | --- | ---
`pathAndFilename` | string | The path and file name of the CSV file that should be loaded and parsed into JSON objects.
`contextName` | string | The name that should be used when adding the objects to the D data structure for data-sharing.

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefData.js, line 94

##### Returns:

A parsed CSV JSON object where all the values have been converted from their string representation into actual values of appropriate type.

Type
  object

#### (inner) getAndProcessXmlData(pathAndFilename) → {object}

Loads the specified file, parses it and converts all values into their appropriate data types.

##### Parameters:

Name | Type | Description
--- | --- | ---
`pathAndFilename` | string | The path and file name of the XML file that should be loaded and parsed into JSON objects.

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefData.js, line 118

##### Returns:

A parsed XML JSON object where all the values have been converted from their string representation into actual values of appropriate type.

Type
  object

#### (inner) initializeConstantsValidationData() → {void}

Calls the dataBroker to initialize the constants verification data structure.

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefData.js, line 233

##### Returns:

Type
  void

#### (inner) searchForUniversalDebugConfigSetting(appConfigPathName, frameworkConfigPathName) → {boolean}

Searches all of the config data files for a general solution to the debugSettings configuration setting.

##### Parameters:

Name | Type | Description
--- | --- | ---
`appConfigPathName` | string | The name of the configuration setting that has the path for the appConfigPath.
`frameworkConfigPathName` | string | The name of the configuration setting that has the path for the frameworkConfigPath.

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefData.js, line 29

##### Returns:

A True or False to indicate if the debugSettings was found to be true in either of the configuration settings (appConfig Or frameworkConfig).

Type
  boolean

#### (inner) setupAllCsvData(dataPathConfigurationName, contextName) → {object}

Sets up all of the specified CSV data.

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataPathConfigurationName` | string | The name of the configuration setting that has the path we should search.
`contextName` | string | The context name that should be used when adding data to the D data structure.

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefData.js, line 141

##### Returns:

A JSON object that contains all of the data that was loaded from all the CSV files and merged together.

Type
  object

#### (inner) setupAllJsonConfigData(dataPathConfigurationName, contextName) → {object}

Sets up all of the JSON data at the specified configuration path.

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataPathConfigurationName` | string | The name of the configuration setting that has the path we should search.
`contextName` | string | The context name that should be used when adding data to the D data structure.

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefData.js, line 203

##### Returns:

A JSON object that contains all of the data that was loaded and merged together.

Type
  object

#### (inner) setupAllXmlData(dataPathConfigurationName, contextName) → {object}

Sets up all of the specified XML data.

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataPathConfigurationName` | string | The name of the configuration setting that has the path we should search.
`contextName` | string | The context name that should be used when adding data to the D data structure.

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefData.js, line 172

##### Returns:

A JSON object that contains all of the data that was loaded from all the XML files and merged together.

Type
  object