Table of Contents

Class DynamicwebProvider

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

Constructors

DynamicwebProvider()

public DynamicwebProvider()

DynamicwebProvider(string)

public DynamicwebProvider(string connectionString)

Parameters

connectionString string

DynamicwebProvider(XmlNode)

public DynamicwebProvider(XmlNode xmlNode)

Parameters

xmlNode XmlNode

Properties

AddUsersToAccountsByCustomerNumber

[AddInParameter("Add users to accounts by customer number")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When ON and the job imports users, active users with a customer number in the import are added to every account with the same customer number after the import, if they are not already members. Memberships removed in the administration are added again while the user keeps the customer number. Requires User Accounts to be enabled")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(90)]
public bool AddUsersToAccountsByCustomerNumber { get; set; }

Property Value

bool

Connection

protected SqlConnection Connection { get; set; }

Property Value

SqlConnection

DeactivateMissingProducts

[AddInParameter("Deactivate missing products")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When ON missing products are deactivated. When OFF no action is taken")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(30)]
public bool DeactivateMissingProducts { get; set; }

Property Value

bool

DefaultLanguage

[AddInParameter("Default Language")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=true;")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(10)]
public string DefaultLanguage { get; set; }

Property Value

string

DeleteIncomingItems

[AddInParameter("Delete incoming rows")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Deletes existing rows present in the import source. When Delete incoming rows is ON, the following options are skipped: Update only existing records, Deactivate missing products, Remove missing rows after import, Delete products / groups for languages included in input, Hide deactivated products")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(50)]
public bool DeleteIncomingItems { get; set; }

Property Value

bool

DeleteProductsAndGroupForSpecificLanguage

[AddInParameter("Delete products/groups for languages included in input")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Deletes products and groups only from the languages included in the import. If Delete incoming rows is ON, Delete products / groups for languages included in input is skipped")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(60)]
public bool DeleteProductsAndGroupForSpecificLanguage { get; set; }

Property Value

bool

DiscardDuplicates

[AddInParameter("Discard duplicates")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When ON, duplicate rows are skipped")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(70)]
public bool DiscardDuplicates { get; set; }

Property Value

bool

HideDeactivatedProducts

[AddInParameter("Hide deactivated products")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When Deactivate missing products is ON, this option hides the deactivated products. If Delete incoming rows is ON, Hide deactivated products is skipped. If Deactivate missing products is OFF, Hide deactivated products is skipped")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(80)]
public bool HideDeactivatedProducts { get; set; }

Property Value

bool

InsertOnlyNewRecords

[AddInParameter("Insert only new records")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Inserts new records present in the source, but does not update existing records")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(23)]
public bool InsertOnlyNewRecords { get; set; }

Property Value

bool

IsFirstJobRun

protected bool IsFirstJobRun { get; set; }

Property Value

bool

PartialUpdate

This property is used to remove rows from the EcomGroupProductRelationsTable, but only for the products that are being imported. It can be set in the job settings xml file in the config section

public virtual bool PartialUpdate { get; set; }

Property Value

bool

RemoveMissingAfterImport

[AddInParameter("Remove missing rows after import")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Deletes rows from each destination table individually, based on whether they are present in the corresponding source table. This setting looks at each table separately and removes rows missing from the source for that specific table. When Delete incoming rows is ON, this option is ignored")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(40)]
public bool RemoveMissingAfterImport { get; set; }

Property Value

bool

RemoveMissingAfterImportDestinationTablesOnly

[AddInParameter("Remove missing rows after import in the destination tables only")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Deletes rows not present in the import source - excluding related tabled")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(35)]
public bool RemoveMissingAfterImportDestinationTablesOnly { get; set; }

Property Value

bool

RemoveMissingRows

[AddInParameter("Remove missing rows across all tables after import")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Deletes rows from all destination tables and relation tables by considering the entire dataset in the import source. This setting evaluates all tables collectively and removes rows missing across the whole activity.")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(45)]
public bool RemoveMissingRows { get; set; }

Property Value

bool

Shop

[AddInParameter("Shop")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=true;")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(20)]
public string? Shop { get; set; }

Property Value

string

SkipFailingRows

[AddInParameter("Persist successful rows and skip failing rows")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Checking this box allows the activity to do partial imports by skipping problematic records and keeping the succesful ones")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(100)]
public bool SkipFailingRows { get; set; }

Property Value

bool

SqlConnectionString

protected string? SqlConnectionString { get; set; }

Property Value

string

UpdateOnlyExistingRecords

[AddInParameter("Update only existing records")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When this option is ON the imported rows are updated but not inserted. When OFF rows are updated and inserted")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(25)]
public bool UpdateOnlyExistingRecords { get; set; }

Property Value

bool

UserKeyField

public string? UserKeyField { get; set; }

Property Value

string

Methods

Close()

Closes the provider when the job has finished, releasing connections and other resources. Called on both the source and the destination provider. Must be overridden; the base implementation throws NotImplementedException.

public override void Close()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

GetHiddenParameterNames(string, object?)

public IEnumerable<string> GetHiddenParameterNames(string parameterName, object? parameterValue)

Parameters

parameterName string
parameterValue object

Returns

IEnumerable<string>

GetOriginalDestinationSchema()

Gets the unmodified schema as read from the underlying destination, ignoring any user edits. Used by the job editor to reset or compare schemas. Must be overridden by destination providers; the base implementation throws NotImplementedException.

public override Schema GetOriginalDestinationSchema()

Returns

Schema

The original destination schema.

GetOriginalSourceSchema()

Gets the unmodified schema as read from the underlying source, ignoring any user edits. Used by the job editor to reset or compare schemas. Must be overridden by source providers; the base implementation throws NotImplementedException.

public override Schema GetOriginalSourceSchema()

Returns

Schema

The original source schema.

GetParameterOptions(string)

public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)

Parameters

parameterName string

Returns

IEnumerable<ParameterOption>

GetReader(Mapping)

Creates a reader that returns the source rows for a table mapping. Called by the destination provider's RunJob(Job) once per active mapping when this provider is the source of the job; the returned reader is drained via IsDone()/GetNext() and disposed afterwards. Must be overridden by source providers; the base implementation throws NotImplementedException.

public override ISourceReader GetReader(Mapping mapping)

Parameters

mapping Mapping

The table mapping to read source rows for.

Returns

ISourceReader

A reader positioned at the first row of the mapped source table.

GetSchema()

Gets the schema (tables and columns) the provider currently exposes, including any user edits when SchemaIsEditable is true. Used by the job editor to build table and column mappings. Must be overridden by every provider; the base implementation throws NotImplementedException.

public override Schema GetSchema()

Returns

Schema

The current schema of the provider.

OrderTablesInJob(Job, bool)

Reorders the job's table mappings so tables referenced by foreign keys are processed before the tables that reference them. Called by the administration UI when table mappings are saved. The base implementation opens a connection to the Dynamicweb database and delegates to OrderTablesByConstraints(Job, SqlConnection, bool); override it to use the provider's own connection, or to enforce a provider-specific order as the Ecom, Order and User providers do.

public override void OrderTablesInJob(Job job, bool isSource)

Parameters

job Job

The job whose mappings are reordered in place.

isSource bool

true to order by source table names; otherwise by destination table names.

OverwriteDestinationSchemaToOriginal()

Discards user edits to the destination schema and reverts to GetOriginalDestinationSchema(). Must be overridden by destination providers; the base implementation throws NotImplementedException.

public override void OverwriteDestinationSchemaToOriginal()

OverwriteSourceSchemaToOriginal()

Discards user edits to the source schema and reverts to GetOriginalSourceSchema(). Must be overridden by source providers; the base implementation throws NotImplementedException.

public override void OverwriteSourceSchemaToOriginal()

RunJob(Job)

Executes the job with this provider as the destination. Called once by the job engine; the implementation loops the active table mappings, reads the rows from job.Source via GetReader(Mapping), processes each row with ProcessInputRow(Dictionary<string, object>, Mapping) and writes it to the destination. Must be overridden by destination providers; the base implementation throws NotImplementedException.

public override bool RunJob(Job job)

Parameters

job Job

The job to run.

Returns

bool

true when the job completed successfully; otherwise false. Log failures to Logger.

SaveAsXml(XmlTextWriter)

Writes the provider configuration as XML when the job definition is saved. Must round-trip with the Ctor(XmlNode) constructor that recreates the provider when the job is loaded. Must be overridden; the base implementation throws NotImplementedException.

public override void SaveAsXml(XmlTextWriter textWriter)

Parameters

textWriter XmlTextWriter

The writer positioned inside the job definition document.

Serialize()

Serializes the provider configuration to an XML fragment string, used when the provider settings are stored as part of a job definition. Must round-trip with the Ctor(XmlNode) constructor. The base implementation throws NotImplementedException.

public override string Serialize()

Returns

string

The provider configuration as an XML string.

TryOrderTablesInJobUsingSchemaMetadata(Job, bool)

Attempts to order mapped tables by using provider-specific persisted schema metadata instead of querying the database.

public override bool TryOrderTablesInJobUsingSchemaMetadata(Job job, bool isSource)

Parameters

job Job

The job whose mappings should be ordered.

isSource bool

true to order source tables; otherwise destination tables.

Returns

bool

true when the provider could order the mappings from persisted metadata alone; otherwise false so the caller can fall back to database-based ordering.

Remarks

The base implementation intentionally returns false. Providers that persist foreign-key metadata, such as SQL-backed providers, override this method to enable in-memory ordering without an extra database lookup during job execution.

UpdateDestinationSettings(IDestination)

Copies the settings of another instance of the same provider into this instance, used when the job editor saves updated destination settings onto an existing job. Must be overridden by destination providers; the base implementation throws NotImplementedException.

public override void UpdateDestinationSettings(IDestination destination)

Parameters

destination IDestination

The instance holding the new settings; cast to the concrete provider type.

UpdateSourceSettings(ISource)

Copies the settings of another instance of the same provider into this instance, used when the job editor saves updated source settings onto an existing job. Must be overridden by source providers; the base implementation throws NotImplementedException.

public override void UpdateSourceSettings(ISource source)

Parameters

source ISource

The instance holding the new settings; cast to the concrete provider type.

ValidateDestinationSettings()

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

public override string ValidateDestinationSettings()

Returns

string

ValidateSourceSettings()

Validates the source settings when the provider is configured as a source in the job editor. Override to check connectivity, file existence and similar; return an error description to show the user, or a non-error string when valid.

public override string ValidateSourceSettings()

Returns

string

A validation message; the default implementation performs no validation.

To top