EDMI.API: add parameter to load file contents for GetFileObject
This commit is contained in:
parent
1b6a69b24f
commit
97fd37de0c
@ -61,6 +61,7 @@ Public Class Client
|
||||
''' <param name="IPAddress">The IP address to connect to</param>
|
||||
''' <param name="PortNumber">The Port number to use for the connection</param>
|
||||
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
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
<xs:sequence>
|
||||
<xs:element name="_AccessRights" nillable="true" type="xs:string" />
|
||||
<xs:element name="_FileContents" nillable="true" type="xs:base64Binary" />
|
||||
<xs:element name="_FileExtension" nillable="true" type="xs:string" />
|
||||
<xs:element name="_FileHash" nillable="true" type="xs:string" />
|
||||
<xs:element name="_FileSize" type="xs:long" />
|
||||
<xs:element name="_ObjectId" type="xs:long" />
|
||||
|
||||
@ -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
|
||||
|
||||
<System.Runtime.Serialization.DataMemberAttribute(IsRequired:=true)> _
|
||||
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
|
||||
|
||||
<System.Runtime.Serialization.DataMemberAttribute(IsRequired:=true)> _
|
||||
Public Property _FileHash() As String
|
||||
Get
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user