add readonly, retentionperiod for EDMIAPI

This commit is contained in:
Jonathan Jenne
2020-02-04 16:37:19 +01:00
parent 97806fe9cd
commit 338cec6859
5 changed files with 20 additions and 14 deletions

View File

@@ -145,6 +145,8 @@
<xs:sequence>
<xs:element xmlns:q10="http://schemas.datacontract.org/2004/07/System.IO" minOccurs="0" name="FileInfo" nillable="true" type="q10:FileInfo" />
<xs:element minOccurs="0" name="Contents" nillable="true" type="xs:base64Binary" />
<xs:element minOccurs="0" name="ReadOnly" type="xs:boolean" />
<xs:element minOccurs="0" name="RetentionTime" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>

View File

@@ -468,10 +468,10 @@ Namespace IDBServiceReference
Function DeleteFileAsync(ByVal DocObject As IDBServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of Boolean)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.IDBService/IIDBService/ImportFile", ReplyAction:="http://DigitalData.Services.IDBService/IIDBService/ImportFileResponse")> _
Function ImportFile(ByVal FileInfo As System.IO.FileInfo, ByVal Contents() As Byte) As IDBServiceReference.DocumentResult2
Function ImportFile(ByVal FileInfo As System.IO.FileInfo, ByVal Contents() As Byte, ByVal [ReadOnly] As Boolean, ByVal RetentionTime As Integer) As IDBServiceReference.DocumentResult2
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.IDBService/IIDBService/ImportFile", ReplyAction:="http://DigitalData.Services.IDBService/IIDBService/ImportFileResponse")> _
Function ImportFileAsync(ByVal FileInfo As System.IO.FileInfo, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of IDBServiceReference.DocumentResult2)
Function ImportFileAsync(ByVal FileInfo As System.IO.FileInfo, ByVal Contents() As Byte, ByVal [ReadOnly] As Boolean, ByVal RetentionTime As Integer) As System.Threading.Tasks.Task(Of IDBServiceReference.DocumentResult2)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.IDBService/IIDBService/GetDocumentByDocumentId", ReplyAction:="http://DigitalData.Services.IDBService/IIDBService/GetDocumentByDocumentIdRespons"& _
"e")> _
@@ -607,12 +607,12 @@ Namespace IDBServiceReference
Return MyBase.Channel.DeleteFileAsync(DocObject)
End Function
Public Function ImportFile(ByVal FileInfo As System.IO.FileInfo, ByVal Contents() As Byte) As IDBServiceReference.DocumentResult2 Implements IDBServiceReference.IIDBService.ImportFile
Return MyBase.Channel.ImportFile(FileInfo, Contents)
Public Function ImportFile(ByVal FileInfo As System.IO.FileInfo, ByVal Contents() As Byte, ByVal [ReadOnly] As Boolean, ByVal RetentionTime As Integer) As IDBServiceReference.DocumentResult2 Implements IDBServiceReference.IIDBService.ImportFile
Return MyBase.Channel.ImportFile(FileInfo, Contents, [ReadOnly], RetentionTime)
End Function
Public Function ImportFileAsync(ByVal FileInfo As System.IO.FileInfo, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of IDBServiceReference.DocumentResult2) Implements IDBServiceReference.IIDBService.ImportFileAsync
Return MyBase.Channel.ImportFileAsync(FileInfo, Contents)
Public Function ImportFileAsync(ByVal FileInfo As System.IO.FileInfo, ByVal Contents() As Byte, ByVal [ReadOnly] As Boolean, ByVal RetentionTime As Integer) As System.Threading.Tasks.Task(Of IDBServiceReference.DocumentResult2) Implements IDBServiceReference.IIDBService.ImportFileAsync
Return MyBase.Channel.ImportFileAsync(FileInfo, Contents, [ReadOnly], RetentionTime)
End Function
Public Function GetDocumentByDocumentId(ByVal DocumentId As Long) As IDBServiceReference.DocumentResult Implements IDBServiceReference.IIDBService.GetDocumentByDocumentId

View File

@@ -73,14 +73,14 @@ Public Class Document
''' </summary>
''' <param name="FilePath">The filename to import</param>
''' <returns>A document object</returns>
Public Async Function ImportFile2(FilePath As String) As Task(Of DocumentResult2)
Public Async Function ImportFile2(FilePath As String, Optional [ReadOnly] As Boolean = False, Optional RetentionPeriod As Integer = -1) As Task(Of DocumentResult2)
Try
Dim oContents As Byte() = File.ReadAllBytes(FilePath)
Dim oInfo As New FileInfo(FilePath)
Dim oName As String = oInfo.Name
Dim oExtension As String = oInfo.Extension.Substring(1)
Dim oResult = Await _channel.ImportFileAsync(oInfo, oContents)
Dim oResult = Await _channel.ImportFileAsync(oInfo, oContents, [ReadOnly], RetentionPeriod)
Return oResult
Catch ex As Exception
_logger.Error(ex)