Show / Hide Table of Contents

Interface IDocumentAgent

Interface for the Document Agent Collection of all services that works with Document data. This is services for the document information, not the physical document themselves. These are handled by the BLOB service methods.

Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Document Agent", "Interface for the Document Agent. Collection of all services that works with Document data. This is services for the document information, not the physical document themselves. These are handled by the BLOB service methods.")]
public interface IDocumentAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;

using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
   using (DocumentAgent agent = new DocumentAgent())
   {
      // call methods on agent here...
   }
}

Methods

CheckinDocumentAsync(int, string[], string, string[], CancellationToken)

Check in a currently checked-out document

Declaration
Task<ReturnInfo> CheckinDocumentAsync(int documentId, string[] allowedReturnTypes, string versionDescription, string[] versionExtraFields, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document Id

string[] allowedReturnTypes

List of return types that the client is prepared to handle, in case the document plugin needs to request additional processing.<br/>Standard allowed return types include 'None', 'Message', 'SoProtocol', 'CustomGui', 'Other'.<br/>An empty array implies that the client places no restriction on possible return action requests.

string versionDescription

Optional textual description related to this version of the document; may be blank, and is discarded if the document/plugin do not support versioning.

string[] versionExtraFields

Optional extra metadata related to the new version (as opposed to metadata related to the document as a whole). Discarded if the document/plugin do not support versioning.

CancellationToken cancellationToken
Returns
Type Description
Task<ReturnInfo>

Return information, including possible requests for further processing ("Return Action"). Return actions are constrained by the allowedReturnTypes parameter.

CheckoutDocumentAsync(int, string[], CancellationToken)

Check out a document for editing by the current user.

Declaration
Task<ReturnInfo> CheckoutDocumentAsync(int documentId, string[] allowedReturnTypes, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document ID

string[] allowedReturnTypes

List of return types that the client is prepared to handle, in case the document plugin needs to request additional processing.<br/>Standard allowed return types include 'None', 'Message', 'SoProtocol', 'CustomGui', 'Other'.<br/>An empty array implies that the client places no restriction on possible return action requests.

CancellationToken cancellationToken
Returns
Type Description
Task<ReturnInfo>

Return information, including possible requests for further processing ("Return Action"). Return actions are constrained by the allowedReturnTypes parameter.

CopyDocumentToCsAttachmentAsync(int, CancellationToken)

Copy a crm document to cs attachemnt. For use in mailings

Declaration
Task<int> CopyDocumentToCsAttachmentAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

The primary key of the document to copy to the cs attachment

CancellationToken cancellationToken
Returns
Type Description
Task<int>

The primary key of the newly added attachment

CreateDefaultDocumentEntityAsync(CancellationToken)

Loading default values into a new DocumentEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<DocumentEntity> CreateDefaultDocumentEntityAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<DocumentEntity>

New DocumentEntity with default values

CreateDefaultDocumentEntityFromSuggestionAsync(int, CancellationToken)

Interface for the Document Agent Collection of all services that works with Document data. This is services for the document information, not the physical document themselves. These are handled by the BLOB service methods.

Declaration
Task<DocumentEntity> CreateDefaultDocumentEntityFromSuggestionAsync(int suggestedDocumentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int suggestedDocumentId
CancellationToken cancellationToken
Returns
Type Description
Task<DocumentEntity>

CreateDefaultDocumentPreviewAsync(CancellationToken)

Loading default values into a new DocumentPreview. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<DocumentPreview> CreateDefaultDocumentPreviewAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<DocumentPreview>

New DocumentPreview with default values

CreateDefaultSuggestedDocumentEntityAsync(CancellationToken)

Loading default values into a new SuggestedDocumentEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<SuggestedDocumentEntity> CreateDefaultSuggestedDocumentEntityAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<SuggestedDocumentEntity>

New SuggestedDocumentEntity with default values

CreateDefaultTemplateVariablesParametersAsync(CancellationToken)

Loading default values into a new TemplateVariablesParameters. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<TemplateVariablesParameters> CreateDefaultTemplateVariablesParametersAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<TemplateVariablesParameters>

New TemplateVariablesParameters with default values

CreateDocumentStreamAsync(DocumentEntity, bool, CancellationToken)

Creates a new Stream that can be used to store the document in the file archive.

Declaration
Task<Stream> CreateDocumentStreamAsync(DocumentEntity documentEntity, bool overwriteExistingData, CancellationToken cancellationToken = default)
Parameters
Type Name Description
DocumentEntity documentEntity

The document the stream belongs to

bool overwriteExistingData

If true, the stream will overwrite existing data stored for this record in the document archive

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

A writeable stream. When written and closed, the stream will become the new document content, subject to locking and versioning constraints.

CreateNewPhysicalDocumentFromTemplateAsync(int, int, int, int, int, int, int, string, CancellationToken)

Create a new document content based on a document template and store it in the document archive. Tags are substituted according to the provided id's. Use GetDocumentStream to obtain the created document. Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned. The client should not assume that any earlier, cached entity information is valid.

Declaration
Task<DocumentEntity> CreateNewPhysicalDocumentFromTemplateAsync(int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId, string uiCulture, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int contactId

Identifier for a contact. Defaults to document's contact if 0

int personId

Identifier for a person. Defaults to document's person if 0

int appointmentId

identifier for an appointment. Defaults to document if 0

int documentId

Identifier for a document. The document defines the template to use.

int saleId

Identifier for sale. Defaults to document's sale if 0.

int selectionId

identifier for selection.

int projectId

identifier for project. Defaults to document's project if 0

string uiCulture

Language variation of template to use when creating document content. (ISO code "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang".

CancellationToken cancellationToken
Returns
Type Description
Task<DocumentEntity>

The updated document entity, after creating the document content from the template.

CreateNewPhysicalDocumentFromTemplateWithCustomTags2Async(int, int, int, int, int, int, int, StringDictionary, string, CancellationToken)

Create a new physical document based on a document template and store it in the document archive. Tags are substituted according to the provided id's. Use GetDocumentStream to obtain the created document content. Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned. The client should not assume that any earlier, cached entity information is valid.

Declaration
Task<DocumentEntity> CreateNewPhysicalDocumentFromTemplateWithCustomTags2Async(int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId, StringDictionary customTags, string uiCulture, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int contactId

Identifier for a contact. Defaults to document's contact if 0

int personId

Identifier for a person. Defaults to document's person if 0

int appointmentId

identifier for an appointment. Defaults to document if 0

int documentId

Identifier for the document

int saleId

Identifier for sale. Defaults to document's sale if 0.

int selectionId

identifier for selection.

int projectId

identifier for project. Defaults to document's project if 0

StringDictionary customTags

Dictionary of custom tag names and values. Each name should have exactly four characters. There should be exactly one value for each tag.

string uiCulture

Language variation of template to use when creating document. (ISO code - "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang".

CancellationToken cancellationToken
Returns
Type Description
Task<DocumentEntity>

The document object with updated info after creating the document

CreateNewPhysicalDocumentFromTemplateWithCustomTagsAsync(int, int, int, int, int, int, int, string[], string[], string, CancellationToken)

Create a new physical document based on a document template and store it in the document archive. Tags are substituted according to the provided id's. Use GetDocumentStream to obtain the created document content. Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned. The client should not assume that any earlier, cached entity information is valid.

Declaration
Task<DocumentEntity> CreateNewPhysicalDocumentFromTemplateWithCustomTagsAsync(int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId, string[] customTags, string[] customValues, string uiCulture, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int contactId

Identifier for a contact. Defaults to document's contact if 0

int personId

Identifier for a person. Defaults to document's person if 0

int appointmentId

identifier for an appointment. Defaults to document if 0

int documentId

Identifier for the document

int saleId

Identifier for sale. Defaults to document's sale if 0.

int selectionId

identifier for selection.

int projectId

identifier for project. Defaults to document's project if 0

string[] customTags

Array of custom tag names. Each name should have exactly four characters. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same.

string[] customValues

Array of values for custom tags. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same.

string uiCulture

Language variation of template to use when creating document. (ISO code - "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang".

CancellationToken cancellationToken
Returns
Type Description
Task<DocumentEntity>

The document object with updated info after creating the document

CreateNewPhysicalMailMergeDocumentFromTemplateAsync(int, string, CancellationToken)

Create a new physical document based on the documents template. Do not replace template tags, as the document is going to be used as a mail merge source. Use GetDocumentStream to obtain the created documents. Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned. The client should not assume that any earlier, cached entity information is valid.

Declaration
Task<DocumentEntity> CreateNewPhysicalMailMergeDocumentFromTemplateAsync(int documentId, string uiCulture, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

Identifier for a document. The template to use is stored in the document entity.

string uiCulture

Language variation of template to use. (ISO code: "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang".

CancellationToken cancellationToken
Returns
Type Description
Task<DocumentEntity>

The document object with updated info after creating the document.

CreateTempFileAsync(string, Stream, CancellationToken)

Create a new temporary file based on the provided stream. Specified filename may be overridden, and actual name is returned.

Declaration
Task<string> CreateTempFileAsync(string filename, Stream dataStream, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string filename

Wanted name of file.

Stream dataStream

Data to be added to the file.

CancellationToken cancellationToken
Returns
Type Description
Task<string>

Actual used filename.

DeleteDocumentEntityAsync(int, CancellationToken)

Deletes the DocumentEntity

Declaration
Task DeleteDocumentEntityAsync(int documentEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentEntityId

The identity of the DocumentEntity

CancellationToken cancellationToken
Returns
Type Description
Task

DeletePhysicalDocumentAsync(int, string[], CancellationToken)

Delete the document contents

Declaration
Task<ReturnInfo> DeletePhysicalDocumentAsync(int documentId, string[] allowedReturnType, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

document primary key

string[] allowedReturnType

List of return types that the client is prepared to handle, in case the document plugin needs to request additional processing. Standard allowed return types include 'None', 'Message', 'SoProtocol', 'CustomGui', 'Other'.<br/>An empty array implies that the client places no restriction on possible return action requests

CancellationToken cancellationToken
Returns
Type Description
Task<ReturnInfo>

Delete status - did removal succeed or not

DeleteTempFileAsync(string, CancellationToken)

Delete a temporary file created with CreateTempFile.

Declaration
Task DeleteTempFileAsync(string filename, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string filename

Name of temporary file to delete.

CancellationToken cancellationToken
Returns
Type Description
Task

ExecuteDocumentCommandAsync(int, string, string[], string, string[], CancellationToken)

Execute a custom command on a particular document, optionally a particular version

Declaration
Task<ReturnInfo> ExecuteDocumentCommandAsync(int documentId, string versionId, string[] allowedReturnTypes, string command, string[] additionalData, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document ID

string versionId

Version ID if applicable/desired; a blank value implies "latest" version and is always acceptable.

string[] allowedReturnTypes

List of return types that the client is prepared to handle, in case the document plugin needs to request additional processing.<br/>Standard allowed return types include 'None', 'Message', 'SoProtocol', 'CustomGui', 'Other'.<br/>An empty array implies that the client places no restriction on possible return action requests.

string command

Command name, generally matching one of those returned from the GetDocumentCommands service. However, it is legal for document plugins to support commands that are not declared through GetDocumentCommands, for instance if a custom GUI needs to access plugin functionality.

string[] additionalData

Any additional data that the document command needs. This parameter can be used as a tunnel between a custom-programmed GUI and its plugin.<br/>It is suggested that the format is name=value, with one such pair per array item.

CancellationToken cancellationToken
Returns
Type Description
Task<ReturnInfo>

Return information, including possible requests for further processing ("Return Action"). Return actions are constrained by the allowedReturnTypes parameter.

GetAppointmentDocumentsAsync(int, CancellationToken)

Get all documents that are linked to the appointment. I.e. the documents that are listed in the appointment dialog.

Declaration
Task<Document[]> GetAppointmentDocumentsAsync(int appointmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId

The appointment id.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of documents

GetCheckoutStateAsync(int, CancellationToken)

Get the current checkout state for a document, relative to the user perforing the call.

Declaration
Task<CheckoutInfo> GetCheckoutStateAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document ID

CancellationToken cancellationToken
Returns
Type Description
Task<CheckoutInfo>

Current checkout state of the document

GetContactDocumentsAsync(int, DateTime, DateTime, int, CancellationToken)

Method that returns a specified number of document appointments within a time range. The document appointments belong to the contact specified.

Declaration
Task<Document[]> GetContactDocumentsAsync(int contactId, DateTime startTime, DateTime endTime, int count, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int contactId

The contact id

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetContactDocumentsByTemplateHeadingAsync(int, DateTime, DateTime, int, int, CancellationToken)

Method that returns a specified number of document appointments within a time range, filtered by the document template heading. The document appointments belong to the contact specified. The heading represents a grouping or filtering of document templates.

Declaration
Task<Document[]> GetContactDocumentsByTemplateHeadingAsync(int contactId, DateTime startTime, DateTime endTime, int count, int templateHeadingId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int contactId

The contact id

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

int templateHeadingId

The document template heading id. The heading represents a grouping or filtering of document templates.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetContactDocumentsByTemplateTypeAsync(int, DateTime, DateTime, int, int, CancellationToken)

Method that returns a specified number of document appointments within a time range, filtered by document template type. The document appointments belong to the contact specified.

Declaration
Task<Document[]> GetContactDocumentsByTemplateTypeAsync(int contactId, DateTime startTime, DateTime endTime, int count, int documentTemplateId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int contactId

The contact id

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

int documentTemplateId

Id of the document template type to filter on.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetContactDocumentsByTemplateTypesAsync(int, DateTime, DateTime, int, int[], CancellationToken)

Method that returns a specified number of document appointments within a time range, filtered by document template types. The document appointments belong to the contact specified.

Declaration
Task<Document[]> GetContactDocumentsByTemplateTypesAsync(int contactId, DateTime startTime, DateTime endTime, int count, int[] documentTemplateIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int contactId

The contact id

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

int[] documentTemplateIds

Ids of the document template types to filter on.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetDocumentAsync(int, CancellationToken)

Gets a Document object.

Declaration
Task<Document> GetDocumentAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

The identifier of the Document object

CancellationToken cancellationToken
Returns
Type Description
Task<Document>

Document

GetDocumentCommandsAsync(int, string[], CancellationToken)

Get a list of custom commands valid for the specific document at this time. This information should not be cached by clients, as it may change between documents and over time.

Declaration
Task<CommandInfo[]> GetDocumentCommandsAsync(int documentId, string[] allowedReturnTypes, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document ID

string[] allowedReturnTypes

List of return types that the client is prepared to handle, in case the document plugin needs to request additional processing.<br/>Standard allowed return types include 'None', 'Message', 'SoProtocol', 'CustomGui', 'Other'.<br/>An empty array implies that the client places no restriction on possible return action requests.<br/>In this context the parameter is used to filter the returned command list, so that commands that require return actions not supported, will not be included by the document plugin.

CancellationToken cancellationToken
Returns
Type Description
Task<CommandInfo[]>

Array of command information items. The command list is constrained by the allowedReturnTypes parameter.

GetDocumentEntityAsync(int, CancellationToken)

Gets a DocumentEntity object.

Declaration
Task<DocumentEntity> GetDocumentEntityAsync(int documentEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentEntityId

The identifier of the DocumentEntity object

CancellationToken cancellationToken
Returns
Type Description
Task<DocumentEntity>

DocumentEntity

GetDocumentLengthAsync(int, string, CancellationToken)

Get length of the document content in bytes.

Declaration
Task<long> GetDocumentLengthAsync(int documentId, string versionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document id

string versionId

Version ID if applicable; a blank value implies "latest" version and is always acceptable.

CancellationToken cancellationToken
Returns
Type Description
Task<long>

The length of the document content in bytes.

GetDocumentListAsync(int[], CancellationToken)

Gets an array of Document objects.

Declaration
Task<Document[]> GetDocumentListAsync(int[] documentIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] documentIds

The identifiers of the Document object

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Document objects

GetDocumentPropertiesAsync(int, string[], CancellationToken)

Get plugin-dependent properties for the document. A number of standard properties that should be supported by all plugins are defined in SuperOffice.CRM.Documents.Constants.Properties.

Declaration
Task<StringDictionary> GetDocumentPropertiesAsync(int documentId, string[] requestedProperties, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document ID

string[] requestedProperties

Array of property names whose values are being requested.

CancellationToken cancellationToken
Returns
Type Description
Task<StringDictionary>

Dictionary of name=value pairs, corresponding to the requested properties.

GetDocumentStreamAsync(int, CancellationToken)

Get the document content as a stream

Declaration
Task<Stream> GetDocumentStreamAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document id

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

The document as a Stream. This stream can be read once and clients should not assume it remains valid after a ReadToEnd or Close.

GetDocumentStreamFromEntityAsync(DocumentEntity, CancellationToken)

Get the document as a stream

Declaration
Task<Stream> GetDocumentStreamFromEntityAsync(DocumentEntity documentEntity, CancellationToken cancellationToken = default)
Parameters
Type Name Description
DocumentEntity documentEntity

The document entity object that refers to the binary data (document)

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

The document as a Stream

GetDocumentUrlAsync(int, string, bool, CancellationToken)

Get a URL referring to the given document content.<para/>This URL may be passed to the ultimate client (text editor of some kind?), which is then responsible for all further operations.<para/>The returned string is a fully qualified URL.<para/>Not all documents and document plugins support this feature.

Declaration
Task<string> GetDocumentUrlAsync(int documentId, string versionId, bool writeableUrl, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document primary key

string versionId

Version ID if applicable/desired; a blank value implies "latest" version and is always acceptable.

bool writeableUrl

If true, then a URL that supports saving is requested. Som edocument plugins may not support read-only URLs, so there is no guarantee that a False value will actually yield a read-only URL, and vice versa.

CancellationToken cancellationToken
Returns
Type Description
Task<string>

Fully resolved URL referring to the document. May be NULL or blank if plugin does not support URLs.

GetDocumentsByTemplateHeadingAsync(int, CancellationToken)

Method that returns document appointments, filtered by the document template heading. The heading represents a grouping or filtering of document templates.

Declaration
Task<Document[]> GetDocumentsByTemplateHeadingAsync(int templateHeadingId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int templateHeadingId

The document template heading id. The heading represents a grouping or filtering of document templates.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetMyPublishedDocumentsAsync(CancellationToken)

Interface for the Document Agent Collection of all services that works with Document data. This is services for the document information, not the physical document themselves. These are handled by the BLOB service methods.

Declaration
Task<Document[]> GetMyPublishedDocumentsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of documents

GetPersonDocumentsAsync(int, CancellationToken)

Get all documents that are linked to the person. I.e. the documents that are listed in the person dialog.

Declaration
Task<Document[]> GetPersonDocumentsAsync(int personId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId

The person id.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of documents

GetPersonDocumentsByDateAsync(int, bool, DateTime, DateTime, int, CancellationToken)

Method that returns a specified number of document appointments within a time range. The document appointments belong to the person specified.

Declaration
Task<Document[]> GetPersonDocumentsByDateAsync(int personId, bool includeProjectDocuments, DateTime startTime, DateTime endTime, int count, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId

The person id of the SuperOffice user (associate).

bool includeProjectDocuments

If true, all appointments that belong to projects where the user is a project member are included as well as the appointments belonging to the person.

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetPersonDocumentsByTemplateHeadingAsync(int, bool, DateTime, DateTime, int, int, CancellationToken)

Method that returns a specified number of document appointments within a time range, filtered by document template heading. The document appointments belong to the person specified. The heading represents a grouping or filtering of document templates.

Declaration
Task<Document[]> GetPersonDocumentsByTemplateHeadingAsync(int personId, bool includeProjectDocuments, DateTime startTime, DateTime endTime, int count, int templateHeadingId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId

The person id of the SuperOffice user (associate).

bool includeProjectDocuments

If true, all appointments that belong to projects where the user is a project member are included as well as the appointments belonging to the person.

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

int templateHeadingId

The document template heading id. The heading represents a grouping or filtering of document templates.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetPersonDocumentsByTemplateTypeAsync(int, bool, DateTime, DateTime, int, int, CancellationToken)

Method that returns a specified number of document appointments within a time range, filtered by document template type. The document appointments belong to the person specified.

Declaration
Task<Document[]> GetPersonDocumentsByTemplateTypeAsync(int personId, bool includeProjectDocuments, DateTime startTime, DateTime endTime, int count, int documentTemplateId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId

The person id of the SuperOffice user (associate).

bool includeProjectDocuments

If true, all appointments that belong to projects where the user is a project member are included as well as the appointments belonging to the person.

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

int documentTemplateId

Id of the document template type to filter on.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetPersonDocumentsByTemplateTypesAsync(int, bool, DateTime, DateTime, int, int[], CancellationToken)

Method that returns a specified number of document appointments within a time range, filtered by document template types. The document appointments belong to the person specified.

Declaration
Task<Document[]> GetPersonDocumentsByTemplateTypesAsync(int personId, bool includeProjectDocuments, DateTime startTime, DateTime endTime, int count, int[] documentTemplateIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId

The person id of the SuperOffice user (associate).

bool includeProjectDocuments

If true, all appointments that belong to projects where the user is a project member are included as well as the appointments belonging to the person.

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

int[] documentTemplateIds

Ids of the document template types to filter on.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetPluginCapabilitiesAsync(int, CancellationToken)

Get a list of plugin-dependent capabilities for a given document archive plugin.<br/>A standard set of properties is defined in SuperOffice.CRM.Documents.Constants.Capabilities.

Declaration
Task<StringDictionary> GetPluginCapabilitiesAsync(int pluginId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int pluginId

Numeric document plugin id, corresponding to the document.archiveProvider id or doctmpl.autoeventid.

CancellationToken cancellationToken
Returns
Type Description
Task<StringDictionary>

Dictionary mapping capability names=values

GetPluginListAsync(CancellationToken)

Get a list of installed document plugins

Declaration
Task<StringDictionary> GetPluginListAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<StringDictionary>

Dictionary mapping plugin id=plugin name

GetPreviewDocumentStreamAsync(int, CancellationToken)

Get the preview version of the document content as a stream. Retrieves a sanitized version if possible

Declaration
Task<DocumentPreview> GetPreviewDocumentStreamAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document id

CancellationToken cancellationToken
Returns
Type Description
Task<DocumentPreview>

Preview version of the document

GetProjectDocumentsAsync(int, DateTime, DateTime, int, CancellationToken)

Method that returns a specified number of document appointments within a time range. The document appointments belong to the project specified.

Declaration
Task<Document[]> GetProjectDocumentsAsync(int projectId, DateTime startTime, DateTime endTime, int count, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int projectId

The project id

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetProjectDocumentsByTemplateHeadingAsync(int, DateTime, DateTime, int, int, CancellationToken)

Method that returns a specified number of document appointments within a time range, filtered by document template heading. The document appointments belong to the project specified. The heading represents a grouping or filtering of document templates.

Declaration
Task<Document[]> GetProjectDocumentsByTemplateHeadingAsync(int projectId, DateTime startTime, DateTime endTime, int count, int templateHeadingId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int projectId

The project id

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

int templateHeadingId

The document template heading id. The heading represents a grouping or filtering of document templates.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetProjectDocumentsByTemplateTypeAsync(int, DateTime, DateTime, int, int, CancellationToken)

Method that returns a specified number of document appointments within a time range, filtered by document template type. The document appointments belong to the project specified.

Declaration
Task<Document[]> GetProjectDocumentsByTemplateTypeAsync(int projectId, DateTime startTime, DateTime endTime, int count, int documentTemplateId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int projectId

The project id

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

int documentTemplateId

Id of the document template type to filter on.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetProjectDocumentsByTemplateTypesAsync(int, DateTime, DateTime, int, int[], CancellationToken)

Method that returns a specified number of document appointments within a time range, filtered by document template types. The document appointments belong to the project specified.

Declaration
Task<Document[]> GetProjectDocumentsByTemplateTypesAsync(int projectId, DateTime startTime, DateTime endTime, int count, int[] documentTemplateIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int projectId

The project id

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

int[] documentTemplateIds

Ids of the document template types to filter on.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetProjectMemberDocumentsAsync(int, DateTime, DateTime, int, CancellationToken)

Method that returns a specified number of document appointments within a time range. The document appointments belong to the project member specified.

Declaration
Task<Document[]> GetProjectMemberDocumentsAsync(int personId, DateTime startTime, DateTime endTime, int count, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId

The project member's person id

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetProjectMemberDocumentsByTemplateHeadingAsync(int, DateTime, DateTime, int, int, CancellationToken)

Method that returns a specified number of document appointments within a time range, filtered by document template heading. The document appointments belong to the project member specified. The heading represents a grouping or filtering of document templates.

Declaration
Task<Document[]> GetProjectMemberDocumentsByTemplateHeadingAsync(int personId, DateTime startTime, DateTime endTime, int count, int templateHeadingId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId

The project member's person id

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

int templateHeadingId

The document template heading id. The heading represents a grouping or filtering of document templates.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetProjectMemberDocumentsByTemplateTypeAsync(int, DateTime, DateTime, int, int, CancellationToken)

Method that returns a specified number of document appointments within a time range, filtered by document template type. The document appointments belong to the project member specified.

Declaration
Task<Document[]> GetProjectMemberDocumentsByTemplateTypeAsync(int personId, DateTime startTime, DateTime endTime, int count, int documentTemplateId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId

The project member's person id

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

int documentTemplateId

Id of the document template type to filter on.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetProjectMemberDocumentsByTemplateTypesAsync(int, DateTime, DateTime, int, int[], CancellationToken)

Method that returns a specified number of document appointments within a time range, filtered by document template types. The document appointments belong to the project member specified.

Declaration
Task<Document[]> GetProjectMemberDocumentsByTemplateTypesAsync(int personId, DateTime startTime, DateTime endTime, int count, int[] documentTemplateIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId

The project member's person id

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

int[] documentTemplateIds

Ids of the document template types to filter on.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetPublishedDocumentAsync(int, CancellationToken)

Get the document if it's published

Declaration
Task<Document> GetPublishedDocumentAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

The document id

CancellationToken cancellationToken
Returns
Type Description
Task<Document>

Document

GetPublishedDocumentsAsync(int[], CancellationToken)

Get the published documents from an array of doucment ids.

Declaration
Task<Document[]> GetPublishedDocumentsAsync(int[] documentIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] documentIds

Array of document ids.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Document

GetPublishedDocumentsByDateAsync(int, bool, DateTime, DateTime, int, CancellationToken)

Method that returns a specified number of published document appointments within a time range. The document appointments is visible to the person specified or the document is in a project the person belongs to.

Declaration
Task<Document[]> GetPublishedDocumentsByDateAsync(int personId, bool includeProjectDocuments, DateTime startTime, DateTime endTime, int count, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId

The personId

bool includeProjectDocuments

Include projectDocuments to select documents in projects person is a member of.

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetPublishedPersonDocumentsByDateAsync(int, bool, DateTime, DateTime, int, CancellationToken)

Method that returns a specified number of published document appointments within a time range. The document appointments belong to the person specified or the document is in a project the person belongs to.

Declaration
Task<Document[]> GetPublishedPersonDocumentsByDateAsync(int personId, bool includeProjectDocuments, DateTime startTime, DateTime endTime, int count, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId

The person id of the SuperOffice user (associate).

bool includeProjectDocuments

If true, all appointments that belong to projects where the user is a project member are included as well as the appointments belonging to the person.

DateTime startTime

The start of the time interval we want appointments from. This will usually be the current time.

DateTime endTime

The end of the time interval.

int count

The maximum number of appointments that should be returned. -1 means no count restrictions.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointments.

GetPublishedProjectDocumentsAsync(int, CancellationToken)

Get published appointment documents by project id.

Declaration
Task<Document[]> GetPublishedProjectDocumentsAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int projectId

The project id

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of Appointment

GetSaleDocumentsAsync(int, CancellationToken)

Get all documents that are linked to the sale. I.e. the documents that are listed in the sale dialog.

Declaration
Task<Document[]> GetSaleDocumentsAsync(int saleId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int saleId

The sale id.

CancellationToken cancellationToken
Returns
Type Description
Task<Document[]>

Array of documents

GetSanitizedDocumentStreamAsync(int, CancellationToken)

Get the document content as a stream. Retrieves a sanitized version if possible

Declaration
Task<Stream> GetSanitizedDocumentStreamAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document id

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

The document as a Stream. This stream can be read once and clients should not assume it remains valid after a ReadToEnd or Close.

GetSanitizedTemplateStreamAsync(string, bool, string, CancellationToken)

Retrieve a stream to a mail template based on its name. Sanitizes the contents if possible.

Declaration
Task<Stream> GetSanitizedTemplateStreamAsync(string templateName, bool allowPersonal, string uiCulture, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string templateName

Filename of mail template to retrieve

bool allowPersonal

If true, try looking up template in personal area before looking in shared document template area

string uiCulture

Language variation of template to use. (ISO code: "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang".

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

Open stream to the mail template

GetSanitizedTemplateStreamFromIdAsync(int, string, CancellationToken)

Retrieve a stream to a document template based on its id. Sanitizes the contents if possible.

Declaration
Task<Stream> GetSanitizedTemplateStreamFromIdAsync(int templateId, string uiCulture, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int templateId

Id of template to retrieve

string uiCulture

Language variation of template to use. (ISO code: "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang".

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

Open stream to the template

GetSuggestedDocumentEntityAsync(int, CancellationToken)

Gets a SuggestedDocumentEntity object.

Declaration
Task<SuggestedDocumentEntity> GetSuggestedDocumentEntityAsync(int suggestedDocumentEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int suggestedDocumentEntityId

The identifier of the SuggestedDocumentEntity object

CancellationToken cancellationToken
Returns
Type Description
Task<SuggestedDocumentEntity>

SuggestedDocumentEntity

GetTempFileAsync(string, CancellationToken)

Get data stream for temporary file created with CreateTempFile.

Declaration
Task<Stream> GetTempFileAsync(string filename, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string filename

Name of temporary file to retrieve.

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

The document as a Stream

GetTemplateStreamAsync(string, bool, string, CancellationToken)

Retrieve a stream to a mail template based on its name

Declaration
Task<Stream> GetTemplateStreamAsync(string templateName, bool allowPersonal, string uiCulture, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string templateName

Filename of mail template to retrieve

bool allowPersonal

If true, try looking up template in personal area before looking in shared document template area

string uiCulture

Language variation of template to use. (ISO code: "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang".

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

Open stream to the mail template

GetTemplateStreamFromIdAsync(int, string, CancellationToken)

Retrieve a stream to a document template based on its id

Declaration
Task<Stream> GetTemplateStreamFromIdAsync(int templateId, string uiCulture, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int templateId

Id of template to retrieve

string uiCulture

Language variation of template to use. (ISO code: "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang".

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

Open stream to the template

GetUnsanitizedPreviewDocumentStreamAsync(int, CancellationToken)

Get the preview version of the document content as a stream. Retrieves an unsanitized version. This has less CPU impact but the caller must sanitize the content before presenting it to the user.

Declaration
Task<DocumentPreview> GetUnsanitizedPreviewDocumentStreamAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document id

CancellationToken cancellationToken
Returns
Type Description
Task<DocumentPreview>

Unsanitized preview version of the document

GetVersionListAsync(int, CancellationToken)

Get a list of existing, committed versions for a given document

Declaration
Task<VersionInfo[]> GetVersionListAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document Id

CancellationToken cancellationToken
Returns
Type Description
Task<VersionInfo[]>

Array of objects describing the existing, committed versions for this document

RenameDocumentAsync(int, string, CancellationToken)

Rename the physical document, i.e., change the file name or equivalent concept in the document archive.

Declaration
Task<string> RenameDocumentAsync(int documentId, string newFilename, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document ID

string newFilename

Suggested new file name. The document archive may amend this to conform to uniqueness constraints, character range limitations etc.

CancellationToken cancellationToken
Returns
Type Description
Task<string>

The actual, new "file" name. This will generally be derived from the suggested name, but may be amended.

SaveDocumentEntityAsync(DocumentEntity, CancellationToken)

Updates the existing DocumentEntity or creates a new DocumentEntity if the id parameter is empty

Declaration
Task<DocumentEntity> SaveDocumentEntityAsync(DocumentEntity documentEntity, CancellationToken cancellationToken = default)
Parameters
Type Name Description
DocumentEntity documentEntity

The DocumentEntity that is saved.

CancellationToken cancellationToken
Returns
Type Description
Task<DocumentEntity>

New or updated DocumentEntity

SaveDocumentTemplateStreamAsync(int, Stream, string, int, CancellationToken)

Saves content in stream to document template file

Declaration
Task<TemplateInfo> SaveDocumentTemplateStreamAsync(int documentTemplateId, Stream content, string languageCode, int pluginId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentTemplateId

Identifier for document template

Stream content

Stream containing content to be saved to document template file

string languageCode

Language variation of template to update. (ISO code: "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang".

int pluginId

Plugin id. Use -1 to use the plugin specified in the template.

CancellationToken cancellationToken
Returns
Type Description
Task<TemplateInfo>

Template info

SavePrivacyReportAsync(string, string, int, CancellationToken)

Generates a Pdf from HTML and makes a document

Declaration
Task<int> SavePrivacyReportAsync(string htmlReport, string title, int personId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string htmlReport

Html to convert

string title

Title of report

int personId

Person id associated with the report

CancellationToken cancellationToken
Returns
Type Description
Task<int>

Document id of saved report

SavePrivacyReportPdfAsync(Stream, string, int, CancellationToken)

Saves a pdf stream, assigns file name, connects to given contact etc.

Declaration
Task<int> SavePrivacyReportPdfAsync(Stream stream, string title, int personId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Stream stream

The pdf document as a stream.

string title

Title of report

int personId

Person id associated with the report

CancellationToken cancellationToken
Returns
Type Description
Task<int>

Document id of saved report

SaveSuggestedDocumentEntityAsync(SuggestedDocumentEntity, CancellationToken)

Updates the existing SuggestedDocumentEntity or creates a new SuggestedDocumentEntity if the id parameter is empty

Declaration
Task<SuggestedDocumentEntity> SaveSuggestedDocumentEntityAsync(SuggestedDocumentEntity suggestedDocumentEntity, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SuggestedDocumentEntity suggestedDocumentEntity

The SuggestedDocumentEntity that is saved.

CancellationToken cancellationToken
Returns
Type Description
Task<SuggestedDocumentEntity>

New or updated SuggestedDocumentEntity

SetDocumentStreamAsync(DocumentEntity, Stream, bool, CancellationToken)

Store a document's contents from its stream. Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned. The client should not assume that any earlier, cached entity information is valid.

Declaration
Task<DocumentEntity> SetDocumentStreamAsync(DocumentEntity documentEntity, Stream stream, bool overwriteExistingData, CancellationToken cancellationToken = default)
Parameters
Type Name Description
DocumentEntity documentEntity

The document entity object that the binary data (document) should be stored to. Its file name may be amended by this call, see the return value

Stream stream

The document as a stream.

bool overwriteExistingData

If true, the stream will overwrite existing data stored for this record in the document archive; this works only for documents that already have a physical document in existence. If false, the call will only work for a document that has no physical document in the archive, and such a physical document will be created.

CancellationToken cancellationToken
Returns
Type Description
Task<DocumentEntity>

Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned. The client should not assume that any earlier, cached entity information is valid.

SetDocumentStreamFromIdAsync(int, Stream, CancellationToken)

Store document content from stream. Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned. The client should not assume that any earlier, cached entity information is valid.

Declaration
Task<DocumentEntity> SetDocumentStreamFromIdAsync(int documentId, Stream stream, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

The document entity object that the binary data (document) should be stored to. Its file name may be amended by this call, see the return value.

Stream stream

The document content as a stream.

CancellationToken cancellationToken
Returns
Type Description
Task<DocumentEntity>

Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned. The client should not assume that any earlier, cached entity information is valid.

SetTemplateStreamAsync(string, bool, Stream, CancellationToken)

Save a mail signature template to the document archive

Declaration
Task SetTemplateStreamAsync(string filename, bool personal, Stream stream, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string filename

Filename of template.

bool personal

If true, save the template in the user area, instead of in shared template area.

Stream stream

The signature template content as a stream.

CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

SubstituteMergeDocumentTemplateVariables2Async(int, int, StringDictionary, CancellationToken)

Parse the source document, and replace any template variable tags with their values, based on the associate Id.<p/> The source document should be of type MergeDraft. This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.

Declaration
Task<Stream> SubstituteMergeDocumentTemplateVariables2Async(int documentId, int associateId, StringDictionary customTags, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

The document id that refers to the binary data (document)

int associateId

The associateId used to subsitute tags in the document.

StringDictionary customTags

Dictionary of custom tag names and values. Each name should have exactly four characters. There should be exactly one value for each tag.

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

The document as a Stream

SubstituteMergeDocumentTemplateVariablesAsync(int, int, string[], string[], CancellationToken)

Parse the source document, and replace any template variable tags with their values, based on the associate Id.<p/> The source document should be of type MergeDraft. This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.

Declaration
Task<Stream> SubstituteMergeDocumentTemplateVariablesAsync(int documentId, int associateId, string[] customTags, string[] customValues, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

The document id that refers to the binary data (document)

int associateId

The associateId used to subsitute tags in the document.

string[] customTags

Array of custom tag names. Each name should have exactly four characters. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same.

string[] customValues

Array of values for custom tags. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same.

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

The document as a Stream

SubstituteMergeDocumentTemplateVariablesEx2Async(int, int, int, int, int, int, int, int, StringDictionary, CancellationToken)

Parse the source document, and replace any template variable tags with their values, based on the provided identifiers.<p/> The source document should be of type MergeDraft. This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.

Declaration
Task<Stream> SubstituteMergeDocumentTemplateVariablesEx2Async(int mergeDocumentId, int contactId, int personId, int projectId, int selectionId, int appointmentId, int documentId, int saleId, StringDictionary customTags, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int mergeDocumentId

The document id that refers to the binary data (document)

int contactId

The contact identifier to use for template substitution

int personId

The person identifier to use for template substitution

int projectId

The project identifier to use for template substitution

int selectionId

The selection identifier to use for template substitution

int appointmentId

The appointment identifier to use for template substitution

int documentId

The document identifier to use for template substitution

int saleId

The sale identifier to use for template substitution

StringDictionary customTags

Dictionary of custom tag names and values. Each name should have exactly four characters. There should be exactly one value for each tag

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

The document as a Stream

SubstituteMergeDocumentTemplateVariablesExAsync(int, int, int, int, int, int, int, int, string[], string[], CancellationToken)

Parse the source document, and replace any template variable tags with their values, based on the provided identifiers.<p/> The source document should be of type MergeDraft. This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.

Declaration
Task<Stream> SubstituteMergeDocumentTemplateVariablesExAsync(int mergeDocumentId, int contactId, int personId, int projectId, int selectionId, int appointmentId, int documentId, int saleId, string[] customTags, string[] customValues, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int mergeDocumentId

The document id that refers to the binary data (document)

int contactId

The contact identifier to use for template substitution

int personId

The person identifier to use for template substitution

int projectId

The project identifier to use for template substitution

int selectionId

The selection identifier to use for template substitution

int appointmentId

The appointment identifier to use for template substitution

int documentId

The document identifier to use for template substitution

int saleId

The sale identifier to use for template substitution

string[] customTags

Array of custom tag names. Each name should have exactly four characters. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same.

string[] customValues

Array of values for custom tags. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same.

CancellationToken cancellationToken
Returns
Type Description
Task<Stream>

The document as a Stream

SubstituteTemplateVariablesAsync(string, GeneratorEncoding, int, int, int, int, int, int, int, string, CancellationToken)

Parse the source string, and replace any template variable tags with their values, based on the ID's given in the other parameters.

Declaration
Task<string> SubstituteTemplateVariablesAsync(string source, GeneratorEncoding generatorEncoding, int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId, string cultureName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string source

Source string to parse for template variables. Such variables must have delimiters corresponding to the standard for the given generator encoding.<p/>Non-text source data (such as the binary content of a .doc file) should be passed in as Base64.

GeneratorEncoding generatorEncoding

Encoding of source string. Non-text formats such as MsWord or Excel should be Base64 encoded in the source string.

int contactId

Identifier for a contact

int personId

Identifier for a person

int appointmentId

Identifier for an appointment

int documentId

Identifier for a document

int saleId

Identifier for a sale

int selectionId

Identifier for a selection

int projectId

Identifier for a project

string cultureName

Name of culture to be used for culture-sensitive data, such as dates or multi-language texts. Use a blank string to accept whatever current culture is set on the server (possibly not a good choice in multinational organizations with a single server).

CancellationToken cancellationToken
Returns
Type Description
Task<string>

Source string with templates substituted, using the same encoding as for the source (binary data will be returned in Base64).

SubstituteTemplateVariablesExAsync(TemplateVariablesParameters, CancellationToken)

Parse the source string, and replace any template variable tags with their values, based on the identities, custom values and entities specified in the other parameters.

Declaration
Task<string> SubstituteTemplateVariablesExAsync(TemplateVariablesParameters parameters, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TemplateVariablesParameters parameters

Name of culture to be used for culture-sensitive data, such as dates or multi-language texts. Use a blank string to accept whatever current culture is set on the server (possibly not a good choice in multinational organizations with a single server).

CancellationToken cancellationToken
Returns
Type Description
Task<string>

Source string with templates substituted, using the same encoding as for the source (binary data will be returned in Base64).

SubstituteTemplateVariablesWithCustomTags2Async(string, GeneratorEncoding, StringDictionary, int, int, int, int, int, int, int, string, CancellationToken)

Parse the source string, and replace any template variable tags with their values, based on the ID's given in the other parameters.<p/>This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.

Declaration
Task<string> SubstituteTemplateVariablesWithCustomTags2Async(string source, GeneratorEncoding generatorEncoding, StringDictionary customTags, int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId, string cultureName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string source

Source string to parse for template variables. Such variables must have delimiters corresponding to the standard for the given generator encoding.<p/>Non-text source data (such as the binary content of a .doc file) should be passed in as Base64.

GeneratorEncoding generatorEncoding

Encoding of source string. Non-text formats such as MsWord or Excel should be Base64 encoded in the source string.

StringDictionary customTags

Dictionary of custom tag names and values. Each name should have exactly four characters. There should be exactly one value for each tag.

int contactId

Identifier for a contact

int personId

Identifier for a person

int appointmentId

Identifier for an appointment

int documentId

Identifier for a document

int saleId

Identifier for a sale

int selectionId

Identifier for a selection

int projectId

Identifier for a project

string cultureName

Name of culture to be used for culture-sensitive data, such as dates or multi-language texts. Use a blank string to accept whatever current culture is set on the server (possibly not a good choice in multinational organizations with a single server).

CancellationToken cancellationToken
Returns
Type Description
Task<string>

Source string with templates substituted, using the same encoding as for the source (binary data will be returned in Base64).

SubstituteTemplateVariablesWithCustomTagsAsync(string, GeneratorEncoding, string[], string[], int, int, int, int, int, int, int, string, CancellationToken)

Parse the source string, and replace any template variable tags with their values, based on the ID's given in the other parameters.<p/>This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.

Declaration
Task<string> SubstituteTemplateVariablesWithCustomTagsAsync(string source, GeneratorEncoding generatorEncoding, string[] customTags, string[] customValues, int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId, string cultureName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string source

Source string to parse for template variables. Such variables must have delimiters corresponding to the standard for the given generator encoding.<p/>Non-text source data (such as the binary content of a .doc file) should be passed in as Base64.

GeneratorEncoding generatorEncoding

Encoding of source string. Non-text formats such as MsWord or Excel should be Base64 encoded in the source string.

string[] customTags

Array of custom tag names. Each name should have exactly four characters. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same.

string[] customValues

Array of values for custom tags. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same.

int contactId

Identifier for a contact

int personId

Identifier for a person

int appointmentId

Identifier for an appointment

int documentId

Identifier for a document

int saleId

Identifier for a sale

int selectionId

Identifier for a selection

int projectId

Identifier for a project

string cultureName

Name of culture to be used for culture-sensitive data, such as dates or multi-language texts. Use a blank string to accept whatever current culture is set on the server (possibly not a good choice in multinational organizations with a single server).

CancellationToken cancellationToken
Returns
Type Description
Task<string>

Source string with templates substituted, using the same encoding as for the source (binary data will be returned in Base64).

UndoCheckoutDocumentAsync(int, string[], CancellationToken)

Undo (abandon) a checkout

Declaration
Task<ReturnInfo> UndoCheckoutDocumentAsync(int documentId, string[] allowedReturnTypes, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

SuperOffice document ID

string[] allowedReturnTypes

List of return types that the client is prepared to handle, in case the document plugin needs to request additional processing.<br/>Standard allowed return types include 'None', 'Message', 'SoProtocol', 'CustomGui', 'Other'.<br/>An empty array implies that the client places no restriction on possible return action requests.

CancellationToken cancellationToken
Returns
Type Description
Task<ReturnInfo>

Return information, including possible requests for further processing ("Return Action"). Return actions are constrained by the allowedReturnTypes parameter.

ValidateDocumentEntityAsync(DocumentEntity, CancellationToken)

Check that entity is ready for saving, return error messages by field.

Declaration
Task<StringDictionary> ValidateDocumentEntityAsync(DocumentEntity documentEntity, CancellationToken cancellationToken = default)
Parameters
Type Name Description
DocumentEntity documentEntity

Entity to be checked for errors.

CancellationToken cancellationToken
Returns
Type Description
Task<StringDictionary>

Error messages tagged by field.

VerifyGetDocumentStreamAsync(int, CancellationToken)

Verify that the requested document stream exists, and that we can access it, without actually getting the stream.

Declaration
Task VerifyGetDocumentStreamAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int documentId

The document id that refers to the binary data (document)

CancellationToken cancellationToken
Returns
Type Description
Task
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top