Skip to main content

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent”></a> Class DocumentMigrationAgent

Namespace: SuperOffice.WebApi.Agents
Assembly: SuperOffice.WebApi.dll
Agent used to support migrating documents between different document-plugins, as single documents or batches. <p></p> <b>Online Restricted:</b> This agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for SuperOffice-internal apps.

Inheritance

objectAgentBaseDocumentMigrationAgent

Implements

IDocumentMigrationAgent, IAgentBase, IDisposable

Inherited Members

AgentBase._json, AgentBase._binary, AgentBase._config, AgentBase._client, AgentBase._disposeClient, AgentBase.Merge(RequestOptions), AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string), AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.ParseAuthorization(IAuthorization), AgentBase.CancelRequest(), AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.SendRequest(HttpRequestMessage, RequestOptions), AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage), AgentBase.ParseResponse<T&gt;(HttpResponseMessage), AgentBase.Finally(RequestOptions), AgentBase.Dispose(), AgentBase.Configuration, AgentBase.Client, AgentBase.HasRunningRequest, AgentBase.ClientCancellationTokenSource, AgentBase.ProgressListener, AgentBase.UploadProgressListener, object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()

Examples

<pre><code class=“lang-csharp”>using SuperOffice.WebApi; using SuperOffice.WebApi.Agents; var mySession = new WebApiOptions(“http://example.com/super/api”); mySession.Authorization = new AuthorizationUsernamePassword(“user”, “pass”); using (DocumentMigrationAgent agent = new DocumentMigrationAgent(mySession)) { // call methods on agent here… }</code></pre>

Constructors

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent__ctor_System_Net_Http_HttpClient_”></a> DocumentMigrationAgent(HttpClient)

Constructor: Agent used to support migrating documents between different document-plugins, as single documents or batches.

Parameters

httpClient HttpClient Use this HTTP client instead of making own HttpClient instance.

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent__ctor_SuperOffice_WebApi_WebApiOptions_System_Net_Http_HttpClient_”></a> DocumentMigrationAgent(WebApiOptions, HttpClient)

Constructor: Agent used to support migrating documents between different document-plugins, as single documents or batches.

Parameters

options WebApiOptions Base URL and authentication values. httpClient HttpClient Optional: Use this HTTP client instead of making a new one.

Methods

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent_CreateDefaultDocumentMigrationItemListAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultDocumentMigrationItemListAsync(RequestOptions)

Set default values into a new DocumentMigrationItemList. NetServer calculates default values on the entity, which is required when creating/storing a new instance

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<DocumentMigrationItemList&gt; A blank DocumentMigrationItemList

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent_CreateDefaultDocumentTemplateMigrationListAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultDocumentTemplateMigrationListAsync(RequestOptions)

Set default values into a new DocumentTemplateMigrationList. NetServer calculates default values on the entity, which is required when creating/storing a new instance

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<DocumentTemplateMigrationList&gt; A blank DocumentTemplateMigrationList

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent_GetForAllDocumentsAsync_System_Int32_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> GetForAllDocumentsAsync(int, bool, RequestOptions)

Gets a migration summary for all documents stored in CRM. Warning: Expensive! <p></p> <b>Online Restricted:</b> The DocumentMigration agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for SuperOffice-internal apps.

Parameters

documentPluginId int The ID of the document-plugin to migrate to. includeEmails bool True if documents to migrate should include emails. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<DocumentMigrationItemList&gt; Never null.

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent_GetForDateRangeAsync_System_Int32_System_DateTime_System_DateTime_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> GetForDateRangeAsync(int, DateTime, DateTime, bool, RequestOptions)

Gets a migration summary for documents in the provided date-rage <p></p> <b>Online Restricted:</b> The DocumentMigration agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for SuperOffice-internal apps.

Parameters

documentPluginId int The ID of the document-plugin to migrate to. minDate DateTime Inclusive mininmum. maxDate DateTime Inclusive maximum. includeEmails bool True if documents to migrate should include emails. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<DocumentMigrationItemList&gt; Never null.

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent_GetForSelectionAsync_System_Int32_System_Int32_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> GetForSelectionAsync(int, int, bool, RequestOptions)

Gets a migration summary for documents in the provided selection <p></p> <b>Online Restricted:</b> The DocumentMigration agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for SuperOffice-internal apps.

Parameters

documentPluginId int The ID of the document-plugin to migrate to. selectionId int ID of the selection used to create the DocumentMigrationSummary instance. includeEmails bool True if documents to migrate should include emails. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<DocumentMigrationItemList&gt; Never null.

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent_GetForTemplatesAsync_System_Int32_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> GetForTemplatesAsync(int, bool, RequestOptions)

Gets a migration summary for all templates stored in CRM. <p></p> <b>Online Restricted:</b> The DocumentMigration agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for SuperOffice-internal apps.

Parameters

targetDocumentPluginId int The ID of the document-plugin to migrate to. includeEmails bool True if templates to migrate should include emails. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<DocumentTemplateMigrationList&gt; Never null.

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent_GetNumberOfConfidentialDocumentsAsync_SuperOffice_WebApi_RequestOptions_”></a> GetNumberOfConfidentialDocumentsAsync(RequestOptions)

Gets the total number of documents that is not visible to everyone <p></p> <b>Online Restricted:</b> The DocumentMigration agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for SuperOffice-internal apps.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<int&gt; Number of confidential documents.

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent_HasDocumentsToMigrateAsync_SuperOffice_WebApi_RequestOptions_”></a> HasDocumentsToMigrateAsync(RequestOptions)

Checks if there are any documents in the current database stored using a non-default document-plugin, and which can be migrated. <p></p> <b>Online Restricted:</b> The DocumentMigration agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for SuperOffice-internal apps.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; True if there are documents available to migrate.

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent_MigrateDocumentToNewDocPluginAsync_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> MigrateDocumentToNewDocPluginAsync(int, int, RequestOptions)

Migrates the document with the provided id to the specified document-plugin. <p></p> <b>Online Restricted:</b> The DocumentMigration agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for SuperOffice-internal apps.

Parameters

documentId int The ID of the document to migrate. documentPluginId int The ID of the document-plugin to migrate to. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_DocumentMigrationAgent_MigrateTemplateToNewDocPluginAsync_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> MigrateTemplateToNewDocPluginAsync(int, int, RequestOptions)

Migrates the template with the provided id to the specified document-plugin. <p></p> <b>Online Restricted:</b> The DocumentMigration agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for SuperOffice-internal apps.

Parameters

documentTemplateId int The ID of the document-template to migrate. targetDocumentPluginId int The ID of the document-plugin to migrate to. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value