Table of Contents

Class XmlProvider

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

Constructors

XmlProvider()

public XmlProvider()

XmlProvider(string)

public XmlProvider(string filename)

Parameters

filename string

XmlProvider(XmlNode)

public XmlProvider(XmlNode xmlNode)

Parameters

xmlNode XmlNode

Properties

ArchiveSourceFiles

[AddInParameter("Archive source files")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Source")]
public virtual bool ArchiveSourceFiles { get; set; }

Property Value

bool

DeleteSourceFile

[AddInParameter("Delete source file")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Source")]
public bool DeleteSourceFile { get; set; }

Property Value

bool

DestinationFile

[AddInParameter("Destination file")]
[AddInParameterEditor(typeof(TextParameterEditor), "append=.xml;required")]
[AddInParameterGroup("Destination")]
public string DestinationFile { get; set; }

Property Value

string

DestinationFolder

[AddInParameter("Destination folder")]
[AddInParameterEditor(typeof(FolderSelectEditor), "folder=/Files/")]
[AddInParameterGroup("Destination")]
public string DestinationFolder { get; set; }

Property Value

string

DestinationXslFile

[AddInParameter("Destination XSL file")]
[AddInParameterEditor(typeof(FileManagerEditor), "folder=/Files/;extensions=xsl,xslt")]
[AddInParameterGroup("Destination")]
public string DestinationXslFile { get; set; }

Property Value

string

DestionationEncoding

[AddInParameter("Destination encoding")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=false")]
[AddInParameterGroup("Destination")]
public string DestionationEncoding { get; set; }

Property Value

string

Encoding

public Encoding Encoding { get; set; }

Property Value

Encoding

ExportIsDone

Flag for finishing the import in ImportDataAddIn. When True update index can be started.

public bool ExportIsDone { get; set; }

Property Value

bool

ExportProductFieldDefinitions

[AddInParameter("Export Product Field Definitions")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
public bool ExportProductFieldDefinitions { get; set; }

Property Value

bool

IncludeTimestampInFileName

[AddInParameter("Include timestamp in filename")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
public virtual bool IncludeTimestampInFileName { get; set; }

Property Value

bool

SchemaIsEditable

Gets a value indicating whether the user can edit the provider's schema (add tables and columns) in the job editor. The default is false; file-based providers such as CSV and XML typically return true.

public override bool SchemaIsEditable { get; }

Property Value

bool

SkipTroublesomeRows

[AddInParameter("Skip Troublesome rows")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
public bool SkipTroublesomeRows { get; set; }

Property Value

bool

SourceDecimalSeparator

[AddInParameter("Source decimal separator")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=false")]
[AddInParameterGroup("Source")]
public string SourceDecimalSeparator { get; set; }

Property Value

string

SourceFile

[AddInParameter("Source file")]
[AddInParameterEditor(typeof(FileManagerEditor), "folder=/Files/;Tooltip=Selecting a source file will override source folder selection")]
[AddInParameterGroup("Source")]
public string SourceFile { get; set; }

Property Value

string

SourceFolder

[AddInParameter("Source folder")]
[AddInParameterEditor(typeof(FolderSelectEditor), "folder=/Files/")]
[AddInParameterGroup("Source")]
public string SourceFolder { get; set; }

Property Value

string

TableOptions

Source xml table name options collection

public Dictionary<string, Dictionary<string, string?>> TableOptions { get; }

Property Value

Dictionary<string, Dictionary<string, string>>

WorkingDirectory

Gets and sets working directory path

public override string WorkingDirectory { get; set; }

Property Value

string

XmlWriter

public XmlWriter XmlWriter { get; }

Property Value

XmlWriter

XslFile

[AddInParameter("XSL file")]
[AddInParameterEditor(typeof(FileManagerEditor), "folder=/Files/;extensions=xsl,xslt")]
[AddInParameterGroup("Source")]
public string XslFile { 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()

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.

GetXmlReader(Mapping)

public XmlReader? GetXmlReader(Mapping map)

Parameters

map Mapping

Returns

XmlReader

Initialize()

Initializes the provider before use. Override to perform setup that must not run in the constructor. The default implementation does nothing.

public override void Initialize()

LoadSettings(Job)

Called before the job runs to let the provider read settings from the job it participates in. Override to pick up job-level configuration; the default implementation does nothing.

public override void LoadSettings(Job job)

Parameters

job Job

The job the provider is the source or destination of.

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

ReadOutputFile()

public string ReadOutputFile()

Returns

string

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.

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.

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.

WriteToSourceFile(string)

public void WriteToSourceFile(string InputXML)

Parameters

InputXML string
To top