From bb9dd66d1f0f707a0d0821aca635927fe4aed9a4 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 9 Apr 2020 16:23:39 +0200 Subject: [PATCH 1/8] EDMI Service: WIP --- EDMI.File/Path.vb | 13 +++-- GUIs.Test.EDMIBenchmark/Form1.vb | 4 +- Modules.Database/Database.vbproj | 1 + Modules.Database/IDatabase.vb | 12 +++++ Modules.Database/MSSQLServer.vb | 52 ++++++++++++++++--- .../DigitalData.Services.EDMIService.wsdl | 1 - .../DigitalData.Services.EDMIService.xsd | 12 ++--- .../EDMIServiceReference/Reference.svcmap | 1 - .../EDMIServiceReference/Reference.vb | 16 +++--- .../EDMIServiceReference/System.IO.xsd | 17 ------ Modules.EDMIAPI/Document.vb | 8 ++- Modules.EDMIAPI/EDMI.API.vbproj | 3 -- Service.EDMIService/App.config | 4 ++ Service.EDMIService/AppConfig.vb | 14 +++++ Service.EDMIService/Database/IDatabase.vb | 3 ++ Service.EDMIService/Database/MSSQL.vb | 20 +++++++ Service.EDMIService/EDMIService.vb | 44 ++++++++++------ Service.EDMIService/EDMIService.vbproj | 2 + Service.EDMIService/IEDMIService.vb | 2 +- Service.EDMIService/WindowsService.vb | 44 ++++++++++------ 20 files changed, 186 insertions(+), 87 deletions(-) create mode 100644 Modules.Database/IDatabase.vb delete mode 100644 Modules.EDMIAPI/Connected Services/EDMIServiceReference/System.IO.xsd create mode 100644 Service.EDMIService/Database/IDatabase.vb create mode 100644 Service.EDMIService/Database/MSSQL.vb diff --git a/EDMI.File/Path.vb b/EDMI.File/Path.vb index e8b904b0..8da28dcb 100644 --- a/EDMI.File/Path.vb +++ b/EDMI.File/Path.vb @@ -17,14 +17,21 @@ Public Class Path End Sub Public Function GetActivePath(DocumentType As String) - Dim oPathParts As New List(Of String) From {_BasePath, PATH_EDMI, PATH_ACTIVE, DocumentType} - oPathParts.AddRange(GetDatePath()) + Dim oPathParts As New List(Of String) From {_BasePath, PATH_EDMI, PATH_ACTIVE} + oPathParts.AddRange(GetRelativePath(DocumentType)) Return IO.Path.Combine(oPathParts.ToArray()) End Function Public Function GetArchivePath(DocumentType As String) - Dim oPathParts As New List(Of String) From {_BasePath, PATH_EDMI, PATH_ARCHIVE, DocumentType} + Dim oPathParts As New List(Of String) From {_BasePath, PATH_EDMI, PATH_ARCHIVE} + oPathParts.AddRange(GetRelativePath(DocumentType)) + + Return IO.Path.Combine(oPathParts.ToArray()) + End Function + + Public Function GetRelativePath(DocumentType As String) + Dim oPathParts As New List(Of String) From {DocumentType} oPathParts.AddRange(GetDatePath()) Return IO.Path.Combine(oPathParts.ToArray()) diff --git a/GUIs.Test.EDMIBenchmark/Form1.vb b/GUIs.Test.EDMIBenchmark/Form1.vb index 1080747a..f6df2a78 100644 --- a/GUIs.Test.EDMIBenchmark/Form1.vb +++ b/GUIs.Test.EDMIBenchmark/Form1.vb @@ -50,9 +50,9 @@ Public Class Form1 Await oStream.ReadAsync(oContents, 0, oFileInfo.Length) End Using - Dim oResult As EDMIServiceReference.DocumentResult2 = Await _Channel.ImportFileAsync(oFileInfo, oContents, False, 0) + Dim oResult As EDMIServiceReference.DocumentResult2 = Await _Channel.ImportFileAsync(oFileInfo.Name, oContents, Environment.UserName) If oResult.OK Then - listboxLog.Items.Add($"File {oFileInfo.Name} imported!") + listboxLog.Items.Add($"File [{oFileInfo.Name}] with Id [{oResult.Document.FileId}] imported!") listboxFileids.Items.Add(oResult.Document.FileId) Else listboxLog.Items.Add($"Import Error: {oResult.ErrorMessage}") diff --git a/Modules.Database/Database.vbproj b/Modules.Database/Database.vbproj index 01a2e276..46730ac9 100644 --- a/Modules.Database/Database.vbproj +++ b/Modules.Database/Database.vbproj @@ -93,6 +93,7 @@ + diff --git a/Modules.Database/IDatabase.vb b/Modules.Database/IDatabase.vb new file mode 100644 index 00000000..b9c5420f --- /dev/null +++ b/Modules.Database/IDatabase.vb @@ -0,0 +1,12 @@ +Imports System.Data.Common + +Public Interface IDatabase + Function GetDatatable(SqlCommand As String, Timeout As Integer) As DataTable + Function GetDatatable(SqlCommand As String) As DataTable + + Function ExecuteNonQuery(SQLCommand As String, Timeout As Integer) As Boolean + Function ExecuteNonQuery(SQLCommand As String) As Boolean + + Function GetScalarValue(SQLQuery As String, Timeout As Integer) As Object + Function GetScalarValue(SQLQuery As String) As Object +End Interface diff --git a/Modules.Database/MSSQLServer.vb b/Modules.Database/MSSQLServer.vb index 6a9a8ae9..d335ce07 100644 --- a/Modules.Database/MSSQLServer.vb +++ b/Modules.Database/MSSQLServer.vb @@ -1,7 +1,10 @@ -Imports System.Data.SqlClient +Imports System.Data.Common +Imports System.Data.SqlClient Imports DigitalData.Modules.Logging Public Class MSSQLServer + Implements IDatabase + Public DBInitialized As Boolean = False Public CurrentSQLConnectionString As String = "" @@ -40,7 +43,7 @@ Public Class MSSQLServer Dim oConnectionStringBuilder As New SqlConnectionStringBuilder() With { .DataSource = Server, .InitialCatalog = Database, - .UserId = UserId, + .UserID = UserId, .Password = Password } @@ -89,7 +92,7 @@ Public Class MSSQLServer ''' ''' sqlcommand for datatable (select XYZ from TableORView) ''' Returns a datatable - Public Function GetDatatable(SqlCommand As String, Timeout As Integer) As DataTable + Public Function GetDatatable(SqlCommand As String, Timeout As Integer) As DataTable Implements IDatabase.GetDatatable Try If TestCanConnect() = False Then Return Nothing @@ -113,7 +116,7 @@ Public Class MSSQLServer End Try End Function - Public Function GetDatatable(SqlCommand As String) As DataTable + Public Function GetDatatable(SqlCommand As String) As DataTable Implements IDatabase.GetDatatable Return GetDatatable(SqlCommand, _Timeout) End Function @@ -128,7 +131,7 @@ Public Class MSSQLServer Return ExecuteNonQuery(executeStatement) End Function - Public Function ExecuteNonQuery(SQLCommand As String, Timeout As Integer) As Boolean + Public Function ExecuteNonQuery(SQLCommand As String, Timeout As Integer) As Boolean Implements IDatabase.ExecuteNonQuery Try If TestCanConnect() = False Then Return Nothing @@ -149,7 +152,7 @@ Public Class MSSQLServer End Try End Function - Public Function ExecuteNonQuery(SQLCommand As String) As Boolean + Public Function ExecuteNonQuery(SQLCommand As String) As Boolean Implements IDatabase.ExecuteNonQuery Return ExecuteNonQuery(SQLCommand, _Timeout) End Function @@ -163,7 +166,7 @@ Public Class MSSQLServer Return GetScalarValue(ScalarSQL) End Function - Public Function GetScalarValue(SQLQuery As String, Timeout As Integer) As Object + Public Function GetScalarValue(SQLQuery As String, Timeout As Integer) As Object Implements IDatabase.GetScalarValue Try If TestCanConnect() = False Then Return Nothing @@ -184,10 +187,43 @@ Public Class MSSQLServer End Try End Function - Public Function GetScalarValue(SQLQuery As String) As Object + Public Function GetScalarValue(SQLQuery As String) As Object Implements IDatabase.GetScalarValue Return GetScalarValue(SQLQuery, _Timeout) End Function + Public Function GetScalarValue(SQLCommand As SqlCommand, OutputParameter As String, Timeout As Integer) As Object + Try + If TestCanConnect() = False Then + Return Nothing + End If + + If SQLCommand.CommandText.Contains(" ") Then + SQLCommand.CommandType = CommandType.Text + Else + SQLCommand.CommandType = CommandType.StoredProcedure + End If + + Using oConnection As SqlConnection = GetSQLConnection() + + SQLCommand.Connection = oConnection + SQLCommand.Parameters(OutputParameter).Direction = ParameterDirection.Output + SQLCommand.CommandTimeout = Timeout + SQLCommand.ExecuteNonQuery() + oConnection.Close() + + Return SQLCommand.Parameters(OutputParameter).Value + End Using + Catch ex As Exception + _Logger.Error(ex) + _Logger.Warn("SQLQuery: " & SQLCommand.CommandText) + Return Nothing + End Try + End Function + + Public Function GetScalarValue(SQLCommand As SqlCommand, OutputParameter As String) As Object + Return GetScalarValue(SQLCommand, OutputParameter, _Timeout) + End Function + ''' ''' Executes the passed sql-statement in asyncmode ''' diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl index 4c17fb89..60584846 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl @@ -8,7 +8,6 @@ - diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd index 51c95fc6..a6517bc3 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd @@ -2,7 +2,6 @@ - @@ -171,24 +170,23 @@ - + - - + - + - + @@ -198,7 +196,7 @@ - + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap index 93c22c81..3b8b7529 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap @@ -30,7 +30,6 @@ - diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb index 08fa4b87..9fea810d 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb @@ -97,9 +97,7 @@ Namespace EDMIServiceReference System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentResult2.DocumentObject)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.IndexResult)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(System.DBNull)), _ - System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentObject)), _ - System.Runtime.Serialization.KnownTypeAttribute(GetType(System.IO.FileInfo)), _ - System.Runtime.Serialization.KnownTypeAttribute(GetType(System.IO.FileSystemInfo))> _ + System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentObject))> _ Partial Public Class ScalarResult Inherits EDMIServiceReference.BaseResult @@ -504,10 +502,10 @@ Namespace EDMIServiceReference Function GetDocumentByContainerIdAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) _ - Function ImportFile(ByVal FileInfo As System.IO.FileInfo, ByVal Contents() As Byte, ByVal [ReadOnly] As Boolean, ByVal RetentionTime As Integer) As EDMIServiceReference.DocumentResult2 + Function ImportFile(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As EDMIServiceReference.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 EDMIServiceReference.DocumentResult2) + Function ImportFileAsync(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult2) _ Function NewFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal LanguageCode As String, ByVal Value As String) As EDMIServiceReference.IndexResult @@ -643,12 +641,12 @@ Namespace EDMIServiceReference Return MyBase.Channel.GetDocumentByContainerIdAsync(ContainerId) End Function - Public Function ImportFile(ByVal FileInfo As System.IO.FileInfo, ByVal Contents() As Byte, ByVal [ReadOnly] As Boolean, ByVal RetentionTime As Integer) As EDMIServiceReference.DocumentResult2 Implements EDMIServiceReference.IEDMIService.ImportFile - Return MyBase.Channel.ImportFile(FileInfo, Contents, [ReadOnly], RetentionTime) + Public Function ImportFile(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As EDMIServiceReference.DocumentResult2 Implements EDMIServiceReference.IEDMIService.ImportFile + Return MyBase.Channel.ImportFile(FileName, Contents, AddedWho) End Function - 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 EDMIServiceReference.DocumentResult2) Implements EDMIServiceReference.IEDMIService.ImportFileAsync - Return MyBase.Channel.ImportFileAsync(FileInfo, Contents, [ReadOnly], RetentionTime) + Public Function ImportFileAsync(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult2) Implements EDMIServiceReference.IEDMIService.ImportFileAsync + Return MyBase.Channel.ImportFileAsync(FileName, Contents, AddedWho) End Function Public Function NewFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal LanguageCode As String, ByVal Value As String) As EDMIServiceReference.IndexResult Implements EDMIServiceReference.IEDMIService.NewFileIndex diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/System.IO.xsd b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/System.IO.xsd deleted file mode 100644 index 68a2b9b7..00000000 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/System.IO.xsd +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Modules.EDMIAPI/Document.vb b/Modules.EDMIAPI/Document.vb index 21121216..1330bf99 100644 --- a/Modules.EDMIAPI/Document.vb +++ b/Modules.EDMIAPI/Document.vb @@ -55,12 +55,10 @@ Public Class Document ''' A document object Public Async Function ImportFileAsync(FilePath As String, Optional [ReadOnly] As Boolean = False, Optional RetentionPeriod As Integer = 0) As Task(Of DocumentResult2) Try - Dim oInfo As New FileInfo(FilePath) - 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(oInfo, oContents, [ReadOnly], RetentionPeriod) + Dim oResult = Await _channel.ImportFileAsync(FilePath, oContents, Environment.UserName) Return oResult End Using @@ -75,11 +73,11 @@ Public Class Document ''' ''' The filename to import ''' A document object - Public Function ImportFile(FilePath As String, Optional [ReadOnly] As Boolean = False, Optional RetentionPeriod As Integer = 0) As DocumentResult2 + Public Function ImportFile(FilePath As String) As DocumentResult2 Try Dim oContents As Byte() = File.ReadAllBytes(FilePath) Dim oInfo As New FileInfo(FilePath) - Dim oDocObject = _channel.ImportFile(oInfo, oContents, [ReadOnly], RetentionPeriod) + Dim oDocObject = _channel.ImportFile(FilePath, oContents, Environment.UserName) Return oDocObject Catch ex As Exception _logger.Error(ex) diff --git a/Modules.EDMIAPI/EDMI.API.vbproj b/Modules.EDMIAPI/EDMI.API.vbproj index c390ee95..0f340797 100644 --- a/Modules.EDMIAPI/EDMI.API.vbproj +++ b/Modules.EDMIAPI/EDMI.API.vbproj @@ -141,9 +141,6 @@ Designer - - Designer - Designer diff --git a/Service.EDMIService/App.config b/Service.EDMIService/App.config index 23db2755..85cbdc9f 100644 --- a/Service.EDMIService/App.config +++ b/Service.EDMIService/App.config @@ -7,6 +7,10 @@ + + + + diff --git a/Service.EDMIService/AppConfig.vb b/Service.EDMIService/AppConfig.vb index 3172d5d1..e1212b52 100644 --- a/Service.EDMIService/AppConfig.vb +++ b/Service.EDMIService/AppConfig.vb @@ -8,6 +8,7 @@ Public Class AppConfig Public Shared ContainerPath As String Public Shared ContainerPassword As String Public Shared DatastorePath As String + Public Shared MSSQLConnectionString As String Public Shared Sub Load() With ConfigurationManager.AppSettings @@ -15,9 +16,22 @@ Public Class AppConfig FirebirdDatabase = .Item("FIREBIRD_DATABASE_NAME") FirebirdUser = .Item("FIREBIRD_DATABASE_USER") FirebirdPassword = .Item("FIREBIRD_DATABASE_PASS") + + MSSQLConnectionString = .Item("MSSQL_CONNECTION_STRING") + ContainerPath = .Item("CONTAINER_PATH") ContainerPassword = .Item("CONTAINER_PASSWORD") + DatastorePath = .Item("DATASTORE_PATH") End With End Sub + + Public Shared Function IsFirebirdConfigured() As Boolean + Dim oProps As New List(Of String) From {FirebirdDataSource, FirebirdDatabase, FirebirdUser, FirebirdPassword} + Return Not oProps.Any(Function(Prop) String.IsNullOrWhiteSpace(Prop)) + End Function + + Public Shared Function IsMSSQLConfigured() As Boolean + Return Not String.IsNullOrWhiteSpace(MSSQLConnectionString) + End Function End Class diff --git a/Service.EDMIService/Database/IDatabase.vb b/Service.EDMIService/Database/IDatabase.vb new file mode 100644 index 00000000..0b370d22 --- /dev/null +++ b/Service.EDMIService/Database/IDatabase.vb @@ -0,0 +1,3 @@ +Public Interface IDatabase + Function NewDocument(RelativePath As String, AddedWho As String, ObjectStoreId As Int64, ReferenceId As Int64) As Int64 +End Interface diff --git a/Service.EDMIService/Database/MSSQL.vb b/Service.EDMIService/Database/MSSQL.vb new file mode 100644 index 00000000..3d4153b1 --- /dev/null +++ b/Service.EDMIService/Database/MSSQL.vb @@ -0,0 +1,20 @@ +Imports DigitalData.Modules.Database +Imports DigitalData.Modules.Logging + +Public Class MSSQL + Implements IDatabase + + Private ReadOnly LogConfig As LogConfig + Private ReadOnly Database As MSSQLServer + Private ReadOnly Logger As Logger + + Public Sub New(LogConfig As LogConfig, Database As MSSQLServer) + Me.LogConfig = LogConfig + Me.Database = Database + Me.Logger = LogConfig.GetLogger() + End Sub + + Public Function NewDocument(RelativePath As String, AddedWho As String, ObjectStoreId As Long, ReferenceId As Long) As Long Implements IDatabase.NewDocument + + End Function +End Class diff --git a/Service.EDMIService/EDMIService.vb b/Service.EDMIService/EDMIService.vb index d5c9979e..2a36814f 100644 --- a/Service.EDMIService/EDMIService.vb +++ b/Service.EDMIService/EDMIService.vb @@ -6,13 +6,15 @@ Imports DigitalData.Modules Imports System.IO Imports System.ServiceModel.Description Imports System.ServiceModel.Channels +Imports System.Data.SqlClient Public Class EDMIService Implements IEDMIService Public Shared LogConfig As LogConfig - Public Shared Database As Firebird + Public Shared MSSQL As MSSQLServer + Public Shared Firebird As Firebird Public Shared AppConfig As AppConfig Public Shared Filesystem As Filesystem.File Public Shared EDMIPath As EDMI.File.Path @@ -54,7 +56,7 @@ Public Class EDMIService #End Region #Region "Request" Public Sub CreateRequest(Name As String, Optional Debug As Boolean = False) - _request = New Request(Name, _username, Database, Debug) + _request = New Request(Name, _username, Firebird, Debug) _debug = Debug _logger.Info("Creating request {0}/{1}", _request.Name, _request.RequestId) @@ -91,7 +93,7 @@ Public Class EDMIService _logger.Info($"ReturnDatatable, SQL: {SQL}") _request.LogDebug($"ReturnDatatable, SQL: {SQL}") - Dim oResult As DataTable = Database.GetDatatableWithConnection(SQL, _request.Connection) + Dim oResult As DataTable = Firebird.GetDatatableWithConnection(SQL, _request.Connection) Return New TableResult(oResult) Catch ex As Exception _logger.Error(ex) @@ -107,7 +109,7 @@ Public Class EDMIService _logger.Info($"ReturnScalar, SQL: {SQL}") _request.LogDebug($"ReturnScalar, SQL: {SQL}") - Dim oResult As Object = Database.GetScalarValueWithConnection(SQL, _request.Connection) + Dim oResult As Object = Firebird.GetScalarValueWithConnection(SQL, _request.Connection) Return New ScalarResult(oResult) Catch ex As Exception _logger.Error(ex) @@ -123,7 +125,7 @@ Public Class EDMIService _logger.Info($"ExecuteNonQuery, SQL: {SQL}") _request.LogDebug($"ExecuteNonQuery, SQL: {SQL}") - Dim oResult As Boolean = Database.ExecuteNonQueryWithConnection(SQL, _request.Connection) + Dim oResult As Boolean = Firebird.ExecuteNonQueryWithConnection(SQL, _request.Connection) Return New NonQueryResult() Catch ex As Exception _logger.Error(ex) @@ -152,7 +154,7 @@ Public Class EDMIService _logger.Debug("File extension of file {0} is {1}", FileName, oExtension) Dim oSQL = $"SELECT FNICM_NEW_DOC('010', '{oContainerId}', '{GetContainerName(oContainerId)}', '{FileName}', '{oExtension}', '{_username}') FROM RDB$DATABASE;" - Dim oDocId As Int64 = Database.GetScalarValue(oSQL) + Dim oDocId As Int64 = Firebird.GetScalarValue(oSQL) If oDocId = -1 Then _logger.Warn("Database returned -1 while creating Document Entry. File was not saved!") @@ -244,7 +246,7 @@ Public Class EDMIService Public Function GetDocumentByDocumentId(DocumentId As Long) As DocumentResult Implements IEDMIService.GetDocumentByDocumentId Try Dim oSQL = $"SELECT GUID, CONTAINER_ID, ORIGINAL_FILENAME FROM TBIDB_DOCUMENT WHERE GUID = {DocumentId}" - Dim oTable = Database.GetDatatable(oSQL) + Dim oTable = Firebird.GetDatatable(oSQL) If oTable.Rows.Count = 0 Then Return New DocumentResult("Document not found") @@ -272,7 +274,7 @@ Public Class EDMIService Public Function GetDocumentByContainerId(ContainerId As String) As DocumentResult Implements IEDMIService.GetDocumentByContainerId Try Dim oSQL = $"SELECT GUID, CONTAINER_ID, ORIGINAL_FILENAME FROM TBIDB_DOCUMENT WHERE CONTAINER_ID = '{ContainerId}'" - Dim oTable = Database.GetDatatable(oSQL) + Dim oTable = Firebird.GetDatatable(oSQL) If oTable.Rows.Count = 0 Then Return New DocumentResult("Document not found") @@ -299,11 +301,12 @@ Public Class EDMIService #End Region #Region "Document" - Public Function ImportFile(FileInfo As FileInfo, Contents() As Byte, [Readonly] As Boolean, RetentionPeriod As Integer) As DocumentResult2 Implements IEDMIService.ImportFile + Public Function ImportFile(FileName As String, Contents() As Byte, AddedWho As String) As DocumentResult2 Implements IEDMIService.ImportFile Dim oDocumentType As String = "DummyDocumentType" Dim oDirectoryPath = EDMIPath.GetActivePath(oDocumentType) - Dim oFilePath = Path.Combine(oDirectoryPath, FileInfo.Name) - Dim oDocument = New DocumentResult2.DocumentObject() With {.FileName = FileInfo.Name, .FileId = Guid.NewGuid.ToString} + Dim oAbsPath = Path.Combine(oDirectoryPath, FileName) + Dim oRelativePath = EDMIPath.GetRelativePath(oDocumentType) + Dim oDocument = New DocumentResult2.DocumentObject With {.FileName = FileName} Try Directory.CreateDirectory(oDirectoryPath) @@ -313,16 +316,26 @@ Public Class EDMIService End Try Try - Dim oVersionedFileName As String = Filesystem.GetVersionedFilename(oFilePath) + Dim oVersionedFileName As String = Filesystem.GetVersionedFilename(oAbsPath) - _logger.Info("Saving file [{0}] to path [{1}]", FileInfo.Name, oVersionedFileName) + _logger.Info("Saving file [{0}] to path [{1}]", FileName, oVersionedFileName) Using oStream = New FileStream(oVersionedFileName, FileMode.CreateNew) oStream.Write(Contents, 0, Contents.Length) oStream.Flush(True) oStream.Close() End Using - EDMIArchive.SetRetention(oVersionedFileName, RetentionPeriod, [Readonly]) + ' insert into db + Dim oCommand As New SqlCommand("PRIDB_NEW_DOCUMENT") + oCommand.Parameters.AddWithValue("@OBJ_ST_ID", 1) + oCommand.Parameters.AddWithValue("@REL_PATH", oDirectoryPath) + oCommand.Parameters.AddWithValue("@WHO", AddedWho) + oCommand.Parameters.AddWithValue("@REF_DOCID", 0) + oCommand.Parameters.Add(New SqlParameter("@IDB_OBJ_ID", SqlDbType.BigInt)) + + Dim oObjectId = MSSQL.GetScalarValue(oCommand, "@IDB_OBJ_ID") + + oDocument.FileId = oObjectId Return New DocumentResult2(oDocument) Catch ex As Exception @@ -330,13 +343,14 @@ Public Class EDMIService Return New DocumentResult2(ex.Message) End Try End Function + #End Region #Region "Index" Public Function NewFileIndex(DocObject As DocumentObject, Syskey As String, LanguageCode As String, Value As String) As IndexResult Implements IEDMIService.NewFileIndex Try Dim oSQL = $"SELECT FNIDB_NEW_DOC_VALUE({DocObject.DocumentId},'{Syskey}','{LanguageCode}','{Value}','{_username}') FROM RDB$DATABASE;" - Dim oIndexId As Int64 = Database.GetScalarValue(oSQL) + Dim oIndexId As Int64 = Firebird.GetScalarValue(oSQL) Return New IndexResult(oIndexId) Catch ex As Exception diff --git a/Service.EDMIService/EDMIService.vbproj b/Service.EDMIService/EDMIService.vbproj index db351beb..77d5cb22 100644 --- a/Service.EDMIService/EDMIService.vbproj +++ b/Service.EDMIService/EDMIService.vbproj @@ -101,6 +101,8 @@ + + diff --git a/Service.EDMIService/IEDMIService.vb b/Service.EDMIService/IEDMIService.vb index 0acc56b9..6a2d43d3 100644 --- a/Service.EDMIService/IEDMIService.vb +++ b/Service.EDMIService/IEDMIService.vb @@ -49,7 +49,7 @@ Interface IEDMIService #Region "Document (New)" - Function ImportFile(FileInfo As FileInfo, Contents As Byte(), [ReadOnly] As Boolean, RetentionTime As Integer) As DocumentResult2 + Function ImportFile(FileName As String, Contents As Byte(), AddedWho As String) As DocumentResult2 #End Region #Region "Index" diff --git a/Service.EDMIService/WindowsService.vb b/Service.EDMIService/WindowsService.vb index 60ef89a2..067b315e 100644 --- a/Service.EDMIService/WindowsService.vb +++ b/Service.EDMIService/WindowsService.vb @@ -13,8 +13,10 @@ Public Class WindowsService Private _logConfig As LogConfig Private _logger As Logger - Private _db As Firebird - Private _clientsConnected As Integer = 0 + + Private _firebird As Firebird + Private _mssql As MSSQLServer + Private _config As AppConfig Private _Path As EDMI.File.Path Private _Archive As EDMI.File.Archive @@ -39,17 +41,28 @@ Public Class WindowsService _logger = _logConfig.GetLogger() _logger.Info("Service {0} is starting...", SERVICE_DISPLAY_NAME) - _logger.Debug("Connecting to database...") - - _db = New Firebird( - _logConfig, - AppConfig.FirebirdDataSource, - AppConfig.FirebirdDatabase, - AppConfig.FirebirdUser, - AppConfig.FirebirdPassword - ) - _logger.Info("Database connection established.") + If AppConfig.IsFirebirdConfigured() Then + _logger.Debug("Connecting to Firebird...") + _firebird = New Firebird( + _logConfig, + AppConfig.FirebirdDataSource, + AppConfig.FirebirdDatabase, + AppConfig.FirebirdUser, + AppConfig.FirebirdPassword + ) + _logger.Info("Database connection established.") + Else + _logger.Info("Firebird is not configured, will not be used!") + End If + + If AppConfig.IsMSSQLConfigured() Then + _logger.Debug("Connecting to MSSQL...") + _mssql = New MSSQLServer(_logConfig, AppConfig.MSSQLConnectionString) + _logger.Info("Database connection established.") + Else + _logger.Info("MSSQL is not configured, will not be used!") + End If _logger.Debug("Initializing EDMI Functions") @@ -57,9 +70,10 @@ Public Class WindowsService _Archive = New EDMI.File.Archive(_logConfig) _filesystem = New Filesystem.File(_logConfig) - _logger.Debug("EDMI Functions initialized.") + _logger.Info("EDMI Functions initialized.") - EDMIService.Database = _db + EDMIService.MSSQL = _mssql + EDMIService.Firebird = _firebird EDMIService.LogConfig = _logConfig EDMIService.AppConfig = _config EDMIService.EDMIArchive = _Archive @@ -71,7 +85,7 @@ Public Class WindowsService _serviceHost = New ServiceHost(GetType(EDMIService)) _serviceHost.Open() - _logger.Debug("WCF ServiceHost started.") + _logger.Info("WCF ServiceHost started.") _logger.Info("Service {0} successfully started.", SERVICE_DISPLAY_NAME) Catch ex As Exception From 52a6d103e6dd985a6ee4d2bac4986dce5159f08e Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 14 Apr 2020 10:34:30 +0200 Subject: [PATCH 2/8] EDMIService: fix paths on import --- EDMI.File/Path.vb | 11 ++++++----- Service.EDMIService/EDMIService.vb | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/EDMI.File/Path.vb b/EDMI.File/Path.vb index 8da28dcb..de043ed8 100644 --- a/EDMI.File/Path.vb +++ b/EDMI.File/Path.vb @@ -16,23 +16,24 @@ Public Class Path _BasePath = DatastoreBasePath End Sub - Public Function GetActivePath(DocumentType As String) + Public Function GetActivePath(DocumentType As String, Optional FileName As String = "") Dim oPathParts As New List(Of String) From {_BasePath, PATH_EDMI, PATH_ACTIVE} - oPathParts.AddRange(GetRelativePath(DocumentType)) + oPathParts.AddRange(GetRelativePath(DocumentType, FileName)) Return IO.Path.Combine(oPathParts.ToArray()) End Function - Public Function GetArchivePath(DocumentType As String) + Public Function GetArchivePath(DocumentType As String, Optional FileName As String = "") Dim oPathParts As New List(Of String) From {_BasePath, PATH_EDMI, PATH_ARCHIVE} - oPathParts.AddRange(GetRelativePath(DocumentType)) + oPathParts.AddRange(GetRelativePath(DocumentType, FileName)) Return IO.Path.Combine(oPathParts.ToArray()) End Function - Public Function GetRelativePath(DocumentType As String) + Public Function GetRelativePath(DocumentType As String, Optional FileName As String = "") Dim oPathParts As New List(Of String) From {DocumentType} oPathParts.AddRange(GetDatePath()) + oPathParts.Add(FileName) Return IO.Path.Combine(oPathParts.ToArray()) End Function diff --git a/Service.EDMIService/EDMIService.vb b/Service.EDMIService/EDMIService.vb index 2a36814f..7d13f7bf 100644 --- a/Service.EDMIService/EDMIService.vb +++ b/Service.EDMIService/EDMIService.vb @@ -303,9 +303,9 @@ Public Class EDMIService #Region "Document" Public Function ImportFile(FileName As String, Contents() As Byte, AddedWho As String) As DocumentResult2 Implements IEDMIService.ImportFile Dim oDocumentType As String = "DummyDocumentType" + Dim oRelativePath As String = EDMIPath.GetRelativePath(oDocumentType, FileName) + Dim oAbsolutePath As String = EDMIPath.GetActivePath(oDocumentType) Dim oDirectoryPath = EDMIPath.GetActivePath(oDocumentType) - Dim oAbsPath = Path.Combine(oDirectoryPath, FileName) - Dim oRelativePath = EDMIPath.GetRelativePath(oDocumentType) Dim oDocument = New DocumentResult2.DocumentObject With {.FileName = FileName} Try @@ -316,7 +316,7 @@ Public Class EDMIService End Try Try - Dim oVersionedFileName As String = Filesystem.GetVersionedFilename(oAbsPath) + Dim oVersionedFileName As String = Filesystem.GetVersionedFilename(oAbsolutePath) _logger.Info("Saving file [{0}] to path [{1}]", FileName, oVersionedFileName) Using oStream = New FileStream(oVersionedFileName, FileMode.CreateNew) @@ -328,7 +328,7 @@ Public Class EDMIService ' insert into db Dim oCommand As New SqlCommand("PRIDB_NEW_DOCUMENT") oCommand.Parameters.AddWithValue("@OBJ_ST_ID", 1) - oCommand.Parameters.AddWithValue("@REL_PATH", oDirectoryPath) + oCommand.Parameters.AddWithValue("@REL_PATH", oRelativePath) oCommand.Parameters.AddWithValue("@WHO", AddedWho) oCommand.Parameters.AddWithValue("@REF_DOCID", 0) oCommand.Parameters.Add(New SqlParameter("@IDB_OBJ_ID", SqlDbType.BigInt)) From a20c0eb4b0e607a635f1d6a107449d01ad54b247 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 14 Apr 2020 16:25:16 +0200 Subject: [PATCH 3/8] WIP: Streaming files from service to client --- EDMI.File/Path.vb | 36 ++++++--- GUIs.Test.EDMIBenchmark/Form1.Designer.vb | 80 +++++++++++++------ GUIs.Test.EDMIBenchmark/Form1.vb | 24 +++++- .../GUIs.Test.EDMIBenchmark.vbproj | 10 +++ .../My Project/licenses.licx | 1 + Modules.EDMIAPI/Channel.vb | 2 +- .../DigitalData.Services.EDMIService.wsdl | 11 +++ .../DigitalData.Services.EDMIService.xsd | 19 ++++- .../EDMIServiceReference/Message.xsd | 6 ++ .../EDMIServiceReference/Reference.svcmap | 1 + .../EDMIServiceReference/Reference.vb | 14 ++++ .../configuration.svcinfo | 2 +- .../configuration91.svcinfo | 6 +- .../EDMIServiceReference/service.wsdl | 11 +++ Modules.EDMIAPI/EDMI.API.vbproj | 3 + Modules.EDMIAPI/app.config | 2 +- Service.EDMIService/App.config | 2 +- Service.EDMIService/EDMIService.vb | 25 +++++- Service.EDMIService/IEDMIService.vb | 3 + 19 files changed, 210 insertions(+), 48 deletions(-) create mode 100644 Modules.EDMIAPI/Connected Services/EDMIServiceReference/Message.xsd diff --git a/EDMI.File/Path.vb b/EDMI.File/Path.vb index de043ed8..ce701e4f 100644 --- a/EDMI.File/Path.vb +++ b/EDMI.File/Path.vb @@ -16,26 +16,42 @@ Public Class Path _BasePath = DatastoreBasePath End Sub - Public Function GetActivePath(DocumentType As String, Optional FileName As String = "") - Dim oPathParts As New List(Of String) From {_BasePath, PATH_EDMI, PATH_ACTIVE} - oPathParts.AddRange(GetRelativePath(DocumentType, FileName)) + Public Function GetActivePath(DocumentType As String, Optional FileName As String = "") As String + Dim oParts = New List(Of String) From {_BasePath, PATH_EDMI, PATH_ACTIVE} + oParts.AddRange(Do_GetRelativePath(DocumentType, FileName)) - Return IO.Path.Combine(oPathParts.ToArray()) + Return IO.Path.Combine(oParts.ToArray()) End Function - Public Function GetArchivePath(DocumentType As String, Optional FileName As String = "") - Dim oPathParts As New List(Of String) From {_BasePath, PATH_EDMI, PATH_ARCHIVE} - oPathParts.AddRange(GetRelativePath(DocumentType, FileName)) + Public Function GetActivePathFromRelativePath(RelativePath As String) As String + Dim oParts = New List(Of String) From {_BasePath, PATH_EDMI, PATH_ACTIVE} + oParts.Add(RelativePath) + Return IO.Path.Combine(oParts.ToArray) + End Function + + Public Function GetArchivePath(DocumentType As String, Optional FileName As String = "") As String + Dim oParts = New List(Of String) From {_BasePath, PATH_EDMI, PATH_ARCHIVE} + oParts.AddRange(Do_GetRelativePath(DocumentType, FileName)) + + Return IO.Path.Combine(oParts.ToArray()) + End Function + + Public Function GetArchivePathFromRelativePath(RelativePath As String) As String + Dim oParts = New List(Of String) From {_BasePath, PATH_EDMI, PATH_ARCHIVE} + oParts.Add(RelativePath) + Return IO.Path.Combine(oParts.ToArray) + End Function - Return IO.Path.Combine(oPathParts.ToArray()) + Public Function GetRelativePath(DocumentType As String, Optional FileName As String = "") As String + Return IO.Path.Combine(Do_GetRelativePath(DocumentType, FileName).ToArray) End Function - Public Function GetRelativePath(DocumentType As String, Optional FileName As String = "") + Private Function Do_GetRelativePath(DocumentType As String, Optional FileName As String = "") As List(Of String) Dim oPathParts As New List(Of String) From {DocumentType} oPathParts.AddRange(GetDatePath()) oPathParts.Add(FileName) - Return IO.Path.Combine(oPathParts.ToArray()) + Return oPathParts End Function Private Function GetDatePath() As List(Of String) diff --git a/GUIs.Test.EDMIBenchmark/Form1.Designer.vb b/GUIs.Test.EDMIBenchmark/Form1.Designer.vb index c05e79ed..ac9e125c 100644 --- a/GUIs.Test.EDMIBenchmark/Form1.Designer.vb +++ b/GUIs.Test.EDMIBenchmark/Form1.Designer.vb @@ -29,9 +29,12 @@ Partial Class Form1 Me.ButtonImportFiles = New DevExpress.XtraBars.BarButtonItem() Me.buttonClearLog = New DevExpress.XtraBars.BarButtonItem() Me.buttonClearFiles = New DevExpress.XtraBars.BarButtonItem() + Me.TextboxObejctId = New DevExpress.XtraBars.BarEditItem() + Me.RepositoryItemTextEdit1 = New DevExpress.XtraEditors.Repository.RepositoryItemTextEdit() + Me.ButtonLoadFile = New DevExpress.XtraBars.BarButtonItem() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() - Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + Me.RibbonPageGroup4 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroup3 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage() @@ -40,9 +43,10 @@ Partial Class Form1 Me.XtraTabControl1 = New DevExpress.XtraTab.XtraTabControl() Me.XtraTabPage1 = New DevExpress.XtraTab.XtraTabPage() Me.XtraTabPage2 = New DevExpress.XtraTab.XtraTabPage() - Me.listboxFileids = New DevExpress.XtraEditors.ListBoxControl() + Me.DocumentViewer1 = New DigitalData.Controls.DocumentViewer.DocumentViewer() CType(Me.listboxFiles, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.RepositoryItemTextEdit1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerControl1.SuspendLayout() CType(Me.listboxLog, System.ComponentModel.ISupportInitialize).BeginInit() @@ -50,7 +54,6 @@ Partial Class Form1 Me.XtraTabControl1.SuspendLayout() Me.XtraTabPage1.SuspendLayout() Me.XtraTabPage2.SuspendLayout() - CType(Me.listboxFileids, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'listboxFiles @@ -64,11 +67,12 @@ Partial Class Form1 'RibbonControl1 ' Me.RibbonControl1.ExpandCollapseItem.Id = 0 - Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.ButtonSelectFiles, Me.ButtonImportFiles, Me.buttonClearLog, Me.buttonClearFiles}) + Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.ButtonSelectFiles, Me.ButtonImportFiles, Me.buttonClearLog, Me.buttonClearFiles, Me.TextboxObejctId, Me.ButtonLoadFile}) Me.RibbonControl1.Location = New System.Drawing.Point(0, 0) - Me.RibbonControl1.MaxItemId = 5 + Me.RibbonControl1.MaxItemId = 7 Me.RibbonControl1.Name = "RibbonControl1" Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) + Me.RibbonControl1.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemTextEdit1}) Me.RibbonControl1.Size = New System.Drawing.Size(1145, 158) Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1 ' @@ -100,30 +104,51 @@ Partial Class Form1 Me.buttonClearFiles.ImageOptions.SvgImage = CType(resources.GetObject("buttonClearFiles.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.buttonClearFiles.Name = "buttonClearFiles" ' + 'TextboxObejctId + ' + Me.TextboxObejctId.Caption = "Document Id" + Me.TextboxObejctId.Edit = Me.RepositoryItemTextEdit1 + Me.TextboxObejctId.EditWidth = 100 + Me.TextboxObejctId.Id = 5 + Me.TextboxObejctId.Name = "TextboxObejctId" + ' + 'RepositoryItemTextEdit1 + ' + Me.RepositoryItemTextEdit1.AutoHeight = False + Me.RepositoryItemTextEdit1.Name = "RepositoryItemTextEdit1" + ' + 'ButtonLoadFile + ' + Me.ButtonLoadFile.Caption = "Load File" + Me.ButtonLoadFile.Id = 6 + Me.ButtonLoadFile.Name = "ButtonLoadFile" + ' 'RibbonPage1 ' - Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup2, Me.RibbonPageGroup3}) + Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup4, Me.RibbonPageGroup3}) Me.RibbonPage1.Name = "RibbonPage1" - Me.RibbonPage1.Text = "Import Files" + Me.RibbonPage1.Text = "Start" ' 'RibbonPageGroup1 ' Me.RibbonPageGroup1.ItemLinks.Add(Me.ButtonSelectFiles) + Me.RibbonPageGroup1.ItemLinks.Add(Me.ButtonImportFiles) Me.RibbonPageGroup1.Name = "RibbonPageGroup1" - Me.RibbonPageGroup1.Text = "RibbonPageGroup1" + Me.RibbonPageGroup1.Text = "Import" ' - 'RibbonPageGroup2 + 'RibbonPageGroup4 ' - Me.RibbonPageGroup2.ItemLinks.Add(Me.ButtonImportFiles) - Me.RibbonPageGroup2.Name = "RibbonPageGroup2" - Me.RibbonPageGroup2.Text = "RibbonPageGroup2" + Me.RibbonPageGroup4.ItemLinks.Add(Me.TextboxObejctId) + Me.RibbonPageGroup4.ItemLinks.Add(Me.ButtonLoadFile) + Me.RibbonPageGroup4.Name = "RibbonPageGroup4" + Me.RibbonPageGroup4.Text = "Retrieve" ' 'RibbonPageGroup3 ' - Me.RibbonPageGroup3.ItemLinks.Add(Me.buttonClearLog) + Me.RibbonPageGroup3.ItemLinks.Add(Me.buttonClearLog, True) Me.RibbonPageGroup3.ItemLinks.Add(Me.buttonClearFiles) Me.RibbonPageGroup3.Name = "RibbonPageGroup3" - Me.RibbonPageGroup3.Text = "RibbonPageGroup3" + Me.RibbonPageGroup3.Text = "Utils" ' 'RibbonStatusBar1 ' @@ -173,22 +198,22 @@ Partial Class Form1 Me.XtraTabPage1.Controls.Add(Me.SplitContainerControl1) Me.XtraTabPage1.Name = "XtraTabPage1" Me.XtraTabPage1.Size = New System.Drawing.Size(1143, 270) - Me.XtraTabPage1.Text = "XtraTabPage1" + Me.XtraTabPage1.Text = "Information" ' 'XtraTabPage2 ' - Me.XtraTabPage2.Controls.Add(Me.listboxFileids) + Me.XtraTabPage2.Controls.Add(Me.DocumentViewer1) Me.XtraTabPage2.Name = "XtraTabPage2" Me.XtraTabPage2.Size = New System.Drawing.Size(1143, 270) - Me.XtraTabPage2.Text = "XtraTabPage2" + Me.XtraTabPage2.Text = "DocumentViewer" ' - 'listboxFileids + 'DocumentViewer1 ' - Me.listboxFileids.Dock = System.Windows.Forms.DockStyle.Left - Me.listboxFileids.Location = New System.Drawing.Point(0, 0) - Me.listboxFileids.Name = "listboxFileids" - Me.listboxFileids.Size = New System.Drawing.Size(278, 270) - Me.listboxFileids.TabIndex = 0 + Me.DocumentViewer1.Dock = System.Windows.Forms.DockStyle.Fill + Me.DocumentViewer1.Location = New System.Drawing.Point(0, 0) + Me.DocumentViewer1.Name = "DocumentViewer1" + Me.DocumentViewer1.Size = New System.Drawing.Size(1143, 270) + Me.DocumentViewer1.TabIndex = 0 ' 'Form1 ' @@ -204,6 +229,7 @@ Partial Class Form1 Me.Text = "Form1" CType(Me.listboxFiles, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.RepositoryItemTextEdit1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerControl1.ResumeLayout(False) CType(Me.listboxLog, System.ComponentModel.ISupportInitialize).EndInit() @@ -211,7 +237,6 @@ Partial Class Form1 Me.XtraTabControl1.ResumeLayout(False) Me.XtraTabPage1.ResumeLayout(False) Me.XtraTabPage2.ResumeLayout(False) - CType(Me.listboxFileids, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() @@ -220,7 +245,6 @@ Partial Class Form1 Friend WithEvents RibbonControl1 As DevExpress.XtraBars.Ribbon.RibbonControl Friend WithEvents RibbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup - Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage Friend WithEvents ButtonSelectFiles As DevExpress.XtraBars.BarButtonItem @@ -232,6 +256,10 @@ Partial Class Form1 Friend WithEvents buttonClearFiles As DevExpress.XtraBars.BarButtonItem Friend WithEvents XtraTabControl1 As DevExpress.XtraTab.XtraTabControl Friend WithEvents XtraTabPage1 As DevExpress.XtraTab.XtraTabPage + Friend WithEvents TextboxObejctId As DevExpress.XtraBars.BarEditItem + Friend WithEvents RepositoryItemTextEdit1 As DevExpress.XtraEditors.Repository.RepositoryItemTextEdit + Friend WithEvents ButtonLoadFile As DevExpress.XtraBars.BarButtonItem + Friend WithEvents RibbonPageGroup4 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents XtraTabPage2 As DevExpress.XtraTab.XtraTabPage - Friend WithEvents listboxFileids As DevExpress.XtraEditors.ListBoxControl + Friend WithEvents DocumentViewer1 As DigitalData.Controls.DocumentViewer.DocumentViewer End Class diff --git a/GUIs.Test.EDMIBenchmark/Form1.vb b/GUIs.Test.EDMIBenchmark/Form1.vb index f6df2a78..2e95f562 100644 --- a/GUIs.Test.EDMIBenchmark/Form1.vb +++ b/GUIs.Test.EDMIBenchmark/Form1.vb @@ -15,6 +15,8 @@ Public Class Form1 "net.tcp://172.24.12.39:9000/DigitalData/Services/Main") _Channel = oChannelFactory.CreateChannel() _Channel.Open() + + DocumentViewer1.Init(oLogConfig, "21182889975216572111813147150675976632") End Sub Private Sub ButtonSelectFiles_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles ButtonSelectFiles.ItemClick @@ -53,7 +55,6 @@ Public Class Form1 Dim oResult As EDMIServiceReference.DocumentResult2 = Await _Channel.ImportFileAsync(oFileInfo.Name, oContents, Environment.UserName) If oResult.OK Then listboxLog.Items.Add($"File [{oFileInfo.Name}] with Id [{oResult.Document.FileId}] imported!") - listboxFileids.Items.Add(oResult.Document.FileId) Else listboxLog.Items.Add($"Import Error: {oResult.ErrorMessage}") End If @@ -111,4 +112,25 @@ Public Class Form1 End Try End Function + + Private Async Sub ButtonLoadFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles ButtonLoadFile.ItemClick + Try + If TextboxObejctId.EditValue = "" Then + MsgBox("Please enter an object id!", MsgBoxStyle.Exclamation, "Uh oh!") + End If + + Dim oObjectId As Integer = TextboxObejctId.EditValue + + Dim oStream = Await _Channel.GetFileByObjectIdAsync(oObjectId) + Dim oMemoryStream As New MemoryStream() + oStream.CopyTo(oMemoryStream) + oMemoryStream.Position = 0 + + listboxLog.Items.Add("Stream read!") + + DocumentViewer1.LoadFile("textfile.png", oMemoryStream) + Catch ex As Exception + MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!") + End Try + End Sub End Class diff --git a/GUIs.Test.EDMIBenchmark/GUIs.Test.EDMIBenchmark.vbproj b/GUIs.Test.EDMIBenchmark/GUIs.Test.EDMIBenchmark.vbproj index 7b567b30..f94cc8cb 100644 --- a/GUIs.Test.EDMIBenchmark/GUIs.Test.EDMIBenchmark.vbproj +++ b/GUIs.Test.EDMIBenchmark/GUIs.Test.EDMIBenchmark.vbproj @@ -57,6 +57,12 @@ ..\Controls.DocumentViewer\obj\Debug\DigitalData.Controls.DocumentViewer.dll + + D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll + + + P:\Visual Studio Projekte\Bibliotheken\MSG .NET\Bin\22_11_19\Independentsoft.Msg.dll + ..\packages\NLog.4.7.0\lib\net45\NLog.dll @@ -142,6 +148,10 @@ + + {0958cddf-4a16-41f6-8837-8335f71d599c} + DocumentViewer + {25017513-0d97-49d3-98d7-ba76d9b251b0} EDMI.API diff --git a/GUIs.Test.EDMIBenchmark/My Project/licenses.licx b/GUIs.Test.EDMIBenchmark/My Project/licenses.licx index 3f51afe8..e29ff0b5 100644 --- a/GUIs.Test.EDMIBenchmark/My Project/licenses.licx +++ b/GUIs.Test.EDMIBenchmark/My Project/licenses.licx @@ -1 +1,2 @@ +DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/Modules.EDMIAPI/Channel.vb b/Modules.EDMIAPI/Channel.vb index 21022dcd..8520bc60 100644 --- a/Modules.EDMIAPI/Channel.vb +++ b/Modules.EDMIAPI/Channel.vb @@ -8,7 +8,7 @@ Public Class Channel .MaxBufferSize = Constants.MAX_BUFFER_SIZE, .MaxBufferPoolSize = Constants.MAX_BUFFER_POOL_SIZE, .MaxConnections = Constants.MAX_CONNECTIONS, - .TransferMode = TransferMode.Buffered, + .TransferMode = TransferMode.Streamed, .Security = New NetTcpSecurity() With { .Mode = SecurityMode.Transport, .Transport = New TcpTransportSecurity() With { diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl index 60584846..86e0dafe 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl @@ -8,6 +8,7 @@ + @@ -88,6 +89,12 @@ + + + + + + @@ -147,6 +154,10 @@ + + + + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd index a6517bc3..c0472c46 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd @@ -2,6 +2,7 @@ + @@ -183,10 +184,24 @@ + + + + + + + + + + + + + + - + @@ -196,7 +211,7 @@ - + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Message.xsd b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Message.xsd new file mode 100644 index 00000000..6a19fc3f --- /dev/null +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Message.xsd @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap index 3b8b7529..19190ce7 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap @@ -30,6 +30,7 @@ + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb index 9fea810d..c53993cf 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb @@ -507,6 +507,12 @@ Namespace EDMIServiceReference _ Function ImportFileAsync(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult2) + _ + Function GetFileByObjectId(ByVal ObjectId As Long) As System.IO.Stream + + _ + Function GetFileByObjectIdAsync(ByVal ObjectId As Long) As System.Threading.Tasks.Task(Of System.IO.Stream) + _ Function NewFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal LanguageCode As String, ByVal Value As String) As EDMIServiceReference.IndexResult @@ -649,6 +655,14 @@ Namespace EDMIServiceReference Return MyBase.Channel.ImportFileAsync(FileName, Contents, AddedWho) End Function + Public Function GetFileByObjectId(ByVal ObjectId As Long) As System.IO.Stream Implements EDMIServiceReference.IEDMIService.GetFileByObjectId + Return MyBase.Channel.GetFileByObjectId(ObjectId) + End Function + + Public Function GetFileByObjectIdAsync(ByVal ObjectId As Long) As System.Threading.Tasks.Task(Of System.IO.Stream) Implements EDMIServiceReference.IEDMIService.GetFileByObjectIdAsync + Return MyBase.Channel.GetFileByObjectIdAsync(ObjectId) + End Function + Public Function NewFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal LanguageCode As String, ByVal Value As String) As EDMIServiceReference.IndexResult Implements EDMIServiceReference.IEDMIService.NewFileIndex Return MyBase.Channel.NewFileIndex(DocObject, Syskey, LanguageCode, Value) End Function diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/configuration.svcinfo b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/configuration.svcinfo index 7ea472c2..4dc839d7 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/configuration.svcinfo +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/configuration.svcinfo @@ -2,7 +2,7 @@ - + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/configuration91.svcinfo b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/configuration91.svcinfo index 84310bc2..12c40947 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/configuration91.svcinfo +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/configuration91.svcinfo @@ -1,5 +1,5 @@ - + @@ -21,8 +21,8 @@ False - - Buffered + + Streamed OleTransactions diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/service.wsdl b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/service.wsdl index 1c267d7c..4129ded6 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/service.wsdl +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/service.wsdl @@ -28,6 +28,8 @@ + + @@ -156,6 +158,15 @@ + + + + + + + + + diff --git a/Modules.EDMIAPI/EDMI.API.vbproj b/Modules.EDMIAPI/EDMI.API.vbproj index 0f340797..6c44daa7 100644 --- a/Modules.EDMIAPI/EDMI.API.vbproj +++ b/Modules.EDMIAPI/EDMI.API.vbproj @@ -134,6 +134,9 @@ Designer + + Designer + Designer diff --git a/Modules.EDMIAPI/app.config b/Modules.EDMIAPI/app.config index 8da9bc40..9de6fa5b 100644 --- a/Modules.EDMIAPI/app.config +++ b/Modules.EDMIAPI/app.config @@ -25,7 +25,7 @@ - + diff --git a/Service.EDMIService/App.config b/Service.EDMIService/App.config index 85cbdc9f..8c1bd90e 100644 --- a/Service.EDMIService/App.config +++ b/Service.EDMIService/App.config @@ -50,7 +50,7 @@ diff --git a/Service.EDMIService/EDMIService.vb b/Service.EDMIService/EDMIService.vb index 7d13f7bf..d1e10899 100644 --- a/Service.EDMIService/EDMIService.vb +++ b/Service.EDMIService/EDMIService.vb @@ -304,7 +304,7 @@ Public Class EDMIService Public Function ImportFile(FileName As String, Contents() As Byte, AddedWho As String) As DocumentResult2 Implements IEDMIService.ImportFile Dim oDocumentType As String = "DummyDocumentType" Dim oRelativePath As String = EDMIPath.GetRelativePath(oDocumentType, FileName) - Dim oAbsolutePath As String = EDMIPath.GetActivePath(oDocumentType) + Dim oAbsolutePath As String = EDMIPath.GetActivePath(oDocumentType, FileName) Dim oDirectoryPath = EDMIPath.GetActivePath(oDocumentType) Dim oDocument = New DocumentResult2.DocumentObject With {.FileName = FileName} @@ -318,7 +318,7 @@ Public Class EDMIService Try Dim oVersionedFileName As String = Filesystem.GetVersionedFilename(oAbsolutePath) - _logger.Info("Saving file [{0}] to path [{1}]", FileName, oVersionedFileName) + _logger.Info("ImportFile: Saving file [{0}] to path [{1}]", FileName, oVersionedFileName) Using oStream = New FileStream(oVersionedFileName, FileMode.CreateNew) oStream.Write(Contents, 0, Contents.Length) oStream.Flush(True) @@ -344,6 +344,27 @@ Public Class EDMIService End Try End Function + Public Function GetFileByObjectId(ObjectId As Int64) As Stream Implements IEDMIService.GetFileByObjectId + Try + Dim oSQL As String = $"SELECT DocRelativePath FROM VWIDB_DOC_DATA WHERE IDB_OBJ_ID = {ObjectId}" + Dim oPath As String = MSSQL.GetScalarValue(oSQL) + + If IsNothing(oPath) Then + Return Nothing + End If + + Dim oFullPath = EDMIPath.GetActivePathFromRelativePath(oPath) + + _logger.Debug("GetFileByObjectId: Loading file [{0}]", oFullPath) + + Dim oSource As FileStream = IO.File.Open(oFullPath, FileMode.Open) + Return oSource + Catch ex As Exception + _logger.Error(ex) + Return Nothing + End Try + End Function + #End Region #Region "Index" diff --git a/Service.EDMIService/IEDMIService.vb b/Service.EDMIService/IEDMIService.vb index 6a2d43d3..4a5bfd94 100644 --- a/Service.EDMIService/IEDMIService.vb +++ b/Service.EDMIService/IEDMIService.vb @@ -50,6 +50,9 @@ Interface IEDMIService #Region "Document (New)" Function ImportFile(FileName As String, Contents As Byte(), AddedWho As String) As DocumentResult2 + + + Function GetFileByObjectId(ObjectId As Int64) As Stream #End Region #Region "Index" From 62e4e409a6f824ceb2d9e388eda11a1588290e35 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 15 Apr 2020 12:09:01 +0200 Subject: [PATCH 4/8] WIP: EDMI Service --- GUIs.Test.EDMIBenchmark/Form1.vb | 8 +- ...iceReference.DocumentResultOld.datasource} | 4 +- ...eference.DocumentStreamResponse.datasource | 10 ++ .../DigitalData.Services.EDMIService.wsdl | 15 +- .../DigitalData.Services.EDMIService.xsd | 19 +-- .../DigitalData.Services.EDMIService1.xsd | 14 +- .../EDMIServiceReference/Reference.svcmap | 2 +- .../EDMIServiceReference/Reference.vb | 139 +++++++++++++----- .../EDMIServiceReference/service.wsdl | 5 +- Modules.EDMIAPI/Document.vb | 4 +- Modules.EDMIAPI/EDMI.API.vbproj | 5 +- Service.EDMIService/EDMIService.vb | 55 ++++--- Service.EDMIService/EDMIService.vbproj | 5 +- Service.EDMIService/IEDMIService.vb | 14 +- Service.EDMIService/Messages.vb | 22 +++ Service.EDMIService/Results/DocumentResult.vb | 7 +- ...ocumentResult2.vb => DocumentResultOld.vb} | 11 +- 17 files changed, 224 insertions(+), 115 deletions(-) rename Modules.EDMIAPI/Connected Services/EDMIServiceReference/{DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentResult2.datasource => DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentResultOld.datasource} (57%) create mode 100644 Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentStreamResponse.datasource create mode 100644 Service.EDMIService/Messages.vb rename Service.EDMIService/Results/{DocumentResult2.vb => DocumentResultOld.vb} (77%) diff --git a/GUIs.Test.EDMIBenchmark/Form1.vb b/GUIs.Test.EDMIBenchmark/Form1.vb index 2e95f562..b412c86a 100644 --- a/GUIs.Test.EDMIBenchmark/Form1.vb +++ b/GUIs.Test.EDMIBenchmark/Form1.vb @@ -52,7 +52,7 @@ Public Class Form1 Await oStream.ReadAsync(oContents, 0, oFileInfo.Length) End Using - Dim oResult As EDMIServiceReference.DocumentResult2 = Await _Channel.ImportFileAsync(oFileInfo.Name, oContents, Environment.UserName) + Dim oResult As EDMIServiceReference.DocumentResult = Await _Channel.ImportFileAsync(oFileInfo.Name, oContents, Environment.UserName) If oResult.OK Then listboxLog.Items.Add($"File [{oFileInfo.Name}] with Id [{oResult.Document.FileId}] imported!") Else @@ -121,14 +121,14 @@ Public Class Form1 Dim oObjectId As Integer = TextboxObejctId.EditValue - Dim oStream = Await _Channel.GetFileByObjectIdAsync(oObjectId) + Dim oResponse = Await _Channel.GetFileByObjectIdAsync(New EDMIServiceReference.DocumentStreamRequest() With {.ObjectId = oObjectId}) Dim oMemoryStream As New MemoryStream() - oStream.CopyTo(oMemoryStream) + oResponse.FileContents.CopyTo(oMemoryStream) oMemoryStream.Position = 0 listboxLog.Items.Add("Stream read!") - DocumentViewer1.LoadFile("textfile.png", oMemoryStream) + DocumentViewer1.LoadFile(oResponse.FileName, oMemoryStream) Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!") End Try diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentResult2.datasource b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentResultOld.datasource similarity index 57% rename from Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentResult2.datasource rename to Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentResultOld.datasource index e6f36b46..3c56e249 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentResult2.datasource +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentResultOld.datasource @@ -5,6 +5,6 @@ Renaming the file extension or editing the content of this file may cause the file to be unrecognizable by the program. --> - - DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentResult2, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentResultOld, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentStreamResponse.datasource b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentStreamResponse.datasource new file mode 100644 index 00000000..9c6b26fa --- /dev/null +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentStreamResponse.datasource @@ -0,0 +1,10 @@ + + + + DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentStreamResponse, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl index 86e0dafe..554c690d 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl @@ -89,11 +89,14 @@ - - + + - - + + + + + @@ -155,8 +158,8 @@ - - + + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd index c0472c46..78896d41 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd @@ -93,7 +93,7 @@ - + @@ -108,7 +108,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -164,7 +164,7 @@ - + @@ -180,24 +180,25 @@ - + - + - + - + + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService1.xsd b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService1.xsd index 3fc9564a..0c04d9a3 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService1.xsd +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService1.xsd @@ -49,7 +49,7 @@ - + @@ -60,26 +60,26 @@ - - + + - + - - + + - + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap index 19190ce7..0dd586d8 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap @@ -30,7 +30,7 @@ - + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb index c53993cf..1df41c22 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb @@ -22,8 +22,8 @@ Namespace EDMIServiceReference System.SerializableAttribute(), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.ScalarResult)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.NonQueryResult)), _ + System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentResultOld)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentResult)), _ - System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentResult2)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.IndexResult)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.TableResult))> _ Partial Public Class BaseResult @@ -92,9 +92,9 @@ Namespace EDMIServiceReference System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.TableResult)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.BaseResult)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.NonQueryResult)), _ + System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentResultOld)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentResult)), _ - System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentResult2)), _ - System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentResult2.DocumentObject)), _ + System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentResult.DocumentObject)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.IndexResult)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(System.DBNull)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentObject))> _ @@ -128,9 +128,9 @@ Namespace EDMIServiceReference _ - Partial Public Class DocumentResult + Partial Public Class DocumentResultOld Inherits EDMIServiceReference.BaseResult Private ContentsField() As Byte @@ -181,14 +181,14 @@ Namespace EDMIServiceReference _ - Partial Public Class DocumentResult2 + Partial Public Class DocumentResult Inherits EDMIServiceReference.BaseResult Private ContentsField() As Byte - Private DocumentField As EDMIServiceReference.DocumentResult2.DocumentObject + Private DocumentField As EDMIServiceReference.DocumentResult.DocumentObject Private HasContentsField As Boolean @@ -206,7 +206,7 @@ Namespace EDMIServiceReference End Property _ - Public Property Document() As EDMIServiceReference.DocumentResult2.DocumentObject + Public Property Document() As EDMIServiceReference.DocumentResult.DocumentObject Get Return Me.DocumentField End Get @@ -233,7 +233,7 @@ Namespace EDMIServiceReference _ Partial Public Class DocumentObject Inherits Object @@ -462,22 +462,22 @@ Namespace EDMIServiceReference Function ExecuteNonQueryAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.NonQueryResult) _ - Function NewFile(ByVal FileName As String, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResult + Function NewFile(ByVal FileName As String, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResultOld _ - Function NewFileAsync(ByVal FileName As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) + Function NewFileAsync(ByVal FileName As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResultOld) _ - Function UpdateFile(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResult + Function UpdateFile(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResultOld _ - Function UpdateFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) + Function UpdateFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResultOld) _ - Function GetFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As EDMIServiceReference.DocumentResult + Function GetFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As EDMIServiceReference.DocumentResultOld _ - Function GetFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) + Function GetFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResultOld) _ Function DeleteFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As Boolean @@ -487,31 +487,32 @@ Namespace EDMIServiceReference _ - Function GetDocumentByDocumentId(ByVal DocumentId As Long) As EDMIServiceReference.DocumentResult + Function GetDocumentByDocumentId(ByVal DocumentId As Long) As EDMIServiceReference.DocumentResultOld _ - Function GetDocumentByDocumentIdAsync(ByVal DocumentId As Long) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) + Function GetDocumentByDocumentIdAsync(ByVal DocumentId As Long) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResultOld) _ - Function GetDocumentByContainerId(ByVal ContainerId As String) As EDMIServiceReference.DocumentResult + Function GetDocumentByContainerId(ByVal ContainerId As String) As EDMIServiceReference.DocumentResultOld _ - Function GetDocumentByContainerIdAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) + Function GetDocumentByContainerIdAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResultOld) _ - Function ImportFile(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As EDMIServiceReference.DocumentResult2 + Function ImportFile(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As EDMIServiceReference.DocumentResult _ - Function ImportFileAsync(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult2) + Function ImportFileAsync(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) 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. _ - Function GetFileByObjectId(ByVal ObjectId As Long) As System.IO.Stream + Function GetFileByObjectId(ByVal request As EDMIServiceReference.DocumentStreamRequest) As EDMIServiceReference.DocumentStreamResponse _ - Function GetFileByObjectIdAsync(ByVal ObjectId As Long) As System.Threading.Tasks.Task(Of System.IO.Stream) + Function GetFileByObjectIdAsync(ByVal request As EDMIServiceReference.DocumentStreamRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentStreamResponse) _ Function NewFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal LanguageCode As String, ByVal Value As String) As EDMIServiceReference.IndexResult @@ -520,6 +521,48 @@ Namespace EDMIServiceReference Function NewFileIndexAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal LanguageCode As String, ByVal Value As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.IndexResult) End Interface + _ + Partial Public Class DocumentStreamRequest + + _ + Public ObjectId As Long + + Public Sub New() + MyBase.New + End Sub + + Public Sub New(ByVal ObjectId As Long) + MyBase.New + Me.ObjectId = ObjectId + End Sub + End Class + + _ + Partial Public Class DocumentStreamResponse + + _ + Public FileName As String + + _ + Public FileContents As System.IO.Stream + + Public Sub New() + MyBase.New + End Sub + + Public Sub New(ByVal FileName As String, ByVal FileContents As System.IO.Stream) + MyBase.New + Me.FileName = FileName + Me.FileContents = FileContents + End Sub + End Class + _ Public Interface IEDMIServiceChannel Inherits EDMIServiceReference.IEDMIService, System.ServiceModel.IClientChannel @@ -599,27 +642,27 @@ Namespace EDMIServiceReference Return MyBase.Channel.ExecuteNonQueryAsync(SQL) End Function - Public Function NewFile(ByVal FileName As String, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMIService.NewFile + Public Function NewFile(ByVal FileName As String, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResultOld Implements EDMIServiceReference.IEDMIService.NewFile Return MyBase.Channel.NewFile(FileName, Contents) End Function - Public Function NewFileAsync(ByVal FileName As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMIService.NewFileAsync + Public Function NewFileAsync(ByVal FileName As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResultOld) Implements EDMIServiceReference.IEDMIService.NewFileAsync Return MyBase.Channel.NewFileAsync(FileName, Contents) End Function - Public Function UpdateFile(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMIService.UpdateFile + Public Function UpdateFile(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResultOld Implements EDMIServiceReference.IEDMIService.UpdateFile Return MyBase.Channel.UpdateFile(DocObject, Contents) End Function - Public Function UpdateFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMIService.UpdateFileAsync + Public Function UpdateFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResultOld) Implements EDMIServiceReference.IEDMIService.UpdateFileAsync Return MyBase.Channel.UpdateFileAsync(DocObject, Contents) End Function - Public Function GetFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMIService.GetFile + Public Function GetFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As EDMIServiceReference.DocumentResultOld Implements EDMIServiceReference.IEDMIService.GetFile Return MyBase.Channel.GetFile(DocObject) End Function - Public Function GetFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMIService.GetFileAsync + Public Function GetFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResultOld) Implements EDMIServiceReference.IEDMIService.GetFileAsync Return MyBase.Channel.GetFileAsync(DocObject) End Function @@ -631,36 +674,52 @@ Namespace EDMIServiceReference Return MyBase.Channel.DeleteFileAsync(DocObject) End Function - Public Function GetDocumentByDocumentId(ByVal DocumentId As Long) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMIService.GetDocumentByDocumentId + Public Function GetDocumentByDocumentId(ByVal DocumentId As Long) As EDMIServiceReference.DocumentResultOld Implements EDMIServiceReference.IEDMIService.GetDocumentByDocumentId Return MyBase.Channel.GetDocumentByDocumentId(DocumentId) End Function - Public Function GetDocumentByDocumentIdAsync(ByVal DocumentId As Long) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMIService.GetDocumentByDocumentIdAsync + Public Function GetDocumentByDocumentIdAsync(ByVal DocumentId As Long) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResultOld) Implements EDMIServiceReference.IEDMIService.GetDocumentByDocumentIdAsync Return MyBase.Channel.GetDocumentByDocumentIdAsync(DocumentId) End Function - Public Function GetDocumentByContainerId(ByVal ContainerId As String) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMIService.GetDocumentByContainerId + Public Function GetDocumentByContainerId(ByVal ContainerId As String) As EDMIServiceReference.DocumentResultOld Implements EDMIServiceReference.IEDMIService.GetDocumentByContainerId Return MyBase.Channel.GetDocumentByContainerId(ContainerId) End Function - Public Function GetDocumentByContainerIdAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMIService.GetDocumentByContainerIdAsync + Public Function GetDocumentByContainerIdAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResultOld) Implements EDMIServiceReference.IEDMIService.GetDocumentByContainerIdAsync Return MyBase.Channel.GetDocumentByContainerIdAsync(ContainerId) End Function - Public Function ImportFile(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As EDMIServiceReference.DocumentResult2 Implements EDMIServiceReference.IEDMIService.ImportFile + 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) End Function - Public Function ImportFileAsync(ByVal FileName As String, ByVal Contents() As Byte, ByVal AddedWho As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult2) Implements EDMIServiceReference.IEDMIService.ImportFileAsync + 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) End Function - Public Function GetFileByObjectId(ByVal ObjectId As Long) As System.IO.Stream Implements EDMIServiceReference.IEDMIService.GetFileByObjectId - Return MyBase.Channel.GetFileByObjectId(ObjectId) + _ + Function EDMIServiceReference_IEDMIService_GetFileByObjectId(ByVal request As EDMIServiceReference.DocumentStreamRequest) As EDMIServiceReference.DocumentStreamResponse Implements EDMIServiceReference.IEDMIService.GetFileByObjectId + Return MyBase.Channel.GetFileByObjectId(request) + End Function + + Public Function GetFileByObjectId(ByVal ObjectId As Long, ByRef FileContents As System.IO.Stream) As String + Dim inValue As EDMIServiceReference.DocumentStreamRequest = New EDMIServiceReference.DocumentStreamRequest() + inValue.ObjectId = ObjectId + Dim retVal As EDMIServiceReference.DocumentStreamResponse = CType(Me,EDMIServiceReference.IEDMIService).GetFileByObjectId(inValue) + FileContents = retVal.FileContents + Return retVal.FileName + End Function + + _ + Function EDMIServiceReference_IEDMIService_GetFileByObjectIdAsync(ByVal request As EDMIServiceReference.DocumentStreamRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentStreamResponse) Implements EDMIServiceReference.IEDMIService.GetFileByObjectIdAsync + Return MyBase.Channel.GetFileByObjectIdAsync(request) End Function - Public Function GetFileByObjectIdAsync(ByVal ObjectId As Long) As System.Threading.Tasks.Task(Of System.IO.Stream) Implements EDMIServiceReference.IEDMIService.GetFileByObjectIdAsync - Return MyBase.Channel.GetFileByObjectIdAsync(ObjectId) + Public Function GetFileByObjectIdAsync(ByVal ObjectId As Long) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentStreamResponse) + Dim inValue As EDMIServiceReference.DocumentStreamRequest = New EDMIServiceReference.DocumentStreamRequest() + inValue.ObjectId = ObjectId + Return CType(Me,EDMIServiceReference.IEDMIService).GetFileByObjectIdAsync(inValue) End Function Public Function NewFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal LanguageCode As String, ByVal Value As String) As EDMIServiceReference.IndexResult Implements EDMIServiceReference.IEDMIService.NewFileIndex diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/service.wsdl b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/service.wsdl index 4129ded6..5f35f48e 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/service.wsdl +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/service.wsdl @@ -160,10 +160,11 @@ - + - + + diff --git a/Modules.EDMIAPI/Document.vb b/Modules.EDMIAPI/Document.vb index 1330bf99..cec2d1d5 100644 --- a/Modules.EDMIAPI/Document.vb +++ b/Modules.EDMIAPI/Document.vb @@ -53,7 +53,7 @@ Public Class Document ''' ''' The filename to import ''' A document object - Public Async Function ImportFileAsync(FilePath As String, Optional [ReadOnly] As Boolean = False, Optional RetentionPeriod As Integer = 0) As Task(Of DocumentResult2) + Public Async Function ImportFileAsync(FilePath As String, Optional [ReadOnly] As Boolean = False, Optional RetentionPeriod As Integer = 0) As Task(Of DocumentResult) Try Using oStream As New FileStream(FilePath, FileMode.Open) Dim oContents As Byte() = {} @@ -73,7 +73,7 @@ Public Class Document ''' ''' The filename to import ''' A document object - Public Function ImportFile(FilePath As String) As DocumentResult2 + Public Function ImportFile(FilePath As String) As DocumentResult Try Dim oContents As Byte() = File.ReadAllBytes(FilePath) Dim oInfo As New FileInfo(FilePath) diff --git a/Modules.EDMIAPI/EDMI.API.vbproj b/Modules.EDMIAPI/EDMI.API.vbproj index 6c44daa7..62d0c483 100644 --- a/Modules.EDMIAPI/EDMI.API.vbproj +++ b/Modules.EDMIAPI/EDMI.API.vbproj @@ -109,7 +109,10 @@ Reference.svcmap - + + Reference.svcmap + + Reference.svcmap diff --git a/Service.EDMIService/EDMIService.vb b/Service.EDMIService/EDMIService.vb index d1e10899..55bd54d5 100644 --- a/Service.EDMIService/EDMIService.vb +++ b/Service.EDMIService/EDMIService.vb @@ -137,7 +137,7 @@ Public Class EDMIService #End Region #Region "Document (with FileContainer)" - Public Function NewFile(FileName As String, Contents() As Byte) As DocumentResult Implements IEDMIService.NewFile + Public Function NewFile(FileName As String, Contents() As Byte) As DocumentResultOld Implements IEDMIService.NewFile Try Dim oContainer As FileContainer Dim oContainerId As String @@ -169,14 +169,14 @@ Public Class EDMIService _logger.Debug("File saved in Container!", FileName) Dim oDocument = New DocumentObject(oContainerId, oDocId, FileName) - Return New DocumentResult(oDocument) + Return New DocumentResultOld(oDocument) Catch ex As Exception _logger.Error(ex) - Return New DocumentResult(ex.Message) + Return New DocumentResultOld(ex.Message) End Try End Function - Public Function UpdateFile(DocObject As DocumentObject, Contents() As Byte) As DocumentResult Implements IEDMIService.UpdateFile + Public Function UpdateFile(DocObject As DocumentObject, Contents() As Byte) As DocumentResultOld Implements IEDMIService.UpdateFile Try TestFileExists(DocObject.ContainerId) @@ -189,14 +189,14 @@ Public Class EDMIService oFileContainer.Save() - Return New DocumentResult(DocObject) + Return New DocumentResultOld(DocObject) Catch ex As Exception _logger.Error(ex) Return Nothing End Try End Function - Public Function GetFile(DocObject As DocumentObject) As DocumentResult Implements IEDMIService.GetFile + Public Function GetFile(DocObject As DocumentObject) As DocumentResultOld Implements IEDMIService.GetFile Try TestFileExists(DocObject.ContainerId) @@ -204,10 +204,10 @@ Public Class EDMIService Dim oContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oContainerPath) Dim oContents As Byte() = oContainer.GetFile().Contents - Return New DocumentResult(DocObject, oContents) + Return New DocumentResultOld(DocObject, oContents) Catch ex As Exception _logger.Error(ex) - Return New DocumentResult(ex.Message) + Return New DocumentResultOld(ex.Message) End Try End Function @@ -243,13 +243,13 @@ Public Class EDMIService End If End Sub - Public Function GetDocumentByDocumentId(DocumentId As Long) As DocumentResult Implements IEDMIService.GetDocumentByDocumentId + Public Function GetDocumentByDocumentId(DocumentId As Long) As DocumentResultOld Implements IEDMIService.GetDocumentByDocumentId Try Dim oSQL = $"SELECT GUID, CONTAINER_ID, ORIGINAL_FILENAME FROM TBIDB_DOCUMENT WHERE GUID = {DocumentId}" Dim oTable = Firebird.GetDatatable(oSQL) If oTable.Rows.Count = 0 Then - Return New DocumentResult("Document not found") + Return New DocumentResultOld("Document not found") End If Dim oRow As DataRow = oTable.Rows.Item(0) @@ -265,19 +265,19 @@ Public Class EDMIService Dim oContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oContainerPath) Dim oContents As Byte() = oContainer.GetFile().Contents - Return New DocumentResult(oDocument, oContents) + Return New DocumentResultOld(oDocument, oContents) Catch ex As Exception - Return New DocumentResult(ex.Message) + Return New DocumentResultOld(ex.Message) End Try End Function - Public Function GetDocumentByContainerId(ContainerId As String) As DocumentResult Implements IEDMIService.GetDocumentByContainerId + Public Function GetDocumentByContainerId(ContainerId As String) As DocumentResultOld Implements IEDMIService.GetDocumentByContainerId Try Dim oSQL = $"SELECT GUID, CONTAINER_ID, ORIGINAL_FILENAME FROM TBIDB_DOCUMENT WHERE CONTAINER_ID = '{ContainerId}'" Dim oTable = Firebird.GetDatatable(oSQL) If oTable.Rows.Count = 0 Then - Return New DocumentResult("Document not found") + Return New DocumentResultOld("Document not found") End If Dim oRow As DataRow = oTable.Rows.Item(0) @@ -293,26 +293,26 @@ Public Class EDMIService Dim oContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oContainerPath) Dim oContents As Byte() = oContainer.GetFile().Contents - Return New DocumentResult(oDocument, oContents) + Return New DocumentResultOld(oDocument, oContents) Catch ex As Exception - Return New DocumentResult(ex.Message) + Return New DocumentResultOld(ex.Message) End Try End Function #End Region #Region "Document" - Public Function ImportFile(FileName As String, Contents() As Byte, AddedWho As String) As DocumentResult2 Implements IEDMIService.ImportFile + Public Function ImportFile(FileName As String, Contents() As Byte, AddedWho As String) As DocumentResult Implements IEDMIService.ImportFile Dim oDocumentType As String = "DummyDocumentType" Dim oRelativePath As String = EDMIPath.GetRelativePath(oDocumentType, FileName) Dim oAbsolutePath As String = EDMIPath.GetActivePath(oDocumentType, FileName) Dim oDirectoryPath = EDMIPath.GetActivePath(oDocumentType) - Dim oDocument = New DocumentResult2.DocumentObject With {.FileName = FileName} + Dim oDocument = New DocumentResult.DocumentObject With {.FileName = FileName} Try Directory.CreateDirectory(oDirectoryPath) Catch ex As Exception _logger.Error(ex) - Return New DocumentResult2(ex.Message) + Return New DocumentResult(ex.Message) End Try Try @@ -337,16 +337,16 @@ Public Class EDMIService oDocument.FileId = oObjectId - Return New DocumentResult2(oDocument) + Return New DocumentResult(oDocument) Catch ex As Exception _logger.Error(ex) - Return New DocumentResult2(ex.Message) + Return New DocumentResult(ex.Message) End Try End Function - Public Function GetFileByObjectId(ObjectId As Int64) As Stream Implements IEDMIService.GetFileByObjectId + Public Function GetFileByObjectId(Data As Messages.DocumentStreamRequest) As Messages.DocumentStreamResponse Implements IEDMIService.GetFileByObjectId Try - Dim oSQL As String = $"SELECT DocRelativePath FROM VWIDB_DOC_DATA WHERE IDB_OBJ_ID = {ObjectId}" + Dim oSQL As String = $"SELECT DocRelativePath FROM VWIDB_DOC_DATA WHERE IDB_OBJ_ID = {Data.ObjectId}" Dim oPath As String = MSSQL.GetScalarValue(oSQL) If IsNothing(oPath) Then @@ -357,8 +357,15 @@ Public Class EDMIService _logger.Debug("GetFileByObjectId: Loading file [{0}]", oFullPath) + Dim oFileInfo As New FileInfo(oFullPath) Dim oSource As FileStream = IO.File.Open(oFullPath, FileMode.Open) - Return oSource + + Dim oMessage As New Messages.DocumentStreamResponse() With { + .FileName = oFileInfo.Name, + .FileContents = oSource + } + + Return oMessage Catch ex As Exception _logger.Error(ex) Return Nothing diff --git a/Service.EDMIService/EDMIService.vbproj b/Service.EDMIService/EDMIService.vbproj index 77d5cb22..ad9b533a 100644 --- a/Service.EDMIService/EDMIService.vbproj +++ b/Service.EDMIService/EDMIService.vbproj @@ -103,13 +103,14 @@ + - + - + Component diff --git a/Service.EDMIService/IEDMIService.vb b/Service.EDMIService/IEDMIService.vb index 4a5bfd94..e52909c8 100644 --- a/Service.EDMIService/IEDMIService.vb +++ b/Service.EDMIService/IEDMIService.vb @@ -29,30 +29,30 @@ Interface IEDMIService #Region "Document (with FileContainer)" - Function NewFile(FileName As String, Contents As Byte()) As DocumentResult + Function NewFile(FileName As String, Contents As Byte()) As DocumentResultOld - Function UpdateFile(DocObject As DocumentObject, Contents As Byte()) As DocumentResult + Function UpdateFile(DocObject As DocumentObject, Contents As Byte()) As DocumentResultOld - Function GetFile(DocObject As DocumentObject) As DocumentResult + Function GetFile(DocObject As DocumentObject) As DocumentResultOld Function DeleteFile(DocObject As DocumentObject) As Boolean - Function GetDocumentByDocumentId(DocumentId As Int64) As DocumentResult + Function GetDocumentByDocumentId(DocumentId As Int64) As DocumentResultOld - Function GetDocumentByContainerId(ContainerId As String) As DocumentResult + Function GetDocumentByContainerId(ContainerId As String) As DocumentResultOld #End Region #Region "Document (New)" - Function ImportFile(FileName As String, Contents As Byte(), AddedWho As String) As DocumentResult2 + Function ImportFile(FileName As String, Contents As Byte(), AddedWho As String) As DocumentResult - Function GetFileByObjectId(ObjectId As Int64) As Stream + Function GetFileByObjectId(Data As Messages.DocumentStreamRequest) As Messages.DocumentStreamResponse #End Region #Region "Index" diff --git a/Service.EDMIService/Messages.vb b/Service.EDMIService/Messages.vb new file mode 100644 index 00000000..1f78722e --- /dev/null +++ b/Service.EDMIService/Messages.vb @@ -0,0 +1,22 @@ +Imports System.IO +Imports System.ServiceModel + +Namespace Messages + + Public Class DocumentStreamRequest + + Public ObjectId As Int64 + End Class + + + Public Class DocumentStreamResponse + + Public FileName As String + + + Public FileContents As Stream + End Class +End Namespace + + + diff --git a/Service.EDMIService/Results/DocumentResult.vb b/Service.EDMIService/Results/DocumentResult.vb index c9d6f3c3..11332187 100644 --- a/Service.EDMIService/Results/DocumentResult.vb +++ b/Service.EDMIService/Results/DocumentResult.vb @@ -1,4 +1,4 @@ -Imports DigitalData.Modules.Filesystem +Imports System.Xml.Serialization Public Class DocumentResult @@ -23,4 +23,9 @@ Public Class DocumentResult Public Sub New(ErrorMessage As String) MyBase.New(ErrorMessage) End Sub + + Public Class DocumentObject + Public FileName As String + Public FileId As String + End Class End Class diff --git a/Service.EDMIService/Results/DocumentResult2.vb b/Service.EDMIService/Results/DocumentResultOld.vb similarity index 77% rename from Service.EDMIService/Results/DocumentResult2.vb rename to Service.EDMIService/Results/DocumentResultOld.vb index f2ad596d..02202516 100644 --- a/Service.EDMIService/Results/DocumentResult2.vb +++ b/Service.EDMIService/Results/DocumentResultOld.vb @@ -1,5 +1,7 @@ - -Public Class DocumentResult2 +Imports DigitalData.Modules.Filesystem + + +Public Class DocumentResultOld Inherits BaseResult Public Document As DocumentObject @@ -21,9 +23,4 @@ Public Class DocumentResult2 Public Sub New(ErrorMessage As String) MyBase.New(ErrorMessage) End Sub - - Public Class DocumentObject - Public FileName As String - Public FileId As String - End Class End Class From b7a5f4d4a3e21e7d2484babd33ca60a252085ccf Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 15 Apr 2020 14:44:42 +0200 Subject: [PATCH 5/8] WIP: EDMI: Improve Error Handling --- GUIs.Test.EDMIBenchmark/Form1.vb | 10 ++++++++-- Service.EDMIService/EDMIService.vb | 27 ++++++++++++++++++++++---- Service.EDMIService/EDMIService.vbproj | 1 + 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/GUIs.Test.EDMIBenchmark/Form1.vb b/GUIs.Test.EDMIBenchmark/Form1.vb index b412c86a..10e41ccf 100644 --- a/GUIs.Test.EDMIBenchmark/Form1.vb +++ b/GUIs.Test.EDMIBenchmark/Form1.vb @@ -115,6 +115,9 @@ Public Class Form1 Private Async Sub ButtonLoadFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles ButtonLoadFile.ItemClick Try + Dim oSWTotal As New Stopwatch() + oSWTotal.Start() + If TextboxObejctId.EditValue = "" Then MsgBox("Please enter an object id!", MsgBoxStyle.Exclamation, "Uh oh!") End If @@ -126,9 +129,12 @@ Public Class Form1 oResponse.FileContents.CopyTo(oMemoryStream) oMemoryStream.Position = 0 - listboxLog.Items.Add("Stream read!") - DocumentViewer1.LoadFile(oResponse.FileName, oMemoryStream) + + oSWTotal.Stop() + listboxLog.Items.Add($"File [{oResponse.FileName}] loaded: [{FormatTime(oSWTotal.ElapsedMilliseconds)}]") + Catch ex As FaultException + MsgBox(ex.Reason.ToString, MsgBoxStyle.Critical, "Error from Service") Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!") End Try diff --git a/Service.EDMIService/EDMIService.vb b/Service.EDMIService/EDMIService.vb index 55bd54d5..05a412c1 100644 --- a/Service.EDMIService/EDMIService.vb +++ b/Service.EDMIService/EDMIService.vb @@ -301,6 +301,13 @@ Public Class EDMIService #End Region #Region "Document" + ''' + ''' + ''' + ''' + ''' + ''' + ''' Public Function ImportFile(FileName As String, Contents() As Byte, AddedWho As String) As DocumentResult Implements IEDMIService.ImportFile Dim oDocumentType As String = "DummyDocumentType" Dim oRelativePath As String = EDMIPath.GetRelativePath(oDocumentType, FileName) @@ -350,7 +357,7 @@ Public Class EDMIService Dim oPath As String = MSSQL.GetScalarValue(oSQL) If IsNothing(oPath) Then - Return Nothing + Throw New FaultException($"Object [{Data.ObjectId}] does not exist in database!") End If Dim oFullPath = EDMIPath.GetActivePathFromRelativePath(oPath) @@ -358,17 +365,29 @@ Public Class EDMIService _logger.Debug("GetFileByObjectId: Loading file [{0}]", oFullPath) Dim oFileInfo As New FileInfo(oFullPath) - Dim oSource As FileStream = IO.File.Open(oFullPath, FileMode.Open) + If Not oFileInfo.Exists Then + Throw New FaultException($"Object [{Data.ObjectId}] does not exist on filesystem!") + End If + + Dim oDestination As New MemoryStream() + Using oSource As FileStream = IO.File.OpenRead(oFullPath) + oSource.CopyTo(oDestination) + End Using + + oDestination.Seek(0, SeekOrigin.Begin) Dim oMessage As New Messages.DocumentStreamResponse() With { .FileName = oFileInfo.Name, - .FileContents = oSource + .FileContents = oDestination } Return oMessage + Catch ex As IOException + _logger.Error(ex) + Throw New FaultException($"Object [{Data.ObjectId}] could not be streamed!") Catch ex As Exception _logger.Error(ex) - Return Nothing + Throw New FaultException(ex.Message) End Try End Function diff --git a/Service.EDMIService/EDMIService.vbproj b/Service.EDMIService/EDMIService.vbproj index ad9b533a..316648f8 100644 --- a/Service.EDMIService/EDMIService.vbproj +++ b/Service.EDMIService/EDMIService.vbproj @@ -71,6 +71,7 @@ ..\packages\NLog.4.7.0\lib\net45\NLog.dll + From 6ee7bd07a30b8789724222c0c8638547ac6b8327 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 15 Apr 2020 16:13:26 +0200 Subject: [PATCH 6/8] EDMIBenchmark: Prepare further tests --- GUIs.Test.EDMIBenchmark/Form1.Designer.vb | 36 +++++++++- GUIs.Test.EDMIBenchmark/Form1.resx | 82 +++++++++++++++++++++++ 2 files changed, 115 insertions(+), 3 deletions(-) diff --git a/GUIs.Test.EDMIBenchmark/Form1.Designer.vb b/GUIs.Test.EDMIBenchmark/Form1.Designer.vb index ac9e125c..bb6cde81 100644 --- a/GUIs.Test.EDMIBenchmark/Form1.Designer.vb +++ b/GUIs.Test.EDMIBenchmark/Form1.Designer.vb @@ -44,6 +44,9 @@ Partial Class Form1 Me.XtraTabPage1 = New DevExpress.XtraTab.XtraTabPage() Me.XtraTabPage2 = New DevExpress.XtraTab.XtraTabPage() Me.DocumentViewer1 = New DigitalData.Controls.DocumentViewer.DocumentViewer() + Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + Me.BarListItem1 = New DevExpress.XtraBars.BarListItem() + Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem() CType(Me.listboxFiles, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.RepositoryItemTextEdit1, System.ComponentModel.ISupportInitialize).BeginInit() @@ -67,9 +70,9 @@ Partial Class Form1 'RibbonControl1 ' Me.RibbonControl1.ExpandCollapseItem.Id = 0 - Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.ButtonSelectFiles, Me.ButtonImportFiles, Me.buttonClearLog, Me.buttonClearFiles, Me.TextboxObejctId, Me.ButtonLoadFile}) + Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.ButtonSelectFiles, Me.ButtonImportFiles, Me.buttonClearLog, Me.buttonClearFiles, Me.TextboxObejctId, Me.ButtonLoadFile, Me.BarListItem1, Me.BarButtonItem1}) Me.RibbonControl1.Location = New System.Drawing.Point(0, 0) - Me.RibbonControl1.MaxItemId = 7 + Me.RibbonControl1.MaxItemId = 9 Me.RibbonControl1.Name = "RibbonControl1" Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) Me.RibbonControl1.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemTextEdit1}) @@ -110,6 +113,7 @@ Partial Class Form1 Me.TextboxObejctId.Edit = Me.RepositoryItemTextEdit1 Me.TextboxObejctId.EditWidth = 100 Me.TextboxObejctId.Id = 5 + Me.TextboxObejctId.ImageOptions.SvgImage = CType(resources.GetObject("TextboxObejctId.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.TextboxObejctId.Name = "TextboxObejctId" ' 'RepositoryItemTextEdit1 @@ -121,11 +125,12 @@ Partial Class Form1 ' Me.ButtonLoadFile.Caption = "Load File" Me.ButtonLoadFile.Id = 6 + Me.ButtonLoadFile.ImageOptions.SvgImage = CType(resources.GetObject("ButtonLoadFile.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.ButtonLoadFile.Name = "ButtonLoadFile" ' 'RibbonPage1 ' - Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup4, Me.RibbonPageGroup3}) + Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup4, Me.RibbonPageGroup3, Me.RibbonPageGroup2}) Me.RibbonPage1.Name = "RibbonPage1" Me.RibbonPage1.Text = "Start" ' @@ -215,6 +220,28 @@ Partial Class Form1 Me.DocumentViewer1.Size = New System.Drawing.Size(1143, 270) Me.DocumentViewer1.TabIndex = 0 ' + 'RibbonPageGroup2 + ' + Me.RibbonPageGroup2.ItemLinks.Add(Me.BarListItem1) + Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem1) + Me.RibbonPageGroup2.Name = "RibbonPageGroup2" + Me.RibbonPageGroup2.Text = "Testing" + ' + 'BarListItem1 + ' + Me.BarListItem1.Caption = "Strategy" + Me.BarListItem1.Id = 7 + Me.BarListItem1.ImageOptions.SvgImage = CType(resources.GetObject("BarListItem1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) + Me.BarListItem1.Name = "BarListItem1" + Me.BarListItem1.Strings.AddRange(New Object() {"Small Files", "Big Files", "Mixed Files"}) + ' + 'BarButtonItem1 + ' + Me.BarButtonItem1.Caption = "Start Looping Test" + Me.BarButtonItem1.Id = 8 + Me.BarButtonItem1.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) + Me.BarButtonItem1.Name = "BarButtonItem1" + ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -262,4 +289,7 @@ Partial Class Form1 Friend WithEvents RibbonPageGroup4 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents XtraTabPage2 As DevExpress.XtraTab.XtraTabPage Friend WithEvents DocumentViewer1 As DigitalData.Controls.DocumentViewer.DocumentViewer + Friend WithEvents BarListItem1 As DevExpress.XtraBars.BarListItem + Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem + Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup End Class diff --git a/GUIs.Test.EDMIBenchmark/Form1.resx b/GUIs.Test.EDMIBenchmark/Form1.resx index 2bbe4509..a2f0f8be 100644 --- a/GUIs.Test.EDMIBenchmark/Form1.resx +++ b/GUIs.Test.EDMIBenchmark/Form1.resx @@ -194,6 +194,88 @@ Ni4xLDIzLjF6IiBjbGFzcz0iQmx1ZSIgLz4NCiAgPHBhdGggZD0iTTI3LjUsMTEuOGwtMTAsMTBsLTku Mi05LjJsMTAtMTBjMC43LTAuNywxLjktMC43LDIuNiwwbDYuNiw2LjZDMjguMiw5LjksMjguMiwxMSwy Ny41LDExLjh6IiBjbGFzcz0iUmVkIiAvPg0KPC9zdmc+Cw== + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl + dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAGkEAAAC77u/ + PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi + IHZpZXdCb3g9IjAgMCAxNiAxNiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv + MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh + Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg + MTYgMTYiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9Cgku + R3JlZW57ZmlsbDojMDM5QzIzO30KCS5XaGl0ZXtmaWxsOiNGRkZGRkY7fQoJLnN0MHtvcGFjaXR5OjAu + Njt9Cgkuc3Qxe29wYWNpdHk6MC41O30KPC9zdHlsZT4NCiAgPHBhdGggZD0iTTE1LDFIMUMwLjUsMSww + LDEuNSwwLDJ2MTJjMCwwLjUsMC41LDEsMSwxaDE0YzAuNSwwLDEtMC41LDEtMVYyQzE2LDEuNSwxNS41 + LDEsMTUsMXogTTE1LDE0SDFWMmgxNFYxNHoiIGNsYXNzPSJCbGFjayIgLz4NCiAgPHBhdGggZD0iTTAs + NVYyYzAtMC41LDAuNS0xLDEtMWgxNGMwLjYsMCwxLDAuNSwxLDF2M0gweiIgY2xhc3M9IkdyZWVuIiAv + Pg0KICA8ZyBpZD0iTGF5ZXJfMiIgY2xhc3M9InN0MCI+DQogICAgPHJlY3QgeD0iMSIgeT0iMiIgd2lk + dGg9IjE0IiBoZWlnaHQ9IjIiIHJ4PSIwIiByeT0iMCIgY2xhc3M9IldoaXRlIiAvPg0KICA8L2c+DQog + IDxyZWN0IHg9IjEiIHk9IjUiIHdpZHRoPSIxNCIgaGVpZ2h0PSI5IiByeD0iMCIgcnk9IjAiIGNsYXNz + PSJXaGl0ZSIgLz4NCiAgPHBhdGggZD0iTTUsMTJWN2gxdjVINXoiIGNsYXNzPSJCbGFjayIgLz4NCiAg + PHBhdGggZD0iTTExLDEyaC0xbDAtMC42QzkuOCwxMS42LDkuNSwxMiw4LjcsMTJjLTAuNSwwLTAuOS0w + LjItMS4yLTAuNUM3LjIsMTEuMiw3LDEwLjcsNywxMC4xQzcsOS41LDcuMiw5LDcuNSw4LjcgIGMwLjMt + MC4zLDAuNy0wLjUsMS4yLTAuNXMwLjksMC4yLDEuMiwwLjVWN0gxMVYxMnogTTguMSwxMC4xYzAsMC40 + LDAsMS4yLDAuOSwxLjJjMC44LDAsMC45LTAuOCwwLjktMS4xQzkuOSw5LjgsOS44LDksOSw5ICBDOC4z + LDksOC4xLDkuNyw4LjEsMTAuMXoiIGNsYXNzPSJCbGFjayIgLz4NCjwvc3ZnPgs= + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl + dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAFcCAAAC77u/ + PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi + IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv + MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh + Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg + MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLlllbGxvd3tmaWxsOiNGRkIxMTU7fQoJ + LlJlZHtmaWxsOiNEMTFDMUM7fQoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KCS5HcmVlbntmaWxsOiMwMzlD + MjM7fQoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9CgkuV2hpdGV7ZmlsbDojRkZGRkZGO30KCS5zdDB7b3Bh + Y2l0eTowLjc1O30KPC9zdHlsZT4NCiAgPGcgaWQ9Ik5leHQiPg0KICAgIDxwYXRoIGQ9Ik0xNiwyQzgu + MywyLDIsOC4zLDIsMTZzNi4zLDE0LDE0LDE0czE0LTYuMywxNC0xNFMyMy43LDIsMTYsMnogTTE2LDI0 + bC04LThoNlY4aDR2OGg2TDE2LDI0eiIgY2xhc3M9IkdyZWVuIiAvPg0KICA8L2c+DQo8L3N2Zz4L + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl + dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAMMDAAAC77u/ + PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi + IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv + MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh + Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg + MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KCS5Z + ZWxsb3d7ZmlsbDojRkZCMTE1O30KCS5SZWR7ZmlsbDojRDExQzFDO30KCS5HcmVlbntmaWxsOiMwMzlD + MjM7fQoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9CgkuV2hpdGV7ZmlsbDojRkZGRkZGO30KCS5zdDB7b3Bh + Y2l0eTowLjU7fQoJLnN0MXtvcGFjaXR5OjAuNzU7fQoJLnN0MntkaXNwbGF5Om5vbmU7fQoJLnN0M3tk + aXNwbGF5OmlubGluZTtmaWxsOiNGRkIxMTU7fQoJLnN0NHtkaXNwbGF5OmlubGluZTt9Cgkuc3Q1e2Rp + c3BsYXk6aW5saW5lO29wYWNpdHk6MC43NTt9Cgkuc3Q2e2Rpc3BsYXk6aW5saW5lO29wYWNpdHk6MC41 + O30KCS5zdDd7ZGlzcGxheTppbmxpbmU7ZmlsbDojMDM5QzIzO30KCS5zdDh7ZGlzcGxheTppbmxpbmU7 + ZmlsbDojRDExQzFDO30KCS5zdDl7ZGlzcGxheTppbmxpbmU7ZmlsbDojMTE3N0Q3O30KCS5zdDEwe2Rp + c3BsYXk6aW5saW5lO2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU+DQogIDxnIGlkPSJLUElfeDVGX0RlZmlu + aXRpb24iPg0KICAgIDxwb2x5Z29uIHBvaW50cz0iMjYsOS4yIDI2LDAgMTIsMTQgOCwxMCAyLDE2IDIs + MjQgMTEuMiwyNCAgIiBjbGFzcz0iR3JlZW4iIC8+DQogICAgPHBhdGggZD0iTTYsMzJoMjZWNkw2LDMy + eiBNMjYsMjZoLTUuNWw1LjUtNS41VjI2eiIgY2xhc3M9IlllbGxvdyIgLz4NCiAgPC9nPg0KPC9zdmc+ + Cw== + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl + dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAALcBAAAC77u/ + PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi + IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv + MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh + Y2U9InByZXNlcnZlIiBpZD0iTmV4dCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzIg + MzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KPC9zdHls + ZT4NCiAgPHBhdGggZD0iTTguOSw0LjFDOC40LDMuOCw4LDQuMSw4LDQuNnYyMC43YzAsMC42LDAuNCww + LjgsMC45LDAuNWwxNi44LTEwLjNjMC41LTAuMywwLjUtMC44LDAtMS4xTDguOSw0LjF6IiBjbGFzcz0i + Qmx1ZSIgLz4NCjwvc3ZnPgs= \ No newline at end of file From 9095c0cd0745abb8431ae0c557ebe0a8d1bacce4 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 16 Apr 2020 13:38:01 +0200 Subject: [PATCH 7/8] EDMI: Add Testing to EDMIBenchmark, Add ListFiles to EDMIService --- GUIs.Test.EDMIBenchmark/Form1.Designer.vb | 423 ++++++++++++++---- GUIs.Test.EDMIBenchmark/Form1.resx | 36 +- GUIs.Test.EDMIBenchmark/Form1.vb | 93 +++- .../GUIs.Test.EDMIBenchmark.vbproj | 4 + .../My Project/licenses.licx | 3 + ...eReference.DocumentListResponse.datasource | 10 + ...italData.Services.EDMIService.Messages.xsd | 33 ++ .../DigitalData.Services.EDMIService.wsdl | 11 + .../DigitalData.Services.EDMIService.xsd | 17 +- .../EDMIServiceReference/Reference.svcmap | 1 + .../EDMIServiceReference/Reference.vb | 108 ++++- .../EDMIServiceReference/service.wsdl | 9 + Modules.EDMIAPI/EDMI.API.vbproj | 6 + Service.EDMIService/EDMIService.vb | 29 +- Service.EDMIService/IEDMIService.vb | 3 + Service.EDMIService/Messages.vb | 27 ++ 16 files changed, 697 insertions(+), 116 deletions(-) create mode 100644 Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentListResponse.datasource create mode 100644 Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.Messages.xsd diff --git a/GUIs.Test.EDMIBenchmark/Form1.Designer.vb b/GUIs.Test.EDMIBenchmark/Form1.Designer.vb index bb6cde81..b5a6d6f6 100644 --- a/GUIs.Test.EDMIBenchmark/Form1.Designer.vb +++ b/GUIs.Test.EDMIBenchmark/Form1.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class Form1 Inherits DevExpress.XtraBars.Ribbon.RibbonForm 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -20,10 +20,13 @@ Partial Class Form1 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. - _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1)) - Me.listboxFiles = New DevExpress.XtraEditors.ListBoxControl() + Dim DockingContainer3 As DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer = New DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer() + Me.DocumentGroup1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.DocumentGroup(Me.components) + Me.Document1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.Document(Me.components) Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl() Me.ButtonSelectFiles = New DevExpress.XtraBars.BarButtonItem() Me.ButtonImportFiles = New DevExpress.XtraBars.BarButtonItem() @@ -32,51 +35,89 @@ Partial Class Form1 Me.TextboxObejctId = New DevExpress.XtraBars.BarEditItem() Me.RepositoryItemTextEdit1 = New DevExpress.XtraEditors.Repository.RepositoryItemTextEdit() Me.ButtonLoadFile = New DevExpress.XtraBars.BarButtonItem() + Me.BarListItem1 = New DevExpress.XtraBars.BarListItem() + Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem() + Me.BarToggleSwitchItem1 = New DevExpress.XtraBars.BarToggleSwitchItem() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroup4 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroup3 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage() - Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl() + Me.DocumentManager1 = New DevExpress.XtraBars.Docking2010.DocumentManager(Me.components) + Me.TabbedView1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView(Me.components) + Me.DockManager1 = New DevExpress.XtraBars.Docking.DockManager(Me.components) + Me.hideContainerBottom = New DevExpress.XtraBars.Docking.AutoHideContainer() + Me.DockPanel3 = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanel3_Container = New DevExpress.XtraBars.Docking.ControlContainer() Me.listboxLog = New DevExpress.XtraEditors.ListBoxControl() - Me.XtraTabControl1 = New DevExpress.XtraTab.XtraTabControl() - Me.XtraTabPage1 = New DevExpress.XtraTab.XtraTabPage() - Me.XtraTabPage2 = New DevExpress.XtraTab.XtraTabPage() + Me.panelContainer1 = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanel4 = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanel4_Container = New DevExpress.XtraBars.Docking.ControlContainer() + Me.GridControl1 = New DevExpress.XtraGrid.GridControl() + Me.BindingSource1 = New System.Windows.Forms.BindingSource(Me.components) + Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.GridColumn1 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.GridColumn2 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.DockPanel1 = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanel1_Container = New DevExpress.XtraBars.Docking.ControlContainer() + Me.listboxFiles = New DevExpress.XtraEditors.ListBoxControl() + Me.DockPanel2 = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanel2_Container = New DevExpress.XtraBars.Docking.ControlContainer() Me.DocumentViewer1 = New DigitalData.Controls.DocumentViewer.DocumentViewer() - Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() - Me.BarListItem1 = New DevExpress.XtraBars.BarListItem() - Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem() - CType(Me.listboxFiles, System.ComponentModel.ISupportInitialize).BeginInit() + Me.Timer1 = New System.Windows.Forms.Timer(Me.components) + Me.BarDockingMenuItem1 = New DevExpress.XtraBars.BarDockingMenuItem() + Me.BarMdiChildrenListItem1 = New DevExpress.XtraBars.BarMdiChildrenListItem() + CType(Me.DocumentGroup1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.Document1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.RepositoryItemTextEdit1, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SplitContainerControl1.SuspendLayout() + CType(Me.DocumentManager1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.TabbedView1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.DockManager1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.hideContainerBottom.SuspendLayout() + Me.DockPanel3.SuspendLayout() + Me.DockPanel3_Container.SuspendLayout() CType(Me.listboxLog, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.XtraTabControl1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.XtraTabControl1.SuspendLayout() - Me.XtraTabPage1.SuspendLayout() - Me.XtraTabPage2.SuspendLayout() + Me.panelContainer1.SuspendLayout() + Me.DockPanel4.SuspendLayout() + Me.DockPanel4_Container.SuspendLayout() + CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.BindingSource1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.DockPanel1.SuspendLayout() + Me.DockPanel1_Container.SuspendLayout() + CType(Me.listboxFiles, System.ComponentModel.ISupportInitialize).BeginInit() + Me.DockPanel2.SuspendLayout() + Me.DockPanel2_Container.SuspendLayout() Me.SuspendLayout() ' - 'listboxFiles + 'DocumentGroup1 ' - Me.listboxFiles.Dock = System.Windows.Forms.DockStyle.Fill - Me.listboxFiles.Location = New System.Drawing.Point(0, 0) - Me.listboxFiles.Name = "listboxFiles" - Me.listboxFiles.Size = New System.Drawing.Size(536, 270) - Me.listboxFiles.TabIndex = 1 + Me.DocumentGroup1.Items.AddRange(New DevExpress.XtraBars.Docking2010.Views.Tabbed.Document() {Me.Document1}) + ' + 'Document1 + ' + Me.Document1.Caption = "Document Viewer" + Me.Document1.ControlName = "DockPanel2" + Me.Document1.FloatLocation = New System.Drawing.Point(0, 0) + Me.Document1.FloatSize = New System.Drawing.Size(200, 200) + Me.Document1.Properties.AllowClose = DevExpress.Utils.DefaultBoolean.[False] + Me.Document1.Properties.AllowFloat = DevExpress.Utils.DefaultBoolean.[True] + Me.Document1.Properties.AllowFloatOnDoubleClick = DevExpress.Utils.DefaultBoolean.[True] ' 'RibbonControl1 ' Me.RibbonControl1.ExpandCollapseItem.Id = 0 - Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.ButtonSelectFiles, Me.ButtonImportFiles, Me.buttonClearLog, Me.buttonClearFiles, Me.TextboxObejctId, Me.ButtonLoadFile, Me.BarListItem1, Me.BarButtonItem1}) + Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.ButtonSelectFiles, Me.ButtonImportFiles, Me.buttonClearLog, Me.buttonClearFiles, Me.TextboxObejctId, Me.ButtonLoadFile, Me.BarListItem1, Me.BarButtonItem2, Me.BarToggleSwitchItem1, Me.BarDockingMenuItem1, Me.BarMdiChildrenListItem1}) Me.RibbonControl1.Location = New System.Drawing.Point(0, 0) - Me.RibbonControl1.MaxItemId = 9 + Me.RibbonControl1.MaxItemId = 13 Me.RibbonControl1.Name = "RibbonControl1" + Me.RibbonControl1.PageHeaderItemLinks.Add(Me.BarDockingMenuItem1) + Me.RibbonControl1.PageHeaderItemLinks.Add(Me.BarMdiChildrenListItem1) Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) Me.RibbonControl1.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemTextEdit1}) - Me.RibbonControl1.Size = New System.Drawing.Size(1145, 158) + Me.RibbonControl1.Size = New System.Drawing.Size(1310, 158) Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1 ' 'ButtonSelectFiles @@ -128,9 +169,30 @@ Partial Class Form1 Me.ButtonLoadFile.ImageOptions.SvgImage = CType(resources.GetObject("ButtonLoadFile.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.ButtonLoadFile.Name = "ButtonLoadFile" ' + 'BarListItem1 + ' + Me.BarListItem1.Caption = "Strategy" + Me.BarListItem1.Id = 7 + Me.BarListItem1.ImageOptions.SvgImage = CType(resources.GetObject("BarListItem1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) + Me.BarListItem1.Name = "BarListItem1" + Me.BarListItem1.Strings.AddRange(New Object() {"Small Files", "Big Files", "Mixed Files"}) + ' + 'BarButtonItem2 + ' + Me.BarButtonItem2.Caption = "List Files" + Me.BarButtonItem2.Id = 9 + Me.BarButtonItem2.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem2.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) + Me.BarButtonItem2.Name = "BarButtonItem2" + ' + 'BarToggleSwitchItem1 + ' + Me.BarToggleSwitchItem1.Caption = "Load File every 3 Seconds" + Me.BarToggleSwitchItem1.Id = 10 + Me.BarToggleSwitchItem1.Name = "BarToggleSwitchItem1" + ' 'RibbonPage1 ' - Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup4, Me.RibbonPageGroup3, Me.RibbonPageGroup2}) + Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup4, Me.RibbonPageGroup3}) Me.RibbonPage1.Name = "RibbonPage1" Me.RibbonPage1.Text = "Start" ' @@ -144,7 +206,9 @@ Partial Class Form1 'RibbonPageGroup4 ' Me.RibbonPageGroup4.ItemLinks.Add(Me.TextboxObejctId) + Me.RibbonPageGroup4.ItemLinks.Add(Me.BarToggleSwitchItem1) Me.RibbonPageGroup4.ItemLinks.Add(Me.ButtonLoadFile) + Me.RibbonPageGroup4.ItemLinks.Add(Me.BarButtonItem2) Me.RibbonPageGroup4.Name = "RibbonPageGroup4" Me.RibbonPageGroup4.Text = "Retrieve" ' @@ -157,139 +221,306 @@ Partial Class Form1 ' 'RibbonStatusBar1 ' - Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 453) + Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 640) Me.RibbonStatusBar1.Name = "RibbonStatusBar1" Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1 - Me.RibbonStatusBar1.Size = New System.Drawing.Size(1145, 24) + Me.RibbonStatusBar1.Size = New System.Drawing.Size(1310, 24) ' 'RibbonPage2 ' Me.RibbonPage2.Name = "RibbonPage2" Me.RibbonPage2.Text = "RibbonPage2" ' - 'SplitContainerControl1 + 'DocumentManager1 + ' + Me.DocumentManager1.ContainerControl = Me + Me.DocumentManager1.MenuManager = Me.RibbonControl1 + Me.DocumentManager1.View = Me.TabbedView1 + Me.DocumentManager1.ViewCollection.AddRange(New DevExpress.XtraBars.Docking2010.Views.BaseView() {Me.TabbedView1}) + ' + 'TabbedView1 + ' + Me.TabbedView1.DocumentGroups.AddRange(New DevExpress.XtraBars.Docking2010.Views.Tabbed.DocumentGroup() {Me.DocumentGroup1}) + Me.TabbedView1.Documents.AddRange(New DevExpress.XtraBars.Docking2010.Views.BaseDocument() {Me.Document1}) + DockingContainer3.Element = Me.DocumentGroup1 + Me.TabbedView1.RootContainer.Nodes.AddRange(New DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer() {DockingContainer3}) + ' + 'DockManager1 ' - Me.SplitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill - Me.SplitContainerControl1.Location = New System.Drawing.Point(0, 0) - Me.SplitContainerControl1.Name = "SplitContainerControl1" - Me.SplitContainerControl1.Panel1.Controls.Add(Me.listboxFiles) - Me.SplitContainerControl1.Panel1.Text = "Panel1" - Me.SplitContainerControl1.Panel2.Controls.Add(Me.listboxLog) - Me.SplitContainerControl1.Panel2.Text = "Panel2" - Me.SplitContainerControl1.Size = New System.Drawing.Size(1143, 270) - Me.SplitContainerControl1.SplitterPosition = 536 - Me.SplitContainerControl1.TabIndex = 4 + Me.DockManager1.AutoHideContainers.AddRange(New DevExpress.XtraBars.Docking.AutoHideContainer() {Me.hideContainerBottom}) + Me.DockManager1.Form = Me + Me.DockManager1.RootPanels.AddRange(New DevExpress.XtraBars.Docking.DockPanel() {Me.panelContainer1, Me.DockPanel2}) + Me.DockManager1.TopZIndexControls.AddRange(New String() {"DevExpress.XtraBars.BarDockControl", "DevExpress.XtraBars.StandaloneBarDockControl", "System.Windows.Forms.StatusBar", "System.Windows.Forms.MenuStrip", "System.Windows.Forms.StatusStrip", "DevExpress.XtraBars.Ribbon.RibbonStatusBar", "DevExpress.XtraBars.Ribbon.RibbonControl", "DevExpress.XtraBars.Navigation.OfficeNavigationBar", "DevExpress.XtraBars.Navigation.TileNavPane", "DevExpress.XtraBars.TabFormControl", "DevExpress.XtraBars.FluentDesignSystem.FluentDesignFormControl", "DevExpress.XtraBars.ToolbarForm.ToolbarFormControl"}) + ' + 'hideContainerBottom + ' + Me.hideContainerBottom.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(240, Byte), Integer), CType(CType(240, Byte), Integer)) + Me.hideContainerBottom.Controls.Add(Me.DockPanel3) + Me.hideContainerBottom.Dock = System.Windows.Forms.DockStyle.Bottom + Me.hideContainerBottom.Location = New System.Drawing.Point(0, 619) + Me.hideContainerBottom.Name = "hideContainerBottom" + Me.hideContainerBottom.Size = New System.Drawing.Size(1310, 21) + ' + 'DockPanel3 + ' + Me.DockPanel3.Controls.Add(Me.DockPanel3_Container) + Me.DockPanel3.Dock = DevExpress.XtraBars.Docking.DockingStyle.Bottom + Me.DockPanel3.FloatVertical = True + Me.DockPanel3.ID = New System.Guid("b0b62b80-3cf3-4f78-a50d-4a79b9cabc39") + Me.DockPanel3.Location = New System.Drawing.Point(0, 0) + Me.DockPanel3.Name = "DockPanel3" + Me.DockPanel3.Options.ShowCloseButton = False + Me.DockPanel3.OriginalSize = New System.Drawing.Size(200, 119) + Me.DockPanel3.SavedDock = DevExpress.XtraBars.Docking.DockingStyle.Bottom + Me.DockPanel3.SavedIndex = 0 + Me.DockPanel3.Size = New System.Drawing.Size(1310, 119) + Me.DockPanel3.Text = "Log" + Me.DockPanel3.Visibility = DevExpress.XtraBars.Docking.DockVisibility.AutoHide + ' + 'DockPanel3_Container + ' + Me.DockPanel3_Container.Controls.Add(Me.listboxLog) + Me.DockPanel3_Container.Location = New System.Drawing.Point(3, 27) + Me.DockPanel3_Container.Name = "DockPanel3_Container" + Me.DockPanel3_Container.Size = New System.Drawing.Size(1304, 89) + Me.DockPanel3_Container.TabIndex = 0 ' 'listboxLog ' Me.listboxLog.Dock = System.Windows.Forms.DockStyle.Fill Me.listboxLog.Location = New System.Drawing.Point(0, 0) Me.listboxLog.Name = "listboxLog" - Me.listboxLog.Size = New System.Drawing.Size(597, 270) + Me.listboxLog.Size = New System.Drawing.Size(1304, 89) Me.listboxLog.TabIndex = 0 ' - 'XtraTabControl1 + 'panelContainer1 + ' + Me.panelContainer1.ActiveChild = Me.DockPanel4 + Me.panelContainer1.Controls.Add(Me.DockPanel4) + Me.panelContainer1.Controls.Add(Me.DockPanel1) + Me.panelContainer1.Dock = DevExpress.XtraBars.Docking.DockingStyle.Left + Me.panelContainer1.ID = New System.Guid("17067a8c-1b48-4d4a-b383-b7f8d5a8be59") + Me.panelContainer1.Location = New System.Drawing.Point(0, 158) + Me.panelContainer1.Name = "panelContainer1" + Me.panelContainer1.Options.ShowCloseButton = False + Me.panelContainer1.OriginalSize = New System.Drawing.Size(451, 200) + Me.panelContainer1.Size = New System.Drawing.Size(451, 461) + Me.panelContainer1.Tabbed = True + Me.panelContainer1.Text = "panelContainer1" + ' + 'DockPanel4 + ' + Me.DockPanel4.Controls.Add(Me.DockPanel4_Container) + Me.DockPanel4.Dock = DevExpress.XtraBars.Docking.DockingStyle.Fill + Me.DockPanel4.ID = New System.Guid("bddc849b-1066-4d2f-8fd3-9bc377a2bd74") + Me.DockPanel4.Location = New System.Drawing.Point(3, 26) + Me.DockPanel4.Name = "DockPanel4" + Me.DockPanel4.Options.ShowCloseButton = False + Me.DockPanel4.OriginalSize = New System.Drawing.Size(200, 200) + Me.DockPanel4.Size = New System.Drawing.Size(444, 406) + Me.DockPanel4.Text = "List Files" + ' + 'DockPanel4_Container + ' + Me.DockPanel4_Container.Controls.Add(Me.GridControl1) + Me.DockPanel4_Container.Location = New System.Drawing.Point(0, 0) + Me.DockPanel4_Container.Name = "DockPanel4_Container" + Me.DockPanel4_Container.Size = New System.Drawing.Size(444, 406) + Me.DockPanel4_Container.TabIndex = 0 + ' + 'GridControl1 + ' + Me.GridControl1.DataSource = Me.BindingSource1 + Me.GridControl1.Dock = System.Windows.Forms.DockStyle.Fill + Me.GridControl1.Location = New System.Drawing.Point(0, 0) + Me.GridControl1.MainView = Me.GridView1 + Me.GridControl1.MenuManager = Me.RibbonControl1 + Me.GridControl1.Name = "GridControl1" + Me.GridControl1.Size = New System.Drawing.Size(444, 406) + Me.GridControl1.TabIndex = 0 + Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1}) + ' + 'BindingSource1 + ' + ' + 'GridView1 + ' + Me.GridView1.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.GridColumn1, Me.GridColumn2}) + Me.GridView1.GridControl = Me.GridControl1 + Me.GridView1.Name = "GridView1" + Me.GridView1.OptionsBehavior.Editable = False + Me.GridView1.OptionsBehavior.ReadOnly = True + ' + 'GridColumn1 + ' + Me.GridColumn1.Caption = "Object Id" + Me.GridColumn1.FieldName = "IDB_OBJ_ID" + Me.GridColumn1.MaxWidth = 100 + Me.GridColumn1.MinWidth = 100 + Me.GridColumn1.Name = "GridColumn1" + Me.GridColumn1.Visible = True + Me.GridColumn1.VisibleIndex = 0 + Me.GridColumn1.Width = 100 + ' + 'GridColumn2 + ' + Me.GridColumn2.Caption = "Document Name" + Me.GridColumn2.FieldName = "DocName" + Me.GridColumn2.Name = "GridColumn2" + Me.GridColumn2.Visible = True + Me.GridColumn2.VisibleIndex = 1 + Me.GridColumn2.Width = 409 + ' + 'DockPanel1 + ' + Me.DockPanel1.Controls.Add(Me.DockPanel1_Container) + Me.DockPanel1.Dock = DevExpress.XtraBars.Docking.DockingStyle.Fill + Me.DockPanel1.ID = New System.Guid("12b5eead-07cc-48c6-93a4-85cd0b4b82ce") + Me.DockPanel1.Location = New System.Drawing.Point(3, 26) + Me.DockPanel1.Name = "DockPanel1" + Me.DockPanel1.Options.ShowCloseButton = False + Me.DockPanel1.OriginalSize = New System.Drawing.Size(200, 200) + Me.DockPanel1.Size = New System.Drawing.Size(444, 406) + Me.DockPanel1.Text = "Files to Upload" + ' + 'DockPanel1_Container + ' + Me.DockPanel1_Container.Controls.Add(Me.listboxFiles) + Me.DockPanel1_Container.Location = New System.Drawing.Point(0, 0) + Me.DockPanel1_Container.Name = "DockPanel1_Container" + Me.DockPanel1_Container.Size = New System.Drawing.Size(444, 406) + Me.DockPanel1_Container.TabIndex = 0 + ' + 'listboxFiles ' - Me.XtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill - Me.XtraTabControl1.Location = New System.Drawing.Point(0, 158) - Me.XtraTabControl1.Name = "XtraTabControl1" - Me.XtraTabControl1.SelectedTabPage = Me.XtraTabPage1 - Me.XtraTabControl1.Size = New System.Drawing.Size(1145, 295) - Me.XtraTabControl1.TabIndex = 7 - Me.XtraTabControl1.TabPages.AddRange(New DevExpress.XtraTab.XtraTabPage() {Me.XtraTabPage1, Me.XtraTabPage2}) + Me.listboxFiles.Dock = System.Windows.Forms.DockStyle.Fill + Me.listboxFiles.Location = New System.Drawing.Point(0, 0) + Me.listboxFiles.Name = "listboxFiles" + Me.listboxFiles.Size = New System.Drawing.Size(444, 406) + Me.listboxFiles.TabIndex = 1 ' - 'XtraTabPage1 + 'DockPanel2 ' - Me.XtraTabPage1.Controls.Add(Me.SplitContainerControl1) - Me.XtraTabPage1.Name = "XtraTabPage1" - Me.XtraTabPage1.Size = New System.Drawing.Size(1143, 270) - Me.XtraTabPage1.Text = "Information" + Me.DockPanel2.Controls.Add(Me.DockPanel2_Container) + Me.DockPanel2.DockedAsTabbedDocument = True + Me.DockPanel2.ID = New System.Guid("e82850af-b594-49e9-ae83-36d4bf007da5") + Me.DockPanel2.Name = "DockPanel2" + Me.DockPanel2.Options.ShowCloseButton = False + Me.DockPanel2.OriginalSize = New System.Drawing.Size(200, 200) + Me.DockPanel2.Text = "Document Viewer" ' - 'XtraTabPage2 + 'DockPanel2_Container ' - Me.XtraTabPage2.Controls.Add(Me.DocumentViewer1) - Me.XtraTabPage2.Name = "XtraTabPage2" - Me.XtraTabPage2.Size = New System.Drawing.Size(1143, 270) - Me.XtraTabPage2.Text = "DocumentViewer" + Me.DockPanel2_Container.Controls.Add(Me.DocumentViewer1) + Me.DockPanel2_Container.Location = New System.Drawing.Point(0, 0) + Me.DockPanel2_Container.Name = "DockPanel2_Container" + Me.DockPanel2_Container.Size = New System.Drawing.Size(853, 432) + Me.DockPanel2_Container.TabIndex = 0 ' 'DocumentViewer1 ' Me.DocumentViewer1.Dock = System.Windows.Forms.DockStyle.Fill Me.DocumentViewer1.Location = New System.Drawing.Point(0, 0) Me.DocumentViewer1.Name = "DocumentViewer1" - Me.DocumentViewer1.Size = New System.Drawing.Size(1143, 270) + Me.DocumentViewer1.Size = New System.Drawing.Size(853, 432) Me.DocumentViewer1.TabIndex = 0 ' - 'RibbonPageGroup2 + 'Timer1 ' - Me.RibbonPageGroup2.ItemLinks.Add(Me.BarListItem1) - Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem1) - Me.RibbonPageGroup2.Name = "RibbonPageGroup2" - Me.RibbonPageGroup2.Text = "Testing" + Me.Timer1.Interval = 3000 ' - 'BarListItem1 + 'BarDockingMenuItem1 ' - Me.BarListItem1.Caption = "Strategy" - Me.BarListItem1.Id = 7 - Me.BarListItem1.ImageOptions.SvgImage = CType(resources.GetObject("BarListItem1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) - Me.BarListItem1.Name = "BarListItem1" - Me.BarListItem1.Strings.AddRange(New Object() {"Small Files", "Big Files", "Mixed Files"}) + Me.BarDockingMenuItem1.Caption = "BarDockingMenuItem1" + Me.BarDockingMenuItem1.Id = 11 + Me.BarDockingMenuItem1.Name = "BarDockingMenuItem1" ' - 'BarButtonItem1 + 'BarMdiChildrenListItem1 ' - Me.BarButtonItem1.Caption = "Start Looping Test" - Me.BarButtonItem1.Id = 8 - Me.BarButtonItem1.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) - Me.BarButtonItem1.Name = "BarButtonItem1" + Me.BarMdiChildrenListItem1.Caption = "BarMdiChildrenListItem1" + Me.BarMdiChildrenListItem1.Id = 12 + Me.BarMdiChildrenListItem1.Name = "BarMdiChildrenListItem1" ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(1145, 477) - Me.Controls.Add(Me.XtraTabControl1) + Me.ClientSize = New System.Drawing.Size(1310, 664) + Me.Controls.Add(Me.panelContainer1) + Me.Controls.Add(Me.hideContainerBottom) Me.Controls.Add(Me.RibbonStatusBar1) Me.Controls.Add(Me.RibbonControl1) Me.Name = "Form1" Me.Ribbon = Me.RibbonControl1 Me.StatusBar = Me.RibbonStatusBar1 Me.Text = "Form1" - CType(Me.listboxFiles, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.DocumentGroup1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.Document1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.RepositoryItemTextEdit1, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit() - Me.SplitContainerControl1.ResumeLayout(False) + CType(Me.DocumentManager1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.TabbedView1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.DockManager1, System.ComponentModel.ISupportInitialize).EndInit() + Me.hideContainerBottom.ResumeLayout(False) + Me.DockPanel3.ResumeLayout(False) + Me.DockPanel3_Container.ResumeLayout(False) CType(Me.listboxLog, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.XtraTabControl1, System.ComponentModel.ISupportInitialize).EndInit() - Me.XtraTabControl1.ResumeLayout(False) - Me.XtraTabPage1.ResumeLayout(False) - Me.XtraTabPage2.ResumeLayout(False) + Me.panelContainer1.ResumeLayout(False) + Me.DockPanel4.ResumeLayout(False) + Me.DockPanel4_Container.ResumeLayout(False) + CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.BindingSource1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.GridView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.DockPanel1.ResumeLayout(False) + Me.DockPanel1_Container.ResumeLayout(False) + CType(Me.listboxFiles, System.ComponentModel.ISupportInitialize).EndInit() + Me.DockPanel2.ResumeLayout(False) + Me.DockPanel2_Container.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() End Sub - Friend WithEvents listboxFiles As DevExpress.XtraEditors.ListBoxControl Friend WithEvents RibbonControl1 As DevExpress.XtraBars.Ribbon.RibbonControl Friend WithEvents RibbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup - Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage Friend WithEvents ButtonSelectFiles As DevExpress.XtraBars.BarButtonItem - Friend WithEvents SplitContainerControl1 As DevExpress.XtraEditors.SplitContainerControl - Friend WithEvents listboxLog As DevExpress.XtraEditors.ListBoxControl Friend WithEvents ButtonImportFiles As DevExpress.XtraBars.BarButtonItem Friend WithEvents buttonClearLog As DevExpress.XtraBars.BarButtonItem Friend WithEvents RibbonPageGroup3 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents buttonClearFiles As DevExpress.XtraBars.BarButtonItem - Friend WithEvents XtraTabControl1 As DevExpress.XtraTab.XtraTabControl - Friend WithEvents XtraTabPage1 As DevExpress.XtraTab.XtraTabPage Friend WithEvents TextboxObejctId As DevExpress.XtraBars.BarEditItem Friend WithEvents RepositoryItemTextEdit1 As DevExpress.XtraEditors.Repository.RepositoryItemTextEdit Friend WithEvents ButtonLoadFile As DevExpress.XtraBars.BarButtonItem Friend WithEvents RibbonPageGroup4 As DevExpress.XtraBars.Ribbon.RibbonPageGroup - Friend WithEvents XtraTabPage2 As DevExpress.XtraTab.XtraTabPage - Friend WithEvents DocumentViewer1 As DigitalData.Controls.DocumentViewer.DocumentViewer Friend WithEvents BarListItem1 As DevExpress.XtraBars.BarListItem - Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem - Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup + Friend WithEvents DocumentManager1 As DevExpress.XtraBars.Docking2010.DocumentManager + Friend WithEvents DockPanel1 As DevExpress.XtraBars.Docking.DockPanel + Friend WithEvents DockPanel1_Container As DevExpress.XtraBars.Docking.ControlContainer + Friend WithEvents listboxFiles As DevExpress.XtraEditors.ListBoxControl + Friend WithEvents listboxLog As DevExpress.XtraEditors.ListBoxControl + Friend WithEvents DocumentViewer1 As DigitalData.Controls.DocumentViewer.DocumentViewer + Friend WithEvents TabbedView1 As DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView + Friend WithEvents DockManager1 As DevExpress.XtraBars.Docking.DockManager + Friend WithEvents DockPanel3 As DevExpress.XtraBars.Docking.DockPanel + Friend WithEvents DockPanel3_Container As DevExpress.XtraBars.Docking.ControlContainer + Friend WithEvents DocumentGroup1 As DevExpress.XtraBars.Docking2010.Views.Tabbed.DocumentGroup + Friend WithEvents Document1 As DevExpress.XtraBars.Docking2010.Views.Tabbed.Document + Friend WithEvents DockPanel2 As DevExpress.XtraBars.Docking.DockPanel + Friend WithEvents DockPanel2_Container As DevExpress.XtraBars.Docking.ControlContainer + Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar + Friend WithEvents panelContainer1 As DevExpress.XtraBars.Docking.DockPanel + Friend WithEvents DockPanel4 As DevExpress.XtraBars.Docking.DockPanel + Friend WithEvents DockPanel4_Container As DevExpress.XtraBars.Docking.ControlContainer + Friend WithEvents GridControl1 As DevExpress.XtraGrid.GridControl + Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents hideContainerBottom As DevExpress.XtraBars.Docking.AutoHideContainer + Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem + Friend WithEvents GridColumn1 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents GridColumn2 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents BindingSource1 As BindingSource + Friend WithEvents BarToggleSwitchItem1 As DevExpress.XtraBars.BarToggleSwitchItem + Friend WithEvents Timer1 As Timer + Friend WithEvents BarDockingMenuItem1 As DevExpress.XtraBars.BarDockingMenuItem + Friend WithEvents BarMdiChildrenListItem1 As DevExpress.XtraBars.BarMdiChildrenListItem End Class diff --git a/GUIs.Test.EDMIBenchmark/Form1.resx b/GUIs.Test.EDMIBenchmark/Form1.resx index a2f0f8be..3d74ebd0 100644 --- a/GUIs.Test.EDMIBenchmark/Form1.resx +++ b/GUIs.Test.EDMIBenchmark/Form1.resx @@ -263,19 +263,39 @@ Cw== - + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl - dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAALcBAAAC77u/ + dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAMEDAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi - IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv + IHZpZXdCb3g9IjAgMCAxNiAxNiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh - Y2U9InByZXNlcnZlIiBpZD0iTmV4dCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzIg - MzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KPC9zdHls - ZT4NCiAgPHBhdGggZD0iTTguOSw0LjFDOC40LDMuOCw4LDQuMSw4LDQuNnYyMC43YzAsMC42LDAuNCww - LjgsMC45LDAuNWwxNi44LTEwLjNjMC41LTAuMywwLjUtMC44LDAtMS4xTDguOSw0LjF6IiBjbGFzcz0i - Qmx1ZSIgLz4NCjwvc3ZnPgs= + Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg + MTYgMTYiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9Cgku + V2hpdGV7ZmlsbDojRkZGRkZGO30KCS5HcmVlbntmaWxsOiMwMzlDMjM7fQoJLnN0MHtvcGFjaXR5OjAu + Njt9Cgkuc3Qxe29wYWNpdHk6MC41O30KPC9zdHlsZT4NCiAgPHBhdGggZD0iTTE1LDFIMUMwLjUsMSww + LDEuNSwwLDJ2MTFjMCwwLjUsMC41LDEsMSwxaDE0YzAuNSwwLDEtMC41LDEtMVYyQzE2LDEuNSwxNS41 + LDEsMTUsMXogTTE1LDEzSDFWMmgxNFYxM3oiIGNsYXNzPSJCbGFjayIgLz4NCiAgPHBhdGggZD0iTTAs + NVYyYzAtMC41LDAuNS0xLDEtMWgxNGMwLjYsMCwxLDAuNSwxLDF2M0gweiIgY2xhc3M9IkdyZWVuIiAv + Pg0KICA8ZyBpZD0iTGF5ZXJfMiIgY2xhc3M9InN0MCI+DQogICAgPHJlY3QgeD0iMSIgeT0iMiIgd2lk + dGg9IjE0IiBoZWlnaHQ9IjIiIHJ4PSIwIiByeT0iMCIgY2xhc3M9IldoaXRlIiAvPg0KICA8L2c+DQog + IDxyZWN0IHg9IjEiIHk9IjUiIHdpZHRoPSIxNCIgaGVpZ2h0PSI4IiByeD0iMCIgcnk9IjAiIGNsYXNz + PSJXaGl0ZSIgLz4NCiAgPGcgaWQ9IkxheWVyXzMiIGNsYXNzPSJzdDAiPg0KICAgIDxwYXRoIGQ9Ik0x + NSw4VjdoLTNWNWgtMXYySDVWNUg0djJIMXYxaDN2MkgxdjFoM3YyaDF2LTJoNnYyaDF2LTJoM3YtMWgt + M1Y4SDE1eiBNMTEsMTBINVY4aDZWMTB6IiBjbGFzcz0iQmxhY2siIC8+DQogIDwvZz4NCjwvc3ZnPgs= + + 17, 17 + + + 181, 17 + + + 316, 17 + + + 453, 17 + \ No newline at end of file diff --git a/GUIs.Test.EDMIBenchmark/Form1.vb b/GUIs.Test.EDMIBenchmark/Form1.vb index 10e41ccf..c117e859 100644 --- a/GUIs.Test.EDMIBenchmark/Form1.vb +++ b/GUIs.Test.EDMIBenchmark/Form1.vb @@ -19,6 +19,11 @@ Public Class Form1 DocumentViewer1.Init(oLogConfig, "21182889975216572111813147150675976632") End Sub + Private Sub AddLogMessage(Message As String) + listboxLog.Items.Add(Message) + listboxLog.MakeItemVisible(listboxLog.Items.Count - 1) + End Sub + Private Sub ButtonSelectFiles_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles ButtonSelectFiles.ItemClick Dim oDialog As New OpenFileDialog() With { .Multiselect = True, @@ -44,7 +49,7 @@ Public Class Form1 Dim oFileName As String = oItem Dim oFileInfo As New FileInfo(oFileName) - listboxLog.Items.Add($"Importing {oFileInfo.Name}... ({FormatBytes(oFileInfo.Length)})") + AddLogMessage($"Importing {oFileInfo.Name}... ({FormatBytes(oFileInfo.Length)})") Dim oContents As Byte() = New Byte(oFileInfo.Length) {} @@ -54,18 +59,17 @@ Public Class Form1 Dim oResult As EDMIServiceReference.DocumentResult = Await _Channel.ImportFileAsync(oFileInfo.Name, oContents, Environment.UserName) If oResult.OK Then - listboxLog.Items.Add($"File [{oFileInfo.Name}] with Id [{oResult.Document.FileId}] imported!") + AddLogMessage($"File [{oFileInfo.Name}] with Id [{oResult.Document.FileId}] imported!") Else - listboxLog.Items.Add($"Import Error: {oResult.ErrorMessage}") + AddLogMessage($"Import Error: {oResult.ErrorMessage}") End If oSW.Stop() - listboxLog.Items.Add($"Import Time: {FormatTime(oSW.ElapsedMilliseconds)}") - listboxLog.Items.Add("") + AddLogMessage($"Import Time: {FormatTime(oSW.ElapsedMilliseconds)}") + AddLogMessage("") Next oSWTotal.Stop() - listboxLog.Items.Add($"Total Time: {FormatTime(oSWTotal.ElapsedMilliseconds)}") - listboxLog.MakeItemVisible(listboxLog.Items.Count - 1) + AddLogMessage($"Total Time: {FormatTime(oSWTotal.ElapsedMilliseconds)}") End Sub Private Sub buttonClearLog_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles buttonClearLog.ItemClick @@ -132,11 +136,84 @@ Public Class Form1 DocumentViewer1.LoadFile(oResponse.FileName, oMemoryStream) oSWTotal.Stop() - listboxLog.Items.Add($"File [{oResponse.FileName}] loaded: [{FormatTime(oSWTotal.ElapsedMilliseconds)}]") + AddLogMessage($"File [{oResponse.FileName}] loaded: [{FormatTime(oSWTotal.ElapsedMilliseconds)}]") Catch ex As FaultException MsgBox(ex.Reason.ToString, MsgBoxStyle.Critical, "Error from Service") Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!") End Try End Sub + + Private Async Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick + Try + Dim oResult = Await _Channel.ListFilesForUserAsync() + BindingSource1.DataSource = oResult.Datatable + Catch ex As Exception + MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!") + End Try + End Sub + + Private Async Sub BindingSource1_CurrentChanged(sender As Object, e As EventArgs) Handles BindingSource1.CurrentChanged + Dim oRow As DataRow = GridView1.GetFocusedDataRow() + + If oRow Is Nothing Then + Exit Sub + End If + + Try + Dim oSWTotal As New Stopwatch() + oSWTotal.Start() + + Dim oObjectId As Int64 = oRow.Item("IDB_OBJ_ID") + Dim oResponse = Await _Channel.GetFileByObjectIdAsync(New EDMIServiceReference.DocumentStreamRequest() With {.ObjectId = oObjectId}) + Dim oMemoryStream As New MemoryStream() + oResponse.FileContents.CopyTo(oMemoryStream) + oMemoryStream.Position = 0 + + DocumentViewer1.LoadFile(oResponse.FileName, oMemoryStream) + + oSWTotal.Stop() + AddLogMessage($"File [{oResponse.FileName}] loaded: [{FormatTime(oSWTotal.ElapsedMilliseconds)}]") + Catch ex As FaultException + MsgBox(ex.Reason.ToString, MsgBoxStyle.Critical, "Error from Service") + Catch ex As Exception + MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!") + End Try + End Sub + + Private Async Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick + Try + Dim oSWTotal As New Stopwatch() + oSWTotal.Start() + + Dim oObjectId As Integer = TextboxObejctId.EditValue + + Dim oResponse = Await _Channel.GetFileByObjectIdAsync(New EDMIServiceReference.DocumentStreamRequest() With {.ObjectId = oObjectId}) + Dim oMemoryStream As New MemoryStream() + oResponse.FileContents.CopyTo(oMemoryStream) + oMemoryStream.Position = 0 + + DocumentViewer1.LoadFile(oResponse.FileName, oMemoryStream) + + oSWTotal.Stop() + AddLogMessage($"File [{oResponse.FileName}] loaded: [{FormatTime(oSWTotal.ElapsedMilliseconds)}]") + Catch ex As Exception + AddLogMessage($"Error while getting file: [{ex.Message}]") + End Try + End Sub + + Private Sub BarToggleSwitchItem1_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarToggleSwitchItem1.CheckedChanged + If BarToggleSwitchItem1.Checked Then + If TextboxObejctId.EditValue = "" Then + Timer1.Stop() + MsgBox("Please set a ObjectId!", MsgBoxStyle.Critical, Text) + Else + Timer1.Start() + AddLogMessage("Timer Started!") + End If + Else + Timer1.Stop() + AddLogMessage("Timer Stopped!") + End If + End Sub End Class diff --git a/GUIs.Test.EDMIBenchmark/GUIs.Test.EDMIBenchmark.vbproj b/GUIs.Test.EDMIBenchmark/GUIs.Test.EDMIBenchmark.vbproj index f94cc8cb..c159aa05 100644 --- a/GUIs.Test.EDMIBenchmark/GUIs.Test.EDMIBenchmark.vbproj +++ b/GUIs.Test.EDMIBenchmark/GUIs.Test.EDMIBenchmark.vbproj @@ -54,9 +54,13 @@ + ..\Controls.DocumentViewer\obj\Debug\DigitalData.Controls.DocumentViewer.dll + + ..\Controls.LookupGrid\obj\Debug\DigitalData.Controls.LookupGrid.dll + D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll diff --git a/GUIs.Test.EDMIBenchmark/My Project/licenses.licx b/GUIs.Test.EDMIBenchmark/My Project/licenses.licx index e29ff0b5..e1f672e4 100644 --- a/GUIs.Test.EDMIBenchmark/My Project/licenses.licx +++ b/GUIs.Test.EDMIBenchmark/My Project/licenses.licx @@ -1,2 +1,5 @@ DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.Docking2010.DocumentManager, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentListResponse.datasource b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentListResponse.datasource new file mode 100644 index 00000000..ba63f700 --- /dev/null +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentListResponse.datasource @@ -0,0 +1,10 @@ + + + + DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentListResponse, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.Messages.xsd b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.Messages.xsd new file mode 100644 index 00000000..00e7f568 --- /dev/null +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.Messages.xsd @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl index 554c690d..886341bc 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.wsdl @@ -9,6 +9,7 @@ + @@ -98,6 +99,12 @@ + + + + + + @@ -161,6 +168,10 @@ + + + + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd index 78896d41..97097dc5 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd @@ -3,6 +3,7 @@ + @@ -199,10 +200,22 @@ + + + + + + + + + + + + - + @@ -212,7 +225,7 @@ - + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap index 0dd586d8..43899f29 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.svcmap @@ -31,6 +31,7 @@ + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb index 1df41c22..8a43f979 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb @@ -97,7 +97,9 @@ Namespace EDMIServiceReference System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentResult.DocumentObject)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.IndexResult)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(System.DBNull)), _ - System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentObject))> _ + System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentObject)), _ + System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentListResponse)), _ + System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.BaseResponse))> _ Partial Public Class ScalarResult Inherits EDMIServiceReference.BaseResult @@ -417,6 +419,96 @@ Namespace EDMIServiceReference End Sub End Class + _ + Partial Public Class DocumentListResponse + Inherits EDMIServiceReference.BaseResponse + + _ + Private DatatableField As System.Data.DataTable + + _ + Public Property Datatable() As System.Data.DataTable + Get + Return Me.DatatableField + End Get + Set + If (Object.ReferenceEquals(Me.DatatableField, value) <> true) Then + Me.DatatableField = value + Me.RaisePropertyChanged("Datatable") + End If + End Set + End Property + End Class + + _ + Partial Public Class BaseResponse + Inherits Object + Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged + + _ + Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject + + _ + Private ErrorMessageField As String + + _ + Private OKField As Boolean + + _ + Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData + Get + Return Me.extensionDataField + End Get + Set + Me.extensionDataField = value + End Set + End Property + + _ + Public Property ErrorMessage() As String + Get + Return Me.ErrorMessageField + End Get + Set + If (Object.ReferenceEquals(Me.ErrorMessageField, value) <> true) Then + Me.ErrorMessageField = value + Me.RaisePropertyChanged("ErrorMessage") + End If + End Set + End Property + + _ + Public Property OK() As Boolean + Get + Return Me.OKField + End Get + Set + If (Me.OKField.Equals(value) <> true) Then + Me.OKField = value + Me.RaisePropertyChanged("OK") + End If + End Set + End Property + + Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged + + Protected Sub RaisePropertyChanged(ByVal propertyName As String) + Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent + If (Not (propertyChanged) Is Nothing) Then + propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName)) + End If + End Sub + End Class + _ Public Interface IEDMIService @@ -514,6 +606,12 @@ Namespace EDMIServiceReference _ Function GetFileByObjectIdAsync(ByVal request As EDMIServiceReference.DocumentStreamRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentStreamResponse) + _ + Function ListFilesForUser() As EDMIServiceReference.DocumentListResponse + + _ + Function ListFilesForUserAsync() As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentListResponse) + _ Function NewFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal LanguageCode As String, ByVal Value As String) As EDMIServiceReference.IndexResult @@ -722,6 +820,14 @@ Namespace EDMIServiceReference Return CType(Me,EDMIServiceReference.IEDMIService).GetFileByObjectIdAsync(inValue) End Function + Public Function ListFilesForUser() As EDMIServiceReference.DocumentListResponse Implements EDMIServiceReference.IEDMIService.ListFilesForUser + Return MyBase.Channel.ListFilesForUser + End Function + + Public Function ListFilesForUserAsync() As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentListResponse) Implements EDMIServiceReference.IEDMIService.ListFilesForUserAsync + Return MyBase.Channel.ListFilesForUserAsync + End Function + Public Function NewFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal LanguageCode As String, ByVal Value As String) As EDMIServiceReference.IndexResult Implements EDMIServiceReference.IEDMIService.NewFileIndex Return MyBase.Channel.NewFileIndex(DocObject, Syskey, LanguageCode, Value) End Function diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/service.wsdl b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/service.wsdl index 5f35f48e..b8d866c0 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/service.wsdl +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/service.wsdl @@ -168,6 +168,15 @@ + + + + + + + + + diff --git a/Modules.EDMIAPI/EDMI.API.vbproj b/Modules.EDMIAPI/EDMI.API.vbproj index 62d0c483..a9808632 100644 --- a/Modules.EDMIAPI/EDMI.API.vbproj +++ b/Modules.EDMIAPI/EDMI.API.vbproj @@ -106,6 +106,9 @@ + + Reference.svcmap + Reference.svcmap @@ -130,6 +133,9 @@ Designer + + Designer + Designer diff --git a/Service.EDMIService/EDMIService.vb b/Service.EDMIService/EDMIService.vb index 05a412c1..bd0e5ea7 100644 --- a/Service.EDMIService/EDMIService.vb +++ b/Service.EDMIService/EDMIService.vb @@ -30,12 +30,24 @@ Public Class EDMIService Public Sub New() Dim oOperationContext As OperationContext = OperationContext.Current Dim oInstanceContext As InstanceContext = oOperationContext.InstanceContext - Dim oUsername = oOperationContext.ServiceSecurityContext.WindowsIdentity.Name + Dim oUsername = StripDomainFromUsername(oOperationContext.ServiceSecurityContext.WindowsIdentity.Name) _username = oUsername _logger = LogConfig.GetLogger() + + _logger.Debug("New Request by User [{0}]", _username) End Sub + Public Function StripDomainFromUsername(UserName As String) + If UserName.Contains("\") Then + Return UserName.Split("\")(1) + ElseIf UserName.Contains("@") Then + Return UserName.Split("@")(0) + Else + Return UserName + End If + End Function + #Region "Auth" Private Function TestUserAuth() As Boolean Try @@ -391,6 +403,21 @@ Public Class EDMIService End Try End Function + Public Function ListFilesForUser() As Messages.DocumentListResponse Implements IEDMIService.ListFilesForUser + Try + Dim oSQL = $"SELECT * FROM VWIDB_DOC_DATA WHERE ADDED_WHO = UPPER('{_username}')" + Dim oDatatable As DataTable = MSSQL.GetDatatable(oSQL) + oDatatable.TableName = "DocumentList" + + Return New Messages.DocumentListResponse() With { + .Datatable = oDatatable + } + Catch ex As Exception + _logger.Error(ex) + Throw New FaultException(ex.Message) + End Try + End Function + #End Region #Region "Index" diff --git a/Service.EDMIService/IEDMIService.vb b/Service.EDMIService/IEDMIService.vb index e52909c8..41a595f7 100644 --- a/Service.EDMIService/IEDMIService.vb +++ b/Service.EDMIService/IEDMIService.vb @@ -53,6 +53,9 @@ Interface IEDMIService Function GetFileByObjectId(Data As Messages.DocumentStreamRequest) As Messages.DocumentStreamResponse + + + Function ListFilesForUser() As Messages.DocumentListResponse #End Region #Region "Index" diff --git a/Service.EDMIService/Messages.vb b/Service.EDMIService/Messages.vb index 1f78722e..4ce640fa 100644 --- a/Service.EDMIService/Messages.vb +++ b/Service.EDMIService/Messages.vb @@ -1,7 +1,27 @@ Imports System.IO +Imports System.Runtime.Serialization Imports System.ServiceModel Namespace Messages + + + + Public MustInherit Class BaseResponse + + Public Property OK As Boolean + + Public Property ErrorMessage As String + + Public Sub New() + OK = True + End Sub + + Public Sub New(ErrorMessage As String) + OK = False + Me.ErrorMessage = ErrorMessage + End Sub + End Class + Public Class DocumentStreamRequest @@ -16,6 +36,13 @@ Namespace Messages Public FileContents As Stream End Class + + Public Class DocumentListResponse + Inherits BaseResponse + + Public Datatable As DataTable + End Class + End Namespace From 88dfb3fab1c1c0ebbbaffbf79e688d8428984be1 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 16 Apr 2020 16:31:34 +0200 Subject: [PATCH 8/8] EDMI: Prepare using moving files to archive and setting retention date on import --- Service.EDMIService/EDMIService.vb | 15 +++++++++++---- Service.EDMIService/IEDMIService.vb | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Service.EDMIService/EDMIService.vb b/Service.EDMIService/EDMIService.vb index bd0e5ea7..3a4885fa 100644 --- a/Service.EDMIService/EDMIService.vb +++ b/Service.EDMIService/EDMIService.vb @@ -314,13 +314,20 @@ Public Class EDMIService #Region "Document" ''' - ''' + ''' Imports a file according to ObjectStoreId ''' ''' ''' - ''' ''' - Public Function ImportFile(FileName As String, Contents() As Byte, AddedWho As String) As DocumentResult Implements IEDMIService.ImportFile + Public Function ImportFile(FileName As String, Contents() As Byte, ObjectStoreId As Int64, DocumentType As String, Optional RetentionDays As Int64 = Nothing) As DocumentResult Implements IEDMIService.ImportFile + ' TODO: + ' - Get Object Store -> Object Catalog -> Catalog Path + ' - If IS_ARCHIVE = True And RetentionDays <> Nothing: + ' DoArchive! + ' - Refactor EDMIPath to get ObjectStore at service start up + ' and return ObjectStore Path from ObjectStoreId + RelativePath + ' VWIDB_OBJECTSTORE + Dim oDocumentType As String = "DummyDocumentType" Dim oRelativePath As String = EDMIPath.GetRelativePath(oDocumentType, FileName) Dim oAbsolutePath As String = EDMIPath.GetActivePath(oDocumentType, FileName) @@ -348,7 +355,7 @@ Public Class EDMIService Dim oCommand As New SqlCommand("PRIDB_NEW_DOCUMENT") oCommand.Parameters.AddWithValue("@OBJ_ST_ID", 1) oCommand.Parameters.AddWithValue("@REL_PATH", oRelativePath) - oCommand.Parameters.AddWithValue("@WHO", AddedWho) + oCommand.Parameters.AddWithValue("@WHO", _username) oCommand.Parameters.AddWithValue("@REF_DOCID", 0) oCommand.Parameters.Add(New SqlParameter("@IDB_OBJ_ID", SqlDbType.BigInt)) diff --git a/Service.EDMIService/IEDMIService.vb b/Service.EDMIService/IEDMIService.vb index 41a595f7..9df8a652 100644 --- a/Service.EDMIService/IEDMIService.vb +++ b/Service.EDMIService/IEDMIService.vb @@ -49,7 +49,7 @@ Interface IEDMIService #Region "Document (New)" - Function ImportFile(FileName As String, Contents As Byte(), AddedWho As String) As DocumentResult + Function ImportFile(FileName As String, Contents As Byte(), ObjectStoreId As Int64, DocumentType As String, Optional RetentionDays As Int64 = Nothing) As DocumentResult Function GetFileByObjectId(Data As Messages.DocumentStreamRequest) As Messages.DocumentStreamResponse