Table of Contents

Class DataImportActivityConfiguration

Namespace
Dynamicweb.DataIntegration.Integration
Assembly
Dynamicweb.DataIntegration.dll

Static helper for the "Data import" activity — the simplified, wizard-driven import flow in the administration interface, as opposed to full data integration activities managed through Job. It resolves where data import configurations are stored on disk, loads and saves the current user's working import job, and lists the saved configurations a user can start an import from.

public class DataImportActivityConfiguration
Inheritance
DataImportActivityConfiguration
Inherited Members

Remarks

Each user works on a single in-progress import job named DefaultDataImportActivityName, stored in the user's personal folder under PersonalJobsBasePath. Use GetDataImportJob() and SaveDataImportJob(Job) to load and persist it. When the user saves the setup as a named, reusable configuration, SaveNewConfiguration(string, ImportJobStorageArea) writes a copy either to the personal folder or to a shared per-area folder under SharedJobsBasePath, depending on the GetDefaultStorageType() global setting.

Things to be careful of:

Fields

DefaultDataImportActivityName

The reserved name ("TemporaryConfig") of the in-progress data import job each user works on. Jobs with this name are treated as data import jobs by IsDataImportJob(string?).

public static readonly string DefaultDataImportActivityName

Field Value

string

JobsBasePath

The virtual root folder where all data integration job files are stored.

public static readonly string JobsBasePath

Field Value

string

PersonalJobsBasePath

The virtual folder holding personal data import configurations, with one subfolder per user id (see GetJobRelativePath()).

public static readonly string PersonalJobsBasePath

Field Value

string

SharedJobsBasePath

The virtual folder holding shared data import configurations, with one subfolder per ImportJobStorageArea (see GetSharedJobRelativePath(ImportJobStorageArea)).

public static readonly string SharedJobsBasePath

Field Value

string

Properties

DataImportJobFilePath

Gets the physical path of the current user's working data import job file ("TemporaryConfig.xml" in the user's personal folder). The file may not exist yet.

public static string DataImportJobFilePath { get; }

Property Value

string

Methods

AddSharedConfigurationFiles(string, Dictionary<string, string>)

Adds the configuration files found in a directory to an existing dictionary, skipping files the current user lacks read permission for and files whose virtual path is already present in the dictionary. Does nothing when the directory does not exist.

public static void AddSharedConfigurationFiles(string directoryPath, Dictionary<string, string> filesDictionary)

Parameters

directoryPath string

The physical path of the directory to enumerate, typically obtained from GetSharedJobPhysicalPath(ImportJobStorageArea).

filesDictionary Dictionary<string, string>

The dictionary the files are added to, keyed by virtual file path with the configuration name as value.

Exceptions

ArgumentNullException

The dictionary is null.

GetConfigurationFiles()

Lists the current user's personal data import configuration files.

public static Dictionary<string, string> GetConfigurationFiles()

Returns

Dictionary<string, string>

A dictionary keyed by virtual file path (starting with "/Files") with the configuration name (file name without extension) as value. Empty when the user has no saved configurations.

GetConfigurationFiles(ImportJobStorageArea)

Lists the current user's personal data import configuration files together with the shared configurations for the given area that the user has read permission for.

public static Dictionary<string, string> GetConfigurationFiles(ImportJobStorageArea area)

Parameters

area ImportJobStorageArea

The storage area whose shared configurations are included.

Returns

Dictionary<string, string>

A dictionary keyed by virtual file path (starting with "/Files") with the configuration name (file name without extension) as value.

GetDataImportJob()

Gets the current user's working data import job, loading it from DataImportJobFilePath when the file exists and otherwise returning a new empty job named DefaultDataImportActivityName.

public static Job GetDataImportJob()

Returns

Job

The working data import job; never null.

GetDataImportJob(bool)

Gets the current user's working data import job, with an option to refresh the stored destination provider schema. Refreshing is relevant when the provider's schema may have changed since the job was last saved and the latest schema is needed; it only happens when the job file exists and the schema management feature is active.

public static Job GetDataImportJob(bool refreshSchema)

Parameters

refreshSchema bool

If set to true, re-saves the destination provider schema from the provider.

Returns

Job

The working data import job; never null.

GetDefaultStorageType()

Gets the storage type new data import configurations are saved with, read from the "/Globalsettings/Settings/Ecom/Import/DefaultStorageType" global setting. Falls back to Personal when the setting is missing or invalid.

public static ImportJobStorageType GetDefaultStorageType()

Returns

ImportJobStorageType

The configured default storage type.

GetJobPhysicalPath()

Gets the physical path of the current user's personal data import folder, i.e. GetJobRelativePath() mapped to disk. The folder may not exist yet.

public static string GetJobPhysicalPath()

Returns

string

The physical path of the personal data import folder.

GetJobRelativePath()

Gets the virtual path of the current user's personal data import folder: PersonalJobsBasePath with the id of the current user appended. When no user context is available, the personal base path itself is returned.

public static string GetJobRelativePath()

Returns

string

The virtual path of the personal data import folder.

GetKeyColumns(Job)

Gets the distinct source column names of the key column mappings (active or not) in the job's first table mapping — the columns used to match import rows against existing destination rows.

public static IEnumerable<string> GetKeyColumns(Job job)

Parameters

job Job

The job to read key columns from; typically the working data import job.

Returns

IEnumerable<string>

The distinct source column names of the key mappings, or an empty sequence when the job has no mappings or no key columns.

GetSharedJobPhysicalPath(ImportJobStorageArea)

Gets the physical path of the shared data import folder for an area, i.e. GetSharedJobRelativePath(ImportJobStorageArea) mapped to disk. The folder may not exist yet.

public static string GetSharedJobPhysicalPath(ImportJobStorageArea area)

Parameters

area ImportJobStorageArea

The storage area to resolve the folder for.

Returns

string

The physical path of the shared data import folder for the area.

GetSharedJobRelativePath(ImportJobStorageArea)

Gets the virtual path of the shared data import folder for an area: SharedJobsBasePath with the area folder name appended.

public static string GetSharedJobRelativePath(ImportJobStorageArea area)

Parameters

area ImportJobStorageArea

The storage area to resolve the folder for.

Returns

string

The virtual path of the shared data import folder for the area.

SaveDataImportJob(Job)

Saves a job as the current user's working data import job. The job's name is overwritten with DefaultDataImportActivityName and the file is written to the user's personal folder, creating the folder if needed and replacing any existing working configuration.

public static void SaveDataImportJob(Job job)

Parameters

job Job

The job to save as the working data import configuration.

SaveNewConfiguration(string)

Saves the current user's working data import job as a named configuration in the user's personal folder, creating the folder if needed. An existing configuration with the same name is overwritten.

public static void SaveNewConfiguration(string configurationName)

Parameters

configurationName string

The name the configuration is saved under; also used as the file name.

SaveNewConfiguration(string, ImportJobStorageArea)

Saves the current user's working data import job as a named configuration, in the shared folder for the given area or in the user's personal folder depending on the GetDefaultStorageType() global setting. The folder is created if needed and an existing configuration with the same name is overwritten.

public static void SaveNewConfiguration(string configurationName, ImportJobStorageArea area)

Parameters

configurationName string

The name the configuration is saved under; also used as the file name.

area ImportJobStorageArea

The storage area the configuration is saved to when the default storage type is Shared.

To top