Show / Hide Table of Contents

Class WMDocumentDTO

Data Transfer Object proxy for a WMDocument.

Inheritance
object
DataTransferObject<WMDocument>
WMAssetBaseDTO<WMDocument>
WMDocumentDTO
Implements
IWMAssetBaseDTO
IWMVersionableAsset
IWMOwnableResource
IWMResource
IDbEntity
IWMEntity
Inherited Members
WMAssetBaseDTO<WMDocument>.ID
WMAssetBaseDTO<WMDocument>.Name
WMAssetBaseDTO<WMDocument>.OwnerID
WMAssetBaseDTO<WMDocument>.OwnerType
WMAssetBaseDTO<WMDocument>.ParentID
WMAssetBaseDTO<WMDocument>.FullPathName
WMAssetBaseDTO<WMDocument>.CreatedBy
WMAssetBaseDTO<WMDocument>.CreatedDate
WMAssetBaseDTO<WMDocument>.LastUpdatedBy
WMAssetBaseDTO<WMDocument>.LastUpdatedDate
WMAssetBaseDTO<WMDocument>.Summary
WMAssetBaseDTO<WMDocument>.Documentation
WMAssetBaseDTO<WMDocument>.DocumentationMIMEType
WMAssetBaseDTO<WMDocument>.Properties
WMAssetBaseDTO<WMDocument>.Version
WMAssetBaseDTO<WMDocument>.VersionName
WMAssetBaseDTO<WMDocument>.Status
WMAssetBaseDTO<WMDocument>.IsDeleted
WMAssetBaseDTO<WMDocument>.PropertiesSerialized
WMAssetBaseDTO<WMDocument>.UpdateDTO<A, B>(WMPrincipal, WMAssetIdentifier, A, DbSet<A>, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMDocument>.CreateDTO<A, B>(WMPrincipal, A, DbSet<A>, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMDocument>.DeleteDTO<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMDocument>.ValidateDirectory<T_Asset>(WMPrincipal, WMAssetBaseDTO<T_Asset>, WMAssetBaseDTO<T_Asset>, WMAppDbContext)
WMAssetBaseDTO<WMDocument>.CloneDTO<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, VersionCreateArgs, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMDocument>.CommitDTO<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, WMAppDbContext)
WMAssetBaseDTO<WMDocument>.DTOVersions<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, WMAppDbContext)
WMAssetBaseDTO<WMDocument>.GetDTO<A>(WMPrincipal, WMAssetIdentifier, IQueryable<A>, WMAppDbContext, Expression<Func<A, A>>)
WMAssetBaseDTO<WMDocument>.GetDTOFromDirectory<A>(WMPrincipal, WMAssetIdentifier, int, DbSet<A>, WMAppDbContext, Expression<Func<A, A>>)
WMAssetBaseDTO<WMDocument>.GetAuthorizedAssetIQueryable<A>(WMPrincipal, IQueryable<A>, WMAppDbContext)
WMAssetBaseDTO<WMDocument>.GetEveryAuthorizedAssetIQueryable(WMPrincipal, WMAppDbContext)
WMAssetBaseDTO<WMDocument>.GetIdentifier(bool)
DataTransferObject<WMDocument>.ModelObject
DataTransferObject<WMDocument>.SetID(string)
DataTransferObject<WMDocument>.CreateModel(WMPrincipal, DbContext, object[])
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Quantellia.WMServer.Asset.Document
Assembly: WMServer.dll
Syntax
[PrimaryKey("ID", new string[] { "Version" })]
public class WMDocumentDTO : WMAssetBaseDTO<WMDocument>, IWMAssetBaseDTO, IWMVersionableAsset, IWMOwnableResource, IWMResource, 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

Clone(WMPrincipal, WMAssetIdentifier, VersionCreateArgs?, WMAppDbContext)

Clones the specified asset with an iterated name "AssetName (1), etc... ", iterates the version number.

