Table of Contents

Interface ISource

Namespace
Dynamicweb.DataIntegration.Integration.Interfaces
Assembly
Dynamicweb.DataIntegration.dll

Add this interface if you are inheriting from a provider that is a source

public interface ISource
Extension Methods

Properties

FilesFolderName

The name of the Files folder in the current installation of Dynamicweb. Empty when used for tests. Implementations may use this value to resolve resource locations inside the product installation.

string FilesFolderName { get; set; }

Property Value

string

Logger

Optional logger instance. Implementations should use this for consistent logging.

ILogger? Logger { get; set; }

Property Value

ILogger

WorkingDirectory

Gets or sets the working directory. When used for testing, all relative paths for standard providers are resolved against this path.

string WorkingDirectory { get; set; }

Property Value

string

Base path for resolving relative file paths during tests or runtime.

Methods

CheckCondition(MappingConditional, Dictionary<string, object>)

Evaluate a mapping conditional against a data row.

bool CheckCondition(MappingConditional mc, Dictionary<string, object> row)

Parameters

mc MappingConditional

Mapping conditional to evaluate.

row Dictionary<string, object>

Row values keyed by column name.

Returns

bool

True if the conditional is satisfied for the given row; otherwise false.

CheckMapping(Mapping)

Validate the provided mapping against this source's schema and capabilities.

List<SchemaComparerResult> CheckMapping(Mapping map)

Parameters

map Mapping

Mapping to validate.

Returns

List<SchemaComparerResult>

Collection of SchemaComparerResult describing issues or an empty list if valid.

Close()

Close the provider and release resources (connections, file handles, etc.). Should be safe to call multiple times (idempotent).

void Close()

GetDetails(string)

Return optional provider details to be stored alongside persisted schema metadata.

string? GetDetails(string id)

Parameters

id string

Returns

string

GetId()

Return a stable identifier for this provider instance when available. Used by JobSchemaService to persist per-provider schema files.

string? GetId()

Returns

string

GetOriginalSourceSchema()

Fetch the most recent schema directly from the source (unmodified, live).

This should return a fresh representation of the source structure and may perform expensive I/O. Use it when you explicitly need the authoritative source schema regardless of any cached/persisted schema.

Schema GetOriginalSourceSchema()

Returns

Schema

A fresh Schema from the source.

GetReader(Mapping)

Create and return an ISourceReader for the provided mapping.

The returned reader must be initialized and ready to enumerate rows for the mapping. Implementations are responsible for any resource allocation; callers will close the reader.

ISourceReader GetReader(Mapping mapping)

Parameters

mapping Mapping

Mapping that configures what/how to read.

Returns

ISourceReader

An ISourceReader instance.

GetSchema()

Return the live Schema (tables + columns) for this source.

Implementer guidance:

  • Return a thread-safe, non-mutating Schema instance (or a defensive copy).
  • Prefer cached or lightweight responses to avoid repeated expensive I/O.
  • This method should reflect the source structure at the time of the call.

Note: schema access is centralized via GetSchema(ISource?). That service consults the SchemaManagementFeature and may use a persisted schema instead of invoking this method. Call this directly only when you need the live schema.

Schema GetSchema()

Returns

Schema

The source Schema describing tables and columns.

Initialize()

Initialize the provider. Open transient resources (connections) required for operation.

Avoid heavy or long-running operations here when possible; prefer lazy initialization where appropriate.

void Initialize()

LoadSettings(Job)

Apply runtime settings from the job prior to execution.

Called when a job runs and allows the provider to adjust settings from the job context before any reading/writing occurs.

void LoadSettings(Job job)

Parameters

job Job

Job containing runtime settings and context.

OverwriteSourceSchemaToOriginal()

Replace the provider's current/cached schema with the latest schema from the source.

Implementations should update any internal schema cache/state so subsequent calls to GetSchema() reflect the original schema returned by GetOriginalSourceSchema().

void OverwriteSourceSchemaToOriginal()

SaveAsXml(XmlTextWriter)

Persist provider settings to the supplied System.Xml.XmlTextWriter.

Implementations should write their configuration elements but must not close or dispose the writer.

void SaveAsXml(XmlTextWriter textWriter)

Parameters

textWriter XmlTextWriter

Xml writer to write settings into.

Serialize()

Serialize provider settings for use by AddinSelectors.

Output must be of the format <xxx>yyy</xxx>, where xxx is the parameter name (as defined by the decoration) and yyy is the value.

string Serialize()

Returns

string

XML fragment describing configured addin parameters.

UpdateSourceSettings(ISource)

Update this instance's settings to match the provided source.

Used to copy settings between provider instances (for example when restoring from saved configuration).

void UpdateSourceSettings(ISource source)

Parameters

source ISource

Source instance to copy settings from.

ValidateSourceSettings()

Validate the source configuration.

Return an empty string for a valid configuration; otherwise return a human-readable error/validation message describing the problem.

string ValidateSourceSettings()

Returns

string

Empty string if valid; otherwise a validation error message.

To top