Class WMDocumentDTO
Data Transfer Object proxy for a WMDocument.
Inherited Members
Namespace: Quantellia.WMServer.Asset.Document
Assembly: WMServer.dll
Syntax
public class WMDocumentDTO : WMAssetBaseDTO<WMDocument>, IWMAssetBaseDTO, IDbEntity, IWMEntity
Constructors
WMDocumentDTO()
Constructor for WMDocumentDTO
Declaration
public WMDocumentDTO()
WMDocumentDTO(string)
Constructor for WMDocumentDTO specifying ID
Declaration
public WMDocumentDTO(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id |
Properties
DocumentData
A Base-64 encoded string representing the stored document
Declaration
public string DocumentData { get; set; }
Property Value
Type | Description |
---|---|
string |
DocumentEditedText
Stores the text of a document in an editable format. Is not guaranteed to be correct, or exist.
Declaration
public string DocumentEditedText { get; set; }
Property Value
Type | Description |
---|---|
string |
DocumentMIMEType
The type of the stored data.
Declaration
public string DocumentMIMEType { get; set; }
Property Value
Type | Description |
---|---|
string |
DocumentName
The name of the document
Declaration
public string DocumentName { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
Create(WMPrincipal, WMDocumentDTO, WMAppDbContext, string, string)
Create a new WMDocumentDTO from the provided data.
Declaration
public static Task<WMDocument> Create(WMPrincipal principal, WMDocumentDTO a_dto, WMAppDbContext context, string assetOwnerType, string assetOwnerID)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the data reader |
WMDocumentDTO | a_dto | The WMDocumentDTO to be created. |
WMAppDbContext | context | The DbContext |
string | assetOwnerType | TYpe of the WMPrincipal that owns the Asset. |
string | assetOwnerID | ID of the WMPrincipal that owns the Asset. |
Returns
Type | Description |
---|---|
Task<WMDocument> |
Exceptions
Type | Condition |
---|---|
Exception |
Delete(WMPrincipal, string, WMAppDbContext)
Delete the WMDocumentDTO with the corresponding ID or FullPathName
Declaration
public static Task Delete(WMPrincipal principal, string dir, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
string | dir | The Id or FullPathName of the corresponding WMDocumentDTO to be deleted. |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |
FromModel()
Create this instance by reading properties from a WMDocument
Declaration
public override void FromModel()
Overrides
Get(WMPrincipal, string, WMAppDbContext?)
Gets the WMDocumentDTO instance with the specified id. Ensures ownership.
Declaration
public static Task<WMDocumentDTO> Get(WMPrincipal principal, string dir, WMAppDbContext? context = null)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
string | dir | |
WMAppDbContext | context |
Returns
Type | Description |
---|---|
Task<WMDocumentDTO> |
Get(WMPrincipal, string?, int, WMAppDbContext?)
Gets a listing of the specified WMDocumentDTO to the recursion depth specified.
Declaration
public static Task<IEnumerable<WMDocumentDTO>> Get(WMPrincipal principal, string? dir = null, int recursionDepth = 0, WMAppDbContext? context = null)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the Asset Directory being requested. |
string | dir | Specification of the directory under which to retrieve WMDocumentDTO |
int | recursionDepth | Depth to which the directory subtrees under the specified directory should be traversed. |
WMAppDbContext | context | Optional reference to a WMAppDbContext instance. |
Returns
Type | Description |
---|---|
Task<IEnumerable<WMDocumentDTO>> |
GetData(WMPrincipal, string, WMAppDbContext)
Returns an object containing the document's data and edited text. These fields aren't supplied in standard GETs do to their large size, and are instead supplied in a separate endpoint.
Declaration
public static Task<DocumentDataArgs> GetData(WMPrincipal principal, string dir, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
string | dir | |
WMAppDbContext | context |
Returns
Type | Description |
---|---|
Task<DocumentDataArgs> |
GetFromDirectory(WMPrincipal, string, int, WMAppDbContext)
Gets a listing of the specified WMDocumentDTO to the recursion depth specified with the ID/Dir of a WMAssetDirectory as input.
Declaration
public static Task<IEnumerable<WMDocumentDTO>> GetFromDirectory(WMPrincipal principal, string dir = null, int recursionDepth = 0, WMAppDbContext context = null)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the data readers being requested. |
string | dir | Specification of the directory under which to retrieve WMDocumentDTO |
int | recursionDepth | Depth to which the directory subtrees under the specified directory should be traversed. |
WMAppDbContext | context | Optional reference to a WMAppDbContext instance. |
Returns
Type | Description |
---|---|
Task<IEnumerable<WMDocumentDTO>> |
Update(WMPrincipal, string, WMDocumentDTO, WMAppDbContext)
Updates the specified WMDocumentDTO from the provided data.
Declaration
public static Task Update(WMPrincipal principal, string id, WMDocumentDTO a_dto, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
string | id | The id or fullpath of the directory |
WMDocumentDTO | a_dto | The WMDocumentDTO to be updated. |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |
UpdateModel(WMPrincipal, DbContext, object[]?)
Updates and returns the contained WMDocument.
Declaration
public override Task<WMDocument> UpdateModel(WMPrincipal principal, DbContext context, object[]? data = null)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
DbContext | context | |
object[] | data |
Returns
Type | Description |
---|---|
Task<WMDocument> |