Class Mapping
- Namespace
- Dynamicweb.DataIntegration.Integration
- Assembly
- Dynamicweb.DataIntegration.dll
Contains the table mapping part of a schema.
public class Mapping
- Inheritance
-
Mapping
- Inherited Members
Constructors
Mapping()
Initializes a new instance of the Mapping class.
public Mapping()
Mapping(ISource, IDestination, int)
Initializes a new instance of the Mapping class. Generally, when adding a mapping to a job, one should use Job.AddMapping().
protected Mapping(ISource source, IDestination destination, int id)
Parameters
source
ISourceThe source.
destination
IDestinationThe destination.
id
intThe id.
Mapping(ISource, IDestination, int, Job)
Initializes a new instance of the Mapping class. Generally, when adding a mapping to a job, one should use Job.AddMapping().
protected Mapping(ISource source, IDestination destination, int id, Job job)
Parameters
source
ISourceThe source.
destination
IDestinationThe destination.
id
intThe id.
job
Job
Mapping(XmlNode, ISource, IDestination, int)
protected Mapping(XmlNode xmlNode, ISource source, IDestination destination, int id)
Parameters
xmlNode
XmlNodesource
ISourcedestination
IDestinationid
int
Mapping(XmlNode, ISource, IDestination, int, Job)
protected Mapping(XmlNode xmlNode, ISource source, IDestination destination, int id, Job job)
Parameters
xmlNode
XmlNodesource
ISourcedestination
IDestinationid
intjob
Job
Mapping(XmlNode, Schema, Schema, int)
protected Mapping(XmlNode xmlNode, Schema source, Schema destination, int id)
Parameters
Fields
AddColumnsFromSourceToMappingIfMissing
public bool AddColumnsFromSourceToMappingIfMissing
Field Value
Job
Job
public readonly Job Job
Field Value
MappingDestinationInitialized
Used to indicate if mapping-specific initialization in the destination has been completed
public bool MappingDestinationInitialized
Field Value
Properties
Active
Gets a value indicating whether this Mapping is active.
public virtual bool Active { get; set; }
Property Value
- bool
true
if active; otherwise,false
.
AnyColumnMappingExists
public bool AnyColumnMappingExists { get; }
Property Value
Comment
public string Comment { get; set; }
Property Value
ConditionalGroups
Gets the conditionals groups for the mapping
public IEnumerable<MappingConditionalGroup> ConditionalGroups { get; }
Property Value
Conditionals
Gets the conditionals for the mapping. Conditionals describe which conditions must be met for a row to be imported.
public MappingConditionalCollection Conditionals { get; }
Property Value
DeleteRowsMissingFromSource
Gets or sets a value indicating whether the destination table should be cleaned out after the job is finished, by removing any row that was not part of the input data for the job.
public virtual bool DeleteRowsMissingFromSource { get; set; }
Property Value
- bool
true
if missing rows should be deleted; otherwise,false
.
Destination
Gets the destination provider this mapping references.
public IDestination Destination { get; }
Property Value
DestinationSchema
public Schema DestinationSchema { get; set; }
Property Value
DestinationTable
Gets or sets the destination table.
public virtual Table DestinationTable { get; set; }
Property Value
- Table
The destination table.
DestinationTableName
public string DestinationTableName { get; set; }
Property Value
HasResponseMappings
public bool HasResponseMappings { get; }
Property Value
Options
Table specific Options
public Dictionary<string, string> Options { get; set; }
Property Value
ScriptClass
Table script class for the input row processing
public virtual string ScriptClass { get; set; }
Property Value
Source
Gets the source provider this mapping references.
public ISource Source { get; }
Property Value
SourceSchema
public Schema SourceSchema { get; set; }
Property Value
SourceTable
Gets or sets the source table.
public virtual Table SourceTable { get; set; }
Property Value
- Table
The source table.
SourceTableName
public string SourceTableName { get; set; }
Property Value
Methods
AddConditional(Column, ConditionalOperator, string)
public void AddConditional(Column sourceColumn, ConditionalOperator conditionalOperator, string condition)
Parameters
sourceColumn
ColumnconditionalOperator
ConditionalOperatorcondition
string
AddConditional(Column, ConditionalOperator, string, bool)
Adds a conditional to the mapping.
public void AddConditional(Column sourceColumn, ConditionalOperator conditionalOperator, string condition, bool useCodeExtension)
Parameters
sourceColumn
ColumnThe source column.
conditionalOperator
ConditionalOperatorThe conditional operator.
condition
stringThe condition.
useCodeExtension
boolThe condition is a CodeExpression addin
AddConditionalGroup(ConditionalGroupOperator)
Adds conditional group
public MappingConditionalGroup AddConditionalGroup(ConditionalGroupOperator conditionalOperator)
Parameters
conditionalOperator
ConditionalGroupOperatoroperator
Returns
- MappingConditionalGroup
Created group
AddMapping(Column, Column)
Adds a columnMapping to the mapping.
public ColumnMapping AddMapping(Column sourceColumn, Column destinationColumn)
Parameters
Returns
AddMapping(Column, Column, bool)
adds a columnMapping to the mapping. isKey indicated if this column should be used to compare incomming rows to existing rows.
public ColumnMapping AddMapping(Column sourceColumn, Column destinationColumn, bool isKey)
Parameters
Returns
- ColumnMapping
true if the mapping can be added, that is, source and destination tables match existing columns. False if the mapping cannot be added
AddResponseMapping(Column, Column, bool)
public ColumnMapping AddResponseMapping(Column sourceColumn, Column destinationColumn, bool isKey)
Parameters
Returns
ClearColumnMappings()
Removes all ColumnMappings from the mapping. Removes all ColumnMappings from the mapping.
public void ClearColumnMappings()
ClearResponseColumnMappings()
public void ClearResponseColumnMappings()
CreateFromNode(XmlNode)
protected void CreateFromNode(XmlNode xmlNode)
Parameters
xmlNode
XmlNode
GetColumnMappings()
public virtual ColumnMappingCollection GetColumnMappings()
Returns
GetColumnMappings(bool)
public virtual ColumnMappingCollection GetColumnMappings(bool forceAll)
Parameters
forceAll
bool
Returns
GetConditionColumns(IEnumerable<string>)
Gets the columns from mapping conditions.
public virtual IEnumerable<Column> GetConditionColumns(IEnumerable<string> columnsToSkip)
Parameters
columnsToSkip
IEnumerable<string>The columns to skip.
Returns
- IEnumerable<Column>
IEnumerable<Column>.
GetId()
Gets the id.
public int GetId()
Returns
GetMappingsWithKeyColumnSet()
public IEnumerable<ColumnMapping> GetMappingsWithKeyColumnSet()
Returns
GetOptionValue(string)
Gets mapping option value
public bool? GetOptionValue(string option)
Parameters
option
stringOption
Returns
- bool?
GetResponseColumnMappings()
public virtual ColumnMappingCollection GetResponseColumnMappings()
Returns
GetResponseColumnMappings(bool)
public virtual ColumnMappingCollection GetResponseColumnMappings(bool forceAll)
Parameters
forceAll
bool
Returns
GetSourceColumns(bool, bool)
Gets the source columns.
public virtual IEnumerable<Column> GetSourceColumns(bool includeOnlyActiveColumns, bool includeConditionColumns)
Parameters
includeOnlyActiveColumns
boolif set to
true
includes only active mapping columns. Otherwise includes all mapping columns.includeConditionColumns
boolif set to
true
included condition columns.
Returns
- IEnumerable<Column>
IEnumerable<Column>.
RemoveConditionalGroup(int)
Removes conditional group
public void RemoveConditionalGroup(int id)
Parameters
id
intGroup id
RemoveMapping(ColumnMapping)
Removes the ColumnMapping.
public void RemoveMapping(ColumnMapping cm)
Parameters
cm
ColumnMappingThe cm.
RemoveResponseMapping(ColumnMapping)
public void RemoveResponseMapping(ColumnMapping cm)