Class ImportJob

Job for importing catalogs

Inheritance
System.Object
ImportJob
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.Catalog.ImportExport
Assembly: Mediachase.Commerce.dll
Version: 10.8.0
Syntax
public class ImportJob : IBackgroundTask

Constructors

ImportJob()

Declaration
[Obsolete("Use a constructor with arguments to configure the import task, and execute it with the background task manager. Will remain at least until November 2016.")]
public ImportJob()

ImportJob(IDictionary<String, String>)

Declaration
public ImportJob(IDictionary<string, string> arguments)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<System.String, System.String> arguments

ImportJob(Guid, String, Boolean)

Declaration
public ImportJob(Guid applicationId, string sourceXmlFile, bool overwriteDuplicates)
Parameters
Type Name Description
System.Guid applicationId
System.String sourceXmlFile
System.Boolean overwriteDuplicates

ImportJob(Guid, String, String, Boolean)

Declaration
public ImportJob(Guid applicationId, string sourceZipFile, string sourceXmlInZip, bool overwriteDuplicates)
Parameters
Type Name Description
System.Guid applicationId
System.String sourceZipFile
System.String sourceXmlInZip
System.Boolean overwriteDuplicates

ImportJob(Guid, String, String, Boolean, Boolean)

Initializes a new instance of the ImportJob class.

Declaration
public ImportJob(Guid applicationId, string sourceZipFile, string sourceXmlInZip, bool overwriteDuplicates, bool isModelsAvailable)
Parameters
Type Name Description
System.Guid applicationId

The application identifier.

System.String sourceZipFile

The source zip file.

System.String sourceXmlInZip

The source XML in zip.

System.Boolean overwriteDuplicates

if set to true [overwrite duplicates].

System.Boolean isModelsAvailable

Determines of the strongly typed models are available to allow asset linking.
The default value is true.
Set to false if you are importing in commerce manager or another context where the media models are not available

Fields

DefaultXmlFileInZip

Declaration
public static readonly string DefaultXmlFileInZip
Field Value
Type Description
System.String

Properties

BackgroundTaskType

Declaration
public Type BackgroundTaskType { get; }
Property Value
Type Description
System.Type

TaskArguments

Declaration
public IDictionary<string, string> TaskArguments { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.String, System.String>

Methods

DoImport(IProgressMessenger, String, Guid, CatalogImportExport, Boolean)

Performs the actual import. This is meant to be run in a separate thread.

Declaration
[Obsolete("Use a constructor with arguments to configure the import task, and execute it with the background task manager. Will remain at least until November 2016.")]
public virtual void DoImport(IProgressMessenger progressMessenger, string filePath, Guid applicationId, CatalogImportExport importer, bool overwriteDuplicates)
Parameters
Type Name Description
IProgressMessenger progressMessenger

The progress messenger that handles progress messages.

System.String filePath

The zip file to import.

System.Guid applicationId

The application ID to import the catalog into.

CatalogImportExport importer

The catalog importer to use.

System.Boolean overwriteDuplicates

The overwrite duplicates setting.

Execute(Action<IBackgroundTaskMessage>, CancellationToken)

Declaration
public bool Execute(Action<IBackgroundTaskMessage> addMessage, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Action<IBackgroundTaskMessage> addMessage
System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Boolean

Implements