Class DocumentMigrationAgent
Namespace: SuperOffice.WebApi.AgentsAssembly: 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
object ← AgentBase ← DocumentMigrationAgentImplements
IDocumentMigrationAgent, IAgentBase, IDisposableInherited 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>(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
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.
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
CreateDefaultDocumentMigrationItemListAsync(RequestOptions)
Set default values into a new DocumentMigrationItemList. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<DocumentMigrationItemList> A blank DocumentMigrationItemListCreateDefaultDocumentTemplateMigrationListAsync(RequestOptions)
Set default values into a new DocumentTemplateMigrationList. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<DocumentTemplateMigrationList> A blank DocumentTemplateMigrationListGetForAllDocumentsAsync(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> Never null.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> Never null.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> Never null.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> Never null.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> Number of confidential documents.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> True if there are documents available to migrate.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 valueMigrateTemplateToNewDocPluginAsync(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.