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
connectionStringstring
OrderProvider(XmlNode)
public OrderProvider(XmlNode xmlNode)
Parameters
xmlNodeXmlNode
Properties
DiscardDuplicates
[AddInParameter("Discard duplicates")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
public bool DiscardDuplicates { get; set; }
Property Value
DoNotExportCarts
[AddInParameter("Export completed orders only")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Source")]
public virtual bool DoNotExportCarts { get; set; }
Property Value
ExportNotExportedOrders
[AddInParameter("Export not yet exported Orders")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Source")]
public virtual bool ExportNotExportedOrders { get; set; }
Property Value
ExportOnlyOrdersWithoutExtID
[AddInParameter("Only export orders without externalID")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Source")]
public virtual bool ExportOnlyOrdersWithoutExtID { get; set; }
Property Value
OrderStateAfterExport
[AddInParameter("Order state after export")]
[AddInParameterEditor(typeof(GroupedDropDownParameterEditor), "none=true;noneText=Leave unchanged;")]
[AddInParameterGroup("Source")]
public virtual string? OrderStateAfterExport { get; set; }
Property Value
RemoveMissingOrderLines
[AddInParameter("Remove missing order lines")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
public bool RemoveMissingOrderLines { get; set; }
Property Value
SkipFailingRows
[AddInParameter("Persist successful rows and skip failing rows")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(100)]
public bool SkipFailingRows { 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.
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.
OrderTablesInJob(Job, bool)
public override void OrderTablesInJob(Job job, bool isSource)
Parameters
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
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.