Class BaseProvider
- Namespace
- Dynamicweb.DataIntegration
- Assembly
- Dynamicweb.DataIntegration.dll
Provides base functionality for source-destination data integration means. Any providers for integration MUST provide three constructors of types: Ctor(), Ctor(string filename) & Ctor(XmlNode xmlNode) as these are all called implicitly through reflection in the frontend and in the Job class.
[AddInName("Dynamicweb.DataIntegration.Providers.Provider")]
[AddInDescription("XML provider")]
public abstract class BaseProvider : ConfigurableAddIn, ISource, IDestination, IParameterizedDestination
- Inheritance
-
BaseProvider
- Implements
- Derived
- Inherited Members
- Extension Methods
Properties
ABasePovider
protected BaseProvider ABasePovider { get; set; }
Property Value
FilesFolderName
The Name of the files folder in the current installation of Dynamicweb. Empty if used for test.
public string FilesFolderName { get; set; }
Property Value
JobIsGoingToRun
Gets and sets "job is going to run" status
public bool JobIsGoingToRun { get; set; }
Property Value
Logger
Logger
public ILogger Logger { get; set; }
Property Value
Parameters
Parameters
public Dictionary<string, string> Parameters { get; set; }
Property Value
SchemaIsEditable
Schema is editable
public virtual bool SchemaIsEditable { get; }
Property Value
WorkingDirectory
Gets and sets working directory path
public virtual string WorkingDirectory { get; set; }
Property Value
Methods
CheckCondition(MappingConditional, Dictionary<string, object>)
Checks mapping conditionals
public bool CheckCondition(MappingConditional mappingConditional, Dictionary<string, object> row)
Parameters
mappingConditional
MappingConditionalMappingConditionals
row
Dictionary<string, object>
Returns
- bool
Result of check
Close()
Closes this instance.
public virtual void Close()
CreateParameterNode(Type, string, string)
protected static XElement CreateParameterNode(Type type, string name, string value)
Parameters
Returns
GetDefaultValue(Type)
Gets the default value for the type
public static object GetDefaultValue(Type type)
Parameters
type
Type
Returns
GetFailedSourceRowMessage(Dictionary<string, object>)
Gets the failed row data message
public static string GetFailedSourceRowMessage(Dictionary<string, object> row)
Parameters
row
Dictionary<string, object>Data row
Returns
- string
The failed row data as string
GetOriginalDestinationSchema()
Gets the schema from the Destination Source
public virtual Schema GetOriginalDestinationSchema()
Returns
GetOriginalSourceSchema()
Get recent Source Tables Schema from source.
public virtual Schema GetOriginalSourceSchema()
Returns
GetReader(Mapping)
Gets the reader.
public virtual ISourceReader GetReader(Mapping mapping)
Parameters
mapping
MappingThe mapping.
Returns
GetSchema()
Gets the schema.
public virtual Schema GetSchema()
Returns
Initialize()
Initializes this instance.
public virtual void Initialize()
IsSortable(Job, bool)
public virtual bool IsSortable(Job job, bool isSource)
Parameters
Returns
LoadSettings(Job)
Loads from the input when the job is run.
This method is run when a job is run, before the actual data transfer takes place. The purpose is to allow settings for source and destination providers to be changed at runtime.
public virtual void LoadSettings(Job job)
Parameters
job
JobThe job.
OverwriteDestinationSchemaToOriginal()
Update current tables schema with most recent schema. Needed for updation of possible old schema loaded from the xml job settings.
public virtual void OverwriteDestinationSchemaToOriginal()
OverwriteSourceSchemaToOriginal()
Update current tables schema with most recent schema. Needed for updation of possible old schema loaded from the xml job settings.
public virtual void OverwriteSourceSchemaToOriginal()
ProcessInputRow(Dictionary<string, object>, Mapping)
Processes the source row using the provider from table mapping script class
protected bool ProcessInputRow(Dictionary<string, object> row, Mapping mapping)
Parameters
row
Dictionary<string, object>source row
mapping
Mappingmapping
Returns
ReplaceMappingConditionalsWithValuesFromRequest(Job)
protected void ReplaceMappingConditionalsWithValuesFromRequest(Job job)
Parameters
job
Job
RunJob(Job)
Runs the job. This is where the majority of the work is done.
public virtual bool RunJob(Job job)
Parameters
job
JobThe job to be run.
Returns
SaveAsXml(XmlTextWriter)
Saves as XML.
public virtual void SaveAsXml(XmlTextWriter textWriter)
Parameters
textWriter
XmlTextWriterThe XmlTextWriter.
Serialize()
Serializes this instance for use in AddinSelectors.
Output must be of the format
public virtual string Serialize()
Returns
- string
Serialized XML output describing addin paramters
UpdateDestinationSettings(IDestination)
Updates the destination settings of the current instance to match the settings of the "destination" paramter.
public virtual void UpdateDestinationSettings(IDestination destination)
Parameters
destination
IDestinationThe destination.
UpdateIndexes(IList<string>, ILogger)
public static void UpdateIndexes(IList<string> indexes, ILogger logger)
Parameters
UpdateSourceSettings(ISource)
Updates the source settings of the current instance to match the settings of the "destination" paramter.
public virtual void UpdateSourceSettings(ISource source)
Parameters
source
ISourceThe source.
ValidateDestinationSettings()
Validates the destination settings. Used to validate properties when created by the AddinSelector.
public virtual string ValidateDestinationSettings()
Returns
ValidateSourceSettings()
Validates the source settings. Used to validate properties when created by the AddinSelector.
public virtual string ValidateSourceSettings()
Returns
- string
Tuple of message text and message type