Zooflow: Implement Single file Search Results, Rework client wrt Address parsing
This commit is contained in:
@@ -15,22 +15,24 @@ Public Class Client
|
||||
' Helper Classes
|
||||
Private ReadOnly LogConfig As LogConfig
|
||||
Private ReadOnly Logger As Logger
|
||||
Private ReadOnly FileEx As Filesystem.File
|
||||
Private ReadOnly ChannelManager As Channel
|
||||
|
||||
' Runtime Variables
|
||||
Private ReadOnly ServerAddress As String
|
||||
Private ReadOnly ServerPort As Integer
|
||||
Private _ServerAddress As ServerAddressStruct
|
||||
Private _ClientConfig As GlobalStateClientConfiguration
|
||||
|
||||
' Channel
|
||||
Private ReadOnly ChannelFactory As ChannelFactory(Of IEDMIServiceChannel)
|
||||
Private Channel As IEDMIServiceChannel
|
||||
Private _CachedTables As New List(Of String)
|
||||
Private _IsOnline As Boolean
|
||||
Private _Channel As IEDMIServiceChannel
|
||||
|
||||
' Update Timer
|
||||
Private WithEvents UpdateTimer As New Timers.Timer
|
||||
|
||||
' Public Variables
|
||||
Public CachedTables As New List(Of String)
|
||||
Public ReadOnly Property CachedTables
|
||||
Get
|
||||
Return _CachedTables
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ClientConfig As GlobalStateClientConfiguration
|
||||
Get
|
||||
@@ -42,24 +44,27 @@ Public Class Client
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IsOnline As Boolean
|
||||
Get
|
||||
Return _IsOnline
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ServerAddress As String
|
||||
Get
|
||||
Return $"{_ServerAddress.Host}:{_ServerAddress.Port}"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Parse a IPAddress:Port String into its parts
|
||||
''' </summary>
|
||||
''' <param name="AddressWithOptionalPort"></param>
|
||||
''' <param name="AddressWithOptionalPort">A Server Address, for example: 192.168.1.50, 192.168.1.50:9000, 192.168.1.50;9000</param>
|
||||
Public Shared Function ParseServiceAddress(AddressWithOptionalPort As String) As Tuple(Of String, Integer)
|
||||
Dim oSplit() As String = AddressWithOptionalPort.Split(":"c)
|
||||
Dim oAppServerAddress As String = oSplit(0)
|
||||
Dim oAppServerPort As Integer
|
||||
Dim oConnection As New Connection()
|
||||
Dim oAddress As ServerAddressStruct = oConnection.ParseServiceAddress(AddressWithOptionalPort)
|
||||
|
||||
If oSplit.Length = 2 Then
|
||||
If Integer.TryParse(oSplit(1), oAppServerPort) Then
|
||||
oAppServerPort = DEFAULT_SERVICE_PORT
|
||||
End If
|
||||
Else
|
||||
oAppServerPort = DEFAULT_SERVICE_PORT
|
||||
End If
|
||||
|
||||
Return New Tuple(Of String, Integer)(oAppServerAddress, oAppServerPort)
|
||||
Return New Tuple(Of String, Integer)(oAddress.Host, oAddress.Port)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
@@ -70,25 +75,18 @@ Public Class Client
|
||||
Public Sub New(pLogConfig As LogConfig, pServiceAdress As String)
|
||||
LogConfig = pLogConfig
|
||||
Logger = pLogConfig.GetLogger()
|
||||
FileEx = New Filesystem.File(pLogConfig)
|
||||
|
||||
Dim oServiceAddress As String = pServiceAdress
|
||||
Dim oAddressArray() As String
|
||||
|
||||
If oServiceAddress.Contains(";") Then
|
||||
oAddressArray = oServiceAddress.Split(";")
|
||||
Else
|
||||
oAddressArray = oServiceAddress.Split(":")
|
||||
End If
|
||||
|
||||
UpdateTimer.Interval = 60 * 1000 * UPDATE_INTERVAL_IN_MINUTES
|
||||
UpdateTimer.Start()
|
||||
|
||||
Try
|
||||
ServerAddress = oAddressArray(0)
|
||||
ServerPort = oAddressArray(1)
|
||||
Logger.Debug("Connecting to Service at: [{0}]", ServerAddress)
|
||||
ChannelFactory = GetChannelFactory(ServerAddress, ServerPort)
|
||||
Dim oConnection = New Connection()
|
||||
_ServerAddress = oConnection.ParseServiceAddress(pServiceAdress)
|
||||
ChannelManager = New Channel(pLogConfig, _ServerAddress)
|
||||
AddHandler ChannelManager.Reconnect, AddressOf Reconnect
|
||||
|
||||
Logger.Debug("Ready for connection to Service at: [{0}:{1}]", _ServerAddress.Host, _ServerAddress.Port)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
@@ -97,60 +95,60 @@ Public Class Client
|
||||
''' <summary>
|
||||
''' Creates a new EDMI Client object
|
||||
''' </summary>
|
||||
''' <param name="LogConfig">LogConfig object</param>
|
||||
''' <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)
|
||||
Me.LogConfig = LogConfig
|
||||
Logger = LogConfig.GetLogger()
|
||||
FileEx = New Filesystem.File(LogConfig)
|
||||
''' <param name="pLogConfig">LogConfig object</param>
|
||||
''' <param name="pIPAddress">The IP address to connect to</param>
|
||||
''' <param name="pPortNumber">The Port number to use for the connection</param>
|
||||
Public Sub New(pLogConfig As LogConfig, pIPAddress As String, pPortNumber As Integer)
|
||||
LogConfig = pLogConfig
|
||||
Logger = pLogConfig.GetLogger()
|
||||
|
||||
UpdateTimer.Interval = 60 * 1000 * UPDATE_INTERVAL_IN_MINUTES
|
||||
UpdateTimer.Start()
|
||||
|
||||
Try
|
||||
Logger.Debug("Connecting to Service at: [{0}]", IPAddress)
|
||||
ChannelFactory = GetChannelFactory(IPAddress, PortNumber)
|
||||
Dim oConnection = New Connection()
|
||||
_ServerAddress = oConnection.ParseServiceAddress(pIPAddress, pPortNumber)
|
||||
ChannelManager = New Channel(pLogConfig, _ServerAddress)
|
||||
AddHandler ChannelManager.Reconnect, AddressOf Reconnect
|
||||
|
||||
Logger.Debug("Ready for connection to Service at: [{0}:{1}]", _ServerAddress.Host, _ServerAddress.Port)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Function GetChannelFactory(pIPAddress As String, pPortNumber As Integer) As ChannelFactory(Of IEDMIServiceChannel)
|
||||
Dim oBinding = API.Channel.GetBinding()
|
||||
Dim oAddress = New EndpointAddress($"net.tcp://{pIPAddress}:{pPortNumber}/DigitalData/Services/Main")
|
||||
Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress)
|
||||
Return oFactory
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Connect to the service
|
||||
''' </summary>
|
||||
''' <returns>True if connection was successful, false otherwise</returns>
|
||||
Public Function Connect() As Boolean
|
||||
Try
|
||||
Channel = GetChannel()
|
||||
_Channel = ChannelManager.GetChannel()
|
||||
|
||||
Logger.Debug("Opening channel..")
|
||||
Channel.Open()
|
||||
_Channel.Open()
|
||||
|
||||
Dim oResponse = Channel.GetClientConfig()
|
||||
Dim oResponse = _Channel.GetClientConfig()
|
||||
If oResponse.OK Then
|
||||
_ClientConfig = oResponse.ClientConfig
|
||||
Else
|
||||
Logger.Warn("Client Configuration could not be loaded: [{0}]", oResponse.ErrorMessage)
|
||||
End If
|
||||
|
||||
Logger.Info($"Connection to AppService {ServerAddress} successfully established!")
|
||||
Logger.Info($"Connection to AppService [{ServerAddress}] successfully established!")
|
||||
|
||||
_IsOnline = True
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
_IsOnline = False
|
||||
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Aborts the channel and creates a new connection
|
||||
''' </summary>
|
||||
@@ -158,9 +156,11 @@ Public Class Client
|
||||
Logger.Warn("Connection faulted. Trying to reconnect..")
|
||||
|
||||
Try
|
||||
Channel.Abort()
|
||||
Channel = GetChannel()
|
||||
Channel.Open()
|
||||
_Channel.Abort()
|
||||
_Channel = ChannelManager.GetChannel()
|
||||
_Channel.Open()
|
||||
|
||||
_IsOnline = True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
@@ -168,14 +168,14 @@ Public Class Client
|
||||
|
||||
Private Async Function UpdateTimer_Elapsed(sender As Object, e As Timers.ElapsedEventArgs) As Task Handles UpdateTimer.Elapsed
|
||||
Try
|
||||
Dim oTables As String() = Await Channel.GetCachedTablesAsync()
|
||||
CachedTables = oTables.
|
||||
Dim oTables As String() = Await _Channel.GetCachedTablesAsync()
|
||||
_CachedTables = oTables.
|
||||
Select(Function(table) table.ToUpper).
|
||||
ToList()
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Update of CachedTable was not successful!")
|
||||
Logger.Error(ex)
|
||||
CachedTables = New List(Of String)
|
||||
_CachedTables = New List(Of String)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
@@ -190,7 +190,7 @@ Public Class Client
|
||||
''' <returns>The ObjectId of the newly generated filesystem object</returns>
|
||||
Public Async Function NewFileAsync(pFilePath As String, pObjectStoreName As String, pObjectKind As String, pIDBDoctypeId As Long, Optional pImportOptions As Options.NewFileOptions = Nothing) As Task(Of Long)
|
||||
Try
|
||||
Dim oNewFile As New Modules.IDB.NewFile(LogConfig, Channel)
|
||||
Dim oNewFile As New Modules.IDB.NewFile(LogConfig, _Channel)
|
||||
Return Await oNewFile.RunAsync(pFilePath, pObjectStoreName, pObjectKind, pIDBDoctypeId, pImportOptions)
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -202,7 +202,7 @@ Public Class Client
|
||||
|
||||
Public Async Function UpdateFileAsync(pObjectId As Long, pFilePath As String, Optional pImportOptions As Options.UpdateFileOptions = Nothing) As Task(Of Long)
|
||||
Try
|
||||
Dim oUpdateFile As New Modules.IDB.UpdateFile(LogConfig, Channel)
|
||||
Dim oUpdateFile As New Modules.IDB.UpdateFile(LogConfig, _Channel)
|
||||
Return Await oUpdateFile.RunAsync(pFilePath, pObjectId, pImportOptions)
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -214,7 +214,7 @@ Public Class Client
|
||||
|
||||
Public Async Function SetObjectStateAsync(pObjectId As Long, pState As String, Optional pOptions As Options.SetObjectStateOptions = Nothing) As Task(Of Boolean)
|
||||
Try
|
||||
Dim oSetObjectState As New Modules.IDB.SetObjectState(LogConfig, Channel)
|
||||
Dim oSetObjectState As New Modules.IDB.SetObjectState(LogConfig, _Channel)
|
||||
Return Await oSetObjectState.RunAsync(pObjectId, pState, pOptions)
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -226,7 +226,7 @@ Public Class Client
|
||||
|
||||
Public Async Function SetAttributeValueAsync(pObjectId As Long, pName As String, pValue As Object, Optional pOptions As Options.SetAttributeValueOptions = Nothing) As Task(Of Boolean)
|
||||
Try
|
||||
Dim oSetAttributeValue As New Modules.IDB.SetAttributeValue(LogConfig, Channel)
|
||||
Dim oSetAttributeValue As New Modules.IDB.SetAttributeValue(LogConfig, _Channel)
|
||||
Return Await oSetAttributeValue.RunAsync(pObjectId, pName, pValue, pOptions)
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -238,7 +238,7 @@ Public Class Client
|
||||
|
||||
Public Async Function CheckOutFile(pObjectId As Long, pComment As String, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long)
|
||||
Try
|
||||
Dim oCheckOutFile As New Modules.IDB.CheckOutFile(LogConfig, Channel)
|
||||
Dim oCheckOutFile As New Modules.IDB.CheckOutFile(LogConfig, _Channel)
|
||||
Return Await oCheckOutFile.RunAsync(pObjectId, pComment, pOptions)
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -250,7 +250,7 @@ Public Class Client
|
||||
|
||||
Public Async Function CheckOutFile(pObjectId As Long, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long)
|
||||
Try
|
||||
Dim oCheckOutFile As New Modules.IDB.CheckOutFile(LogConfig, Channel)
|
||||
Dim oCheckOutFile As New Modules.IDB.CheckOutFile(LogConfig, _Channel)
|
||||
Return Await oCheckOutFile.RunAsync(pObjectId, String.Empty, pOptions)
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -262,7 +262,7 @@ Public Class Client
|
||||
|
||||
Public Async Function CheckInFile(pObjectId As Long, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long)
|
||||
Try
|
||||
Dim oCheckInFile As New Modules.IDB.CheckInFile(LogConfig, Channel)
|
||||
Dim oCheckInFile As New Modules.IDB.CheckInFile(LogConfig, _Channel)
|
||||
Return Await oCheckInFile.RunAsync(pObjectId, pOptions)
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -280,7 +280,7 @@ Public Class Client
|
||||
pIDBDoctypeId As String,
|
||||
Optional pImportOptions As Options.ImportFileOptions = Nothing) As Task(Of ImportFileResponse)
|
||||
Try
|
||||
Dim oImportFile As New Modules.IDB.ImportFile(LogConfig, Channel)
|
||||
Dim oImportFile As New Modules.IDB.ImportFile(LogConfig, _Channel)
|
||||
Return Await oImportFile.RunAsync(pFilePath, pAttributeValues, pObjectStoreName, pObjectKind, pIDBDoctypeId, pImportOptions)
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -290,7 +290,6 @@ Public Class Client
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Async Function Globix_ImportFileAsync(
|
||||
pFilePath As String,
|
||||
pProfileId As Integer,
|
||||
@@ -300,7 +299,7 @@ Public Class Client
|
||||
pIDBDoctypeId As String,
|
||||
Optional pImportOptions As Options.ImportFileOptions = Nothing) As Task(Of Globix_ImportFileResponse)
|
||||
Try
|
||||
Dim oImportFile As New Modules.Globix.ImportFile(LogConfig, Channel)
|
||||
Dim oImportFile As New Modules.Globix.ImportFile(LogConfig, _Channel)
|
||||
Return Await oImportFile.RunAsync(pFilePath, pProfileId, pAttributeValues, pObjectStoreName, pObjectKind, pIDBDoctypeId, pImportOptions)
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -312,7 +311,7 @@ Public Class Client
|
||||
|
||||
Public Function Zooflow_GetFileObject(pObjectId As Long, pLoadFileContents As Boolean) As FileObject
|
||||
Try
|
||||
Dim oGetFileObject As New Modules.Zooflow.GetFileObject(LogConfig, Channel)
|
||||
Dim oGetFileObject As New Modules.Zooflow.GetFileObject(LogConfig, _Channel)
|
||||
Dim oFileObject = oGetFileObject.Run(pObjectId, pLoadFileContents)
|
||||
Return oFileObject
|
||||
Catch ex As Exception
|
||||
@@ -472,7 +471,7 @@ Public Class Client
|
||||
.Language = pOptions.Language
|
||||
}
|
||||
}
|
||||
Dim oResponse = Channel.GetAttributeValue(oArgs)
|
||||
Dim oResponse = _Channel.GetAttributeValue(oArgs)
|
||||
If oResponse.OK = False Then
|
||||
Return New VariableValue()
|
||||
|
||||
@@ -536,7 +535,7 @@ Public Class Client
|
||||
Dim oAttributes As New List(Of ObjectAttribute)
|
||||
|
||||
Try
|
||||
Dim oResult As TableResult = Channel.ReturnDatatable_MSSQL_IDB($"EXEC [PRIDB_GET_VALUE_DT] {pObjectId}, '{pLanguage}'")
|
||||
Dim oResult As TableResult = _Channel.ReturnDatatable_MSSQL_IDB($"EXEC [PRIDB_GET_VALUE_DT] {pObjectId}, '{pLanguage}'")
|
||||
|
||||
If oResult.OK = False Then
|
||||
Throw New ApplicationException(oResult.ErrorMessage)
|
||||
@@ -577,7 +576,7 @@ Public Class Client
|
||||
|
||||
Dim oSql = $"DECLARE @NEW_OBJ_MD_ID BIGINT
|
||||
EXEC PRIDB_NEW_OBJ_DATA({pObjectId}, '{pAttributeName}', '{oUsername}', '{pValue}', '{oLanguage}', 0, @OMD_ID = @NEW_OBJ_MD_ID OUTPUT)"
|
||||
Dim oResult = Channel.ExecuteNonQuery_MSSQL_IDB(oSql)
|
||||
Dim oResult = _Channel.ExecuteNonQuery_MSSQL_IDB(oSql)
|
||||
|
||||
If oResult.OK = False Then
|
||||
Logger.Warn("Error while deleting Term object")
|
||||
@@ -594,7 +593,7 @@ Public Class Client
|
||||
|
||||
Dim oIdIsForeign As Integer = 1
|
||||
Dim oDELSQL = $"EXEC PRIDB_DELETE_TERM_OBJECT_METADATA {pObjectId},'{pAttributeName}','{pTerm2Delete}','{oUsername}','{oLanguage}',{oIdIsForeign}"
|
||||
Dim oResult = Channel.ExecuteNonQuery_MSSQL_IDB(oDELSQL)
|
||||
Dim oResult = _Channel.ExecuteNonQuery_MSSQL_IDB(oDELSQL)
|
||||
|
||||
If oResult.OK = False Then
|
||||
Logger.Warn("Error while deleting Term object")
|
||||
@@ -611,7 +610,7 @@ Public Class Client
|
||||
#Region "GetDatatable"
|
||||
Public Function GetDatatableFromIDB(pSQL As String) As GetDatatableResponse
|
||||
Try
|
||||
Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
Dim oResponse = _Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB
|
||||
})
|
||||
@@ -624,7 +623,7 @@ Public Class Client
|
||||
|
||||
Public Function GetDatatableFromECM(pSQL As String) As GetDatatableResponse
|
||||
Try
|
||||
Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
Dim oResponse = _Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.ECM
|
||||
})
|
||||
@@ -637,7 +636,7 @@ Public Class Client
|
||||
|
||||
Public Function GetDatatableFromConnection(pSQL As String, pConnectionId As Integer) As GetDatatableResponse
|
||||
Try
|
||||
Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
Dim oResponse = _Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.None,
|
||||
.ConnectionId = pConnectionId
|
||||
@@ -651,7 +650,7 @@ Public Class Client
|
||||
|
||||
Public Async Function GetDatatableFromIDBAsync(pSQL As String) As Task(Of GetDatatableResponse)
|
||||
Try
|
||||
Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
Dim oResponse = Await _Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB
|
||||
})
|
||||
@@ -664,7 +663,7 @@ Public Class Client
|
||||
|
||||
Public Async Function GetDatatableFromECMAsync(pSQL As String) As Task(Of GetDatatableResponse)
|
||||
Try
|
||||
Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
Dim oResponse = Await _Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.ECM
|
||||
})
|
||||
@@ -677,7 +676,7 @@ Public Class Client
|
||||
|
||||
Public Async Function GetDatatableFromConnectionAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetDatatableResponse)
|
||||
Try
|
||||
Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
Dim oResponse = Await _Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.None,
|
||||
.ConnectionId = pConnectionId
|
||||
@@ -693,7 +692,7 @@ Public Class Client
|
||||
#Region "GetScalarValue"
|
||||
Public Function GetScalarValueFromIDB(pSQL As String) As GetScalarValueResponse
|
||||
Try
|
||||
Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
Dim oResponse = _Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB
|
||||
})
|
||||
@@ -706,7 +705,7 @@ Public Class Client
|
||||
|
||||
Public Function GetScalarValueFromECM(pSQL As String) As GetScalarValueResponse
|
||||
Try
|
||||
Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
Dim oResponse = _Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.ECM
|
||||
})
|
||||
@@ -719,7 +718,7 @@ Public Class Client
|
||||
|
||||
Public Function GetScalarValueFromConnection(pSQL As String, pConnectionId As Integer) As GetScalarValueResponse
|
||||
Try
|
||||
Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
Dim oResponse = _Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.None,
|
||||
.ConnectionId = pConnectionId
|
||||
@@ -733,7 +732,7 @@ Public Class Client
|
||||
|
||||
Public Async Function GetScalarValueFromIDBAsync(pSQL As String) As Task(Of GetScalarValueResponse)
|
||||
Try
|
||||
Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
Dim oResponse = Await _Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB
|
||||
})
|
||||
@@ -746,7 +745,7 @@ Public Class Client
|
||||
|
||||
Public Async Function GetScalarValueFromECMAsync(pSQL As String) As Task(Of GetScalarValueResponse)
|
||||
Try
|
||||
Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
Dim oResponse = Await _Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.ECM
|
||||
})
|
||||
@@ -759,7 +758,7 @@ Public Class Client
|
||||
|
||||
Public Async Function GetScalarValueFromConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of GetScalarValueResponse)
|
||||
Try
|
||||
Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
Dim oResponse = Await _Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.None,
|
||||
.ConnectionId = pConnectionId
|
||||
@@ -775,7 +774,7 @@ Public Class Client
|
||||
#Region "ExecuteNonQuery"
|
||||
Public Function ExecuteNonQueryFromIDB(pSQL As String) As ExecuteNonQueryResponse
|
||||
Try
|
||||
Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||
Dim oResponse = _Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB
|
||||
})
|
||||
@@ -788,7 +787,7 @@ Public Class Client
|
||||
|
||||
Public Function ExecuteNonQueryFromECM(pSQL As String) As ExecuteNonQueryResponse
|
||||
Try
|
||||
Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||
Dim oResponse = _Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.ECM
|
||||
})
|
||||
@@ -801,7 +800,7 @@ Public Class Client
|
||||
|
||||
Public Function ExecuteNonQueryFromConnection(pSQL As String, pConnectionId As Integer) As ExecuteNonQueryResponse
|
||||
Try
|
||||
Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||
Dim oResponse = _Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.None,
|
||||
.ConnectionId = pConnectionId
|
||||
@@ -815,7 +814,7 @@ Public Class Client
|
||||
|
||||
Public Async Function ExecuteNonQueryFromIDBAsync(pSQL As String) As Task(Of ExecuteNonQueryResponse)
|
||||
Try
|
||||
Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||
Dim oResponse = Await _Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB
|
||||
})
|
||||
@@ -828,7 +827,7 @@ Public Class Client
|
||||
|
||||
Public Async Function ExecuteNonQueryFromECMAsync(pSQL As String) As Task(Of ExecuteNonQueryResponse)
|
||||
Try
|
||||
Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||
Dim oResponse = Await _Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.ECM
|
||||
})
|
||||
@@ -841,7 +840,7 @@ Public Class Client
|
||||
|
||||
Public Async Function ExecuteNonQueryFromConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of ExecuteNonQueryResponse)
|
||||
Try
|
||||
Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||
Dim oResponse = Await _Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.None,
|
||||
.ConnectionId = pConnectionId
|
||||
@@ -857,7 +856,7 @@ Public Class Client
|
||||
|
||||
Public Function GetDatatableByName(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As TableResult
|
||||
Try
|
||||
Dim oResponse = Channel.ReturnDatatableFromCache(DatatableName, FilterExpression, SortByColumn)
|
||||
Dim oResponse = _Channel.ReturnDatatableFromCache(DatatableName, FilterExpression, SortByColumn)
|
||||
Return oResponse
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
@@ -867,7 +866,7 @@ Public Class Client
|
||||
|
||||
Public Async Function GetDatatableByNameAsync(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As Task(Of TableResult)
|
||||
Try
|
||||
Dim oResponse = Await Channel.ReturnDatatableFromCacheAsync(DatatableName, FilterExpression, SortByColumn)
|
||||
Dim oResponse = Await _Channel.ReturnDatatableFromCacheAsync(DatatableName, FilterExpression, SortByColumn)
|
||||
Return oResponse
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
@@ -885,7 +884,7 @@ Public Class Client
|
||||
''' <returns></returns>
|
||||
Public Function GetDocumentInfo(UserId As Long, ObjectId As Long) As DocumentInfo
|
||||
Try
|
||||
Dim oResponse As DocumentInfoResponse = Channel.GetFileInfoByObjectId(New DocumentInfoRequest With {
|
||||
Dim oResponse As DocumentInfoResponse = _Channel.GetFileInfoByObjectId(New DocumentInfoRequest With {
|
||||
.ObjectId = ObjectId,
|
||||
.UserId = UserId
|
||||
})
|
||||
@@ -916,7 +915,7 @@ Public Class Client
|
||||
.ObjectId = ObjectId,
|
||||
.UserId = UserId
|
||||
}
|
||||
Dim oResponse As DocumentInfoResponse = Await Channel.GetFileInfoByObjectIdAsync(oParams)
|
||||
Dim oResponse As DocumentInfoResponse = Await _Channel.GetFileInfoByObjectIdAsync(oParams)
|
||||
|
||||
Return New DocumentInfo With {
|
||||
.AccessRight = oResponse.FileRight,
|
||||
@@ -930,23 +929,7 @@ Public Class Client
|
||||
|
||||
|
||||
#Region "Private Functions"
|
||||
''' <summary>
|
||||
''' Creates a channel and adds a Faulted-Handler
|
||||
''' </summary>
|
||||
''' <returns>A channel object</returns>
|
||||
Private Function GetChannel() As IEDMIServiceChannel
|
||||
Try
|
||||
Logger.Debug("...Creating channel..")
|
||||
Dim oChannel = ChannelFactory.CreateChannel()
|
||||
|
||||
AddHandler oChannel.Faulted, AddressOf Reconnect
|
||||
|
||||
Return oChannel
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function GetUserLanguage(pOverrideLanguage As String) As String
|
||||
Return NotNull(pOverrideLanguage, Threading.Thread.CurrentThread.CurrentUICulture.Name)
|
||||
|
||||
Reference in New Issue
Block a user