Class ImporterAsync
Normally this one would be called Importer and the other LegacyImporter, but backwards compatibility :( Importer class without any legacy code. Include the legacy support in the Importer class, use that in legacy clients (and hopefully we'll be able remove that one at some point). Use this class everywhere else.
Inherited Members
Namespace: Sdl.Core.TM.ImportExport
Assembly: Sdl.Core.TM.ImportExport.dll
Syntax
public class ImporterAsync
Constructors
ImporterAsync(ICultureMetadataManager, Func<ImportStatistics, ImportResults, Task<Boolean>>, ICoreTmMetricsReporter)
Initializes a new instance of the Importer class.
Declaration
public ImporterAsync(ICultureMetadataManager cultureMetadataManager, Func<ImportStatistics, ImportResults, Task<bool>> batchImportedAsync = null, ICoreTmMetricsReporter metricsReporter = null)
Parameters
Type | Name | Description |
---|---|---|
ICultureMetadataManager | cultureMetadataManager | |
Func<ImportStatistics, ImportResults, Task<Boolean>> | batchImportedAsync | |
ICoreTmMetricsReporter | metricsReporter |
ImporterAsync(IImportDestinationAsync, ICultureMetadataManager, Func<ImportStatistics, ImportResults, Task<Boolean>>, ICoreTmMetricsReporter)
Normally this one would be called Importer and the other LegacyImporter, but backwards compatibility :( Importer class without any legacy code. Include the legacy support in the Importer class, use that in legacy clients (and hopefully we'll be able remove that one at some point). Use this class everywhere else.
Declaration
public ImporterAsync(IImportDestinationAsync importDestinationAsync, ICultureMetadataManager cultureMetadataManager, Func<ImportStatistics, ImportResults, Task<bool>> batchImportedAsync = null, ICoreTmMetricsReporter metricsReporter = null)
Parameters
Type | Name | Description |
---|---|---|
IImportDestinationAsync | importDestinationAsync | |
ICultureMetadataManager | cultureMetadataManager | |
Func<ImportStatistics, ImportResults, Task<Boolean>> | batchImportedAsync | |
ICoreTmMetricsReporter | metricsReporter |
Fields
_batchImportedAsync
Normally this one would be called Importer and the other LegacyImporter, but backwards compatibility :( Importer class without any legacy code. Include the legacy support in the Importer class, use that in legacy clients (and hopefully we'll be able remove that one at some point). Use this class everywhere else.
Declaration
protected readonly Func<ImportStatistics, ImportResults, Task<bool>> _batchImportedAsync
Field Value
Type | Description |
---|---|
Func<ImportStatistics, ImportResults, Task<Boolean>> |
BadTuCount
Normally this one would be called Importer and the other LegacyImporter, but backwards compatibility :( Importer class without any legacy code. Include the legacy support in the Importer class, use that in legacy clients (and hopefully we'll be able remove that one at some point). Use this class everywhere else.
Declaration
protected int BadTuCount
Field Value
Type | Description |
---|---|
Int32 |
Buffer
Normally this one would be called Importer and the other LegacyImporter, but backwards compatibility :( Importer class without any legacy code. Include the legacy support in the Importer class, use that in legacy clients (and hopefully we'll be able remove that one at some point). Use this class everywhere else.
Declaration
protected readonly List<TranslationUnit> Buffer
Field Value
Type | Description |
---|---|
List<TranslationUnit> |
DefaultTranslationUnitChunkSize
Defines the default size for a chunk of translation units to be processed in one round-trip through the import/export process.
Declaration
public const int DefaultTranslationUnitChunkSize = 200
Field Value
Type | Description |
---|---|
Int32 |
ErrorOutput
Normally this one would be called Importer and the other LegacyImporter, but backwards compatibility :( Importer class without any legacy code. Include the legacy support in the Importer class, use that in legacy clients (and hopefully we'll be able remove that one at some point). Use this class everywhere else.
Declaration
protected TMXWriter ErrorOutput
Field Value
Type | Description |
---|---|
TMXWriter |
MaxTranslationUnitChunkSize
Defines the maximum allowed chunk size.
Declaration
public const int MaxTranslationUnitChunkSize = 200
Field Value
Type | Description |
---|---|
Int32 |
MinTranslationUnitChunkSize
Defines the minimum allowed chunk size.
Declaration
public const int MinTranslationUnitChunkSize = 2
Field Value
Type | Description |
---|---|
Int32 |
Properties
CanChangeImportFile
Flag set to true if the imported file can/should be changed
Declaration
public bool CanChangeImportFile { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
ChunkSize
Gets or sets the size of the translation unit chunk size
Declaration
public int ChunkSize { get; set; }
Property Value
Type | Description |
---|---|
Int32 | The size of the chunk. |
Exclusive
If true, indicates this Importer is the only flow making changes to the destination TM, in which case optimisations are used. Do not set true if other flows/users may be updating the TM during the import.
Declaration
public bool Exclusive { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
FileTypeManager
Gets or sets the file type manager. This is only needed when imported bilingual documents; it is not required when imported TMX files.
Declaration
public IFileTypeManager FileTypeManager { get; set; }
Property Value
Type | Description |
---|---|
IFileTypeManager | The file type manager. |
ImportSettings
Gets or sets the import settings.
Declaration
public ImportSettings ImportSettings { get; set; }
Property Value
Type | Description |
---|---|
ImportSettings |
InvalidTranslationUnitsExportPath
Gets or sets the invalid translation units export path.
Declaration
public string InvalidTranslationUnitsExportPath { get; set; }
Property Value
Type | Description |
---|---|
String | The invalid translation units export path. |
Statistics
Gets the statistics.
Declaration
public ImportStatistics Statistics { get; set; }
Property Value
Type | Description |
---|---|
ImportStatistics | The statistics. |
TranslationMemoryUserIdSetting
Gets or sets the user id used to import TUs.
Declaration
public string TranslationMemoryUserIdSetting { get; set; }
Property Value
Type | Description |
---|---|
String |
Methods
Flush(ImportStatistics, IImportDestinationAsync)
Flushes the content of the internal translation unit buffer into the translation memory immediately.
Declaration
protected Task<bool> Flush(ImportStatistics stats, IImportDestinationAsync importDestination)
Parameters
Type | Name | Description |
---|---|---|
ImportStatistics | stats | The import results. |
IImportDestinationAsync | importDestination |
Returns
Type | Description |
---|---|
Task<Boolean> | Response.Cancel if there is an event listener that has signaled it wants to stop the import, otherwise Response.Continue. |
Remarks
Stats is an input/output parameter and it will be updated after the execution of this method accordingly.
GetDefaultFileTypeManager()
Returns the default file type manager.
Declaration
public IFileTypeManager GetDefaultFileTypeManager()
Returns
Type | Description |
---|---|
IFileTypeManager |
ImportAsync(String, IImportDestinationAsync)
Starts the import from the specified file.
Declaration
public Task<bool> ImportAsync(string fileName, IImportDestinationAsync importDestination)
Parameters
Type | Name | Description |
---|---|---|
String | fileName | The file name. |
IImportDestinationAsync | importDestination |
Returns
Type | Description |
---|---|
Task<Boolean> |
OnBatchImportedAsync(ImportStatistics, ImportResults)
Normally this one would be called Importer and the other LegacyImporter, but backwards compatibility :( Importer class without any legacy code. Include the legacy support in the Importer class, use that in legacy clients (and hopefully we'll be able remove that one at some point). Use this class everywhere else.
Declaration
protected virtual Task<bool> OnBatchImportedAsync(ImportStatistics overallResults, ImportResults batchResults)
Parameters
Type | Name | Description |
---|---|---|
ImportStatistics | overallResults | |
ImportResults | batchResults |
Returns
Type | Description |
---|---|
Task<Boolean> |
OutputErrorTuAsync(TranslationUnit, ImportResult)
Normally this one would be called Importer and the other LegacyImporter, but backwards compatibility :( Importer class without any legacy code. Include the legacy support in the Importer class, use that in legacy clients (and hopefully we'll be able remove that one at some point). Use this class everywhere else.
Declaration
protected Task OutputErrorTuAsync(TranslationUnit tu, ImportResult result)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | tu | |
ImportResult | result |
Returns
Type | Description |
---|---|
Task |