Declaration
public static Task<WMDocumentDTO> Clone(WMPrincipal principal, WMAssetIdentifier identifier, VersionCreateArgs? args, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The owner of the directory

WMAssetIdentifier identifier

The identifier of the directory

VersionCreateArgs args

Arguments for creating a version.

WMAppDbContext context

The DbContext

Returns
Type Description
Task<WMDocumentDTO>
Exceptions
Type Condition
Exception

Commit(WMPrincipal, WMAssetIdentifier, WMAppDbContext)

Commits the specified asset as Head.

Declaration
public static Task Commit(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The owner of the directory

WMAssetIdentifier identifier

The identifier of the directory

WMAppDbContext context

The DbContext

Returns
Type Description
Task
Exceptions
Type Condition
Exception

Create(WMPrincipal, WMDocumentDTO, WMAppDbContext)

Create a new WMDocumentDTO from the provided data.

Declaration
public static Task<WMDocument> Create(WMPrincipal principal, WMDocumentDTO a_dto, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The owner of the data reader

WMDocumentDTO a_dto

The WMDocumentDTO to be created.

WMAppDbContext context

The DbContext

Returns
Type Description
Task<WMDocument>
Exceptions
Type Condition
Exception

Delete(WMPrincipal, WMAssetIdentifier, WMAppDbContext)

Delete the WMDocumentDTO with the corresponding ID or FullPathName

Declaration
public static Task Delete(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The owner of the directory

WMAssetIdentifier identifier

The identifier of the asset

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
DataTransferObject<WMDocument>.FromModel()

Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMDocumentDTO, WMDocumentDTO>>)

Gets the WMDocumentDTO instance with the specified id. Ensures ownership.

Declaration
public static Task<WMDocumentDTO> Get(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext? context = null, Expression<Func<WMDocumentDTO, WMDocumentDTO>> propertySelector = null)
Parameters
Type Name Description
WMPrincipal principal
WMAssetIdentifier identifier
WMAppDbContext context
Expression<Func<WMDocumentDTO, WMDocumentDTO>> propertySelector

An optional expression that allows additional mapping of the database DTO object to the instance DTO object. (i.e. excluding DocumentData and DocumentEditedText from WMDocumentDTO, which requires excessive time and bandwidth. An example of this can be found in Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMDocumentDTO, WMDocumentDTO>>))

Returns
Type Description
Task<WMDocumentDTO>

GetData(WMPrincipal, WMAssetIdentifier, 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, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal
WMAssetIdentifier identifier
WMAppDbContext context
Returns
Type Description
Task<DocumentDataArgs>

GetFromDirectory(WMPrincipal, WMAssetIdentifier, int, WMAppDbContext, Expression<Func<WMDocumentDTO, WMDocumentDTO>>)

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, WMAssetIdentifier identifier = null, int recursionDepth = 0, WMAppDbContext context = null, Expression<Func<WMDocumentDTO, WMDocumentDTO>> propertySelector = null)
Parameters
Type Name Description
WMPrincipal principal

The owner of the data readers being requested.

WMAssetIdentifier identifier

The identifier of the asset

int recursionDepth

Depth to which the directory subtrees under the specified directory should be traversed.

WMAppDbContext context

Optional reference to a WMAppDbContext instance.

Expression<Func<WMDocumentDTO, WMDocumentDTO>> propertySelector

An optional expression that allows additional mapping of the database DTO object to the instance DTO object. (i.e. excluding DocumentData and DocumentEditedText from WMDocumentDTO, which requires excessive time and bandwidth. An example of this can be found in Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMDocumentDTO, WMDocumentDTO>>))

Returns
Type Description
Task<IEnumerable<WMDocumentDTO>>

ResourceDefinition()

The resource operation definition for this asset.

Declaration
public static WMResourceOperationsDefinition ResourceDefinition()
Returns
Type Description
WMResourceOperationsDefinition

Update(WMPrincipal, WMAssetIdentifier, WMDocumentDTO, WMAppDbContext)

Updates the specified WMDocumentDTO from the provided data.

Declaration
public static Task Update(WMPrincipal principal, WMAssetIdentifier identifier, WMDocumentDTO a_dto, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The owner of the directory

WMAssetIdentifier identifier

The identifier of the asset

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>
Overrides
WMAssetBaseDTO<WMDocument>.UpdateModel(WMPrincipal, DbContext, object[])

Versions(WMPrincipal, WMAssetIdentifier, WMAppDbContext)

Gets all versions of the specified asset.

Declaration
public static Task<IEnumerable<VersionArgs>> Versions(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The owner of the directory

WMAssetIdentifier identifier

The identifier of the directory

WMAppDbContext context

The DbContext

Returns
Type Description
Task<IEnumerable<VersionArgs>>
Exceptions
Type Condition
Exception

Implements

IWMAssetBaseDTO
IWMVersionableAsset
IWMOwnableResource
IWMResource
IDbEntity
IWMEntity
In this article
Back to top Copyright © 2025 Quantellia LLC.    Version 2.0.0 Revision 399     Last Updated 1/15/2025    DRAFT DOCUMENTATION. SUBJECT TO CHANGE