Table of Contents

Class ImportFromFileActivityPreset

Namespace
Dynamicweb.DataIntegration.Integration.DataImport
Assembly
Dynamicweb.DataIntegration.dll
public abstract class ImportFromFileActivityPreset : BaseActivityPreset
Inheritance
ImportFromFileActivityPreset
Inherited Members

Properties

ConfigurationFile

public string? ConfigurationFile { get; set; }

Property Value

string

ConfigurationJob

protected Job? ConfigurationJob { get; }

Property Value

Job

DataImportPreset

Gets a value indicating whether the preset is a simplified data import preset. When true, the administration UI uses the data import editing experience (file upload, sheet selection, preview) instead of the generic preset installation screen. The default is false.

public override bool DataImportPreset { get; }

Property Value

bool

DestinationColumnPefixes

protected virtual string[] DestinationColumnPefixes { get; }

Property Value

string[]

DestinationId

public string? DestinationId { get; set; }

Property Value

string

DestinationProvider

Gets or sets the destination provider add-in the preset is configured with. When set, the installation UI renders the provider's add-in parameters as an extra field group and writes the user's values back to the instance before ValidateSettings() and Install(out string) run. The default is null.

public override ConfigurableAddIn? DestinationProvider { get; set; }

Property Value

ConfigurableAddIn

DestinationProviderName

protected abstract string DestinationProviderName { get; }

Property Value

string

DestinationTableName

protected abstract string DestinationTableName { get; }

Property Value

string

KeyColumns

[AddInParameter("KeyColumns")]
[AddInLabel("Import keys")]
[AddInParameterEditor(typeof(SelectionBoxParameterEditor), "leftheader=Excluded;rightheader=Included;")]
[AddInParameterOrder(20)]
public string? KeyColumns { get; set; }

Property Value

string

NeedsPreview

Gets a value indicating whether the preset can supply a data preview. When true, the preset editing screens call GetPreviewListData(out List<Dictionary<string, object>>, out IEnumerable<string>, out string) and render the returned rows as a preview table. The default is false.

public override bool NeedsPreview { get; }

Property Value

bool

SelectedTable

[AddInParameterGroup("Source file")]
[AddInParameter("SelectedTable")]
[AddInLabel("Sheet")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "reloadOnChange=true", Explanation = "Select the sheet to import from the source file.")]
[AddInParameterOrder(10)]
public string? SelectedTable { get; set; }

Property Value

string

SourceFile

public string? SourceFile { get; set; }

Property Value

string

SourceProvider

Gets or sets the source provider add-in the preset is configured with. When set, the installation UI renders the provider's add-in parameters as an extra field group and writes the user's values back to the instance before ValidateSettings() and Install(out string) run. The default is null.

public override ConfigurableAddIn? SourceProvider { get; set; }

Property Value

ConfigurableAddIn

Methods

GetDataImportMapping(Job)

protected virtual Mapping? GetDataImportMapping(Job job)

Parameters

job Job

Returns

Mapping

GetDefaultKeyColumns()

protected virtual string? GetDefaultKeyColumns()

Returns

string

GetParameterOptions(string)

public virtual IEnumerable<ParameterOption> GetParameterOptions(string parameterName)

Parameters

parameterName string

Returns

IEnumerable<ParameterOption>

GetPreviewListData(out List<Dictionary<string, object>>, out IEnumerable<string>, out string)

Supplies the rows and columns shown as a data preview in the preset editing screens. Called when NeedsPreview is true; the preview is only rendered when the method returns true. The base implementation returns false with empty data.

public override bool GetPreviewListData(out List<Dictionary<string, object>> listData, out IEnumerable<string> columns, out string error)

Parameters

listData List<Dictionary<string, object>>

Receives the preview rows, each keyed by column name.

columns IEnumerable<string>

Receives the column names in display order.

error string

Receives a message describing why the preview could not be produced.

Returns

bool

true when preview data is available; otherwise false.

GetSourceTables()

protected TableCollection GetSourceTables()

Returns

TableCollection

Install(out string)

Performs the installation — creates the integration activity (job) the preset represents. Called once by the install command after ValidateSettings() returned an empty string and, when NeedsEndpoint is true, after SetEndpoint(Endpoint) has been called.

public override bool Install(out string errors)

Parameters

errors string

Receives a message describing why the installation failed; shown to the user when the method returns false.

Returns

bool

true when the activity was installed successfully; otherwise false.

LoadSettings()

Loads the preset's parameter values from an existing installed activity. Called by the data import query when the editing UI is opened for an already configured activity, after SourceProvider and DestinationProvider have been populated; override to read the persisted configuration back into the add-in parameter properties. The base implementation does nothing.

public override void LoadSettings()

PrepareMapping(Mapping)

protected virtual void PrepareMapping(Mapping mapping)

Parameters

mapping Mapping

ValidateSettings()

Validates the preset configuration. Called by the install and update commands after the user's parameter values have been applied to the instance and before Install(out string); a non-empty return value aborts the installation and is shown to the user.

public override string ValidateSettings()

Returns

string

An empty string when the settings are valid; otherwise a message describing the problems.

To top