From 6f0164d0107cbfcc65549bb1b6ac58e327d71172 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Fri, 1 Mar 2019 15:52:00 +0100 Subject: [PATCH] File Container, Prepare Import for Marvman --- DDMonorepo.sln | 2 +- EDMI_ClientSuite/ClientSuite.vbproj | 4 +- EDMI_ClientSuite/frmFileTest.vb | 24 ++- EDMI_FILE_OPs/Channel.vb | 3 + ...erviceReference.DocumentResult.datasource} | 4 +- .../DigitalData.Modules.Filesystem.xsd | 12 +- .../DigitalData.Services.EDMService.wsdl | 10 + .../DigitalData.Services.EDMService.xsd | 31 ++- .../DigitalData.Services.EDMService1.xsd | 8 +- .../EDMIServiceReference/Reference.vb | 188 ++++++++++-------- .../EDMIServiceReference/service.wsdl | 9 + EDMI_FILE_OPs/Document.vb | 144 ++++++++++++++ .../{EDMIFileOps.vbproj => EDMIAPI.vbproj} | 5 +- EDMI_FILE_OPs/FileOp.vb | 120 ----------- Filesystem/DocumentObject.vb | 12 ++ Filesystem/FileContainer.vb | 27 +-- Filesystem/FileContainerInner.vb | 5 +- Filesystem/Filesystem.vbproj | 1 + Modules.Database/Firebird.vb | 3 + .../DDEDM_NetworkService/DDEDMService.vbproj | 1 + .../DDEDM_NetworkService/DocumentResult.vb | 20 ++ SERVICES/DDEDM_NetworkService/EDMService.vb | 140 +++++++++---- SERVICES/DDEDM_NetworkService/IEDMService.vb | 15 +- .../DDEDM_NetworkService/WindowsService.vb | 2 + 24 files changed, 490 insertions(+), 300 deletions(-) create mode 100644 EDMI_FILE_OPs/Channel.vb rename EDMI_FILE_OPs/Connected Services/EDMIServiceReference/{DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ContainerResult.datasource => DigitalData.Modules.EDMIFileOps.EDMIServiceReference.DocumentResult.datasource} (57%) create mode 100644 EDMI_FILE_OPs/Document.vb rename EDMI_FILE_OPs/{EDMIFileOps.vbproj => EDMIAPI.vbproj} (97%) delete mode 100644 EDMI_FILE_OPs/FileOp.vb create mode 100644 Filesystem/DocumentObject.vb create mode 100644 SERVICES/DDEDM_NetworkService/DocumentResult.vb diff --git a/DDMonorepo.sln b/DDMonorepo.sln index 58afbfdf..dd0beef4 100644 --- a/DDMonorepo.sln +++ b/DDMonorepo.sln @@ -61,7 +61,7 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ClientSuite", "EDMI_ClientS EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDEDMService", "SERVICES\DDEDM_NetworkService\DDEDMService.vbproj", "{A8C3F298-76AB-4359-AB3C-986E313B4336}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EDMIFileOps", "EDMI_FILE_OPs\EDMIFileOps.vbproj", "{5B1171DC-FFFE-4813-A20D-786AAE47B320}" +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EDMIAPI", "EDMI_FILE_OPs\EDMIAPI.vbproj", "{5B1171DC-FFFE-4813-A20D-786AAE47B320}" EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDEDMLicenseService", "DDLicenseService\DDEDMLicenseService.vbproj", "{CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C}" EndProject diff --git a/EDMI_ClientSuite/ClientSuite.vbproj b/EDMI_ClientSuite/ClientSuite.vbproj index e6ac3033..2ec288e9 100644 --- a/EDMI_ClientSuite/ClientSuite.vbproj +++ b/EDMI_ClientSuite/ClientSuite.vbproj @@ -368,9 +368,9 @@ {44982F9B-6116-44E2-85D0-F39650B1EF99} Config - + {5b1171dc-fffe-4813-a20d-786aae47b320} - EDMIFileOps + EDMIAPI {991d0231-4623-496d-8bd0-9ca906029cbc} diff --git a/EDMI_ClientSuite/frmFileTest.vb b/EDMI_ClientSuite/frmFileTest.vb index 0928c1c5..1f4faa3f 100644 --- a/EDMI_ClientSuite/frmFileTest.vb +++ b/EDMI_ClientSuite/frmFileTest.vb @@ -1,8 +1,10 @@ -Imports DigitalData.Modules.EDMIFileOps +Imports System.IO +Imports DigitalData.Modules.EDMIFileOps +Imports DigitalData.Modules.Filesystem Imports DigitalData.Modules.Logging Public Class frmFileTest - Private _fileOp As FileOp + Private _fileOp As Document Private _Logger As Logger Public Sub New() @@ -13,7 +15,7 @@ Public Class frmFileTest Private Sub frmFileTest_Load(sender As Object, e As EventArgs) Handles Me.Load Try - _fileOp = New FileOp(My.LogConfig, My.Settings.EDM_NetworkService_Adress) + _fileOp = New Document(My.LogConfig, My.Settings.EDM_NetworkService_Adress) Catch ex As Exception _Logger.Warn($"Unexpected error in frmFileTest_Load: {ex.Message}") @@ -27,9 +29,19 @@ Public Class frmFileTest If oResult <> DialogResult.OK Then Exit Sub End If - Dim oFileID = Await _fileOp.New_EDMI_File(oDialog.FileName, Environment.UserName) - MsgBox(oFileID) - ListBox1.Items.Add(oFileID) + Try + Dim oDocObject = Await _fileOp.ImportFileAsync(oDialog.FileName) + + If oDocObject.OK = False Then + MsgBox(oDocObject.ErrorMessage) + Exit Sub + End If + + ListBox1.Items.Add(oDocObject) + Catch ex As Exception + MsgBox(ex.Message) + _Logger.Error(ex) + End Try End Sub End Class \ No newline at end of file diff --git a/EDMI_FILE_OPs/Channel.vb b/EDMI_FILE_OPs/Channel.vb new file mode 100644 index 00000000..03a749e5 --- /dev/null +++ b/EDMI_FILE_OPs/Channel.vb @@ -0,0 +1,3 @@ +Public Class Channel + +End Class diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ContainerResult.datasource b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.DocumentResult.datasource similarity index 57% rename from EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ContainerResult.datasource rename to EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.DocumentResult.datasource index 37ec8092..f6bab7be 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ContainerResult.datasource +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.DocumentResult.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.EDMIFileOps.EDMIServiceReference.ContainerResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + DigitalData.Modules.EDMIFileOps.EDMIServiceReference.DocumentResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.Filesystem.xsd b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.Filesystem.xsd index 46469df3..b1e687d9 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.Filesystem.xsd +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.Filesystem.xsd @@ -1,13 +1,11 @@  - + - - - - - + + + - + \ No newline at end of file diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.wsdl b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.wsdl index e4fa8f9c..f0e6a0cc 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.wsdl +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.wsdl @@ -70,6 +70,12 @@ + + + + + + @@ -111,5 +117,9 @@ + + + + \ No newline at end of file diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.xsd b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.xsd index 29f05a8b..477a2919 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.xsd +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.xsd @@ -1,6 +1,7 @@  + @@ -83,22 +84,22 @@ + - - + - + @@ -106,28 +107,28 @@ - + - + - + - + @@ -138,4 +139,20 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService1.xsd b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService1.xsd index 4fce5c2f..f45af9fe 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService1.xsd +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService1.xsd @@ -37,12 +37,14 @@ - + - + + + - + \ No newline at end of file diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/Reference.vb b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/Reference.vb index 1d74e893..fa0afbfe 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/Reference.vb +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/Reference.vb @@ -101,9 +101,9 @@ Namespace EDMIServiceReference System.SerializableAttribute(), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.TableResult)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.NonQueryResult)), _ - System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.ContainerResult)), _ + System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentResult)), _ System.Runtime.Serialization.KnownTypeAttribute(GetType(System.DBNull)), _ - System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.FileContainerInner))> _ + System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentObject))> _ Partial Public Class ScalarResult Inherits Object Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged @@ -244,19 +244,23 @@ Namespace EDMIServiceReference _ - Partial Public Class ContainerResult + Partial Public Class DocumentResult Inherits Object Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged _ Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject - Private ContainerField As EDMIServiceReference.FileContainerInner + Private ContentsField() As Byte + + Private DocumentField As EDMIServiceReference.DocumentObject Private ErrorMessageField As String + Private HasContentsField As Boolean + Private OKField As Boolean _ @@ -270,14 +274,27 @@ Namespace EDMIServiceReference End Property _ - Public Property Container() As EDMIServiceReference.FileContainerInner + Public Property Contents() As Byte() + Get + Return Me.ContentsField + End Get + Set + If (Object.ReferenceEquals(Me.ContentsField, value) <> true) Then + Me.ContentsField = value + Me.RaisePropertyChanged("Contents") + End If + End Set + End Property + + _ + Public Property Document() As EDMIServiceReference.DocumentObject Get - Return Me.ContainerField + Return Me.DocumentField End Get Set - If (Object.ReferenceEquals(Me.ContainerField, value) <> true) Then - Me.ContainerField = value - Me.RaisePropertyChanged("Container") + If (Object.ReferenceEquals(Me.DocumentField, value) <> true) Then + Me.DocumentField = value + Me.RaisePropertyChanged("Document") End If End Set End Property @@ -295,6 +312,19 @@ Namespace EDMIServiceReference End Set End Property + _ + Public Property HasContents() As Boolean + Get + Return Me.HasContentsField + End Get + Set + If (Me.HasContentsField.Equals(value) <> true) Then + Me.HasContentsField = value + Me.RaisePropertyChanged("HasContents") + End If + End Set + End Property + _ Public Property OK() As Boolean Get @@ -320,24 +350,20 @@ Namespace EDMIServiceReference _ - Partial Public Class FileContainerInner + Partial Public Class DocumentObject Inherits Object Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged _ Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject - Private ContentsField() As Byte - - Private CreatedAtField As Date + Private _ContainerIdField As String - Private ExtensionField As String + Private _DocumentIdField As Long - Private FileIdField As String - - Private UpdatedAtField As Date + Private _FileNameField As String _ Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData @@ -350,66 +376,40 @@ Namespace EDMIServiceReference End Property _ - Public Property Contents() As Byte() - Get - Return Me.ContentsField - End Get - Set - If (Object.ReferenceEquals(Me.ContentsField, value) <> true) Then - Me.ContentsField = value - Me.RaisePropertyChanged("Contents") - End If - End Set - End Property - - _ - Public Property CreatedAt() As Date + Public Property _ContainerId() As String Get - Return Me.CreatedAtField + Return Me._ContainerIdField End Get Set - If (Me.CreatedAtField.Equals(value) <> true) Then - Me.CreatedAtField = value - Me.RaisePropertyChanged("CreatedAt") + If (Object.ReferenceEquals(Me._ContainerIdField, value) <> true) Then + Me._ContainerIdField = value + Me.RaisePropertyChanged("_ContainerId") End If End Set End Property _ - Public Property Extension() As String + Public Property _DocumentId() As Long Get - Return Me.ExtensionField + Return Me._DocumentIdField End Get Set - If (Object.ReferenceEquals(Me.ExtensionField, value) <> true) Then - Me.ExtensionField = value - Me.RaisePropertyChanged("Extension") + If (Me._DocumentIdField.Equals(value) <> true) Then + Me._DocumentIdField = value + Me.RaisePropertyChanged("_DocumentId") End If End Set End Property _ - Public Property FileId() As String + Public Property _FileName() As String Get - Return Me.FileIdField + Return Me._FileNameField End Get Set - If (Object.ReferenceEquals(Me.FileIdField, value) <> true) Then - Me.FileIdField = value - Me.RaisePropertyChanged("FileId") - End If - End Set - End Property - - _ - Public Property UpdatedAt() As Date - Get - Return Me.UpdatedAtField - End Get - Set - If (Me.UpdatedAtField.Equals(value) <> true) Then - Me.UpdatedAtField = value - Me.RaisePropertyChanged("UpdatedAt") + If (Object.ReferenceEquals(Me._FileNameField, value) <> true) Then + Me._FileNameField = value + Me.RaisePropertyChanged("_FileName") End If End Set End Property @@ -465,28 +465,40 @@ Namespace EDMIServiceReference Function ExecuteNonQueryAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.NonQueryResult) _ - Function CreateFile(ByVal Contents() As Byte, ByVal Extension As String) As String + Function CreateFile(ByVal FileName As String, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResult _ - Function CreateFileAsync(ByVal Contents() As Byte, ByVal Extension As String) As System.Threading.Tasks.Task(Of String) + Function CreateFileAsync(ByVal FileName As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) _ - Function UpdateFile(ByVal ContainerId As String, ByVal Contents() As Byte) As String + Function UpdateFile(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResult _ - Function UpdateFileAsync(ByVal ContainerId As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of String) + Function UpdateFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) _ - Function GetFile(ByVal ContainerId As String) As EDMIServiceReference.ContainerResult + Function GetFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As EDMIServiceReference.DocumentResult _ - Function GetFileAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.ContainerResult) + Function GetFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) _ - Function DeleteFile(ByVal ContainerId As String) As Boolean + Function DeleteFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As Boolean _ - Function DeleteFileAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of Boolean) + Function DeleteFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of Boolean) + + _ + Function SetFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal Value As String) As Object + + _ + Function SetFileIndexAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal Value As String) As System.Threading.Tasks.Task(Of Object) End Interface _ @@ -568,36 +580,44 @@ Namespace EDMIServiceReference Return MyBase.Channel.ExecuteNonQueryAsync(SQL) End Function - Public Function CreateFile(ByVal Contents() As Byte, ByVal Extension As String) As String Implements EDMIServiceReference.IEDMService.CreateFile - Return MyBase.Channel.CreateFile(Contents, Extension) + Public Function CreateFile(ByVal FileName As String, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMService.CreateFile + Return MyBase.Channel.CreateFile(FileName, Contents) + End Function + + Public Function CreateFileAsync(ByVal FileName As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMService.CreateFileAsync + Return MyBase.Channel.CreateFileAsync(FileName, Contents) + End Function + + Public Function UpdateFile(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMService.UpdateFile + Return MyBase.Channel.UpdateFile(DocObject, Contents) End Function - Public Function CreateFileAsync(ByVal Contents() As Byte, ByVal Extension As String) As System.Threading.Tasks.Task(Of String) Implements EDMIServiceReference.IEDMService.CreateFileAsync - Return MyBase.Channel.CreateFileAsync(Contents, Extension) + Public Function UpdateFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMService.UpdateFileAsync + Return MyBase.Channel.UpdateFileAsync(DocObject, Contents) End Function - Public Function UpdateFile(ByVal ContainerId As String, ByVal Contents() As Byte) As String Implements EDMIServiceReference.IEDMService.UpdateFile - Return MyBase.Channel.UpdateFile(ContainerId, Contents) + Public Function GetFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMService.GetFile + Return MyBase.Channel.GetFile(DocObject) End Function - Public Function UpdateFileAsync(ByVal ContainerId As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of String) Implements EDMIServiceReference.IEDMService.UpdateFileAsync - Return MyBase.Channel.UpdateFileAsync(ContainerId, Contents) + Public Function GetFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMService.GetFileAsync + Return MyBase.Channel.GetFileAsync(DocObject) End Function - Public Function GetFile(ByVal ContainerId As String) As EDMIServiceReference.ContainerResult Implements EDMIServiceReference.IEDMService.GetFile - Return MyBase.Channel.GetFile(ContainerId) + Public Function DeleteFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As Boolean Implements EDMIServiceReference.IEDMService.DeleteFile + Return MyBase.Channel.DeleteFile(DocObject) End Function - Public Function GetFileAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.ContainerResult) Implements EDMIServiceReference.IEDMService.GetFileAsync - Return MyBase.Channel.GetFileAsync(ContainerId) + Public Function DeleteFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of Boolean) Implements EDMIServiceReference.IEDMService.DeleteFileAsync + Return MyBase.Channel.DeleteFileAsync(DocObject) End Function - Public Function DeleteFile(ByVal ContainerId As String) As Boolean Implements EDMIServiceReference.IEDMService.DeleteFile - Return MyBase.Channel.DeleteFile(ContainerId) + Public Function SetFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal Value As String) As Object Implements EDMIServiceReference.IEDMService.SetFileIndex + Return MyBase.Channel.SetFileIndex(DocObject, Syskey, Value) End Function - Public Function DeleteFileAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of Boolean) Implements EDMIServiceReference.IEDMService.DeleteFileAsync - Return MyBase.Channel.DeleteFileAsync(ContainerId) + Public Function SetFileIndexAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal Value As String) As System.Threading.Tasks.Task(Of Object) Implements EDMIServiceReference.IEDMService.SetFileIndexAsync + Return MyBase.Channel.SetFileIndexAsync(DocObject, Syskey, Value) End Function End Class End Namespace diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/service.wsdl b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/service.wsdl index a655416c..abced3f1 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/service.wsdl +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/service.wsdl @@ -129,6 +129,15 @@ + + + + + + + + + diff --git a/EDMI_FILE_OPs/Document.vb b/EDMI_FILE_OPs/Document.vb new file mode 100644 index 00000000..939d5bd5 --- /dev/null +++ b/EDMI_FILE_OPs/Document.vb @@ -0,0 +1,144 @@ +Imports DigitalData.Modules.Logging +Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference +Imports System.ServiceModel +Imports System.IO + +Public Class Document + Private _logger As Logger + Private _logConfig As LogConfig + Private _channelFactory As ChannelFactory(Of IEDMServiceChannel) + Private _channel As IEDMServiceChannel + Public Sub New(LogConfig As LogConfig, EDMI_ServiceAdress As String) + _logger = LogConfig.GetLogger() + _logConfig = LogConfig + + Try + Dim binding As New NetTcpBinding() + binding.Security.Mode = SecurityMode.Transport + binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows + binding.MaxReceivedMessageSize = 2147483647 + binding.MaxBufferSize = 2147483647 + binding.MaxBufferPoolSize = 2147483647 + binding.MaxConnections = 10000 + binding.ReaderQuotas.MaxArrayLength = 2147483647 + binding.ReaderQuotas.MaxStringContentLength = 2147483647 + Dim endpointAddress = New EndpointAddress(EDMI_ServiceAdress) + _channelFactory = New ChannelFactory(Of IEDMServiceChannel)(binding, endpointAddress) + Connect2NetService() + Catch ex As Exception + _logger.Error(ex) + End Try + End Sub + + Private Function Connect2NetService() + Try + _channel = Nothing + _channel = _channelFactory.CreateChannel() + _logger.Info("Successfully connected to EDM_Network Service") + AddHandler _channel.Faulted, AddressOf Reconnect + _channel.Open() + Return True + Catch ex As Exception + _logger.Error(ex) + Return True + End Try + End Function + Private Sub Reconnect() + _channel.Abort() + Connect2NetService() + End Sub + + ''' + ''' Imports a file by filename + ''' + ''' The filename to import + ''' A document object + Public Async Function ImportFileAsync(FilePath As String) As Task(Of DocumentResult) + Try + Return Await CreateDocument(FilePath) + Catch ex As Exception + _logger.Error(ex) + Throw ex + End Try + End Function + + Public Async Function SetFileIndex(DocObject As DocumentObject, Syskey As String, Value As String) As Task + Try + Dim oResult As DocumentResult = _channel + Catch ex As Exception + _logger.Error(ex) + Throw ex + End Try + End Function + + Private Async Function CreateDocument(FilePath As String) As Task(Of DocumentResult) + Try + Dim oContents As Byte() = File.ReadAllBytes(FilePath) + Dim oInfo As New FileInfo(FilePath) + Dim oName As String = oInfo.Name + Dim oExtension As String = oInfo.Extension.Substring(1) + + Dim oDocObject = Await _channel.CreateFileAsync(oName, oContents) + Return oDocObject + Catch ex As Exception + _logger.Error(ex) + Throw ex + End Try + End Function + + 'Public Async Function New_EDMI_File(oFILENAME As String, oUserName As String) As Task(Of String) + ' Try + ' Dim oFileGUID As DocumentResult = Await CreateDocument(oFILENAME) + ' Dim oFileRecordID = Nothing + ' If Not IsNothing(oFileGUID) Then + ' Dim oSQL = $"SELECT FNEDMI_SET_RECORD(""TBEDMI_ADRESSE"",""{oUserName}"",FALSE,NULL,"""",'{oFileGUID._ContainerId}') FROM rdb$database;" + ' oFileRecordID = Await New_EDMIFile_CreateDB_Record(oSQL) + ' End If + ' Return oFileRecordID + ' Catch ex As Exception + ' _logger.Error(ex) + ' Return Nothing + ' End Try + 'End Function + + 'Private Async Function New_EDMIFile_CreateDB_Record(FBCommand As String) As Task(Of String) + ' Try + ' Dim oTimeTotal As TimeSpan + ' Dim oStopwatch As New Stopwatch() + ' oStopwatch.Start() + ' Dim oRecord_ID As String + ' Dim oRequestName = Await _channel.CreateDatabaseRequestAsync("CreateEDMFileRecord", True) + ' Dim oResult = Await _channel.ReturnScalarAsync(FBCommand) + + ' oTimeTotal = oStopwatch.Elapsed + ' oStopwatch.Reset() + + ' Await _channel.CloseDatabaseRequestAsync() + + ' If Not oResult.OK Then + ' _logger.Warn($"Unexpected error while executing command: {oResult.ErrorMessage}") + ' Else + ' oRecord_ID = oResult.Scalar + ' _logger.Debug($"SCALAR (SERVICE) {FBCommand} - TIME: {(oTimeTotal.ToString)}") + ' End If + ' Return oRecord_ID + ' Catch ex As Exception + ' _logger.Error(ex) + ' Return Nothing + ' End Try + 'End Function + Public Async Function Load_EDMIFile_2TempPath(oEDMIFile_GUID As String) As Task(Of String) + 'Try + ' Dim oResult As EDMIServiceReference.ContainerResult = Await _channel.GetFileAsync(oEDMIFile_GUID) + ' Dim oTempPath = Path.Combine(Path.GetTempPath(), "EDMI_FileContainer") + ' Directory.CreateDirectory(oTempPath) + ' Dim oFilePath = Path.Combine(oTempPath, $"{oResult.Container.FileId}.{oResult.Container.Extension}") + ' File.WriteAllBytes(oFilePath, oResult.Container.Contents) + ' ' Process.Start(oTempPath) + ' Return oTempPath + 'Catch ex As Exception + ' _logger.Error(ex) + ' Return Nothing + 'End Try + End Function +End Class diff --git a/EDMI_FILE_OPs/EDMIFileOps.vbproj b/EDMI_FILE_OPs/EDMIAPI.vbproj similarity index 97% rename from EDMI_FILE_OPs/EDMIFileOps.vbproj rename to EDMI_FILE_OPs/EDMIAPI.vbproj index 29f5eb4f..2ba79cea 100644 --- a/EDMI_FILE_OPs/EDMIFileOps.vbproj +++ b/EDMI_FILE_OPs/EDMIAPI.vbproj @@ -72,12 +72,13 @@ + True True Reference.svcmap - + True @@ -104,7 +105,7 @@ - + Reference.svcmap diff --git a/EDMI_FILE_OPs/FileOp.vb b/EDMI_FILE_OPs/FileOp.vb deleted file mode 100644 index 169533b5..00000000 --- a/EDMI_FILE_OPs/FileOp.vb +++ /dev/null @@ -1,120 +0,0 @@ -Imports DigitalData.Modules.Logging -Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference -Imports System.ServiceModel -Imports System.IO - -Public Class FileOp - Private _logger As Logger - Private _logConfig As LogConfig - Private _channelFactory As ChannelFactory(Of IEDMServiceChannel) - Private _channel As IEDMServiceChannel - Public Sub New(LogConfig As LogConfig, EDMI_ServiceAdress As String) - _logger = LogConfig.GetLogger() - _logConfig = LogConfig - - Try - Dim binding As New NetTcpBinding() - binding.Security.Mode = SecurityMode.Transport - binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows - binding.MaxReceivedMessageSize = 2147483647 - binding.MaxBufferSize = 2147483647 - binding.MaxBufferPoolSize = 2147483647 - binding.MaxConnections = 10000 - binding.ReaderQuotas.MaxArrayLength = 2147483647 - binding.ReaderQuotas.MaxStringContentLength = 2147483647 - Dim endpointAddress = New EndpointAddress(EDMI_ServiceAdress) - _channelFactory = New ChannelFactory(Of IEDMServiceChannel)(binding, endpointAddress) - Connect2NetService() - Catch ex As Exception - _logger.Error(ex) - End Try - - End Sub - Private Function Connect2NetService() - Try - _channel = Nothing - _channel = _channelFactory.CreateChannel() - _logger.Info("Successfully connected to EDM_Network Service") - AddHandler _channel.Faulted, AddressOf Reconnect - _channel.Open() - Return True - Catch ex As Exception - _logger.Error(ex) - Return True - End Try - End Function - Private Sub Reconnect() - _channel.Abort() - Connect2NetService() - End Sub - - Public Async Function New_EDMI_File(oFILENAME As String, oUserName As String) As Task(Of String) - Try - Dim oFileGUID = Await New_EDMIFile_CreateContainer(oFILENAME) - Dim oFileRecordID = Nothing - If Not IsNothing(oFileGUID) Then - Dim oSQL = $"SELECT FNEDMI_SET_RECORD(""TBEDMI_ADRESSE"",""{oUserName}"",FALSE,NULL,"""",'{oFileGUID}') FROM rdb$database;" - oFileRecordID = Await New_EDMIFile_CreateDB_Record(oSQL) - End If - Return oFileRecordID - Catch ex As Exception - _logger.Error(ex) - Return Nothing - End Try - End Function - Private Async Function New_EDMIFile_CreateContainer(oFILENAME As String) As Task(Of String) - Try - Dim sw As New Stopwatch() - sw.Start() - Dim oFileContents = File.ReadAllBytes(oFILENAME) - Dim oExtension As String = New FileInfo(oFILENAME).Extension.Substring(1) - Dim oFileGUID = Await _channel.CreateFileAsync(oFileContents, oExtension) - sw.Stop() - _logger.Info($"File successfully transferred - stopwatch: {sw.Elapsed.ToString}") - Return oFileGUID - Catch ex As Exception - _logger.Error(ex) - Return Nothing - End Try - End Function - Private Async Function New_EDMIFile_CreateDB_Record(FBCommand As String) As Task(Of String) - Try - Dim oTimeTotal As TimeSpan - Dim oStopwatch As New Stopwatch() - oStopwatch.Start() - Dim oRecord_ID As String - Dim oRequestName = Await _channel.CreateDatabaseRequestAsync("CreateEDMFileRecord", True) - Dim oResult = Await _channel.ReturnScalarAsync(FBCommand) - - oTimeTotal = oStopwatch.Elapsed - oStopwatch.Reset() - - Await _channel.CloseDatabaseRequestAsync() - - If Not oResult.OK Then - _logger.Warn($"Unexpected error while executing command: {oResult.ErrorMessage}") - Else - oRecord_ID = oResult.Scalar - _logger.Debug($"SCALAR (SERVICE) {FBCommand} - TIME: {(oTimeTotal.ToString)}") - End If - Return oRecord_ID - Catch ex As Exception - _logger.Error(ex) - Return Nothing - End Try - End Function - Public Async Function Load_EDMIFile_2TempPath(oEDMIFile_GUID As String) As Task(Of String) - Try - Dim oResult As EDMIServiceReference.ContainerResult = Await _channel.GetFileAsync(oEDMIFile_GUID) - Dim oTempPath = Path.Combine(Path.GetTempPath(), "EDMI_FileContainer") - Directory.CreateDirectory(oTempPath) - Dim oFilePath = Path.Combine(oTempPath, $"{oResult.Container.FileId}.{oResult.Container.Extension}") - File.WriteAllBytes(oFilePath, oResult.Container.Contents) - ' Process.Start(oTempPath) - Return oTempPath - Catch ex As Exception - _logger.Error(ex) - Return Nothing - End Try - End Function -End Class diff --git a/Filesystem/DocumentObject.vb b/Filesystem/DocumentObject.vb new file mode 100644 index 00000000..90b727fe --- /dev/null +++ b/Filesystem/DocumentObject.vb @@ -0,0 +1,12 @@ + +Public Class DocumentObject + Public ReadOnly Property FileName As String + Public ReadOnly Property ContainerId As String + Public ReadOnly Property DocumentId As Int64 + + Public Sub New(ContainerId As String, DocumentId As Int64, FileName As String) + _ContainerId = ContainerId + _DocumentId = DocumentId + _FileName = FileName + End Sub +End Class diff --git a/Filesystem/FileContainer.vb b/Filesystem/FileContainer.vb index 4dd18145..b50170ea 100644 --- a/Filesystem/FileContainer.vb +++ b/Filesystem/FileContainer.vb @@ -43,7 +43,6 @@ Imports ProtoBuf Public Class FileContainer Private _crypto As Encryption Private _compression As Compression - Private _containerId As Guid Private _inner As FileContainerInner Private _logger As Logger Private _logConfig As LogConfig @@ -57,15 +56,7 @@ Public Class FileContainer _inner.Contents = value End Set End Property - Public Property Extension As String - Get - Return _inner.Extension - End Get - Set(value As String) - _inner.Extension = value - End Set - End Property - Public ReadOnly Property FileId As String + Public ReadOnly Property ContainerId As String Get Return _inner.FileId End Get @@ -92,24 +83,22 @@ Public Class FileContainer Return oContainer End Function - Public Sub New(LogConfig As LogConfig, Password As String, Path As String) + Public Sub New(LogConfig As LogConfig, Password As String) _logger = LogConfig.GetLogger() _crypto = New Encryption(LogConfig, Password) _compression = New Compression(LogConfig) _inner = New FileContainerInner() - _path = Path End Sub - Public Sub New(LogConfig As LogConfig, Password As String) - _logger = LogConfig.GetLogger() - _crypto = New Encryption(LogConfig, Password) - _compression = New Compression(LogConfig) - _inner = New FileContainerInner() + Public Sub New(LogConfig As LogConfig, Password As String, Path As String) + MyClass.New(LogConfig, Password) + _path = Path End Sub - Public Sub SetFile(Contents As Byte(), Extension As String) + Public Sub SetFile(Contents As Byte(), FileName As String) _inner.Contents = Contents - _inner.Extension = Extension + _inner.UpdatedAt = Date.Now + _inner.FileName = FileName End Sub Public Function GetFile() As FileContainerInner diff --git a/Filesystem/FileContainerInner.vb b/Filesystem/FileContainerInner.vb index 0a77b30f..fc787ce0 100644 --- a/Filesystem/FileContainerInner.vb +++ b/Filesystem/FileContainerInner.vb @@ -12,11 +12,12 @@ Public Class FileContainerInner Public UpdatedAt As DateTime - Public Extension As String + Public FileName As String Public Sub New() - FileId = Guid.NewGuid.ToString + FileId = Guid.NewGuid().ToString CreatedAt = Date.Now + UpdatedAt = Date.Now End Sub End Class \ No newline at end of file diff --git a/Filesystem/Filesystem.vbproj b/Filesystem/Filesystem.vbproj index 720246c0..eef47b43 100644 --- a/Filesystem/Filesystem.vbproj +++ b/Filesystem/Filesystem.vbproj @@ -76,6 +76,7 @@ + diff --git a/Modules.Database/Firebird.vb b/Modules.Database/Firebird.vb index e2f6838f..0d9ffffe 100644 --- a/Modules.Database/Firebird.vb +++ b/Modules.Database/Firebird.vb @@ -186,6 +186,7 @@ Public Class Firebird _logger.Debug("Executing Non-Query: {0}", SqlCommand) If Connection Is Nothing Then + _Logger.Warn("Connection is nothing!") Return Nothing End If @@ -236,6 +237,7 @@ Public Class Firebird _logger.Debug("Fetching Scalar-Value: {0}", SqlQuery) If Connection Is Nothing Then + _Logger.Warn("Connection is nothing!") Return Nothing End If @@ -282,6 +284,7 @@ Public Class Firebird _logger.Debug("Fetching Datatable: {0}", SqlQuery) If Connection Is Nothing Then + _Logger.Warn("Connection is nothing!") Return Nothing End If diff --git a/SERVICES/DDEDM_NetworkService/DDEDMService.vbproj b/SERVICES/DDEDM_NetworkService/DDEDMService.vbproj index 5594f0b6..35835a38 100644 --- a/SERVICES/DDEDM_NetworkService/DDEDMService.vbproj +++ b/SERVICES/DDEDM_NetworkService/DDEDMService.vbproj @@ -85,6 +85,7 @@ + diff --git a/SERVICES/DDEDM_NetworkService/DocumentResult.vb b/SERVICES/DDEDM_NetworkService/DocumentResult.vb new file mode 100644 index 00000000..bbc4e5e8 --- /dev/null +++ b/SERVICES/DDEDM_NetworkService/DocumentResult.vb @@ -0,0 +1,20 @@ +Imports DigitalData.Modules.Filesystem + + +Public Class DocumentResult + Public ReadOnly OK As Boolean + Public ReadOnly ErrorMessage As String + Public Document As DocumentObject + Public HasContents As Boolean + Public Contents As Byte() + + Public Sub New() + OK = True + ErrorMessage = Nothing + End Sub + + Public Sub New(ErrorMessage As String) + OK = False + Me.ErrorMessage = ErrorMessage + End Sub +End Class diff --git a/SERVICES/DDEDM_NetworkService/EDMService.vb b/SERVICES/DDEDM_NetworkService/EDMService.vb index 5c670a1e..cadca5da 100644 --- a/SERVICES/DDEDM_NetworkService/EDMService.vb +++ b/SERVICES/DDEDM_NetworkService/EDMService.vb @@ -3,7 +3,6 @@ Imports DigitalData.Modules.Database Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Filesystem Imports System.IO -Imports DigitalData.Services.EDMService Public Class EDMService @@ -28,17 +27,35 @@ Public Class EDMService _logger = LogConfig.GetLogger() End Sub +#Region "Auth" + Private Function TestUserAuth() As Boolean + Try + Dim oSQL As String = $"SELECT FNICM_AUTH_USER('{_username}') FROM RDB$DATABASE;" + Dim oResult As Boolean = Database.GetScalarValue(oSQL) + + Return oResult + Catch ex As Exception + _logger.Error(ex) + Return False + End Try + End Function +#End Region + #Region "Heartbeat" Public Function Heartbeat() As Boolean Implements IEDMService.Heartbeat Return True End Function #End Region #Region "Request" - Public Function CreateDatabaseRequest(Name As String, Optional Debug As Boolean = False) As String Implements IEDMService.CreateDatabaseRequest + Public Sub CreateRequest(Name As String, Optional Debug As Boolean = False) _request = New Request(Name, _username, Database, Debug) _debug = Debug _logger.Info("Creating request {0}/{1}", _request.Name, _request.RequestId) + End Sub + + Public Function CreateDatabaseRequest(Name As String, Optional Debug As Boolean = False) As String Implements IEDMService.CreateDatabaseRequest + CreateRequest(Name, Debug) Return _request.Name End Function @@ -111,80 +128,123 @@ Public Class EDMService #End Region -#Region "FileContainer" - Private Function GetFilePath(ContainerId As String) As String - Return Path.Combine(AppConfig.ContainerPath, ContainerId & ".enc") - End Function - Private Sub TestFileExists(ContainerId) - Dim oContainerPath = GetFilePath(ContainerId) +#Region "Document" + Public Function CreateFile(FileName As String, Contents() As Byte) As DocumentResult Implements IEDMService.CreateFile + Try + Dim oContainer As FileContainer + Dim oContainerId As String - If Not IO.File.Exists(oContainerPath) Then - Throw New FileNotFoundException("Container existiert nicht", oContainerPath) - End If - End Sub + If Not TestUserAuth() Then + Throw New Exception("User not authorized") + End If - Public Function GetFile(ContainerId As String) As ContainerResult Implements IEDMService.GetFile - Try - TestFileExists(ContainerId) + oContainer = FileContainer.Create(LogConfig, AppConfig.ContainerPassword) + oContainerId = oContainer.ContainerId + _logger.Debug("Container created with id {0}", oContainerId) - Dim oContainerPath = GetFilePath(ContainerId) - Dim oContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oContainerPath) + Dim oExtension As String = Path.GetExtension(FileName).Substring(1) + _logger.Debug("File extension of file {0} is {1}", FileName, oExtension) - Dim oResult As New ContainerResult With { - .Container = oContainer.GetFile() - } + Dim oSQL = $"SELECT FNICM_NEW_DOC('{FileName}','{oExtension}','{oContainerId}','{GetContainerName(oContainerId)}','{_username}') FROM RDB$DATABASE;" + Dim oDocId As Int64 = Database.GetScalarValue(oSQL) - Return oResult + If oDocId = -1 Then + _logger.Warn("Database returned -1 while creating Document Entry. File was not saved!") + Return Nothing + End If + + _logger.Debug("Database Entry created with DocId {0}", oDocId) + + oContainer.SetFile(Contents, FileName) + oContainer.SaveAs(GetContainerPath(oContainerId)) + + _logger.Debug("File saved in Container!", FileName) + + Return New DocumentResult() With { + .Document = New DocumentObject(oContainerId, oDocId, FileName) + } Catch ex As Exception _logger.Error(ex) - Return New ContainerResult(ex.Message) + Return New DocumentResult(ex.Message) End Try End Function - Public Function CreateFile(Contents() As Byte, Extension As String) As String Implements IEDMService.CreateFile + Public Function UpdateFile(DocObject As DocumentObject, Contents() As Byte) As DocumentResult Implements IEDMService.UpdateFile Try - Dim oContainer As FileContainer = FileContainer.Create(LogConfig, AppConfig.ContainerPassword) - Dim oContainerId As String = oContainer.FileId + TestFileExists(DocObject.ContainerId) + + ' TODO: update db - oContainer.SetFile(Contents, Extension) - oContainer.SaveAs(GetFilePath(oContainerId)) + Dim oFilePath = GetContainerPath(DocObject.ContainerId) + Dim oFileContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oFilePath) - Return oContainerId + oFileContainer.SetFile(Contents, oFileContainer.GetFile.FileName) + oFileContainer.Save() + + Return New DocumentResult() With { + .Document = DocObject + } Catch ex As Exception _logger.Error(ex) Return Nothing End Try End Function - Public Function UpdateFile(FileId As String, Contents() As Byte) As String Implements IEDMService.UpdateFile + Public Function GetFile(DocObject As DocumentObject) As DocumentResult Implements IEDMService.GetFile Try - TestFileExists(FileId) - - Dim oFilePath = GetFilePath(FileId) - Dim oFileContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oFilePath) + TestFileExists(DocObject.ContainerId) - oFileContainer.SetFile(Contents, oFileContainer.Extension) - oFileContainer.Save() + Dim oContainerPath = GetContainerPath(DocObject.ContainerId) + Dim oContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oContainerPath) + Dim oContents As Byte() = oContainer.GetFile().Contents - Return oFileContainer.FileId + Return New DocumentResult With { + .Document = DocObject, + .Contents = oContents + } Catch ex As Exception _logger.Error(ex) - Return Nothing + Return New DocumentResult(ex.Message) End Try End Function - Public Function DeleteFile(FileId As String) As Boolean Implements IEDMService.DeleteFile + Public Function DeleteFile(DocObject As DocumentObject) As Boolean Implements IEDMService.DeleteFile Try - TestFileExists(FileId) + TestFileExists(DocObject.ContainerId) - Dim oFilePath = GetFilePath(FileId) + Dim oFilePath = GetContainerPath(DocObject.ContainerId) IO.File.Delete(oFilePath) + 'TODO: Delete doc from db + Return True Catch ex As Exception _logger.Error(ex) Return False End Try End Function + + + Private Function GetContainerPath(ContainerId As String) As String + Return Path.Combine(AppConfig.ContainerPath, GetContainerName(ContainerId)) + End Function + + Private Function GetContainerName(ContainerId As String) As String + Return ContainerId & ".enc" + End Function + + Private Sub TestFileExists(ContainerId) + Dim oContainerPath = GetContainerPath(ContainerId) + + If Not IO.File.Exists(oContainerPath) Then + Throw New FileNotFoundException("Container existiert nicht", oContainerPath) + End If + End Sub +#End Region + +#Region "Index" + Public Function SetFileIndex(DocObject As DocumentObject, Syskey As String, Value As String) As Object Implements IEDMService.SetFileIndex + Throw New NotImplementedException() + End Function #End Region End Class \ No newline at end of file diff --git a/SERVICES/DDEDM_NetworkService/IEDMService.vb b/SERVICES/DDEDM_NetworkService/IEDMService.vb index afc90e45..47666711 100644 --- a/SERVICES/DDEDM_NetworkService/IEDMService.vb +++ b/SERVICES/DDEDM_NetworkService/IEDMService.vb @@ -26,18 +26,23 @@ Interface IEDMService Function ExecuteNonQuery(SQL As String) As NonQueryResult #End Region -#Region "FileContainer" +#Region "Document" - Function CreateFile(Contents As Byte(), Extension As String) As String + Function CreateFile(FileName As String, Contents As Byte()) As DocumentResult - Function UpdateFile(ContainerId As String, Contents As Byte()) As String + Function UpdateFile(DocObject As DocumentObject, Contents As Byte()) As DocumentResult - Function GetFile(ContainerId As String) As ContainerResult + Function GetFile(DocObject As DocumentObject) As DocumentResult - Function DeleteFile(ContainerId As String) As Boolean + Function DeleteFile(DocObject As DocumentObject) As Boolean +#End Region + +#Region "Index" + + Function SetFileIndex(DocObject As DocumentObject, Syskey As String, Value As String) #End Region End Interface \ No newline at end of file diff --git a/SERVICES/DDEDM_NetworkService/WindowsService.vb b/SERVICES/DDEDM_NetworkService/WindowsService.vb index 64fb44d6..ddc796e5 100644 --- a/SERVICES/DDEDM_NetworkService/WindowsService.vb +++ b/SERVICES/DDEDM_NetworkService/WindowsService.vb @@ -4,6 +4,8 @@ Imports System.Configuration Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Database Imports DigitalData.Modules.Database.Exceptions +Imports System.ServiceModel.Channels +Imports System.ServiceModel.Dispatcher Public Class WindowsService Inherits ServiceBase