Class DocumentController
  Controller for the REST API interface to document management functions.
    Inheritance
    
    
    DocumentController
   
  
  
  Assembly: WMServer.dll
  Syntax
  
    [Route("document")]
[Authorize]
[ApiController]
public class DocumentController : ControllerBase
   
  Constructors
  
  DocumentController(WMAppDbContext)
  Constructor that injects the database context.
Declaration
  
    public DocumentController(WMAppDbContext context)
   
  Parameters
  
  Methods
  
  Clone(string, VersionCreateArgs?)
  Creates a new version of the specified asset.
Declaration
  
    [HttpPost("{id}/createVersion")]
public Task<ActionResult<IEnumerable<OpenDIDocument>>> Clone(string id, VersionCreateArgs? args = null)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | id | The identifier of the asset | 
      
        | VersionCreateArgs | args | Arguments for creating the new version | 
    
  
  Returns
  
  Exceptions
  
  
  Commit(string)
  Commits the specified asset to Head.
Declaration
  
    [HttpPost("{id}/commitVersion")]
public Task<IActionResult> Commit(string id)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | id | The identifier of the asset | 
    
  
  Returns
  
  Exceptions
  
  
  Delete(string)
  Delete an existing instance of a document
Declaration
  
    [HttpDelete("{id}")]
public Task<IActionResult> Delete(string id)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | id |  | 
    
  
  Returns
  
  
  GenerateFromTemplate(string, ADGArgs)
  Generates a new document using a template and a decision model. Creates a new document or overwrites an existing document.
Declaration
  
    [HttpPost("{id}/generate")]
public Task<ActionResult<ADGReturnArgs>> GenerateFromTemplate(string id, ADGArgs args)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | id | The ID of the document to use as a template. | 
      
        | ADGArgs | args | args with additional information needed to generate a document from the template. | 
    
  
  Returns
  
  
  Get()
  Get the list of documents owned by the current user.
Declaration
  
    [HttpGet]
public Task<ActionResult<IEnumerable<OpenDIDocument>>> Get()
   
  Returns
  
  
  Get(string)
  Get the document with the specified ID
Declaration
  
    [HttpGet("{id}")]
public Task<ActionResult<OpenDIDocument>> Get(string id)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | id |  | 
    
  
  Returns
  
  
  GetData(string)
  Retreive the data in a document.
Declaration
  
    [HttpGet("{id}/data")]
public Task<ActionResult<DocumentDataArgs>> GetData(string id)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | id |  | 
    
  
  Returns
  
  
  Post(OpenDIDocument[])
  Create a new instance of a document
Declaration
  
    [HttpPost]
public Task<ActionResult<OpenDIDocument>> Post(OpenDIDocument[] openDI_documents)
   
  Parameters
  
  Returns
  
  
  Put(string, OpenDIDocument)
  Update an existing instance of a document
Declaration
  
    [HttpPut("{id}")]
public Task<IActionResult> Put(string id, OpenDIDocument openDI_m)
   
  Parameters
  
  Returns
  
  
  Versions(string)
  Commits the specified asset to Head.
Declaration
  
    [HttpPost("{id}/versions")]
public Task<ActionResult<IEnumerable<VersionArgs>>> Versions(string id)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | id | The identifier of the asset | 
    
  
  Returns
  
  Exceptions