Table of Contents

Class OrderProvider

Namespace
Dynamicweb.DataIntegration.Providers.OrderProvider
Assembly
Dynamicweb.DataIntegration.dll
[AddInName("Dynamicweb.DataIntegration.Providers.Provider")]
[AddInLabel("Order Provider")]
[AddInDescription("Order provider")]
[AddInIgnore(false)]
public class OrderProvider : BaseSqlProvider, IParameterizedDestination, IParameterOptions, ISource, IDestination
Inheritance
OrderProvider
Implements
Inherited Members
Extension Methods

Constructors

OrderProvider()

public OrderProvider()

OrderProvider(string)

public OrderProvider(string connectionString)

Parameters

connectionString string

OrderProvider(XmlNode)

public OrderProvider(XmlNode xmlNode)

Parameters

xmlNode XmlNode

Properties

DiscardDuplicates

[AddInParameter("Discard duplicates")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
public bool DiscardDuplicates { get; set; }

Property Value

bool

DoNotExportCarts

[AddInParameter("Export completed orders only")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Source")]
public virtual bool DoNotExportCarts { get; set; }

Property Value

bool

ExportNotExportedOrders

[AddInParameter("Export not yet exported Orders")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Source")]
public virtual bool ExportNotExportedOrders { get; set; }

Property Value

bool

ExportOnlyOrdersWithoutExtID

[AddInParameter("Only export orders without externalID")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Source")]
public virtual bool ExportOnlyOrdersWithoutExtID { get; set; }

Property Value

bool

OrderStateAfterExport

[AddInParameter("Order state after export")]
[AddInParameterEditor(typeof(GroupedDropDownParameterEditor), "none=true;noneText=Leave unchanged;")]
[AddInParameterGroup("Source")]
public virtual string? OrderStateAfterExport { get; set; }

Property Value

string

RemoveMissingOrderLines

[AddInParameter("Remove missing order lines")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
public bool RemoveMissingOrderLines { get; set; }

Property Value

bool

SkipFailingRows

[AddInParameter("Persist successful rows and skip failing rows")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(100)]
public bool SkipFailingRows { get; set; }

Property Value

bool

Methods

Close()

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

public override void Close()

GetOriginalDestinationSchema()

Gets the schema from the Destination Source

public override Schema GetOriginalDestinationSchema()

Returns

Schema

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.

public override Schema GetOriginalSourceSchema()

Returns

Schema

A fresh Schema from the source.

GetParameterOptions(string)

public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)

Parameters

parameterName string

Returns

IEnumerable<ParameterOption>

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.

public override ISourceReader GetReader(Mapping mapping)

Parameters

mapping Mapping

Mapping that configures what/how to read.

Returns

ISourceReader

An ISourceReader instance.

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.

public override void LoadSettings(Job job)

Parameters

job Job

Job containing runtime settings and context.

OrderTablesInJob(Job, bool)

public override void OrderTablesInJob(Job job, bool isSource)

Parameters

job Job
isSource bool

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().

public override void OverwriteDestinationSchemaToOriginal()

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().

public override void OverwriteSourceSchemaToOriginal()

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.

public override bool RunJob(Job job)

Parameters

job Job

Job to execute.

Returns

bool

True if the job completed successfully; otherwise false.

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.

public override 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).

public override void UpdateDestinationSettings(IDestination destination)

Parameters

destination IDestination

Destination instance to copy settings from.

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).

public override void UpdateSourceSettings(ISource source)

Parameters

source ISource

Source instance to copy settings from.

ValidateDestinationSettings()

Validates the destination settings. Used to validate properties when created by the AddinSelector.

public override string ValidateDestinationSettings()

Returns

string

ValidateSourceSettings()

Validate the source configuration.

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

public override string ValidateSourceSettings()

Returns

string

Empty string if valid; otherwise a validation error message.

To top