Search Results for

    Show / Hide Table of Contents

    Class ImportDataParameter

    The server data task parameters for the import data process

    See https://help.lemonedge.com/importing/ for more information

    Inheritance
    object
    SerializedParam
    ServerTaskParameter
    ImportDataParameter
    Implements
    ICloneable
    ICloneable<ImportDataParameter>
    INotifyPropertyChanged
    Inherited Members
    ServerTaskParameter.ShouldAutomaticallyCreateTask(IHasSaveProcessingTask, IEntityUpdater)
    ServerTaskParameter.DisplayUserParamOnSave(IHasSaveProcessingTask, IEntityUpdater)
    ServerTaskParameter.AllowSaveWithNoChangesForTaskCreation(IHasSaveProcessingTask, IEntityUpdater)
    ServerTaskParameter.AllowAutoCreateOnLockedItems
    SerializedParam.GetParam<T>(string)
    SerializedParam.GetParam<T>(byte[])
    SerializedParam.GetParam(string)
    SerializedParam.GetParam(string, bool)
    SerializedParam.GetParam(byte[])
    SerializedParam.ToSerializedString()
    SerializedParam.ToSerializedBytes()
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.API.Core.Tasks.Parameters
    Assembly: LemonEdge.API.dll
    Syntax
    [DataContract]
    public class ImportDataParameter : ServerTaskParameter, ICloneable, ICloneable<ImportDataParameter>, INotifyPropertyChanged

    Constructors

    ImportDataParameter()

    Declaration
    public ImportDataParameter()

    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
    string

    Properties

    ByPassProcessors

    Indicates when importing the data the system should by pass creating processors to process set data. Improves performance for large datasets, and also can be used where you want the data (such as gl postings) to be precisely what the source system was without additional transaction code processing - use with caution.

    Declaration
    public bool ByPassProcessors { get; set; }
    Property Value
    Type Description
    bool

    ByPassValidation

    Indicates when importing the data the system should by pass all validation. Improves performance for large datasets, and also can be used where you want the data (such as gl postings) to be precisely what the source system was without additional validation.

    Declaration
    public bool ByPassValidation { get; set; }
    Property Value
    Type Description
    bool

    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
    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
    string

    DefaultTextEncoding

    Default encoding to use for this file

    Declaration
    public TextFileEncoding? DefaultTextEncoding { get; set; }
    Property Value
    Type Description
    TextFileEncoding?

    Files

    A list of all filenames being imported for these parameters

    Declaration
    public string Files { get; set; }
    Property Value
    Type Description
    string

    ImportType

    The operation to use when importing the data

    Declaration
    public ImportSaveType ImportType { get; set; }
    Property Value
    Type Description
    ImportSaveType

    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
    IReadOnlyDictionary<string, (string CSVType, byte[] Data)>

    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
    string filePath

    The path to a valid csv import file

    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
    string filePath

    The path to a valid csv import file

    string uniqueKey

    The type of entity being imported represented as the entity unique key ( UniqueKey)

    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
    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()

    Creates a new instance of this class (of type ImportDataParameter) with all the same property values as this instance

    Declaration
    public ImportDataParameter Clone()
    Returns
    Type Description
    ImportDataParameter

    A new instance of this class with all the same property values as this instance

    CopyFromParam(SerializedParam)

    Should be overridden by inheriting implementations to ensure all parameters values are copied from the specified source

    Declaration
    protected override void CopyFromParam(SerializedParam source)
    Parameters
    Type Name Description
    SerializedParam source

    The source instance of a SerializedParam that is of the same type as this one to copy parameter values from

    Overrides
    SerializedParam.CopyFromParam(SerializedParam)
    Remarks

    Used by the generic implementation of Clone()

    CopyFromSource(ImportDataParameter)

    Updates all properties in this item to have the same properties as the source object.

    Declaration
    public void CopyFromSource(ImportDataParameter source)
    Parameters
    Type Name Description
    ImportDataParameter source

    The source object to copy all values from.

    CreateNewParam()

    Must be implemented by inheriting classes to provide a new instance of the current class type.

    Used when cloning this SerializedParam to create a new instance of the same type

    Declaration
    protected override SerializedParam CreateNewParam()
    Returns
    Type Description
    SerializedParam

    A new instance of the current SerializedParam type

    Overrides
    SerializedParam.CreateNewParam()

    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
    string

    A string stating that this is an imprt data task against the specified entity type

    Overrides
    ServerTaskParameter.GetUserFriendlyTaskInstanceIdentityInfo(IServerTask)

    OnFilesUpdated()

    Raises the event stating that the files for importing have been modified

    Declaration
    public void OnFilesUpdated()

    ParseEntityImportTypeFromCompressedFile(byte[], IDataMappingBase)

    Declaration
    public static Task<(EntityDescriptor Descriptor, TextFileEncoding? DefaultEncoding)> ParseEntityImportTypeFromCompressedFile(byte[] csvData, IDataMappingBase mapping = null)
    Parameters
    Type Name Description
    byte[] csvData
    IDataMappingBase mapping
    Returns
    Type Description
    Task<(EntityDescriptor Descriptor, TextFileEncoding? DefaultEncoding)>

    ParseEntityImportTypeFromFile(byte[], IDataMappingBase)

    Declaration
    public static Task<(EntityDescriptor Descriptor, TextFileEncoding? DefaultEncoding)> ParseEntityImportTypeFromFile(byte[] csvData, IDataMappingBase mapping = null)
    Parameters
    Type Name Description
    byte[] csvData
    IDataMappingBase mapping
    Returns
    Type Description
    Task<(EntityDescriptor Descriptor, TextFileEncoding? DefaultEncoding)>

    ParseEntityImportTypeFromFile(Func<Task<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 Descriptor, TextFileEncoding? DefaultEncoding)> ParseEntityImportTypeFromFile(Func<Task<TextReader>> getReader, IDataMappingBase mapping = null)
    Parameters
    Type Name Description
    Func<Task<TextReader>> getReader
    IDataMappingBase mapping

    An optional mapping used for the csv file parsing and encoding

    Returns
    Type Description
    Task<(EntityDescriptor Descriptor, TextFileEncoding? DefaultEncoding)>

    The type of entity being imported from the csv file. If it cann not be automatically determined then null is returned

    ParseEntityImportTypeFromFile(FileInfo, IDataMappingBase)

    Declaration
    public static Task<(EntityDescriptor Descriptor, TextFileEncoding? DefaultEncoding)> ParseEntityImportTypeFromFile(FileInfo file, IDataMappingBase mapping = null)
    Parameters
    Type Name Description
    FileInfo file
    IDataMappingBase mapping
    Returns
    Type Description
    Task<(EntityDescriptor Descriptor, TextFileEncoding? DefaultEncoding)>

    ParseEntityImportTypeFromFile(TextReader, IDataMappingBase)

    Declaration
    public static Task<(EntityDescriptor Descriptor, TextFileEncoding? DefaultEncoding)> ParseEntityImportTypeFromFile(TextReader data, IDataMappingBase mapping = null)
    Parameters
    Type Name Description
    TextReader data
    IDataMappingBase mapping
    Returns
    Type Description
    Task<(EntityDescriptor Descriptor, TextFileEncoding? DefaultEncoding)>

    ParseEntityImportTypeFromFile(string, IDataMappingBase)

    Declaration
    public static Task<(EntityDescriptor Descriptor, TextFileEncoding? DefaultEncoding)> ParseEntityImportTypeFromFile(string csvData, IDataMappingBase mapping = null)
    Parameters
    Type Name Description
    string csvData
    IDataMappingBase mapping
    Returns
    Type Description
    Task<(EntityDescriptor Descriptor, TextFileEncoding? DefaultEncoding)>

    Events

    PropertyChanged

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type Description
    PropertyChangedEventHandler

    Implements

    ICloneable
    ICloneable<T>
    INotifyPropertyChanged

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.