From 97fd37de0c0afe2b5a80cb5fa92c6491104f978f Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Fri, 17 Dec 2021 16:41:05 +0100 Subject: [PATCH] EDMI.API: add parameter to load file contents for GetFileObject --- Modules.EDMIAPI/Client.vb | 12 +++++++----- ...ervices.EDMIService.Methods.GetFileObject.xsd | 1 + .../EDMIServiceReference/Reference.vb | 15 +++++++++++++++ Modules.EDMIAPI/Modules/ZooFlow/GetFileObject.vb | 16 ++++++++++++---- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/Modules.EDMIAPI/Client.vb b/Modules.EDMIAPI/Client.vb index 0b008467..b527fd59 100644 --- a/Modules.EDMIAPI/Client.vb +++ b/Modules.EDMIAPI/Client.vb @@ -61,6 +61,7 @@ Public Class Client ''' The IP address to connect to ''' The Port number to use for the connection Public Sub New(LogConfig As LogConfig, IPAddress As String, PortNumber As Integer) + _LogConfig = LogConfig _logger = LogConfig.GetLogger() _FileEx = New Filesystem.File(LogConfig) @@ -247,10 +248,10 @@ Public Class Client End Try End Function - Public Function GetFileObject(pObjectId As Long) As FileObject + Public Function GetFileObject(pObjectId As Long, pLoadFileContents As Boolean) As FileObject Try - Dim oGetFileObject As New Modules.Zooflow.GetFileObject(_LogConfig, Me) - Dim oFileObject = oGetFileObject.Run(pObjectId) + Dim oGetFileObject As New Modules.Zooflow.GetFileObject(_LogConfig, _channel) + Dim oFileObject = oGetFileObject.Run(pObjectId, pLoadFileContents) Return oFileObject Catch ex As Exception _logger.Error(ex) @@ -258,10 +259,10 @@ Public Class Client End Try End Function - Public Async Function GetFileObjectAsync(pObjectId As Long) As Task(Of FileObject) + Public Async Function GetFileObjectAsync(pObjectId As Long, pLoadFileContents As Boolean) As Task(Of FileObject) Try Dim oGetFileObject As New Modules.Zooflow.GetFileObject(_LogConfig, Me) - Dim oFileObject = Await oGetFileObject.RunAsync(pObjectId) + Dim oFileObject = Await oGetFileObject.RunAsync(pObjectId, pLoadFileContents) Return oFileObject Catch ex As Exception _logger.Error(ex) @@ -734,6 +735,7 @@ Public Class Client End Class Public Class DocumentInfo + Public Id As Long Public FullPath As String Public AccessRight As AccessRight End Class diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.Methods.GetFileObject.xsd b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.Methods.GetFileObject.xsd index c0bd799b..5e423071 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.Methods.GetFileObject.xsd +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.Methods.GetFileObject.xsd @@ -22,6 +22,7 @@ + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb index f9f6c6da..732d3ae2 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb @@ -1307,6 +1307,8 @@ Namespace EDMIServiceReference Private _FileContentsField() As Byte + Private _FileExtensionField As String + Private _FileHashField As String Private _FileSizeField As Long @@ -1349,6 +1351,19 @@ Namespace EDMIServiceReference End Set End Property + _ + Public Property _FileExtension() As String + Get + Return Me._FileExtensionField + End Get + Set + If (Object.ReferenceEquals(Me._FileExtensionField, value) <> true) Then + Me._FileExtensionField = value + Me.RaisePropertyChanged("_FileExtension") + End If + End Set + End Property + _ Public Property _FileHash() As String Get diff --git a/Modules.EDMIAPI/Modules/ZooFlow/GetFileObject.vb b/Modules.EDMIAPI/Modules/ZooFlow/GetFileObject.vb index 73f05eb6..8553377a 100644 --- a/Modules.EDMIAPI/Modules/ZooFlow/GetFileObject.vb +++ b/Modules.EDMIAPI/Modules/ZooFlow/GetFileObject.vb @@ -13,9 +13,13 @@ Namespace Modules.Zooflow Channel = pChannel End Sub - Public Async Function RunAsync(pObjectId As Long) As Task(Of FileObject) + Public Async Function RunAsync(pObjectId As Long, pLoadFileContents As Boolean) As Task(Of FileObject) Try - Dim oResult = Await Channel.GetFileObjectAsync(New GetFileObjectRequest With {.ObjectId = pObjectId}) + Dim oParams = New GetFileObjectRequest With { + .ObjectId = pObjectId, + .LoadFileContents = pLoadFileContents + } + Dim oResult = Await Channel.GetFileObjectAsync(oParams) If oResult.OK Then Return oResult.FileObject Else @@ -27,9 +31,13 @@ Namespace Modules.Zooflow End Try End Function - Public Function Run(pObjectId As Long) As FileObject + Public Function Run(pObjectId As Long, pLoadFileContents As Boolean) As FileObject Try - Dim oResult = Channel.GetFileObject(New GetFileObjectRequest With {.ObjectId = pObjectId}) + Dim oParams = New GetFileObjectRequest With { + .ObjectId = pObjectId, + .LoadFileContents = pLoadFileContents + } + Dim oResult = Channel.GetFileObject(oParams) If oResult.OK Then Return oResult.FileObject Else