EDMI: Load Object Store Paths

This commit is contained in:
Jonathan Jenne
2020-04-17 11:57:18 +02:00
parent 88dfb3fab1
commit 14194248ad
12 changed files with 183 additions and 121 deletions

View File

@@ -174,7 +174,9 @@
<xs:sequence>
<xs:element minOccurs="0" name="FileName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="Contents" nillable="true" type="xs:base64Binary" />
<xs:element minOccurs="0" name="AddedWho" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="ObjectStoreId" type="xs:long" />
<xs:element minOccurs="0" name="DocumentType" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="RetentionDays" type="xs:long" />
</xs:sequence>
</xs:complexType>
</xs:element>

View File

@@ -594,10 +594,10 @@ Namespace EDMIServiceReference
Function GetDocumentByContainerIdAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResultOld)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMIService/IEDMIService/ImportFile", ReplyAction:="http://DigitalData.Services.EDMIService/IEDMIService/ImportFileResponse")> _
Function ImportFile(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As EDMIServiceReference.DocumentResult
Function ImportFile(ByVal FileName As String, ByVal Contents() As Byte, ByVal ObjectStoreId As Long, ByVal DocumentType As String, ByVal RetentionDays As Long) As EDMIServiceReference.DocumentResult
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMIService/IEDMIService/ImportFile", ReplyAction:="http://DigitalData.Services.EDMIService/IEDMIService/ImportFileResponse")> _
Function ImportFileAsync(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult)
Function ImportFileAsync(ByVal FileName As String, ByVal Contents() As Byte, ByVal ObjectStoreId As Long, ByVal DocumentType As String, ByVal RetentionDays As Long) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult)
'CODEGEN: Der Nachrichtenvertrag wird generiert, da der Wrappername (DocumentStreamRequest) von Nachricht "DocumentStreamRequest" nicht mit dem Standardwert (GetFileByObjectId) übereinstimmt.
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMIService/IEDMIService/GetFileByObjectId", ReplyAction:="http://DigitalData.Services.EDMIService/IEDMIService/GetFileByObjectIdResponse")> _
@@ -788,12 +788,12 @@ Namespace EDMIServiceReference
Return MyBase.Channel.GetDocumentByContainerIdAsync(ContainerId)
End Function
Public Function ImportFile(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMIService.ImportFile
Return MyBase.Channel.ImportFile(FileName, Contents, AddedWho)
Public Function ImportFile(ByVal FileName As String, ByVal Contents() As Byte, ByVal ObjectStoreId As Long, ByVal DocumentType As String, ByVal RetentionDays As Long) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMIService.ImportFile
Return MyBase.Channel.ImportFile(FileName, Contents, ObjectStoreId, DocumentType, RetentionDays)
End Function
Public Function ImportFileAsync(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMIService.ImportFileAsync
Return MyBase.Channel.ImportFileAsync(FileName, Contents, AddedWho)
Public Function ImportFileAsync(ByVal FileName As String, ByVal Contents() As Byte, ByVal ObjectStoreId As Long, ByVal DocumentType As String, ByVal RetentionDays As Long) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMIService.ImportFileAsync
Return MyBase.Channel.ImportFileAsync(FileName, Contents, ObjectStoreId, DocumentType, RetentionDays)
End Function
<System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)> _

View File

@@ -53,12 +53,12 @@ Public Class Document
''' </summary>
''' <param name="FilePath">The filename to import</param>
''' <returns>A document object</returns>
Public Async Function ImportFileAsync(FilePath As String, Optional [ReadOnly] As Boolean = False, Optional RetentionPeriod As Integer = 0) As Task(Of DocumentResult)
Public Async Function ImportFileAsync(FilePath As String, Optional [ReadOnly] As Boolean = False, Optional RetentionDays As Integer = 0) As Task(Of DocumentResult)
Try
Using oStream As New FileStream(FilePath, FileMode.Open)
Dim oContents As Byte() = {}
Dim oBytesRead = Await oStream.ReadAsync(oContents, 0, oStream.Length)
Dim oResult = Await _channel.ImportFileAsync(FilePath, oContents, Environment.UserName)
Dim oResult = Await _channel.ImportFileAsync(FilePath, oContents, 1, "WichtigesDokument", RetentionDays)
Return oResult
End Using
@@ -77,7 +77,7 @@ Public Class Document
Try
Dim oContents As Byte() = File.ReadAllBytes(FilePath)
Dim oInfo As New FileInfo(FilePath)
Dim oDocObject = _channel.ImportFile(FilePath, oContents, Environment.UserName)
Dim oDocObject = _channel.ImportFile(FilePath, oContents, 1, "WichtigesDokument", 0)
Return oDocObject
Catch ex As Exception
_logger.Error(ex)