Skip to main content

<a id=“SuperOffice_WebApi_Agents_IImportAgent”></a> Interface IImportAgent

Namespace: SuperOffice.WebApi.Agents
Assembly: SuperOffice.WebApi.dll
This agent can be used to import data into the system

Implements

IAgentBase, IDisposable

Methods

<a id=“SuperOffice_WebApi_Agents_IImportAgent_CreateDefaultImportLineAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultImportLineAsync(int, RequestOptions)

Create a new empty import row with x count of values

Parameters

countColumns int The count of values that will can be filled out requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ImportLine&gt; A new ImportLine

<a id=“SuperOffice_WebApi_Agents_IImportAgent_CreateErpImportDataAsync_SuperOffice_WebApi_Data_ArchiveRestrictionInfo___System_String___System_Int32_SuperOffice_WebApi_Data_ErpActorType_SuperOffice_WebApi_RequestOptions_”></a> CreateErpImportDataAsync(ArchiveRestrictionInfo[], string[], int, ErpActorType, RequestOptions)

Populates the ImportLines and columnDefs basedfrom erp system

Parameters

restriction ArchiveRestrictionInfo[] Archive restrictions. columns string[] Columns. connectionId int Connection id for Erp system erpActorType ErpActorType Erp Actor type requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ImportErpData&gt; The ImportLines and ColumnDefs

<a id=“SuperOffice_WebApi_Agents_IImportAgent_PreviewImportAsync_SuperOffice_WebApi_Data_ImportLine___System_String___System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> PreviewImportAsync(ImportLine[], string[], string, string, RequestOptions)

Preview the import

Parameters

importLines ImportLine[] The rows that will be manipulated and according to Import rules columnDefinition string[] An array of the columndefinitions, like firstname, lastname, … culture string The current culture used in the import. Used to match language specific strings context string Optional context for the import. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ImportLine[]&gt; An array of the the rows that can be imported, manipulated according to Import rules given

<a id=“SuperOffice_WebApi_Agents_IImportAgent_SaveImportAsync_SuperOffice_WebApi_Data_ImportLine___System_String___System_Boolean_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> SaveImportAsync(ImportLine[], string[], bool, string, string, RequestOptions)

Do the actual import

Parameters

importLines ImportLine[] The rows that will be imported columnDefinition string[] An array of the columndefinitions, like firstname, lastname, … createSelection bool true if a selection of the imported entities shall be made culture string The current culture used in the import. Used to match language specific strings context string Optional context for the import. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<int[]&gt; First part: the id of the selection created after the import, 0 if no selection is created. Second part: The number of rows actually imported