From e3639930e1d01fbaaa45b5b04c62bda0266c36bf Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 22 Dec 2020 12:58:08 +0100 Subject: [PATCH] EDMIService: clean up --- Service.EDMIService/EDMIService.vb | 11 +++++------ Service.EDMIService/EDMIService.vbproj | 1 - Service.EDMIService/IEDMIService.vb | 7 +++---- Service.EDMIService/Results/AccessRightResult.vb | 2 +- Service.EDMIService/Rights.vb | 7 ------- Service.EDMIService/WindowsService.vb | 1 - 6 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 Service.EDMIService/Rights.vb diff --git a/Service.EDMIService/EDMIService.vb b/Service.EDMIService/EDMIService.vb index f739aa38..9302901b 100644 --- a/Service.EDMIService/EDMIService.vb +++ b/Service.EDMIService/EDMIService.vb @@ -7,7 +7,7 @@ Imports System.ServiceModel Imports System.Data.SqlClient Imports System.ServiceModel.Description Imports DigitalData.Services.EDMIService.Messages -Imports DigitalData.Services.EDMIService.Rights +Imports DigitalData.Modules.EDMI.API.Rights Public Class EDMIService @@ -219,7 +219,7 @@ Public Class EDMIService ''' Imports a file according to ObjectStoreId ''' ''' - Public Function ImportFile(Data As Messages.DocumentImportRequest) As Messages.DocumentImportResponse Implements IEDMIService.ImportFile + Public Function ImportFile(Data As DocumentImportRequest) As DocumentImportResponse Implements IEDMIService.ImportFile Dim oObjectStore = GlobalState.ObjectStores. Where(Function(s) s.Id = Data.ObjectStoreId). FirstOrDefault() @@ -276,7 +276,7 @@ Public Class EDMIService End Try End Function - Public Function GetFileByObjectId(Data As Messages.DocumentStreamRequest) As Messages.DocumentStreamResponse Implements IEDMIService.GetFileByObjectId + Public Function GetFileByObjectId(Data As DocumentStreamRequest) As DocumentStreamResponse Implements IEDMIService.GetFileByObjectId Try Dim oSQL As String = $"SELECT ObjectStoreId FROM VWIDB_DOC_DATA WHERE IDB_OBJ_ID = {Data.ObjectId}" Dim oObjectStoreId = MSSQL_IDB.GetScalarValue(oSQL) @@ -288,7 +288,6 @@ Public Class EDMIService Dim oSQL2 As String = $"SELECT DocRelativePath FROM VWIDB_DOC_DATA WHERE IDB_OBJ_ID = {Data.ObjectId}" Dim oPath As String = MSSQL_IDB.GetScalarValue(oSQL2) - If IsNothing(oPath) Then Throw New FaultException($"Object [{Data.ObjectId}] does not exist in database!") End If @@ -325,13 +324,13 @@ Public Class EDMIService End Try End Function - Public Function ListFilesForUser() As Messages.DocumentListResponse Implements IEDMIService.ListFilesForUser + Public Function ListFilesForUser() As DocumentListResponse Implements IEDMIService.ListFilesForUser Try Dim oSQL = $"SELECT * FROM VWIDB_DOC_DATA" Dim oDatatable As DataTable = MSSQL_IDB.GetDatatable(oSQL) oDatatable.TableName = "DocumentList" - Return New Messages.DocumentListResponse() With { + Return New DocumentListResponse() With { .Datatable = oDatatable } Catch ex As Exception diff --git a/Service.EDMIService/EDMIService.vbproj b/Service.EDMIService/EDMIService.vbproj index 2b495e16..b77d578f 100644 --- a/Service.EDMIService/EDMIService.vbproj +++ b/Service.EDMIService/EDMIService.vbproj @@ -133,7 +133,6 @@ - diff --git a/Service.EDMIService/IEDMIService.vb b/Service.EDMIService/IEDMIService.vb index 81584c39..0431c6fe 100644 --- a/Service.EDMIService/IEDMIService.vb +++ b/Service.EDMIService/IEDMIService.vb @@ -56,14 +56,13 @@ Interface IEDMIService #Region "Document (New)" - Function ImportFile(Data As Messages.DocumentImportRequest) As Messages.DocumentImportResponse - 'Function ImportFile(FileName As String, Contents As Byte(), ObjectStoreId As Int64, DocumentType As String, Optional RetentionDays As Int64 = Nothing) As Messages.DocumentImportResponse + Function ImportFile(Data As DocumentImportRequest) As DocumentImportResponse - Function GetFileByObjectId(Data As Messages.DocumentStreamRequest) As Messages.DocumentStreamResponse + Function GetFileByObjectId(Data As DocumentStreamRequest) As DocumentStreamResponse - Function ListFilesForUser() As Messages.DocumentListResponse + Function ListFilesForUser() As DocumentListResponse #End Region End Interface \ No newline at end of file diff --git a/Service.EDMIService/Results/AccessRightResult.vb b/Service.EDMIService/Results/AccessRightResult.vb index 52c5dcd3..d8640d49 100644 --- a/Service.EDMIService/Results/AccessRightResult.vb +++ b/Service.EDMIService/Results/AccessRightResult.vb @@ -1,6 +1,6 @@ Imports System.Runtime.Serialization -Imports DigitalData.Services.EDMIService.Rights Imports DigitalData.Modules.Language +Imports DigitalData.Modules.EDMI.API.Rights Namespace Messages Public Class AccessRightResult diff --git a/Service.EDMIService/Rights.vb b/Service.EDMIService/Rights.vb deleted file mode 100644 index dc6ce6bf..00000000 --- a/Service.EDMIService/Rights.vb +++ /dev/null @@ -1,7 +0,0 @@ -Public Class Rights - Public Enum AccessRight - VIEW_ONLY = 1 - VIEW_EXPORT = 2 - FULL = 4 - End Enum -End Class diff --git a/Service.EDMIService/WindowsService.vb b/Service.EDMIService/WindowsService.vb index c23d1831..efacfb70 100644 --- a/Service.EDMIService/WindowsService.vb +++ b/Service.EDMIService/WindowsService.vb @@ -39,7 +39,6 @@ Public Class WindowsService Dim oServicePath As String = AppDomain.CurrentDomain.BaseDirectory _LogConfig = New LogConfig(LogConfig.PathType.CustomPath, IO.Path.Combine(oServicePath, "Log")) - _LogConfig.Debug = True _Logger = _LogConfig.GetLogger() _Logger.Info("Service {0} is starting...", SERVICE_DISPLAY_NAME) _Logger.Info("ServiceDirectory: {0}", oServicePath)