Class ImportDataParameter
The server data task parameters for the import data processs
See https://help.lemonedge.com/importing/ for more information
Inherited Members
Namespace: LemonEdge.API.Tasks.Parameters
Assembly: API.dll
Syntax
[DataContract]
public class ImportDataParameter : ServerTaskParameter, ICloneable, ICloneable<ImportDataParameter>, INotifyPropertyChanged
Fields
UNIQUE_TASK_ID
The unique id of the import data server task
Declaration
public const string UNIQUE_TASK_ID = "19b76e60-471e-49bb-a072-9ccdc617dbff"
Field Value
Type | Description |
---|---|
System.String |
Properties
DataMappingID
Any mapping to use when importing the data to map it from its source format to the expected system format
Declaration
public Guid? DataMappingID { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Guid> |
DataMappingID_Label
The name of any mapping to use when importing the data to map it from its source format to the expected system format
Declaration
public string DataMappingID_Label { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Files
A list of all filenames being imported for these parameters
Declaration
public string Files { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Imports
Details of all data to import with the file name as the key, and the type to import and data as the dictionary value
Declaration
public IReadOnlyDictionary<string, (string CSVType, byte[] Data)> Imports { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyDictionary<System.String, System.ValueTuple<System.String, System.Byte[]>> |
ImportType
The operation to use when importing the data
Declaration
public ImportSaveType ImportType { get; set; }
Property Value
Type | Description |
---|---|
ImportSaveType |
Methods
AddCSVFileToImport(String, String)
Adds the specified csv file to the files to import
Declaration
public void AddCSVFileToImport(string filePath, string uniqueKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path to a valid csv import file |
System.String | uniqueKey | The type of entity being imported represented as the entity unique key (UniqueKey) |
AddCSVFileToImport(String, String, Byte[])
Adds the specified csv file to the files to import
Declaration
public void AddCSVFileToImport(string filePath, string uniqueKey, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path to a valid csv import file |
System.String | uniqueKey | The type of entity being imported represented as the entity unique key (UniqueKey) |
System.Byte[] | data | The data from the file |
AddXMLFileToImport(String)
Adds the specified xml file to the files to import
Declaration
public void AddXMLFileToImport(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path to a valid lemonedge xml import file |
ClearFiles()
Removes all files from the parameters specifying which files to import
Declaration
public void ClearFiles()
Clone()
Declaration
public ImportDataParameter Clone()
Returns
Type | Description |
---|---|
ImportDataParameter |
CopyFromParam(SerializedParam)
Declaration
protected override void CopyFromParam(SerializedParam source)
Parameters
Type | Name | Description |
---|---|---|
SerializedParam | source |
Overrides
CopyFromSource(ImportDataParameter)
Declaration
public void CopyFromSource(ImportDataParameter source)
Parameters
Type | Name | Description |
---|---|---|
ImportDataParameter | source |
CreateNewParam()
Declaration
protected override SerializedParam CreateNewParam()
Returns
Type | Description |
---|---|
SerializedParam |
Overrides
GetUserFriendlyTaskInstanceIdentityInfo(IServerTask)
Returns that this is an imprt data task against the specified entity type
Declaration
public override string GetUserFriendlyTaskInstanceIdentityInfo(IServerTask task)
Parameters
Type | Name | Description |
---|---|---|
IServerTask | task | The server task for processing the data to import |
Returns
Type | Description |
---|---|
System.String | A string stating that this is an imprt data task against the specified entity type |
Overrides
OnFilesUpdated()
Raises the event stating that the files for importing have been modified
Declaration
public void OnFilesUpdated()
ParseEntityImportTypeFromFile(TextReader, IDataMappingBase)
A function that given a csv file to import, (and an optional possible mapping) will parse the headers and first row of the file to try and determine what type of data is being imported
This is done by looking for the ImportDataType header and associated data stating the entity type (SetName)
Declaration
public static Task<EntityDescriptor> ParseEntityImportTypeFromFile(TextReader data, IDataMappingBase mapping = null)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextReader | data | The csv file to import |
IDataMappingBase | mapping | An optional mapping used for the csv file parsing and encoding |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<EntityDescriptor> | The type of entity being imported from the csv file. If it cann not be automatically determined then null is returned |
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
System.ComponentModel.PropertyChangedEventHandler |