Class EcomProvider
- Namespace
- Dynamicweb.DataIntegration.Providers.EcomProvider
- Assembly
- Dynamicweb.DataIntegration.dll
[AddInName("Dynamicweb.DataIntegration.Providers.Provider")]
[AddInLabel("Ecom Provider")]
[AddInDescription("Ecom provider")]
[AddInIgnore(false)]
public class EcomProvider : BaseSqlProvider, IParameterizedDestination, IParameterOptions, IParameterVisibility, ISource, IDestination, IDisposable
- Inheritance
-
EcomProvider
- Implements
- Inherited Members
- Extension Methods
Constructors
EcomProvider()
public EcomProvider()
EcomProvider(string)
public EcomProvider(string connectionString)
Parameters
connectionStringstring
EcomProvider(XmlNode)
public EcomProvider(XmlNode xmlNode)
Parameters
xmlNodeXmlNode
Properties
Connection
protected SqlConnection Connection { get; set; }
Property Value
CreateMissingGoups
[AddInParameter("Create missing groups")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(43)]
public bool CreateMissingGoups { get; set; }
Property Value
DeactivateMissingProducts
[AddInParameter("Deactivate missing products")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When ON missing products are deactivated. When OFF no action is taken. When Delete incoming rows is ON, Deactivate missing products is skipped. The Hide deactivated products option is used only when Deactivate missing products is ON")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(30)]
public bool DeactivateMissingProducts { get; set; }
Property Value
DefaultLanguage
[AddInParameter("Default Language")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=true;Tooltip=Set the default language for the imported products")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(10)]
public string DefaultLanguage { get; set; }
Property Value
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 products, Update only existing records, Deactivate missing products, Remove missing rows after import, and Delete products / groups for languages included in input")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(50)]
public bool DeleteIncomingItems { get; set; }
Property Value
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. When Delete incoming rows is ON, this option is ignored")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(60)]
public bool DeleteProductsAndGroupForSpecificLanguage { get; set; }
Property Value
DisableCacheClearing
[AddInParameter("Disable cache clearing")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=This setting disables cache clearing after import\t")]
[AddInParameterGroup("Hidden")]
[AddInParameterOrder(90)]
public bool DisableCacheClearing { get; set; }
Property Value
DiscardDuplicates
[AddInParameter("Discard duplicates")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When ON, duplicate rows are skipped")]
[AddInParameterGroup("Destination")]
public bool DiscardDuplicates { get; set; }
Property Value
GetGroupNamesForProduct
public bool GetGroupNamesForProduct { get; set; }
Property Value
GetGroupNamesForVariantOptions
public bool GetGroupNamesForVariantOptions { get; set; }
Property Value
GetManufacturerNamesForProducts
public bool GetManufacturerNamesForProducts { get; set; }
Property Value
GetRelatedProductGroupsByName
public bool GetRelatedProductGroupsByName { get; set; }
Property Value
GetRelatedProductsByName
public bool GetRelatedProductsByName { get; set; }
Property Value
GetVariantGroupNamesForProduct
public bool GetVariantGroupNamesForProduct { get; set; }
Property Value
GroupsForProductsBy
[AddInParameter("Get groups for products by:")]
[AddInParameterEditor(typeof(RadioParameterEditor), "")]
[AddInParameterGroup("Source")]
public string GroupsForProductsBy { get; set; }
Property Value
GroupsForVariantOptionsBy
[AddInParameter("Get groups for variant options by:")]
[AddInParameterEditor(typeof(RadioParameterEditor), "")]
[AddInParameterGroup("Source")]
public string GroupsForVariantOptionsBy { get; set; }
Property Value
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
IgnoreEmptyCategoryFieldValues
[AddInParameter("Ignore empty category field values")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When checked, the Ecom provider does not write empty category field values to the database")]
[AddInParameterGroup("Destination")]
public bool IgnoreEmptyCategoryFieldValues { get; set; }
Property Value
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
ManufacturerForProductsBy
[AddInParameter("Get manufacturer for products by:")]
[AddInParameterEditor(typeof(RadioParameterEditor), "")]
[AddInParameterGroup("Source")]
public string ManufacturerForProductsBy { get; set; }
Property Value
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
RelatedProductGroupsBy
[AddInParameter("Get related product groups by:")]
[AddInParameterEditor(typeof(RadioParameterEditor), "")]
[AddInParameterGroup("Source")]
public string RelatedProductGroupsBy { get; set; }
Property Value
RelatedProductsBy
[AddInParameter("Get related products by:")]
[AddInParameterEditor(typeof(RadioParameterEditor), "")]
[AddInParameterGroup("Source")]
public string RelatedProductsBy { get; set; }
Property Value
RemoveMissingAfterImport
[AddInParameter("Remove missing rows after import")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Removes rows from the destination and relation tables. This option takes precedence")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(40)]
public bool RemoveMissingAfterImport { get; set; }
Property Value
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
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(41)]
public bool RemoveMissingRows { get; set; }
Property Value
Shop
[AddInParameter("Shop")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=true;Tooltip=Set a shop for the imported products")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(20)]
public string Shop { get; set; }
Property Value
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
SourceLanguage
[AddInParameter("Source language")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=true;Tooltip=Select only products in this language.")]
[AddInParameterGroup("Source")]
public string SourceLanguage { get; set; }
Property Value
SourceShop
[AddInParameter("Source shop")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=true;Tooltip=Select only products from this shop.")]
[AddInParameterGroup("Source")]
public string SourceShop { get; set; }
Property Value
UpdateOnlyExistingProducts
[AddInParameter("Update only existing products")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(42)]
public bool UpdateOnlyExistingProducts { get; set; }
Property Value
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
UseProductIdFoundByNumber
[AddInParameter("Use existing Product Id found by Number in Variant Products")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When checked, the values in Dynamicweb ProductId and ProductVariantID will be used at import to update products in Dynamicweb. A product is only updated if it matches the ProductNumber (in default language) of the imported row and if the Dynamicweb ProductVariantId field is not empty")]
[AddInParameterGroup("Destination")]
public bool UseProductIdFoundByNumber { get; set; }
Property Value
UseStrictPrimaryKeyMatching
[AddInParameter("Use strict primary key matching")]
[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")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(38)]
public bool UseStrictPrimaryKeyMatching { get; set; }
Property Value
UserKeyField
[AddInParameter("User key field")]
[AddInParameterEditor(typeof(TextParameterEditor), "")]
[AddInParameterGroup("Hidden")]
public string UserKeyField { get; set; }
Property Value
VariantGroupsForProductsBy
[AddInParameter("Get variant groups for products by:")]
[AddInParameterEditor(typeof(RadioParameterEditor), "")]
[AddInParameterGroup("Source")]
public string VariantGroupsForProductsBy { 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()
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
disposingbool
GetHiddenParameterNames(string, object?)
public IEnumerable<string> GetHiddenParameterNames(string parameterName, object? parameterValue)
Parameters
Returns
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.
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.