MauroImportExport 1.0.0.818

There is a newer version of this package available.
See the version list below for details.
dotnet add package MauroImportExport --version 1.0.0.818
                    
NuGet\Install-Package MauroImportExport -Version 1.0.0.818
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MauroImportExport" Version="1.0.0.818" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MauroImportExport" Version="1.0.0.818" />
                    
Directory.Packages.props
<PackageReference Include="MauroImportExport" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MauroImportExport --version 1.0.0.818
                    
#r "nuget: MauroImportExport, 1.0.0.818"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MauroImportExport@1.0.0.818
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MauroImportExport&version=1.0.0.818
                    
Install as a Cake Addin
#tool nuget:?package=MauroImportExport&version=1.0.0.818
                    
Install as a Cake Tool

MauroImportExport Module

Overview

The MauroImportExport module provides a pluggable import / export framework with:

  • Discoverable handlers (exporters & importers) catalogued via IModelTransferRegistry.
  • Declarative parameter definitions (TransferParameterDefinition) supporting Boolean, Choice, and String types.
  • A per‑execution ambient context (TransferExecutionContext) allowing handlers to access parameter values through TransferParameterReader without changing existing method signatures.
  • Multi‑file export support (IMultiFileExporter) with UI integration for folder vs zip destination.
  • Deterministic ordering for JSON + Mermaid outputs to stabilise hashing / test assertions.

Key Types

Type Purpose
TransferParameterDefinition Declares a single parameter (type, default, choices, localisation prompt key).
TransferParameterValues Validated / coerced parameter map used inside an execution scope.
TransferExecutionContext Async‑local storage for the active TransferParameterValues.
TransferParameterReader Helper to retrieve strongly typed values with fallbacks.
ITransferParameterProvider Optional interface for handlers to expose their parameter definitions.
TransferHandlerDescriptor Registry surface describing a handler (format, direction, version, parameters, display metadata).
IModelTransferRegistry Aggregates exporters/importers and surfaces descriptors.
ModelTransferExecutor (Planned/used in UI) Orchestrates parameter capture and handler invocation with logging + cancellation.
IMultiFileExporter Exporters producing multiple artefacts (folder or zip).

Handler Discovery & Registration

Handlers are manually registered in ModelTransferRegistryFactory.CreateDefault(). Future Phase 3 work intends attribute based discovery, e.g.

[ModelTransferExporter("my-format")] // future idea
public sealed class MyCustomExporter : IModelExporter, ITransferParameterProvider { ... }

Adding a New Exporter / Importer

  1. Implement IModelExporter or IModelImporter (optionally ITransferParameterProvider, IPluginVersioned).
  2. Provide semantic version in PluginVersion (MAJOR.MINOR.PATCH) – align with resource key or behaviour surface changes.
  3. (Optional) Expose parameters:
public IReadOnlyCollection<TransferParameterDefinition> GetParameterDefinitions() => new []
{
    new TransferParameterDefinition(
        Key: "my.flag",
        Type: TransferParameterType.Boolean,
        Prompt: "myexporter.flag.prompt", // localisation key
        Description: "Enable special flag",
        DefaultValue: true,
        Choices: null)
};
  1. Register in factory:
registry.Register(new MyCustomExporter());
  1. Add localisation entries for Prompt key(s).

Parameter Semantics

  • Boolean: coerces from bool or "true"/"false" strings.
  • Choice: validated (case‑insensitive) against declared Choices; falls back to default on invalid input.
  • String: trimmed; empty replaced with default unless AllowEmpty = true.
  • Required: throws if missing (or empty when not allowed).

Ambient Execution

At the start of an export/import the UI (or executor) builds a TransferParameterValues instance and pushes it:

using (TransferExecutionContext.Push(values))
{
    await exporter.ExportAsync(model, progress, token);
}

Inside the handler:

bool includeMeta = TransferParameterReader.GetBoolean("includeMetadata", true);
string ordering = TransferParameterReader.GetString("dataTypeOrdering", "Id");

Multi‑File Export

IMultiFileExporter returns a collection of artefacts (file name + bytes). The UI offers:

  • Folder output (writes each artefact preserving sub‑paths)
  • Zip output (single archive)

Existing multi‑file handlers: svg-diagrams (SVG diagrams), mmd (Mermaid single artefact list path).

UI Integration (TransferParametersPage)

  • Radio buttons choose Import vs Export (Export disabled until a model is loaded).
  • Picker lists handlers with friendly DisplayName and shows Description.
  • Parameter controls are generated by type (Switch / Picker / Entry).
  • Previously used parameter values are persisted per (direction + format + key): transfer.params.{export|import}.{format}.{paramKey}.
  • Last successful import format remembered (transfer.lastimport.format).
  • Execution shows progress bar + detail; cancellation supported.

JSON Export Determinism

Ordering enforced:

  • Classes by id ascending.
  • Data elements within class by id.
  • Data types extracted along traversal then ordered by Id or Label based on parameter. This stabilises content for hashing / diffing.

Display Names / Descriptions

Descriptor fields (examples):

Format DisplayName Description
json Mauro Edit JSON Comprehensive Mauro JSON export
mmd Mermaid Diagrams Generate Mermaid syntax diagrams
svg-diagrams SVG Diagrams Render model diagrams as SVG files
xmi XMI Model Import XMI model (merging associations)
skos SKOS (TTL) Export / import SKOS Turtle
rdfs RDFS (TTL) Import RDFS ontology (Turtle)
jsonschema JSON Schema Export / experimental import of JSON Schema
oas OpenAPI Specification Import OpenAPI 3.0/3.1 API specifications (details)

Persistence Key Patterns

  • Parameters: transfer.params.{direction}.{format}.{param}
  • Last Import Format: transfer.lastimport.format
  • (Planned) Last Export Folder: transfer.lastpath.export.{format}

Versioning Guidance

  • Increment MAJOR for breaking schema / contract changes (e.g. JSON structure changes).
  • Increment MINOR when adding new parameters (backwards compatible).
  • Increment PATCH for internal fixes / ordering / localisation additions.

Format-Specific Documentation

Detailed documentation for individual import/export formats:

  • OAS (OpenAPI Specification) - Import OpenAPI 3.0/3.1 API specifications with comprehensive mapping strategies
  • JSON Schema - Advanced JSON Schema import with multi-draft support
  • DITA - DITA 1.3 topic and DITAMAP export for technical documentation

Roadmap (Abbrev)

  • Accessibility semantics (screen reader friendly descriptions combining prompt+value).
  • Test suite: validation, cancellation, deterministic hashing.
  • Round‑trip model smoke tests (JSON, SKOS, XMI, RDFS).
  • Attribute based discovery prototype.
  • Visual parameter deviation indicators + quick reset.

Contributing

Ensure any new handler:

  • Supplies semantic version.
  • Provides stable ordering when output ordering affects diffability.
  • Adds localisation keys for prompts.
  • Includes basic test coverage (future test suite scaffolding forthcoming).

© 2025 Oughitbridge Limited.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.1376 129 1/23/2026
1.0.0.891 204 12/23/2025
1.0.0.818 141 12/6/2025