MS Divers Globix,EDMI Service etc
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user