Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • PowerShell scripts executed in a constrained runspace.
  • The runspace is initialized with no available cmdlets.
  • Cmdlets designed specifically for Data Import use are added to the runspace
    • Invoke-OdsApiRequest
    • New-ArrayList
    • New-StringBuilder
    • ...
  • Cmdlets explicitly whitelisted by the administrator are added to the runspace (probably will be defined in a config file)
    • High-risk cmdlets should be avoided (New-Object, Invoke-WebRequest). 

Importing modules:

  • Via configuration, a list of modules to be imported into the constrained runspace is defined.
  • Cmdlets designed specifically for Data Import are packaged as a PowerShell binary module and included by default.
  • PowerShell binary modules and PowerShell script modules can be imported into the constrained runspace by configuration.

User Interface Changes

Menu

...

Database Changes

TableChangeJustification
PreprocessorsScripts

New Table:

  • Id (PK, int)
  • Name (nvarchar(255) not null)
  • PreprocessorType ScriptType (nvarchar(20), not null)
  • ScriptContent (nvarchar(max) null)
  • RequiresOdsApi (bit, not null)

Supports storage of PowerShell scripts.

EF Core note: Implement PreprocessorType ScriptType as an enum.

DataMaps

New column:

  • FileProcessorId FileProcessorScriptId (FK, int, null)
Optionally associate a data map with a Custom File Processor.
Agents

Removed columns:

  • RowProcessor (nvarchar(max), null)
  • FileGenerator (nvarchar(max), null)

New columns:

  • RowProcessorId RowProcessorScriptId (FK, int, null)
  • FileGeneratorId FileGeneratorScriptId (FK, int, null)

Replace Custom Row Processor and Custom File Generator filenames with database references.

This will require a specialized migration:

  • Create a preprocessor Script record with Name of the current value.
  • Reference it from the new column, and drop the old column.
  • On web application startup, for any Preprocessor Script records with a null ScriptContent value, get the file from the file system (by Name and known path per PreprocessorTypeScriptType) and populate contents into Script Content.

...

  • ScriptContent.