rename ECM references to IDB
This commit is contained in:
@@ -44,13 +44,15 @@
|
||||
</netTcpBinding>
|
||||
</bindings>
|
||||
<services>
|
||||
<service behaviorConfiguration="DefaultServiceBehavior" name="DigitalData.Services.EDMService.EDMService">
|
||||
<endpoint address="" binding="netTcpBinding" bindingConfiguration="tcpBinding" name="tcpBinding" contract="DigitalData.Services.EDMService.IEDMService">
|
||||
<service behaviorConfiguration="DefaultServiceBehavior" name="DigitalData.Services.IDBService.IDBService">
|
||||
<endpoint address="" binding="netTcpBinding" bindingConfiguration="tcpBinding"
|
||||
name="tcpBinding" contract="DigitalData.Services.IDBService.IIDBService">
|
||||
<identity>
|
||||
<dns value="localhost" />
|
||||
</identity>
|
||||
</endpoint>
|
||||
<endpoint address="mex" binding="mexTcpBinding" name="MexTcpBinding" contract="IMetadataExchange" />
|
||||
<endpoint address="mex" binding="mexTcpBinding" name="MexTcpBinding"
|
||||
contract="IMetadataExchange" />
|
||||
<host>
|
||||
<baseAddresses>
|
||||
<add baseAddress="net.tcp://localhost:9000/DigitalData/Services/Main" />
|
||||
|
||||
@@ -3,11 +3,10 @@ Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Filesystem
|
||||
Imports System.IO
|
||||
Imports DigitalData.Services.EDMService
|
||||
|
||||
<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession)>
|
||||
Public Class EDMService
|
||||
Implements IEDMService
|
||||
Public Class IDBService
|
||||
Implements IIDBService
|
||||
|
||||
Public Shared LogConfig As LogConfig
|
||||
Public Shared Database As Firebird
|
||||
@@ -31,7 +30,7 @@ Public Class EDMService
|
||||
#Region "Auth"
|
||||
Private Function TestUserAuth() As Boolean
|
||||
Try
|
||||
Dim oSQL As String = $"SELECT FNICM_AUTH_USER('{_username}') FROM RDB$DATABASE;"
|
||||
Dim oSQL As String = $"SELECT FNIDB_AUTH_USER('{_username}') FROM RDB$DATABASE;"
|
||||
Dim oResult As Boolean = Database.GetScalarValue(oSQL)
|
||||
|
||||
Return oResult
|
||||
@@ -43,7 +42,7 @@ Public Class EDMService
|
||||
#End Region
|
||||
|
||||
#Region "Heartbeat"
|
||||
Public Function Heartbeat() As Boolean Implements IEDMService.Heartbeat
|
||||
Public Function Heartbeat() As Boolean Implements IIDBService.Heartbeat
|
||||
Return True
|
||||
End Function
|
||||
#End Region
|
||||
@@ -55,13 +54,13 @@ Public Class EDMService
|
||||
_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
|
||||
Public Function CreateDatabaseRequest(Name As String, Optional Debug As Boolean = False) As String Implements IIDBService.CreateDatabaseRequest
|
||||
CreateRequest(Name, Debug)
|
||||
|
||||
Return _request.Name
|
||||
End Function
|
||||
|
||||
Public Sub CloseDatabaseRequest() Implements IEDMService.CloseDatabaseRequest
|
||||
Public Sub CloseDatabaseRequest() Implements IIDBService.CloseDatabaseRequest
|
||||
If IsNothing(_request) Then
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -79,7 +78,7 @@ Public Class EDMService
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function ReturnDatatable(SQL As String) As TableResult Implements IEDMService.ReturnDatatable
|
||||
Public Function ReturnDatatable(SQL As String) As TableResult Implements IIDBService.ReturnDatatable
|
||||
Try
|
||||
TestRequestCreated()
|
||||
|
||||
@@ -95,7 +94,7 @@ Public Class EDMService
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ReturnScalar(SQL As String) As ScalarResult Implements IEDMService.ReturnScalar
|
||||
Public Function ReturnScalar(SQL As String) As ScalarResult Implements IIDBService.ReturnScalar
|
||||
Try
|
||||
TestRequestCreated()
|
||||
|
||||
@@ -111,7 +110,7 @@ Public Class EDMService
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ExecuteNonQuery(SQL As String) As NonQueryResult Implements IEDMService.ExecuteNonQuery
|
||||
Public Function ExecuteNonQuery(SQL As String) As NonQueryResult Implements IIDBService.ExecuteNonQuery
|
||||
Try
|
||||
TestRequestCreated()
|
||||
|
||||
@@ -130,7 +129,7 @@ Public Class EDMService
|
||||
|
||||
#End Region
|
||||
#Region "Document"
|
||||
Public Function NewFile(FileName As String, Contents() As Byte) As DocumentResult Implements IEDMService.NewFile
|
||||
Public Function NewFile(FileName As String, Contents() As Byte) As DocumentResult Implements IIDBService.NewFile
|
||||
Try
|
||||
Dim oContainer As FileContainer
|
||||
Dim oContainerId As String
|
||||
@@ -169,7 +168,7 @@ Public Class EDMService
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function UpdateFile(DocObject As DocumentObject, Contents() As Byte) As DocumentResult Implements IEDMService.UpdateFile
|
||||
Public Function UpdateFile(DocObject As DocumentObject, Contents() As Byte) As DocumentResult Implements IIDBService.UpdateFile
|
||||
Try
|
||||
TestFileExists(DocObject.ContainerId)
|
||||
|
||||
@@ -189,7 +188,7 @@ Public Class EDMService
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetFile(DocObject As DocumentObject) As DocumentResult Implements IEDMService.GetFile
|
||||
Public Function GetFile(DocObject As DocumentObject) As DocumentResult Implements IIDBService.GetFile
|
||||
Try
|
||||
TestFileExists(DocObject.ContainerId)
|
||||
|
||||
@@ -204,7 +203,7 @@ Public Class EDMService
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function DeleteFile(DocObject As DocumentObject) As Boolean Implements IEDMService.DeleteFile
|
||||
Public Function DeleteFile(DocObject As DocumentObject) As Boolean Implements IIDBService.DeleteFile
|
||||
Try
|
||||
TestFileExists(DocObject.ContainerId)
|
||||
|
||||
@@ -238,9 +237,9 @@ Public Class EDMService
|
||||
#End Region
|
||||
|
||||
#Region "Utils"
|
||||
Public Function GetDocumentByDocumentId(DocumentId As Long) As DocumentResult Implements IEDMService.GetDocumentByDocumentId
|
||||
Public Function GetDocumentByDocumentId(DocumentId As Long) As DocumentResult Implements IIDBService.GetDocumentByDocumentId
|
||||
Try
|
||||
Dim oSQL = $"SELECT GUID, CONTAINER_ID, ORIGINAL_FILENAME FROM TBICM_DOCUMENT WHERE GUID = {DocumentId}"
|
||||
Dim oSQL = $"SELECT GUID, CONTAINER_ID, ORIGINAL_FILENAME FROM TBIDB_DOCUMENT WHERE GUID = {DocumentId}"
|
||||
Dim oTable = Database.GetDatatable(oSQL)
|
||||
|
||||
If oTable.Rows.Count = 0 Then
|
||||
@@ -266,9 +265,9 @@ Public Class EDMService
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetDocumentByContainerId(ContainerId As String) As DocumentResult Implements IEDMService.GetDocumentByContainerId
|
||||
Public Function GetDocumentByContainerId(ContainerId As String) As DocumentResult Implements IIDBService.GetDocumentByContainerId
|
||||
Try
|
||||
Dim oSQL = $"SELECT GUID, CONTAINER_ID, ORIGINAL_FILENAME FROM TBICM_DOCUMENT WHERE CONTAINER_ID = '{ContainerId}'"
|
||||
Dim oSQL = $"SELECT GUID, CONTAINER_ID, ORIGINAL_FILENAME FROM TBIDB_DOCUMENT WHERE CONTAINER_ID = '{ContainerId}'"
|
||||
Dim oTable = Database.GetDatatable(oSQL)
|
||||
|
||||
If oTable.Rows.Count = 0 Then
|
||||
@@ -296,9 +295,9 @@ Public Class EDMService
|
||||
#End Region
|
||||
|
||||
#Region "Index"
|
||||
Public Function NewFileIndex(DocObject As DocumentObject, Syskey As String, LanguageCode As String, Value As String) As IndexResult Implements IEDMService.NewFileIndex
|
||||
Public Function NewFileIndex(DocObject As DocumentObject, Syskey As String, LanguageCode As String, Value As String) As IndexResult Implements IIDBService.NewFileIndex
|
||||
Try
|
||||
Dim oSQL = $"SELECT FNICM_NEW_DOC_VALUE({DocObject.DocumentId},'{Syskey}','{LanguageCode}','{Value}','{_username}') FROM RDB$DATABASE;"
|
||||
Dim oSQL = $"SELECT FNIDB_NEW_DOC_VALUE({DocObject.DocumentId},'{Syskey}','{LanguageCode}','{Value}','{_username}') FROM RDB$DATABASE;"
|
||||
Dim oIndexId As Int64 = Database.GetScalarValue(oSQL)
|
||||
|
||||
Return New IndexResult(oIndexId)
|
||||
@@ -6,9 +6,9 @@
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A8C3F298-76AB-4359-AB3C-986E313B4336}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<StartupObject>DigitalData.Services.EDMService.WindowsService</StartupObject>
|
||||
<RootNamespace>DigitalData.Services.EDMService</RootNamespace>
|
||||
<AssemblyName>EDMService</AssemblyName>
|
||||
<StartupObject>DigitalData.Services.IDBService.WindowsService</StartupObject>
|
||||
<RootNamespace>DigitalData.Services.IDBService</RootNamespace>
|
||||
<AssemblyName>IDBService</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Console</MyType>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
@@ -21,7 +21,7 @@
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>EDMService.xml</DocumentationFile>
|
||||
<DocumentationFile>IDBService.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
@@ -31,7 +31,7 @@
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>EDMService.xml</DocumentationFile>
|
||||
<DocumentationFile>IDBService.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
@@ -89,12 +89,12 @@
|
||||
<Compile Include="Results\DocumentResult.vb" />
|
||||
<Compile Include="Exceptions.vb" />
|
||||
<Compile Include="Results\DatabaseResult.vb" />
|
||||
<Compile Include="EDMService.vb" />
|
||||
<Compile Include="IDBService.vb" />
|
||||
<Compile Include="Results\IndexResult.vb" />
|
||||
<Compile Include="WindowsService.vb">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="IEDMService.vb" />
|
||||
<Compile Include="IIDBService.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -1,8 +1,8 @@
|
||||
Imports System.ServiceModel
|
||||
Imports DigitalData.Modules.Filesystem
|
||||
|
||||
<ServiceContract([Namespace]:="http://DigitalData.Services.EDMService")>
|
||||
Interface IEDMService
|
||||
<ServiceContract([Namespace]:="http://DigitalData.Services.IDBService")>
|
||||
Interface IIDBService
|
||||
|
||||
#Region "Heartbeat"
|
||||
<OperationContract>
|
||||
@@ -8,10 +8,10 @@ Imports System.Runtime.InteropServices
|
||||
|
||||
' Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("EDMService")>
|
||||
<Assembly: AssemblyTitle("IDBService")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Digital Data")>
|
||||
<Assembly: AssemblyProduct("EDMService")>
|
||||
<Assembly: AssemblyProduct("IDBService")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2018")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.Services.EDMService.Resources", GetType(Resources).Assembly)
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.Services.IDBService.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
|
||||
@@ -64,9 +64,9 @@ Namespace My
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.DigitalData.Services.EDMService.My.MySettings
|
||||
Friend ReadOnly Property Settings() As Global.DigitalData.Services.IDBService.My.MySettings
|
||||
Get
|
||||
Return Global.DigitalData.Services.EDMService.My.MySettings.Default
|
||||
Return Global.DigitalData.Services.IDBService.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Module SettingsModule
|
||||
Public Const SERVICE_NAME As String = "DDEDMSvc"
|
||||
Public Const SERVICE_DISPLAY_NAME As String = "Digital Data EDM Service"
|
||||
Public Const SERVICE_NAME As String = "DDIDBSvc"
|
||||
Public Const SERVICE_DISPLAY_NAME As String = "Digital Data IDB Service"
|
||||
End Module
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
Imports System.ServiceModel
|
||||
Imports System.ServiceProcess
|
||||
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
|
||||
|
||||
Private _serviceHost As ServiceHost = Nothing
|
||||
Private _edmService As EDMService = Nothing
|
||||
Private _edmService As IDBService = Nothing
|
||||
|
||||
Private _logConfig As LogConfig
|
||||
Private _logger As Logger
|
||||
@@ -49,24 +45,29 @@ Public Class WindowsService
|
||||
|
||||
_logger.Info("Database connection established.")
|
||||
|
||||
EDMService.Database = _db
|
||||
EDMService.LogConfig = _logConfig
|
||||
EDMService.AppConfig = _config
|
||||
IDBService.Database = _db
|
||||
IDBService.LogConfig = _logConfig
|
||||
IDBService.AppConfig = _config
|
||||
|
||||
_logger.Debug("Starting WCF ServiceHost...")
|
||||
|
||||
_serviceHost = New ServiceHost(GetType(EDMService))
|
||||
_serviceHost = New ServiceHost(GetType(IDBService))
|
||||
_serviceHost.Open()
|
||||
|
||||
_logger.Info("WCF ServiceHost started.")
|
||||
_logger.Debug("WCF ServiceHost started.")
|
||||
|
||||
_logger.Info("Service {0} successfully started.", SERVICE_DISPLAY_NAME)
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex, "Failed to start the service host!")
|
||||
GracefullyStop()
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnStop()
|
||||
GracefullyStop()
|
||||
End Sub
|
||||
|
||||
Private Sub GracefullyStop()
|
||||
If _serviceHost IsNot Nothing Then
|
||||
_serviceHost.Close()
|
||||
_serviceHost = Nothing
|
||||
|
||||
Reference in New Issue
Block a user