ClassInMemoryFlowDocumentRepository
Repository for multi-document orchestration scenarios. Manages multiple flow documents in memory with support for creation and import.
Definition
Namespace:Telerik.Documents.AI.Tools.Flow.Core
Assembly:Telerik.Documents.AI.Tools.Flow.Core.dll
Syntax:
public sealed class InMemoryFlowDocumentRepository : InMemoryDocumentRepositoryBase<RadFlowDocument>, IFlowDocumentRepository, IDocumentRepository<RadFlowDocument>, IDocumentRepository, ISupportPdfExport
Inheritance: objectInMemoryDocumentRepositoryBase<RadFlowDocument>InMemoryFlowDocumentRepository
Implements:
Inherited Members
Constructors
InMemoryFlowDocumentRepository(TimeSpan?)
Initializes a new instance with no documents.
Declaration
public InMemoryFlowDocumentRepository(TimeSpan? importTimeout)
Parameters
importTimeout
Timeout for import operations, or null to allow unlimited time.
Properties
DefaultFormat
Gets the default format for documents created by this repository.
Declaration
protected override DocumentFormat DefaultFormat { get; }
Property Value
Overrides
DefaultNewDocumentBaseName
Gets the default base name for newly created documents.
Declaration
protected override string DefaultNewDocumentBaseName { get; }
Property Value
Overrides
DocumentType
Gets the document type managed by this repository.
Declaration
public override DocumentType DocumentType { get; }
Property Value
Overrides
Implements
Methods
CreateDocument(string, string[])
Creates a document using the specified document identifier and arguments.
Declaration
public string CreateDocument(string documentId, string[] args)
Parameters
documentId
The unique identifier for the document to be created. Cannot be null or empty.
args
string[]
An array of arguments used to populate or configure the document. Cannot be null.
Returns
A string containing the contents of the created document.
Implements
Export(string, DocumentFormat, Stream)
Exports a document to a byte array in the specified format.
Declaration
public void Export(string documentId, DocumentFormat format, Stream destinationStream)
Parameters
documentId
The document identifier to export. If null, exports the default/current document.
format
The target format for export.
destinationStream
The stream to which the document will be exported.
Exceptions
Thrown when the specified format is not supported.
Thrown when the specified document ID does not exist.
Implements
ExportToPdf(string, Stream)
Exports the specified document to PDF format and writes the result to the provided stream.
Declaration
public void ExportToPdf(string documentId, Stream destinationStream)
Parameters
documentId
The unique identifier of the document to export. Cannot be null or empty.
destinationStream
The stream to which the generated PDF will be written. Must be writable and remain open for the duration of the operation.
Implements
Import(Stream, DocumentFormat, string)
Imports a document from a byte array and adds it to the repository.
Declaration
public string Import(Stream data, DocumentFormat format, string documentName = null)
Parameters
data
The document content as a byte array.
format
The format of the document being imported.
documentName
Optional name for the imported document.
Returns
The document ID assigned to the imported document.
Exceptions
Thrown when the repository does not support creation or the format is not supported.
Implements
MergeAndExport(string[], Stream, DocumentFormat)
Merges the specified source documents and exports the combined result to the provided stream in the specified format.
Declaration
public void MergeAndExport(string[] sourceFileIds, Stream stream, DocumentFormat exportFormat)
Parameters
sourceFileIds
string[]
An array of identifiers for the source documents to merge. The order of identifiers determines the order in which documents are merged. Cannot be null or empty.
stream
The stream to which the merged document will be written. Must be writable and remain open for the duration of the operation.
exportFormat
The format in which to export the merged document.
Implements