EDMIService: clean up
This commit is contained in:
parent
d791d20118
commit
e3639930e1
@ -7,7 +7,7 @@ Imports System.ServiceModel
|
|||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports System.ServiceModel.Description
|
Imports System.ServiceModel.Description
|
||||||
Imports DigitalData.Services.EDMIService.Messages
|
Imports DigitalData.Services.EDMIService.Messages
|
||||||
Imports DigitalData.Services.EDMIService.Rights
|
Imports DigitalData.Modules.EDMI.API.Rights
|
||||||
|
|
||||||
<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession)>
|
<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession)>
|
||||||
Public Class EDMIService
|
Public Class EDMIService
|
||||||
@ -219,7 +219,7 @@ Public Class EDMIService
|
|||||||
''' Imports a file according to ObjectStoreId
|
''' Imports a file according to ObjectStoreId
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <returns></returns>
|
''' <returns></returns>
|
||||||
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.
|
Dim oObjectStore = GlobalState.ObjectStores.
|
||||||
Where(Function(s) s.Id = Data.ObjectStoreId).
|
Where(Function(s) s.Id = Data.ObjectStoreId).
|
||||||
FirstOrDefault()
|
FirstOrDefault()
|
||||||
@ -276,7 +276,7 @@ Public Class EDMIService
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
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
|
Try
|
||||||
Dim oSQL As String = $"SELECT ObjectStoreId FROM VWIDB_DOC_DATA WHERE IDB_OBJ_ID = {Data.ObjectId}"
|
Dim oSQL As String = $"SELECT ObjectStoreId FROM VWIDB_DOC_DATA WHERE IDB_OBJ_ID = {Data.ObjectId}"
|
||||||
Dim oObjectStoreId = MSSQL_IDB.GetScalarValue(oSQL)
|
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 oSQL2 As String = $"SELECT DocRelativePath FROM VWIDB_DOC_DATA WHERE IDB_OBJ_ID = {Data.ObjectId}"
|
||||||
Dim oPath As String = MSSQL_IDB.GetScalarValue(oSQL2)
|
Dim oPath As String = MSSQL_IDB.GetScalarValue(oSQL2)
|
||||||
|
|
||||||
|
|
||||||
If IsNothing(oPath) Then
|
If IsNothing(oPath) Then
|
||||||
Throw New FaultException($"Object [{Data.ObjectId}] does not exist in database!")
|
Throw New FaultException($"Object [{Data.ObjectId}] does not exist in database!")
|
||||||
End If
|
End If
|
||||||
@ -325,13 +324,13 @@ Public Class EDMIService
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ListFilesForUser() As Messages.DocumentListResponse Implements IEDMIService.ListFilesForUser
|
Public Function ListFilesForUser() As DocumentListResponse Implements IEDMIService.ListFilesForUser
|
||||||
Try
|
Try
|
||||||
Dim oSQL = $"SELECT * FROM VWIDB_DOC_DATA"
|
Dim oSQL = $"SELECT * FROM VWIDB_DOC_DATA"
|
||||||
Dim oDatatable As DataTable = MSSQL_IDB.GetDatatable(oSQL)
|
Dim oDatatable As DataTable = MSSQL_IDB.GetDatatable(oSQL)
|
||||||
oDatatable.TableName = "DocumentList"
|
oDatatable.TableName = "DocumentList"
|
||||||
|
|
||||||
Return New Messages.DocumentListResponse() With {
|
Return New DocumentListResponse() With {
|
||||||
.Datatable = oDatatable
|
.Datatable = oDatatable
|
||||||
}
|
}
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
|||||||
@ -133,7 +133,6 @@
|
|||||||
<Compile Include="Exceptions.vb" />
|
<Compile Include="Exceptions.vb" />
|
||||||
<Compile Include="Results\DatabaseResult.vb" />
|
<Compile Include="Results\DatabaseResult.vb" />
|
||||||
<Compile Include="EDMIService.vb" />
|
<Compile Include="EDMIService.vb" />
|
||||||
<Compile Include="Rights.vb" />
|
|
||||||
<Compile Include="Scheduler.vb" />
|
<Compile Include="Scheduler.vb" />
|
||||||
<Compile Include="Scheduler\DatatableJob.vb" />
|
<Compile Include="Scheduler\DatatableJob.vb" />
|
||||||
<Compile Include="Scheduler\JobListener.vb" />
|
<Compile Include="Scheduler\JobListener.vb" />
|
||||||
|
|||||||
@ -56,14 +56,13 @@ Interface IEDMIService
|
|||||||
|
|
||||||
#Region "Document (New)"
|
#Region "Document (New)"
|
||||||
<OperationContract>
|
<OperationContract>
|
||||||
Function ImportFile(Data As Messages.DocumentImportRequest) As Messages.DocumentImportResponse
|
Function ImportFile(Data As DocumentImportRequest) As DocumentImportResponse
|
||||||
'Function ImportFile(FileName As String, Contents As Byte(), ObjectStoreId As Int64, DocumentType As String, Optional RetentionDays As Int64 = Nothing) As Messages.DocumentImportResponse
|
|
||||||
|
|
||||||
<OperationContract>
|
<OperationContract>
|
||||||
Function GetFileByObjectId(Data As Messages.DocumentStreamRequest) As Messages.DocumentStreamResponse
|
Function GetFileByObjectId(Data As DocumentStreamRequest) As DocumentStreamResponse
|
||||||
|
|
||||||
<OperationContract>
|
<OperationContract>
|
||||||
Function ListFilesForUser() As Messages.DocumentListResponse
|
Function ListFilesForUser() As DocumentListResponse
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
End Interface
|
End Interface
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Imports System.Runtime.Serialization
|
Imports System.Runtime.Serialization
|
||||||
Imports DigitalData.Services.EDMIService.Rights
|
|
||||||
Imports DigitalData.Modules.Language
|
Imports DigitalData.Modules.Language
|
||||||
|
Imports DigitalData.Modules.EDMI.API.Rights
|
||||||
|
|
||||||
Namespace Messages
|
Namespace Messages
|
||||||
Public Class AccessRightResult
|
Public Class AccessRightResult
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
Public Class Rights
|
|
||||||
Public Enum AccessRight
|
|
||||||
VIEW_ONLY = 1
|
|
||||||
VIEW_EXPORT = 2
|
|
||||||
FULL = 4
|
|
||||||
End Enum
|
|
||||||
End Class
|
|
||||||
@ -39,7 +39,6 @@ Public Class WindowsService
|
|||||||
Dim oServicePath As String = AppDomain.CurrentDomain.BaseDirectory
|
Dim oServicePath As String = AppDomain.CurrentDomain.BaseDirectory
|
||||||
|
|
||||||
_LogConfig = New LogConfig(LogConfig.PathType.CustomPath, IO.Path.Combine(oServicePath, "Log"))
|
_LogConfig = New LogConfig(LogConfig.PathType.CustomPath, IO.Path.Combine(oServicePath, "Log"))
|
||||||
_LogConfig.Debug = True
|
|
||||||
_Logger = _LogConfig.GetLogger()
|
_Logger = _LogConfig.GetLogger()
|
||||||
_Logger.Info("Service {0} is starting...", SERVICE_DISPLAY_NAME)
|
_Logger.Info("Service {0} is starting...", SERVICE_DISPLAY_NAME)
|
||||||
_Logger.Info("ServiceDirectory: {0}", oServicePath)
|
_Logger.Info("ServiceDirectory: {0}", oServicePath)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user