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
filenamestring
XmlProvider(XmlNode)
public XmlProvider(XmlNode xmlNode)
Parameters
xmlNodeXmlNode
Properties
ArchiveSourceFiles
[AddInParameter("Archive source files")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Source")]
public virtual bool ArchiveSourceFiles { get; set; }
Property Value
DeleteSourceFile
[AddInParameter("Delete source file")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Source")]
public bool DeleteSourceFile { get; set; }
Property Value
DestinationFile
[AddInParameter("Destination file")]
[AddInParameterEditor(typeof(TextParameterEditor), "append=.xml;required")]
[AddInParameterGroup("Destination")]
public string DestinationFile { get; set; }
Property Value
DestinationFolder
[AddInParameter("Destination folder")]
[AddInParameterEditor(typeof(FolderSelectEditor), "folder=/Files/")]
[AddInParameterGroup("Destination")]
public string DestinationFolder { get; set; }
Property Value
DestinationXslFile
[AddInParameter("Destination XSL file")]
[AddInParameterEditor(typeof(FileManagerEditor), "folder=/Files/;extensions=xsl,xslt")]
[AddInParameterGroup("Destination")]
public string DestinationXslFile { get; set; }
Property Value
DestionationEncoding
[AddInParameter("Destination encoding")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=false")]
[AddInParameterGroup("Destination")]
public string DestionationEncoding { get; set; }
Property Value
Encoding
public Encoding Encoding { get; set; }
Property Value
ExportIsDone
Flag for finishing the import in ImportDataAddIn. When True update index can be started.
public bool ExportIsDone { get; set; }
Property Value
ExportProductFieldDefinitions
[AddInParameter("Export Product Field Definitions")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
public bool ExportProductFieldDefinitions { get; set; }
Property Value
IncludeTimestampInFileName
[AddInParameter("Include timestamp in filename")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
public virtual bool IncludeTimestampInFileName { get; set; }
Property Value
SchemaIsEditable
Schema is editable
public override bool SchemaIsEditable { get; }
Property Value
SkipTroublesomeRows
[AddInParameter("Skip Troublesome rows")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
public bool SkipTroublesomeRows { get; set; }
Property Value
SourceDecimalSeparator
[AddInParameter("Source decimal separator")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=false")]
[AddInParameterGroup("Source")]
public string SourceDecimalSeparator { get; set; }
Property Value
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
SourceFolder
[AddInParameter("Source folder")]
[AddInParameterEditor(typeof(FolderSelectEditor), "folder=/Files/")]
[AddInParameterGroup("Source")]
public string SourceFolder { get; set; }
Property Value
TableOptions
Source xml table name options collection
public Dictionary<string, Dictionary<string, string?>> TableOptions { get; }
Property Value
WorkingDirectory
Gets and sets working directory path
public override string WorkingDirectory { get; set; }
Property Value
XmlWriter
public XmlWriter XmlWriter { get; }
Property Value
XslFile
[AddInParameter("XSL file")]
[AddInParameterEditor(typeof(FileManagerEditor), "folder=/Files/;extensions=xsl,xslt")]
[AddInParameterGroup("Source")]
public string XslFile { get; set; }
Property Value
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
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
GetParameterOptions(string)
public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)
Parameters
parameterNamestring
Returns
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
mappingMappingMapping that configures what/how to read.
Returns
- ISourceReader
An ISourceReader instance.
GetXmlReader(Mapping)
public XmlReader? GetXmlReader(Mapping map)
Parameters
mapMapping
Returns
Initialize()
Initialize the provider. Open transient resources (connections) required for operation.
Avoid heavy or long-running operations here when possible; prefer lazy initialization where appropriate.
public override void Initialize()
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
jobJobJob containing runtime settings and context.
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()
ReadOutputFile()
public string ReadOutputFile()
Returns
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
jobJobJob 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
destinationIDestinationDestination 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
sourceISourceSource instance to copy settings from.
ValidateDestinationSettings()
Validates the destination settings. Used to validate properties when created by the AddinSelector.
public override string ValidateDestinationSettings()
Returns
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.
WriteToSourceFile(string)
public void WriteToSourceFile(string InputXML)
Parameters
InputXMLstring