Interface IDestination
- Namespace
- Dynamicweb.DataIntegration.Integration.Interfaces
- Assembly
- Dynamicweb.DataIntegration.dll
Add this interface if you are inheriting from a provider that is a destination
public interface IDestination
- 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
Logger
Optional logger instance. Implementations should use this for consistent logging.
ILogger? Logger { get; set; }
Property Value
SchemaIsEditable
Indicates whether the destination schema is editable, meaning that the user can add tables and columns to the current generated schema.
bool SchemaIsEditable { get; }
Property Value
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
CheckMapping(Mapping)
Validate the provided mapping against this destination's schema and capabilities.
List<SchemaComparerResult> CheckMapping(Mapping map)
Parameters
mapMappingMapping to validate.
Returns
- List<SchemaComparerResult>
Collection of SchemaComparerResult describing issues or an empty list if valid.
Close(bool)
Close the destination and release resources. jobFailed indicates whether the
job finished with an error and may be used to change shutdown behavior (commit/rollback).
Method should be safe to call multiple times (idempotent).
void Close(bool jobFailed)
Parameters
jobFailedboolTrue if the job failed; false otherwise.
GetDetails(string)
Return optional provider details to be stored alongside persisted schema metadata.
string? GetDetails(string id)
Parameters
idstring
Returns
GetId()
Return a stable identifier for this provider instance when available. Used by JobSchemaService to persist per-provider schema files.
string? GetId()
Returns
GetOriginalDestinationSchema()
Fetch the most recent schema directly from the destination (unmodified, live).
This should return a fresh representation of the destination structure and may perform expensive I/O. Use it when you explicitly need the authoritative destination schema.
Schema GetOriginalDestinationSchema()
Returns
GetSchema()
Return the live Schema (tables + columns) for this destination.
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 destination structure at the time of the call.
Note: schema access is centralized via GetSchema(IDestination?). 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
Initialize()
Initialize the destination. Open transient resources (connections) required for operation.
Avoid heavy or long-running operations here when possible; prefer lazy initialization where appropriate.
void Initialize()
OverwriteDestinationSchemaToOriginal()
Replace the destination's current/cached schema with the latest schema from the destination.
Implementations should update any internal schema cache/state so subsequent calls to GetSchema() reflect the original schema returned by GetOriginalDestinationSchema().
void OverwriteDestinationSchemaToOriginal()
RunJob(Job)
Execute the job against this destination. The implementation performs the write/insert/update operations required by the job and returns true on success.
Implementations should be robust: validate inputs, log errors, and leave destination in a consistent state or perform appropriate rollback where applicable.
bool RunJob(Job job)
Parameters
jobJobJob to execute.
Returns
- bool
True if the job completed successfully; otherwise false.
SaveAsXml(XmlTextWriter)
Persist destination 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
textWriterXmlTextWriterXml 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.
UpdateDestinationSettings(IDestination)
Update this instance's settings to match the provided destination.
Used to copy settings between provider instances (for example when restoring from saved configuration).
void UpdateDestinationSettings(IDestination destination)
Parameters
destinationIDestinationDestination instance to copy settings from.
ValidateDestinationSettings()
Validate the destination configuration.
Return an empty string for a valid configuration; otherwise return a human-readable error/validation message describing the problem.
string ValidateDestinationSettings()
Returns
- string
Empty string if valid; otherwise a validation error message.