Class DocumentMigrationAgent
Facade for the DocumentMigration Agent Agent used to support migrating documents between different document-plugins, as single documents or batches.
Online Restricted: This agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for SuperOffice-internal apps.Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
public class DocumentMigrationAgent : AgentBase<IDocumentMigrationAgent>, IDisposable, IDocumentMigrationAgent, IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentMigrationAgent agent = new DocumentMigrationAgent())
{
// call methods on agent here...
}
}
Constructors
DocumentMigrationAgent()
Facade for the DocumentMigration Agent Agent used to support migrating documents between different document-plugins, as single documents or batches.
Online Restricted: This agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for SuperOffice-internal apps.Declaration
public DocumentMigrationAgent()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentMigrationAgent agent = new DocumentMigrationAgent())
{
// call methods on agent here...
}
}
Methods
CreateDefaultDocumentMigrationItemList()
Loading default values into a new DocumentMigrationItemList. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public DocumentMigrationItemList CreateDefaultDocumentMigrationItemList()
Returns
Type | Description |
---|---|
DocumentMigrationItemList | New DocumentMigrationItemList with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentMigrationAgent agent = new DocumentMigrationAgent())
{
// call methods on agent here...
}
}
CreateDefaultDocumentTemplateMigrationList()
Loading default values into a new DocumentTemplateMigrationList. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public DocumentTemplateMigrationList CreateDefaultDocumentTemplateMigrationList()
Returns
Type | Description |
---|---|
DocumentTemplateMigrationList | New DocumentTemplateMigrationList with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentMigrationAgent agent = new DocumentMigrationAgent())
{
// call methods on agent here...
}
}
GetForAllDocuments(Int32, Boolean)
Gets a migration summary for all documents stored in CRM. Warning: Expensive!
Declaration
public DocumentMigrationItemList GetForAllDocuments(int documentPluginId, bool includeEmails)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentPluginId | The ID of the document-plugin to migrate to. |
Boolean | includeEmails | True if documents to migrate should include emails. |
Returns
Type | Description |
---|---|
DocumentMigrationItemList | Never null. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentMigrationAgent agent = new DocumentMigrationAgent())
{
// call methods on agent here...
}
}
GetForDateRange(Int32, DateTime, DateTime, Boolean)
Gets a migration summary for documents in the provided date-rage
Declaration
public DocumentMigrationItemList GetForDateRange(int documentPluginId, DateTime minDate, DateTime maxDate, bool includeEmails)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentPluginId | The ID of the document-plugin to migrate to. |
DateTime | minDate | Inclusive mininmum. |
DateTime | maxDate | Inclusive maximum. |
Boolean | includeEmails | True if documents to migrate should include emails. |
Returns
Type | Description |
---|---|
DocumentMigrationItemList | Never null. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentMigrationAgent agent = new DocumentMigrationAgent())
{
// call methods on agent here...
}
}
GetForSelection(Int32, Int32, Boolean)
Gets a migration summary for documents in the provided selection
Declaration
public DocumentMigrationItemList GetForSelection(int documentPluginId, int selectionId, bool includeEmails)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentPluginId | The ID of the document-plugin to migrate to. |
Int32 | selectionId | ID of the selection used to create the DocumentMigrationSummary instance. |
Boolean | includeEmails | True if documents to migrate should include emails. |
Returns
Type | Description |
---|---|
DocumentMigrationItemList | Never null. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentMigrationAgent agent = new DocumentMigrationAgent())
{
// call methods on agent here...
}
}
GetForTemplates(Int32, Boolean)
Gets a migration summary for all templates stored in CRM.
Declaration
public DocumentTemplateMigrationList GetForTemplates(int targetDocumentPluginId, bool includeEmails)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetDocumentPluginId | The ID of the document-plugin to migrate to. |
Boolean | includeEmails | True if templates to migrate should include emails. |
Returns
Type | Description |
---|---|
DocumentTemplateMigrationList | Never null. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentMigrationAgent agent = new DocumentMigrationAgent())
{
// call methods on agent here...
}
}
GetNumberOfConfidentialDocuments()
Gets the total number of documents that is not visible to everyone
Declaration
public int GetNumberOfConfidentialDocuments()
Returns
Type | Description |
---|---|
Int32 | Number of confidential documents. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentMigrationAgent agent = new DocumentMigrationAgent())
{
// call methods on agent here...
}
}
HasDocumentsToMigrate()
Checks if there are any documents in the current database stored using a non-default document-plugin, and which can be migrated.
Declaration
public bool HasDocumentsToMigrate()
Returns
Type | Description |
---|---|
Boolean | True if there are documents available to migrate. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentMigrationAgent agent = new DocumentMigrationAgent())
{
// call methods on agent here...
}
}
MigrateDocumentToNewDocPlugin(Int32, Int32)
Migrates the document with the provided id to the specified document-plugin.
Declaration
public void MigrateDocumentToNewDocPlugin(int documentId, int documentPluginId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | The ID of the document to migrate. |
Int32 | documentPluginId | The ID of the document-plugin to migrate to. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentMigrationAgent agent = new DocumentMigrationAgent())
{
// call methods on agent here...
}
}
MigrateTemplateToNewDocPlugin(Int32, Int32)
Migrates the template with the provided id to the specified document-plugin.
Declaration
public void MigrateTemplateToNewDocPlugin(int documentTemplateId, int targetDocumentPluginId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentTemplateId | The ID of the document-template to migrate. |
Int32 | targetDocumentPluginId | The ID of the document-plugin to migrate to. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentMigrationAgent agent = new DocumentMigrationAgent())
{
// call methods on agent here...
}
}