Class ODataProvider
- Namespace
- Dynamicweb.DataIntegration.Providers.ODataProvider
- Assembly
- Dynamicweb.DataIntegration.dll
[AddInName("Dynamicweb.DataIntegration.Providers.Provider")]
[AddInLabel("OData Provider")]
[AddInDescription("OData provider")]
[AddInIgnore(false)]
[AddInUseParameterSectioning(true)]
[ResponseMapping(true)]
public class ODataProvider : BaseProvider, IParameterizedDestination, ISource, IDestination, IParameterOptions, IODataBaseProvider, IParameterVisibility
- Inheritance
-
ODataProvider
- Implements
- Inherited Members
- Extension Methods
Constructors
ODataProvider()
public ODataProvider()
ODataProvider(XmlNode)
public ODataProvider(XmlNode xmlNode)
Parameters
xmlNodeXmlNode
Properties
ContinueOnError
[AddInParameter("Continue on error")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Use this when the job should continue when endpoint returns an error.")]
[AddInParameterGroup("Destination")]
public bool ContinueOnError { get; set; }
Property Value
DeltaModifier
[AddInParameter("Delta modifier")]
[AddInParameterEditor(typeof(TextParameterEditor), "infoText=Add your own delta properties. Default looking at these properties: Last_Date_Modified, Order_Date, LastDateTimeModified, lastModifiedDateTime and modifiedon.;inputClass=NewUIinput;")]
[AddInParameterGroup("Source")]
public string? DeltaModifier { get; set; }
Property Value
DestinationEndpointId
[AddInParameter("Destination endpoint")]
[AddInParameterEditor(typeof(GroupedDropDownParameterEditor), "none=true;refreshParameters=true;required=true")]
[AddInParameterGroup("Destination")]
public string? DestinationEndpointId { get; set; }
Property Value
DoNotStoreLastResponseInLogFile
[AddInParameter("Do not store last response in log file")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Useful when working with large amount of data.")]
[AddInParameterGroup("Source")]
public bool DoNotStoreLastResponseInLogFile { get; set; }
Property Value
EndpointId
[AddInParameter("Predefined endpoint")]
[AddInParameterEditor(typeof(GroupedDropDownParameterEditor), "none=true;refreshParameters=true;required=true;sortBy=,,default")]
[AddInParameterGroup("Source")]
public string? EndpointId { get; set; }
Property Value
ErpType
public ErpType ErpType { get; }
Property Value
FailJobOnEndpointIsBusy
[AddInParameter("Fail job if endpoint is busy or down")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=If endpoint is busy or down during the run time, it will not insert already imported rows.")]
[AddInParameterGroup("Source")]
public bool FailJobOnEndpointIsBusy { get; set; }
Property Value
MaximumPageSize
[AddInParameter("Maximum page size")]
[AddInParameterEditor(typeof(IntegerNumberParameterEditor), "allowNegativeValues=false")]
[AddInParameterGroup("Source")]
public int MaximumPageSize { get; set; }
Property Value
Mode
[AddInParameter("Mode")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "required=true;reloadOnChange=true;none=true;nonetext=Please select a Mode;SortBy=Key;")]
[AddInParameterGroup("Source")]
public string? Mode { get; set; }
Property Value
RequestIntervals
[AddInParameter("Run request in intervals (pages)")]
[AddInParameterEditor(typeof(IntegerNumberParameterEditor), "allowNegativeValues=false")]
[AddInParameterGroup("Source")]
public int RequestIntervals { get; set; }
Property Value
RequestTimeout
[AddInParameter("Request timeout (minutes)")]
[AddInParameterEditor(typeof(IntegerNumberParameterEditor), "allowNegativeValues=false")]
[AddInParameterGroup("Source")]
public int RequestTimeout { get; set; }
Property Value
RunLastRequest
[AddInParameter("Run last response")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Runs the job from the last saved response instead of calling the endpoint.")]
[AddInParameterGroup("Source")]
public bool RunLastRequest { get; set; }
Property Value
SchemaIsEditable
Schema is editable
public override bool SchemaIsEditable { get; }
Property Value
SourceDecimalSeparator
[AddInParameter("Source decimal separator")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=false")]
[AddInParameterGroup("Source")]
public string SourceDecimalSeparator { 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()
EndpointIsLoadAllEntities(string)
public static bool EndpointIsLoadAllEntities(string endpointAddress)
Parameters
endpointAddressstring
Returns
GetDetails(string)
Return optional provider details to be stored alongside persisted schema metadata.
public override string? GetDetails(string id)
Parameters
idstring
Returns
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.
GetSchema()
Return the live Schema (tables + columns) for this source.
Implementer guidance:
- Return a thread-safe, non-mutating Schema instance (or a defensive copy).
- Prefer cached or lightweight responses to avoid repeated expensive I/O.
- This method should reflect the source structure at the time of the call.
Note: schema access is centralized via GetSchema(ISource?). That service consults the SchemaManagementFeature and may use a persisted schema instead of invoking this method. Call this directly only when you need the live schema.
public override Schema GetSchema()
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()
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.
SaveAsXml(XmlTextWriter)
Persist provider settings to the supplied System.Xml.XmlTextWriter.
Implementations should write their configuration elements but must not close or dispose the writer.
public override void SaveAsXml(XmlTextWriter textWriter)
Parameters
textWriterXmlTextWriterXml writer to write settings into.
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.