MS Divers Globix,EDMI Service etc
This commit is contained in:
4
Service.EDMIService/ClassConstants.vb
Normal file
4
Service.EDMIService/ClassConstants.vb
Normal file
@@ -0,0 +1,4 @@
|
||||
Public Class ClassConstants
|
||||
Public Const FileStoreWork = "WORK"
|
||||
Public Const FileStoreArchive = "ARCHIVE"
|
||||
End Class
|
||||
@@ -10,6 +10,7 @@ Imports DigitalData.Services.EDMIService.Messages
|
||||
Imports DigitalData.Modules.EDMI.API.Rights
|
||||
Imports DigitalData.Services.EDMIService.Exceptions
|
||||
|
||||
|
||||
<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession)>
|
||||
Public Class EDMIService
|
||||
Implements IEDMIService
|
||||
@@ -518,5 +519,85 @@ Public Class EDMIService
|
||||
Return AccessRight.VIEW_ONLY
|
||||
End Try
|
||||
End Function
|
||||
Public Function New_FileStore_Object(IDB_OBJ_ID As Long, pStoreType As String, pDate As String) As String Implements IEDMIService.New_FileStore_Object
|
||||
Try
|
||||
Dim oRelpath As String
|
||||
If pStoreType = String.Empty Then
|
||||
pStoreType = ClassConstants.FileStoreWork
|
||||
End If
|
||||
oRelpath = GetFileStorePraefix(pStoreType)
|
||||
If pDate = String.Empty Then
|
||||
oRelpath = GetFolderToday(oRelpath)
|
||||
Else
|
||||
Try
|
||||
Dim odate = CDate(pDate)
|
||||
oRelpath = GetFolderDate(oRelpath, odate)
|
||||
Catch ex As Exception
|
||||
Return ""
|
||||
End Try
|
||||
End If
|
||||
Dim oIDB_FileObject As String
|
||||
If oRelpath = String.Empty Then
|
||||
Return "ERROR"
|
||||
Else
|
||||
_Logger.Debug($"oRelpath is [{oRelpath}]")
|
||||
|
||||
oIDB_FileObject = Path.Combine(oRelpath, GetDigitalDataFileObject(IDB_OBJ_ID))
|
||||
End If
|
||||
|
||||
Return oIDB_FileObject
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Return ""
|
||||
End Try
|
||||
End Function
|
||||
Private Function GetDigitalDataFileObject(IDB_OBJ_ID As Long) As String
|
||||
Return $"{IDB_OBJ_ID}.ddfo"
|
||||
End Function
|
||||
Private Function GetFileStorePraefix(pStoreType As String) As String
|
||||
Dim oObjectStore
|
||||
Dim EDMIPath As String
|
||||
If pStoreType = ClassConstants.FileStoreArchive Then
|
||||
oObjectStore = GlobalState.ObjectStores.Item(0)
|
||||
Else pStoreType = ClassConstants.FileStoreWork
|
||||
oObjectStore = GlobalState.ObjectStores.Item(1)
|
||||
End If
|
||||
_Logger.Debug($"oObjectStore is [{oObjectStore.Path}]")
|
||||
Return oObjectStore.Path
|
||||
|
||||
End Function
|
||||
Private Function GetFolderToday(pRelationalPath As String) As String
|
||||
Dim oDateSubDirectoryName As String = Now.ToString("yyyy-MM-dd")
|
||||
Dim oFolderToday As String = Path.Combine(pRelationalPath, oDateSubDirectoryName)
|
||||
' Create the destination directory if it does not exist
|
||||
If Not Directory.Exists(oFolderToday) Then
|
||||
Try
|
||||
Directory.CreateDirectory(oFolderToday)
|
||||
_Logger.Debug($"created NEW todayFolder [{oFolderToday}]")
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Return ""
|
||||
End Try
|
||||
End If
|
||||
Return oFolderToday
|
||||
End Function
|
||||
Private Function GetFolderDate(pRelationalPath As String, pDate As Date) As String
|
||||
Dim oDateSubDirectoryName As String = pDate.ToString("yyyy-MM-dd")
|
||||
Dim oFolderDateSepecial As String = Path.Combine(pRelationalPath, oDateSubDirectoryName)
|
||||
' Create the destination directory if it does not exist
|
||||
If Not Directory.Exists(oFolderDateSepecial) Then
|
||||
Try
|
||||
Directory.CreateDirectory(oFolderDateSepecial)
|
||||
_Logger.Debug($"created NEW DateSpecialFolder [{oFolderDateSepecial}]")
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Return ""
|
||||
End Try
|
||||
End If
|
||||
Return oFolderDateSepecial
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
@@ -124,6 +124,7 @@
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ClassConstants.vb" />
|
||||
<Compile Include="Config.vb" />
|
||||
<Compile Include="GlobalState.vb" />
|
||||
<Compile Include="Helpers\AccessRightResult.vb" />
|
||||
|
||||
@@ -78,6 +78,10 @@ Interface IEDMIService
|
||||
<OperationContract>
|
||||
<FaultContract(GetType(UnexpectedErrorFault))>
|
||||
Function ListFilesForUser() As DocumentListResponse
|
||||
|
||||
<OperationContract>
|
||||
<FaultContract(GetType(UnexpectedErrorFault))>
|
||||
Function New_FileStore_Object(IDB_OBJ_ID As Long, pStoreType As String, pDate As String) As String
|
||||
#End Region
|
||||
|
||||
End Interface
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.0.0.0")>
|
||||
<Assembly: AssemblyVersion("2.0.0.1")>
|
||||
<Assembly: AssemblyFileVersion("2.0.0.1")>
|
||||
|
||||
Reference in New Issue
Block a user