Compare commits
3 Commits
5fc7fe8df9
...
3e11385907
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e11385907 | ||
|
|
3e5918297c | ||
|
|
d75272a17f |
@@ -39,7 +39,12 @@ Public Class frmtest
|
|||||||
Dim oObjectId As Long = Await My.Application.Service.Client.ImportFileAsync(
|
Dim oObjectId As Long = Await My.Application.Service.Client.ImportFileAsync(
|
||||||
txtFile2Import.Text,
|
txtFile2Import.Text,
|
||||||
txtProfileId.Text,
|
txtProfileId.Text,
|
||||||
New List(Of EDMIServiceReference.UserAttributeValue),
|
New List(Of EDMIServiceReference.UserAttributeValue) From {
|
||||||
|
New EDMIServiceReference.UserAttributeValue With {
|
||||||
|
.AttributeName = "Attribut String1",
|
||||||
|
.AttributeValues = New List(Of String) From {"SchreiberM"}.ToArray
|
||||||
|
}
|
||||||
|
},
|
||||||
"WORK",
|
"WORK",
|
||||||
"DOC",
|
"DOC",
|
||||||
"DEFAULT"
|
"DEFAULT"
|
||||||
|
|||||||
@@ -10,10 +10,4 @@
|
|||||||
''' </summary>
|
''' </summary>
|
||||||
''' <returns></returns>
|
''' <returns></returns>
|
||||||
Property IsComplex As Boolean
|
Property IsComplex As Boolean
|
||||||
|
|
||||||
''' <summary>
|
|
||||||
''' Main Replace Function
|
|
||||||
''' </summary>
|
|
||||||
''' <returns>The replaced string</returns>
|
|
||||||
Function Replace(pInput As String, pReplaceMap As Dictionary(Of String, Object)) As String
|
|
||||||
End Interface
|
End Interface
|
||||||
|
|||||||
@@ -17,24 +17,23 @@ Namespace Modules
|
|||||||
MyBase.New(pLogConfig)
|
MyBase.New(pLogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function Replace(pInput As String, pReplaceMap As Dictionary(Of String, Object)) As String Implements IModule.Replace
|
Public Function Replace(pInput As String, pClipboardContents As String) As String
|
||||||
Dim oResult = pInput
|
Dim oResult = pInput
|
||||||
Dim oCounter = 0
|
Dim oCounter = 0
|
||||||
Dim oClipboardContents = pReplaceMap.Item(CLIP_VALUE_BOARD)
|
|
||||||
|
|
||||||
Try
|
Try
|
||||||
' LEGACY: Replace Clipboard Contents
|
' LEGACY: Replace Clipboard Contents
|
||||||
oResult = oResult.Replace(CLIPBOARD_VALUE_DE.ToLower, oClipboardContents)
|
oResult = oResult.Replace(CLIPBOARD_VALUE_DE.ToLower, pClipboardContents)
|
||||||
oResult = oResult.Replace(CLIPBOARD_VALUE_DE.ToUpper, oClipboardContents)
|
oResult = oResult.Replace(CLIPBOARD_VALUE_DE.ToUpper, pClipboardContents)
|
||||||
oResult = oResult.Replace(CLIPBOARD_VALUE_DE, oClipboardContents)
|
oResult = oResult.Replace(CLIPBOARD_VALUE_DE, pClipboardContents)
|
||||||
|
|
||||||
oResult = oResult.Replace(CLIPBOARD_VALUE_EN.ToLower, oClipboardContents)
|
oResult = oResult.Replace(CLIPBOARD_VALUE_EN.ToLower, pClipboardContents)
|
||||||
oResult = oResult.Replace(CLIPBOARD_VALUE_EN.ToUpper, oClipboardContents)
|
oResult = oResult.Replace(CLIPBOARD_VALUE_EN.ToUpper, pClipboardContents)
|
||||||
oResult = oResult.Replace(CLIPBOARD_VALUE_EN, oClipboardContents)
|
oResult = oResult.Replace(CLIPBOARD_VALUE_EN, pClipboardContents)
|
||||||
|
|
||||||
' Replace Clipboard Contents
|
' Replace Clipboard Contents
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, CLIP_VALUE_BOARD)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, CLIP_VALUE_BOARD)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, oClipboardContents)
|
oResult = ReplacePattern(oResult, PatternIdentifier, pClipboardContents)
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
|
|||||||
@@ -19,15 +19,14 @@ Namespace Modules
|
|||||||
MyBase.New(pLogConfig)
|
MyBase.New(pLogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function Replace(pInput As String, pReplaceMap As Dictionary(Of String, Object)) As String Implements IModule.Replace
|
Public Function Replace(pInput As String, pPanel As Panel) As String
|
||||||
Dim oResult = pInput
|
Dim oResult = pInput
|
||||||
Dim oCounter = 0
|
Dim oCounter = 0
|
||||||
Dim oPanel As Panel = pReplaceMap.Item(CTRL_VALUE_PANEL)
|
|
||||||
|
|
||||||
While ContainsPattern(oResult, PatternIdentifier)
|
While ContainsPattern(oResult, PatternIdentifier)
|
||||||
Try
|
Try
|
||||||
Dim oControlName As String = GetNextPattern(oResult, PatternIdentifier).Value
|
Dim oControlName As String = GetNextPattern(oResult, PatternIdentifier).Value
|
||||||
Dim oControl As Control = oPanel.Controls.Find(oControlName, False).FirstOrDefault()
|
Dim oControl As Control = pPanel.Controls.Find(oControlName, False).FirstOrDefault()
|
||||||
|
|
||||||
If oControl IsNot Nothing Then
|
If oControl IsNot Nothing Then
|
||||||
Dim oReplaceValue As String
|
Dim oReplaceValue As String
|
||||||
|
|||||||
@@ -20,42 +20,41 @@ Namespace Modules
|
|||||||
MyBase.New(pLogConfig)
|
MyBase.New(pLogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function Replace(pInput As String, pReplaceMap As Dictionary(Of String, Object)) As String Implements IModule.Replace
|
Public Function Replace(pInput As String, pFileInfo As FileInfo) As String
|
||||||
Dim oResult = pInput
|
Dim oResult = pInput
|
||||||
Dim oCounter = 0
|
Dim oCounter = 0
|
||||||
Dim oFileInfo As FileInfo = pReplaceMap.Item(FILE_VALUE_FILEINFO)
|
|
||||||
|
|
||||||
' Replace Filename without extension
|
' Replace Filename without extension
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, FILE_VALUE_FILENAME)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, FILE_VALUE_FILENAME)
|
||||||
Dim oFilenameWithoutExtension = Path.GetFileNameWithoutExtension(oFileInfo.Name)
|
Dim oFilenameWithoutExtension = Path.GetFileNameWithoutExtension(pFileInfo.Name)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, oFilenameWithoutExtension)
|
oResult = ReplacePattern(oResult, PatternIdentifier, oFilenameWithoutExtension)
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
' Replace Filename with extension
|
' Replace Filename with extension
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, FILE_VALUE_FILENAME_EXT)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, FILE_VALUE_FILENAME_EXT)
|
||||||
Dim oFilename As String = oFileInfo.Name
|
Dim oFilename As String = pFileInfo.Name
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, oFilename)
|
oResult = ReplacePattern(oResult, PatternIdentifier, oFilename)
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
' Replace Extension
|
' Replace Extension
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, FILE_VALUE_FILENAME_EXT)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, FILE_VALUE_FILENAME_EXT)
|
||||||
Dim oExtension As String = oFileInfo.Extension.Substring(1)
|
Dim oExtension As String = pFileInfo.Extension.Substring(1)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, oExtension)
|
oResult = ReplacePattern(oResult, PatternIdentifier, oExtension)
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
' Replace creation date
|
' Replace creation date
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, FILE_VALUE_DATE_CREATED)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, FILE_VALUE_DATE_CREATED)
|
||||||
Dim oDateCreated = oFileInfo.CreationTime.ToString("yyyy-MM-dd")
|
Dim oDateCreated = pFileInfo.CreationTime.ToString("yyyy-MM-dd")
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, oDateCreated)
|
oResult = ReplacePattern(oResult, PatternIdentifier, oDateCreated)
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
' Replace last modification date
|
' Replace last modification date
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, FILE_VALUE_DATE_CREATED)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, FILE_VALUE_DATE_CREATED)
|
||||||
Dim oDateModified = oFileInfo.LastWriteTime.ToString("yyyy-MM-dd")
|
Dim oDateModified = pFileInfo.LastWriteTime.ToString("yyyy-MM-dd")
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, oDateModified)
|
oResult = ReplacePattern(oResult, PatternIdentifier, oDateModified)
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|||||||
@@ -1,26 +1,29 @@
|
|||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
|
|
||||||
Namespace Modules
|
Namespace Modules.Globix
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Patterns for Generating a Filename in Global Indexer
|
''' Patterns for Generating a Filename in Global Indexer
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Class Globix
|
Public Class GlobixAutomatic
|
||||||
Inherits BaseModule
|
Inherits BaseModule
|
||||||
Implements IModule
|
Implements IModule
|
||||||
|
|
||||||
Public Const GBX_VALUE_INDICIES = "GLOBIX_INDICIES"
|
Public Property PatternIdentifier As String = "ATTR_A" Implements IModule.PatternIdentifier
|
||||||
|
|
||||||
Public Property PatternIdentifier As String = "GBX" Implements IModule.PatternIdentifier
|
|
||||||
Public Property IsComplex As Boolean = True Implements IModule.IsComplex
|
Public Property IsComplex As Boolean = True Implements IModule.IsComplex
|
||||||
|
|
||||||
Public Sub New(pLogConfig As LogConfig)
|
Public Sub New(pLogConfig As LogConfig)
|
||||||
MyBase.New(pLogConfig)
|
MyBase.New(pLogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function Replace(pInput As String, pReplaceMap As Dictionary(Of String, Object)) As String Implements IModule.Replace
|
Public Function Replace(pInput As String, pIndexes As Dictionary(Of String, List(Of String))) As String
|
||||||
Dim oResult = pInput
|
Dim oResult = pInput
|
||||||
Dim oCounter = 0
|
Dim oCounter = 0
|
||||||
Dim pIndexes As Dictionary(Of String, List(Of String)) = pReplaceMap.Item(GBX_VALUE_INDICIES)
|
|
||||||
|
If pIndexes Is Nothing Then
|
||||||
|
Throw New ArgumentNullException("pIndexes")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Logger.Debug("Replacing Automatic Indexes. [{0}] Indexes loaded.", pIndexes?.Count)
|
||||||
|
|
||||||
While ContainsPattern(oResult, PatternIdentifier)
|
While ContainsPattern(oResult, PatternIdentifier)
|
||||||
Try
|
Try
|
||||||
59
Modules.Patterns/Modules/Globix/GlobixManual.vb
Normal file
59
Modules.Patterns/Modules/Globix/GlobixManual.vb
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
Imports DigitalData.Modules.Logging
|
||||||
|
|
||||||
|
Namespace Modules.Globix
|
||||||
|
''' <summary>
|
||||||
|
''' Patterns for Generating a Filename in Global Indexer
|
||||||
|
''' </summary>
|
||||||
|
Public Class GlobixManual
|
||||||
|
Inherits BaseModule
|
||||||
|
Implements IModule
|
||||||
|
|
||||||
|
Public Property PatternIdentifier As String = "ATTR_M" Implements IModule.PatternIdentifier
|
||||||
|
Public Property IsComplex As Boolean = True Implements IModule.IsComplex
|
||||||
|
|
||||||
|
Public Sub New(pLogConfig As LogConfig)
|
||||||
|
MyBase.New(pLogConfig)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Function Replace(pInput As String, pIndexes As Dictionary(Of String, List(Of String))) As String
|
||||||
|
Dim oResult = pInput
|
||||||
|
Dim oCounter = 0
|
||||||
|
|
||||||
|
If pIndexes Is Nothing Then
|
||||||
|
Throw New ArgumentNullException("pIndexes")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Logger.Debug("Replacing Manual Indexes. [{0}] Indexes loaded.", pIndexes?.Count)
|
||||||
|
|
||||||
|
While ContainsPattern(oResult, PatternIdentifier)
|
||||||
|
Try
|
||||||
|
Dim oIndexName As String = GetNextPattern(oResult, PatternIdentifier).Value
|
||||||
|
|
||||||
|
If pIndexes.ContainsKey(oIndexName) = False Then
|
||||||
|
Logger.Warn("Value for Index [{0}] does not exist and will not be used for replacing. Exiting.", oIndexName)
|
||||||
|
Return oResult
|
||||||
|
End If
|
||||||
|
|
||||||
|
' TODO: If Index contains multiple values, only the first value will be used as value
|
||||||
|
Dim oIndexValues As List(Of String) = pIndexes.Item(oIndexName)
|
||||||
|
Dim oFirstValue As String = oIndexValues.FirstOrDefault()
|
||||||
|
|
||||||
|
If oFirstValue Is Nothing Then
|
||||||
|
Logger.Warn("Value for Index [{0}] is empty and will not be used for replacing. Exiting.")
|
||||||
|
Return oResult
|
||||||
|
End If
|
||||||
|
|
||||||
|
oResult = ReplacePattern(oResult, PatternIdentifier, oFirstValue)
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Return oResult
|
||||||
|
Finally
|
||||||
|
IncrementCounterOrThrow(oCounter)
|
||||||
|
End Try
|
||||||
|
End While
|
||||||
|
|
||||||
|
Return oResult
|
||||||
|
End Function
|
||||||
|
End Class
|
||||||
|
End Namespace
|
||||||
@@ -4,7 +4,7 @@ Imports DigitalData.Modules.Logging
|
|||||||
|
|
||||||
Namespace Modules
|
Namespace Modules
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Patterns for Windream Indicies
|
''' Patterns for IDB Attributes
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Class IDB
|
Public Class IDB
|
||||||
Inherits BaseModule
|
Inherits BaseModule
|
||||||
@@ -12,14 +12,14 @@ Namespace Modules
|
|||||||
|
|
||||||
Public Const IDB_OBJECT_ID = "IDB_OBJECT_ID"
|
Public Const IDB_OBJECT_ID = "IDB_OBJECT_ID"
|
||||||
|
|
||||||
Public Property PatternIdentifier As String = "IDB" Implements IModule.PatternIdentifier
|
Public Property PatternIdentifier As String = "ATTR" Implements IModule.PatternIdentifier
|
||||||
Public Property IsComplex As Boolean = True Implements IModule.IsComplex
|
Public Property IsComplex As Boolean = True Implements IModule.IsComplex
|
||||||
|
|
||||||
Public Sub New(pLogConfig As LogConfig)
|
Public Sub New(pLogConfig As LogConfig)
|
||||||
MyBase.New(pLogConfig)
|
MyBase.New(pLogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function Replace(pInput As String, pReplaceMap As Dictionary(Of String, Object)) As String Implements IModule.Replace
|
Public Function Replace(pInput As String) As String
|
||||||
'TODO: Implement, depends on IDB Data, which is not in monorepo yet
|
'TODO: Implement, depends on IDB Data, which is not in monorepo yet
|
||||||
|
|
||||||
Return pInput
|
Return pInput
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Namespace Modules
|
|||||||
MyBase.New(pLogConfig)
|
MyBase.New(pLogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function Replace(pInput As String, pReplaceMap As Dictionary(Of String, Object)) As String Implements IModule.Replace
|
Public Function Replace(pInput As String) As String
|
||||||
Dim oResult = pInput
|
Dim oResult = pInput
|
||||||
Dim oCounter = 0
|
Dim oCounter = 0
|
||||||
Dim oNow As Date = Now
|
Dim oNow As Date = Now
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
|
Imports DigitalData.Modules.ZooFlow
|
||||||
|
|
||||||
Namespace Modules
|
Namespace Modules
|
||||||
Public Class User
|
Public Class User
|
||||||
@@ -20,37 +21,37 @@ Namespace Modules
|
|||||||
MyBase.New(pLogConfig)
|
MyBase.New(pLogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function Replace(pInput As String, pReplaceMap As Dictionary(Of String, Object)) As String Implements IModule.Replace
|
Public Function Replace(pInput As String, pUser As State.UserState) As String
|
||||||
Dim oResult = pInput
|
Dim oResult = pInput
|
||||||
Dim oCounter = 0
|
Dim oCounter = 0
|
||||||
|
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, USER_VALUE_PRENAME)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, USER_VALUE_PRENAME)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, pReplaceMap.Item(USER_VALUE_PRENAME))
|
oResult = ReplacePattern(oResult, PatternIdentifier, pUser.GivenName)
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, USER_VALUE_SURNAME)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, USER_VALUE_SURNAME)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, pReplaceMap.Item(USER_VALUE_SURNAME))
|
oResult = ReplacePattern(oResult, PatternIdentifier, pUser.Surname)
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, USER_VALUE_EMAIL)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, USER_VALUE_EMAIL)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, pReplaceMap.Item(USER_VALUE_EMAIL))
|
oResult = ReplacePattern(oResult, PatternIdentifier, pUser.Email)
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, USER_VALUE_SHORTNAME)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, USER_VALUE_SHORTNAME)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, pReplaceMap.Item(USER_VALUE_SHORTNAME))
|
oResult = ReplacePattern(oResult, PatternIdentifier, pUser.ShortName)
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, USER_VALUE_LANGUAGE)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, USER_VALUE_LANGUAGE)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, pReplaceMap.Item(USER_VALUE_LANGUAGE))
|
oResult = ReplacePattern(oResult, PatternIdentifier, pUser.Language)
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, USER_VALUE_USER_ID)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, USER_VALUE_USER_ID)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, pReplaceMap.Item(USER_VALUE_USER_ID))
|
oResult = ReplacePattern(oResult, PatternIdentifier, pUser.UserId)
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,9 @@ Namespace Modules
|
|||||||
MyBase.New(pLogConfig)
|
MyBase.New(pLogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function Replace(pInput As String, pReplaceMap As Dictionary(Of String, Object)) As String Implements IModule.Replace
|
Public Function Replace(pInput As String, pWMObject As WINDREAMLib.WMObject) As String
|
||||||
Dim oResult = pInput
|
Dim oResult = pInput
|
||||||
Dim oCounter = 0
|
Dim oCounter = 0
|
||||||
Dim pWMObject As WINDREAMLib.WMObject = pReplaceMap.Item(WM_VALUE_DOCUMENT)
|
|
||||||
|
|
||||||
While ContainsPattern(oResult, PatternIdentifier)
|
While ContainsPattern(oResult, PatternIdentifier)
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -82,8 +82,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Constants.vb" />
|
<Compile Include="Constants.vb" />
|
||||||
<Compile Include="Modules\FileInformation.vb" />
|
<Compile Include="Modules\FileInformation.vb" />
|
||||||
|
<Compile Include="Modules\Globix\GlobixAutomatic.vb" />
|
||||||
<Compile Include="Modules\IDB.vb" />
|
<Compile Include="Modules\IDB.vb" />
|
||||||
<Compile Include="Modules\Globix.vb" />
|
<Compile Include="Modules\Globix\GlobixManual.vb" />
|
||||||
<Compile Include="Modules\Windream.vb" />
|
<Compile Include="Modules\Windream.vb" />
|
||||||
<Compile Include="Modules\User.vb" />
|
<Compile Include="Modules\User.vb" />
|
||||||
<Compile Include="IModule.vb" />
|
<Compile Include="IModule.vb" />
|
||||||
|
|||||||
@@ -19,42 +19,9 @@ Imports WINDREAMLib
|
|||||||
''' {#WMI#String 39}
|
''' {#WMI#String 39}
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Class Patterns2
|
Public Class Patterns2
|
||||||
''' <summary>
|
|
||||||
''' Complex patterns that rely on Windream
|
|
||||||
''' </summary>
|
|
||||||
Public Const PATTERN_WMI = "WMI"
|
|
||||||
|
|
||||||
''' <summary>
|
|
||||||
''' Complex patterns that rely on IDB Attribute values
|
|
||||||
''' </summary>
|
|
||||||
Public Const PATTERN_IDBA = "IDBA"
|
|
||||||
|
|
||||||
''' <summary>
|
|
||||||
''' Complex patterns that rely on Control Values
|
|
||||||
''' </summary>
|
|
||||||
Public Const PATTERN_CTRL = "CTRL"
|
|
||||||
|
|
||||||
''' <summary>
|
|
||||||
''' Simple patterns that rely on Data from the TBDD_USER table
|
|
||||||
''' </summary>
|
|
||||||
Public Const PATTERN_USER = "USER"
|
|
||||||
|
|
||||||
Public Const USER_VALUE_PRENAME = "PRENAME"
|
|
||||||
Public Const USER_VALUE_SURNAME = "SURNAME"
|
|
||||||
Public Const USER_VALUE_EMAIL = "EMAIL"
|
|
||||||
Public Const USER_VALUE_SHORTNAME = "SHORTNAME"
|
|
||||||
Public Const USER_VALUE_LANGUAGE = "LANGUAGE"
|
|
||||||
Public Const USER_VALUE_USER_ID = "USER_ID"
|
|
||||||
Public Const VALUE_PROFILE_ID = "PROFILE_ID"
|
|
||||||
Public Const VALUE_PROFILE_TITLE = "PROFILE_TITLE"
|
|
||||||
|
|
||||||
Private ReadOnly LogConfig As LogConfig
|
Private ReadOnly LogConfig As LogConfig
|
||||||
Private ReadOnly Logger As Logger
|
Private ReadOnly Logger As Logger
|
||||||
Private ReadOnly Base As Modules.BaseModule
|
Private ReadOnly Base As Modules.BaseModule
|
||||||
|
|
||||||
Private ReadOnly ControlPanel As Panel
|
|
||||||
Private ReadOnly IDBActive As Boolean
|
|
||||||
|
|
||||||
Private ReadOnly Modules As New List(Of IModule)
|
Private ReadOnly Modules As New List(Of IModule)
|
||||||
|
|
||||||
Public Sub New(pLogConfig As LogConfig)
|
Public Sub New(pLogConfig As LogConfig)
|
||||||
@@ -67,192 +34,97 @@ Public Class Patterns2
|
|||||||
New Modules.Clipboard(LogConfig),
|
New Modules.Clipboard(LogConfig),
|
||||||
New Modules.Controls(LogConfig),
|
New Modules.Controls(LogConfig),
|
||||||
New Modules.User(LogConfig),
|
New Modules.User(LogConfig),
|
||||||
New Modules.FileInformation(LogConfig)
|
New Modules.FileInformation(LogConfig),
|
||||||
|
New Modules.IDB(LogConfig),
|
||||||
|
New Modules.Globix.GlobixAutomatic(LogConfig),
|
||||||
|
New Modules.Globix.GlobixManual(LogConfig)
|
||||||
})
|
})
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub New(pLogConfig As LogConfig, pControlPanel As Panel, pIDBActive As Boolean)
|
|
||||||
MyClass.New(pLogConfig)
|
|
||||||
ControlPanel = pControlPanel
|
|
||||||
IDBActive = pIDBActive
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Function ReplaceAllValues(pInput As String, pPanel As Panel, pUser As State.UserState, pFIleinfo As FileInfo) As String
|
|
||||||
Dim oResult = pInput
|
|
||||||
|
|
||||||
For Each oModule In Modules
|
|
||||||
Try
|
|
||||||
Dim oArgs = GetReplaceMapForModule(oModule, pPanel:=pPanel, pUser:=pUser, pFileInfo:=pFIleinfo)
|
|
||||||
oResult = oModule.Replace(oResult, oArgs)
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Warn("Placeholders for String [{0}] could not be replaced completely in Module [{1}]. Skipping.", pInput, oModule.GetType.Name)
|
|
||||||
Logger.Error(ex)
|
|
||||||
End Try
|
|
||||||
Next
|
|
||||||
|
|
||||||
Return oResult
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function ReplaceUserValues(pInput As String, pUser As State.UserState) As String
|
Public Function ReplaceUserValues(pInput As String, pUser As State.UserState) As String
|
||||||
Logger.Debug("Replacing User Values")
|
Try
|
||||||
Dim oResult = pInput
|
Logger.Debug("Replacing User Values")
|
||||||
|
Dim oModule = New Modules.User(LogConfig)
|
||||||
Dim oModule = GetModule(Of Modules.User)()
|
Return oModule.Replace(pInput, pUser)
|
||||||
Dim oArgs = GetReplaceMapForModule(oModule, pUser:=pUser)
|
Catch ex As Exception
|
||||||
oResult = DoReplaceForModule(oResult, oModule, oArgs)
|
Logger.Warn("Error occurred while replacing User Values")
|
||||||
|
Logger.Error(ex)
|
||||||
Return oResult
|
Return pInput
|
||||||
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ReplaceFileValues(pInput As String, pFileInfo As FileInfo) As String
|
Public Function ReplaceFileValues(pInput As String, pFileInfo As FileInfo) As String
|
||||||
Logger.Debug("Replacing File Values")
|
Try
|
||||||
Dim oResult = pInput
|
Logger.Debug("Replacing File Values")
|
||||||
|
Dim oModule = New Modules.FileInformation(LogConfig)
|
||||||
Dim oModule = GetModule(Of Modules.FileInformation)()
|
Return oModule.Replace(pInput, pFileInfo)
|
||||||
Dim oArgs = GetReplaceMapForModule(oModule, pFileInfo:=pFileInfo)
|
Catch ex As Exception
|
||||||
oResult = DoReplaceForModule(oResult, oModule, oArgs)
|
Logger.Warn("Error occurred while replacing File Values")
|
||||||
|
Logger.Error(ex)
|
||||||
Return oResult
|
Return pInput
|
||||||
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ReplaceControlValues(pInput As String, pPanel As Panel) As String
|
Public Function ReplaceControlValues(pInput As String, pPanel As Panel) As String
|
||||||
Logger.Debug("Replacing Control Values")
|
Try
|
||||||
Dim oResult = pInput
|
Logger.Debug("Replacing Control Values")
|
||||||
|
Dim oModule = New Modules.Controls(LogConfig)
|
||||||
Dim oModule = GetModule(Of Modules.Controls)()
|
Return oModule.Replace(pInput, pPanel)
|
||||||
Dim oArgs = GetReplaceMapForModule(oModule, pPanel:=pPanel)
|
Catch ex As Exception
|
||||||
oResult = DoReplaceForModule(oResult, oModule, oArgs)
|
Logger.Warn("Error occurred while replacing Control Values")
|
||||||
|
Logger.Error(ex)
|
||||||
Return oResult
|
Return pInput
|
||||||
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ReplaceWindreamValues(pInput As String, pWMObject As WMObject) As String
|
Public Function ReplaceWindreamValues(pInput As String, pWMObject As WMObject) As String
|
||||||
Logger.Debug("Replacing Windream Values")
|
Try
|
||||||
Dim oResult = pInput
|
Logger.Debug("Replacing Windream Values")
|
||||||
|
Dim oModule = New Modules.Windream(LogConfig)
|
||||||
Dim oModule = GetModule(Of Modules.Windream)()
|
Return oModule.Replace(pInput, pWMObject)
|
||||||
Dim oArgs = GetReplaceMapForModule(oModule, pWMObject:=pWMObject)
|
Catch ex As Exception
|
||||||
oResult = DoReplaceForModule(oResult, oModule, oArgs)
|
Logger.Warn("Error occurred while replacing Windream Values")
|
||||||
|
Logger.Error(ex)
|
||||||
Return oResult
|
Return pInput
|
||||||
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ReplaceInternalValues(pInput As String) As String
|
Public Function ReplaceInternalValues(pInput As String, Optional pClipboardContents As String = "") As String
|
||||||
Logger.Debug("Replacing Internal Values")
|
Logger.Debug("Replacing Internal Values")
|
||||||
Dim oResult = pInput
|
Dim oResult = pInput
|
||||||
|
|
||||||
Dim oInternalModule = GetModule(Of Modules.Internal)()
|
Try
|
||||||
Dim oInternalArgs = GetReplaceMapForModule(oInternalModule)
|
Dim oInternal = New Modules.Internal(LogConfig)
|
||||||
oResult = DoReplaceForModule(oResult, oInternalModule, oInternalArgs)
|
Dim oClipboard = New Modules.Clipboard(LogConfig)
|
||||||
|
|
||||||
Dim oClipboardModule = GetModule(Of Modules.Clipboard)()
|
oResult = oInternal.Replace(oResult)
|
||||||
Dim oClipboardArgs = GetReplaceMapForModule(oClipboardModule)
|
oResult = oClipboard.Replace(oResult, pClipboardContents)
|
||||||
oResult = DoReplaceForModule(oResult, oClipboardModule, oClipboardArgs)
|
|
||||||
|
|
||||||
Return oResult
|
Return oResult
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Warn("Error occurred while replacing Internal Values")
|
||||||
|
Logger.Error(ex)
|
||||||
|
Return oResult
|
||||||
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ReplaceGlobixValues(pInput As String, pGlobixIndexes As Dictionary(Of String, List(Of String))) As String
|
Public Function ReplaceGlobixValues(pInput As String, pAutomaticIndexes As Dictionary(Of String, List(Of String)), pManualIndexes As Dictionary(Of String, List(Of String))) As String
|
||||||
Logger.Debug("Replacing Globix Values")
|
Logger.Debug("Replacing Globix Values")
|
||||||
Dim oResult = pInput
|
Dim oResult = pInput
|
||||||
|
|
||||||
Dim oGlobixModule = GetModule(Of Modules.Globix)()
|
|
||||||
Dim oGlobixArgs = GetReplaceMapForModule(oGlobixModule, pGlobixIndexes:=pGlobixIndexes)
|
|
||||||
oResult = DoReplaceForModule(oResult, oGlobixModule, oGlobixArgs)
|
|
||||||
|
|
||||||
Return oResult
|
|
||||||
End Function
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Function DoReplaceForModule(pInput As String, pModule As IModule, pArgs As Dictionary(Of String, Object)) As String
|
|
||||||
Try
|
Try
|
||||||
If pModule IsNot Nothing AndAlso pModule?.GetType?.Name IsNot Nothing Then
|
Dim oAutomatic = New Modules.Globix.GlobixAutomatic(LogConfig)
|
||||||
Logger.Debug("Calling Replace for Module [{0}]", pModule.GetType.Name)
|
Dim oManual = New Modules.Globix.GlobixManual(LogConfig)
|
||||||
End If
|
|
||||||
|
|
||||||
Logger.Debug("Calling Replace for Input String [{0}]", pInput)
|
oResult = oAutomatic.Replace(oResult, pAutomaticIndexes)
|
||||||
|
oResult = oManual.Replace(oResult, pManualIndexes)
|
||||||
|
|
||||||
pInput = pModule.Replace(pInput, pArgs)
|
Return oResult
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Logger.Warn("Placeholders for String [{0}] could not be replaced completely in Module [{1}]. Skipping.", pInput, pModule.GetType.Name)
|
Logger.Warn("Error occurred while replacing Globix Values")
|
||||||
Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
|
Return oResult
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return pInput
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Private Function GetModule(Of ModuleT)() As IModule
|
|
||||||
Return Modules.
|
|
||||||
Where(Function(m) TypeOf m Is ModuleT).
|
|
||||||
SingleOrDefault()
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Private Function GetReplaceMapForModule(pModule As IModule,
|
|
||||||
Optional pPanel As Panel = Nothing,
|
|
||||||
Optional pUser As State.UserState = Nothing,
|
|
||||||
Optional pWMObject As WMObject = Nothing,
|
|
||||||
Optional pGlobixIndexes As Dictionary(Of String, List(Of String)) = Nothing,
|
|
||||||
Optional pFileInfo As FileInfo = Nothing
|
|
||||||
) As Dictionary(Of String, Object)
|
|
||||||
Dim oArgs As New Dictionary(Of String, Object)
|
|
||||||
|
|
||||||
If TypeOf pModule Is Modules.Clipboard Then
|
|
||||||
Logger.Debug("Adding Arguments for Clipboard Module")
|
|
||||||
Try
|
|
||||||
oArgs.Add(Patterns.Modules.Clipboard.CLIP_VALUE_BOARD, My.Computer.Clipboard.GetText())
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
End Try
|
|
||||||
|
|
||||||
ElseIf TypeOf pModule Is Modules.FileInformation Then
|
|
||||||
Logger.Debug("Adding Arguments for File Module")
|
|
||||||
Try
|
|
||||||
oArgs.Add(Patterns.Modules.FileInformation.FILE_VALUE_FILEINFO, pFileInfo)
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
End Try
|
|
||||||
|
|
||||||
ElseIf TypeOf pModule Is Modules.User Then
|
|
||||||
Logger.Debug("Adding Arguments for User Module")
|
|
||||||
Try
|
|
||||||
oArgs.Add(Patterns.Modules.User.USER_VALUE_EMAIL, pUser.Email)
|
|
||||||
oArgs.Add(Patterns.Modules.User.USER_VALUE_LANGUAGE, pUser.Language)
|
|
||||||
oArgs.Add(Patterns.Modules.User.USER_VALUE_PRENAME, pUser.GivenName)
|
|
||||||
oArgs.Add(Patterns.Modules.User.USER_VALUE_SHORTNAME, pUser.ShortName)
|
|
||||||
oArgs.Add(Patterns.Modules.User.USER_VALUE_SURNAME, pUser.Surname)
|
|
||||||
oArgs.Add(Patterns.Modules.User.USER_VALUE_USER_ID, pUser.UserId)
|
|
||||||
oArgs.Add(Patterns.Modules.User.USER_VALUE_USER_NAME, pUser.UserName)
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
End Try
|
|
||||||
|
|
||||||
ElseIf TypeOf pModule Is Modules.Controls Then
|
|
||||||
Logger.Debug("Adding Arguments for Controls Module")
|
|
||||||
Try
|
|
||||||
oArgs.Add(Patterns.Modules.Controls.CTRL_VALUE_PANEL, pPanel)
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
End Try
|
|
||||||
|
|
||||||
ElseIf TypeOf pModule Is Modules.Windream Then
|
|
||||||
Logger.Debug("Adding Arguments for Windream Module")
|
|
||||||
Try
|
|
||||||
oArgs.Add(Patterns.Modules.Windream.WM_VALUE_DOCUMENT, pWMObject)
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
End Try
|
|
||||||
|
|
||||||
ElseIf TypeOf pModule Is Modules.Globix Then
|
|
||||||
Logger.Debug("Adding Arguments for Globix Module")
|
|
||||||
Try
|
|
||||||
oArgs.Add(Patterns.Modules.Globix.GBX_VALUE_INDICIES, pGlobixIndexes)
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
End Try
|
|
||||||
End If
|
|
||||||
|
|
||||||
Return oArgs
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
#Region "Helper Functions"
|
#Region "Helper Functions"
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ Public Class BaseClass
|
|||||||
Friend Logger As Logger
|
Friend Logger As Logger
|
||||||
|
|
||||||
Public Sub New(pLogConfig As LogConfig)
|
Public Sub New(pLogConfig As LogConfig)
|
||||||
|
Dim oClassName = [GetType]().Name
|
||||||
LogConfig = pLogConfig
|
LogConfig = pLogConfig
|
||||||
Logger = pLogConfig.GetLogger()
|
Logger = pLogConfig.GetLogger(oClassName)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub LogAndThrow(pMessage As String)
|
Public Sub LogAndThrow(pMessage As String)
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ Public Class GlobalState
|
|||||||
.DataSource = oConnection.Server,
|
.DataSource = oConnection.Server,
|
||||||
.InitialCatalog = oConnection.Database,
|
.InitialCatalog = oConnection.Database,
|
||||||
.UserID = oConnection.Username,
|
.UserID = oConnection.Username,
|
||||||
.Password = MSSQLServer.DecryptConnectionString(oConnection.Password)
|
.Password = oConnection.Password
|
||||||
}
|
}
|
||||||
|
|
||||||
Return oBuilder.ToString
|
Return MSSQLServer.DecryptConnectionString(oBuilder.ToString)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ Namespace Methods.GlobalIndexer.ImportFile
|
|||||||
|
|
||||||
Private ReadOnly Patterns As Patterns2
|
Private ReadOnly Patterns As Patterns2
|
||||||
Private ReadOnly GetDatatable As GetDatatableFromCacheMethod
|
Private ReadOnly GetDatatable As GetDatatableFromCacheMethod
|
||||||
|
Private ReadOnly Connection As SqlClient.SqlConnection
|
||||||
|
Private ReadOnly Transaction As SqlClient.SqlTransaction
|
||||||
Private Profile As DataRow
|
Private Profile As DataRow
|
||||||
|
|
||||||
Private Const VIEW_PROFILE = "VWGI_DOCTYPE_IDB"
|
Private Const VIEW_PROFILE = "VWGI_DOCTYPE_IDB"
|
||||||
@@ -23,6 +24,8 @@ Namespace Methods.GlobalIndexer.ImportFile
|
|||||||
|
|
||||||
Patterns = New Patterns2(pLogConfig)
|
Patterns = New Patterns2(pLogConfig)
|
||||||
GetDatatable = New GetDatatableFromCacheMethod(LogConfig, Database, GlobalState)
|
GetDatatable = New GetDatatableFromCacheMethod(LogConfig, Database, GlobalState)
|
||||||
|
Connection = Database.GetConnection()
|
||||||
|
Transaction = Connection.BeginTransaction()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
@@ -67,12 +70,52 @@ Namespace Methods.GlobalIndexer.ImportFile
|
|||||||
|
|
||||||
If oResponse.OK Then
|
If oResponse.OK Then
|
||||||
Logger.Info("Import of file [{0}] under ObjectId [{1}] successful!", pData.File.FileName, oResponse.ObjectId)
|
Logger.Info("Import of file [{0}] under ObjectId [{1}] successful!", pData.File.FileName, oResponse.ObjectId)
|
||||||
Return New ImportFileResponse(oResponse.ObjectId)
|
|
||||||
Else
|
Else
|
||||||
Throw New ApplicationException(oResponse.ErrorMessage)
|
Throw New ApplicationException(oResponse.ErrorMessage)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Logger.Info("Writing Attributes for ObjectId [{0}]", oResponse.ObjectId)
|
||||||
|
|
||||||
|
Dim oAttributes As New Dictionary(Of String, Object)
|
||||||
|
For Each oFinalAttribute In oFinalAttributes
|
||||||
|
If oFinalAttribute.AttributeValues Is Nothing OrElse oFinalAttribute.AttributeValues.Count = 0 Then
|
||||||
|
Logger.Warn("Values for Attribute [{0}] are empty. Skipping.", oFinalAttribute.AttributeName)
|
||||||
|
Continue For
|
||||||
|
End If
|
||||||
|
|
||||||
|
oAttributes.Add(oFinalAttribute.AttributeName, oFinalAttribute.AttributeValues.First)
|
||||||
|
Next
|
||||||
|
|
||||||
|
For Each oAttribute As KeyValuePair(Of String, Object) In oAttributes
|
||||||
|
Try
|
||||||
|
' Dont write empty attributes
|
||||||
|
If oAttribute.Value Is Nothing Then
|
||||||
|
Continue For
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim oSuccess = Helpers.SetAttributeValue(Connection, Transaction, oResponse.ObjectId, oAttribute.Key, oAttribute.Value, pData.User.Language, pData.User.UserName)
|
||||||
|
If oSuccess Then
|
||||||
|
Logger.Info("Attribute [{0}] written with value [{1}]", oAttribute.Key, oAttribute.Value)
|
||||||
|
Else
|
||||||
|
Logger.Warn("Attribute value could not be written")
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
LogAndThrow(ex, $"Attribute [{oAttribute.Key}] could not be written!")
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
|
||||||
|
' Finally, commit the transaction
|
||||||
|
Transaction?.Commit()
|
||||||
|
|
||||||
|
Return New ImportFileResponse(oResponse.ObjectId)
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
Logger.Warn("Error occurred while importing file!")
|
||||||
|
Logger.Error(ex)
|
||||||
|
|
||||||
|
Logger.Info("Rolling back transaction.")
|
||||||
|
Transaction?.Rollback()
|
||||||
|
|
||||||
Return New ImportFileResponse(ex)
|
Return New ImportFileResponse(ex)
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
@@ -142,7 +185,7 @@ Namespace Methods.GlobalIndexer.ImportFile
|
|||||||
oIndexes.Add(oAutomaticIndex)
|
oIndexes.Add(oAutomaticIndex)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Logger.Info("[{0}] automatic indexes loaded.", oIndexes)
|
Logger.Info("Automatic indexes loaded: [{0}]", oIndexes.Count)
|
||||||
|
|
||||||
Return oIndexes
|
Return oIndexes
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -186,6 +229,8 @@ Namespace Methods.GlobalIndexer.ImportFile
|
|||||||
oIndexes.Add(oManualIndex)
|
oIndexes.Add(oManualIndex)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
Logger.Info("Manual indexes loaded: [{0}]", oIndexes.Count)
|
||||||
|
|
||||||
Return oIndexes
|
Return oIndexes
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
|||||||
@@ -33,24 +33,29 @@ Namespace Methods.GlobalIndexer.ImportFile.Steps
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Logger.Info("Processing [{0}] automatic indexes", AutomaticIndexes.Count)
|
Logger.Info("Processing [{0}] automatic indexes", AutomaticIndexes.Count)
|
||||||
Dim oAttributes As List(Of UserAttributeValue) = pUserAttributes
|
Dim oUserAttributes As List(Of UserAttributeValue) = pUserAttributes
|
||||||
|
Dim oAutoAttributes As New List(Of UserAttributeValue)
|
||||||
|
|
||||||
For Each oAutomaticIndex In AutomaticIndexes
|
For Each oAutomaticIndex In AutomaticIndexes
|
||||||
' We add oAttributes from the previous run into the current run so it is in theory possible to reference
|
' We add oAttributes from the previous run into the current run so it is in theory possible to reference
|
||||||
' automatic attributes which have been set just before.
|
' automatic attributes which have been set just before.
|
||||||
Dim oAttribute = ApplyAutomaticIndex(oAutomaticIndex, pFileInfo, pUserState, oAttributes)
|
Dim oAttribute = ApplyAutomaticIndex(oAutomaticIndex, pFileInfo, pUserState, oUserAttributes, oAutoAttributes)
|
||||||
|
|
||||||
If oAttribute IsNot Nothing Then
|
If oAttribute IsNot Nothing Then
|
||||||
Logger.Info("Adding Attribute [{0}]", oAttribute)
|
Logger.Debug("Adding Attribute [{0}]", oAttribute)
|
||||||
oAttributes.Add(oAttribute)
|
oAutoAttributes.Add(oAttribute)
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Return oAttributes
|
oUserAttributes.AddRange(oAutoAttributes)
|
||||||
|
Return oUserAttributes
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function ApplyAutomaticIndex(pAutomaticIndex As AutomaticIndex,
|
||||||
Private Function ApplyAutomaticIndex(pAutomaticIndex As AutomaticIndex, pFileInfo As FileInfo, pUserState As UserState, pAttributes As List(Of UserAttributeValue)) As UserAttributeValue
|
pFileInfo As FileInfo,
|
||||||
|
pUserState As UserState,
|
||||||
|
pAttributes As List(Of UserAttributeValue),
|
||||||
|
pAutoAttributes As List(Of UserAttributeValue)) As UserAttributeValue
|
||||||
Try
|
Try
|
||||||
Dim oAttributeDict = pAttributes.ToDictionary(
|
Dim oAttributeDict = pAttributes.ToDictionary(
|
||||||
Function(attr) attr.AttributeName,
|
Function(attr) attr.AttributeName,
|
||||||
@@ -77,6 +82,8 @@ Namespace Methods.GlobalIndexer.ImportFile.Steps
|
|||||||
Dim oConnectionString As String = GlobalState.GetConnectionString(pAutomaticIndex.SQLConnectionId)
|
Dim oConnectionString As String = GlobalState.GetConnectionString(pAutomaticIndex.SQLConnectionId)
|
||||||
Dim oFinalSQLCommand = pAutomaticIndex.SQLCommand
|
Dim oFinalSQLCommand = pAutomaticIndex.SQLCommand
|
||||||
|
|
||||||
|
' TODO: Dont show the unmasked conn string
|
||||||
|
Logger.Debug("SQL Connection String is: [{0}]", oConnectionString)
|
||||||
Logger.Debug("SQL Command is: [{0}]", oFinalSQLCommand)
|
Logger.Debug("SQL Command is: [{0}]", oFinalSQLCommand)
|
||||||
|
|
||||||
oFinalSQLCommand = GetPlaceholderValue(oFinalSQLCommand, pFileInfo, pUserState, oAttributeDict)
|
oFinalSQLCommand = GetPlaceholderValue(oFinalSQLCommand, pFileInfo, pUserState, oAttributeDict)
|
||||||
@@ -109,11 +116,12 @@ Namespace Methods.GlobalIndexer.ImportFile.Steps
|
|||||||
Private Function GetPlaceholderValue(pValue As String, pFileInfo As FileInfo, pUserState As UserState, pAttributes As Dictionary(Of String, List(Of String))) As String
|
Private Function GetPlaceholderValue(pValue As String, pFileInfo As FileInfo, pUserState As UserState, pAttributes As Dictionary(Of String, List(Of String))) As String
|
||||||
Dim oResult As String = pValue
|
Dim oResult As String = pValue
|
||||||
|
|
||||||
|
|
||||||
oResult = Patterns.ReplaceInternalValues(oResult)
|
oResult = Patterns.ReplaceInternalValues(oResult)
|
||||||
oResult = Patterns.ReplaceFileValues(oResult, pFileInfo)
|
oResult = Patterns.ReplaceFileValues(oResult, pFileInfo)
|
||||||
oResult = Patterns.ReplaceUserValues(oResult, pUserState)
|
oResult = Patterns.ReplaceUserValues(oResult, pUserState)
|
||||||
oResult = Patterns.ReplaceGlobixValues(oResult, pAttributes)
|
|
||||||
|
' TODO: Get the automatic indexes in here too
|
||||||
|
oResult = Patterns.ReplaceGlobixValues(oResult, New Dictionary(Of String, List(Of String)), pAttributes)
|
||||||
|
|
||||||
Return oResult
|
Return oResult
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -127,13 +127,13 @@ Public Class NewFileMethod
|
|||||||
|
|
||||||
'TODO: File dates in try catch
|
'TODO: File dates in try catch
|
||||||
|
|
||||||
Dim oDefaultAttributes As New Dictionary(Of String, Object) From {
|
Dim oSystemAttributes As New Dictionary(Of String, Object) From {
|
||||||
{"OriginFileName", pData.File.FileName},
|
{"OriginFileName", pData.File.FileName},
|
||||||
{"OriginCreationDatetime", pData.File.FileCreatedAt},
|
{"OriginCreationDatetime", pData.File.FileCreatedAt},
|
||||||
{"OriginChangedDatetime", pData.File.FileChangedAt}
|
{"OriginChangedDatetime", pData.File.FileChangedAt}
|
||||||
}
|
}
|
||||||
|
|
||||||
For Each oAttribute As KeyValuePair(Of String, Object) In oDefaultAttributes
|
For Each oAttribute As KeyValuePair(Of String, Object) In oSystemAttributes
|
||||||
Try
|
Try
|
||||||
' Dont write empty attributes
|
' Dont write empty attributes
|
||||||
If oAttribute.Value Is Nothing Then
|
If oAttribute.Value Is Nothing Then
|
||||||
@@ -142,9 +142,9 @@ Public Class NewFileMethod
|
|||||||
|
|
||||||
Dim oSuccess = Helpers.SetAttributeValue(Connection, Transaction, oObjectId, oAttribute.Key, oAttribute.Value, pData.User.Language, pData.User.UserName)
|
Dim oSuccess = Helpers.SetAttributeValue(Connection, Transaction, oObjectId, oAttribute.Key, oAttribute.Value, pData.User.Language, pData.User.UserName)
|
||||||
If oSuccess Then
|
If oSuccess Then
|
||||||
Logger.Debug("Default Attribute [{0}] written with value [{1}]", oAttribute.Key, oAttribute.Value)
|
Logger.Debug("System Attribute [{0}] written with value [{1}]", oAttribute.Key, oAttribute.Value)
|
||||||
Else
|
Else
|
||||||
Logger.Warn("Default attribute value could not be written")
|
Logger.Warn("System attribute value could not be written")
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
LogAndThrow(ex, $"System attribute [{oAttribute.Key}] could not be written!")
|
LogAndThrow(ex, $"System attribute [{oAttribute.Key}] could not be written!")
|
||||||
@@ -158,7 +158,7 @@ Public Class NewFileMethod
|
|||||||
|
|
||||||
Return New NewFile.NewFileResponse(oObjectId)
|
Return New NewFile.NewFileResponse(oObjectId)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Logger.Warn("Error occurred while importing file!")
|
Logger.Warn("Error occurred while creating file!")
|
||||||
Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
|
|
||||||
Logger.Info("Cleaning up files.")
|
Logger.Info("Cleaning up files.")
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ Public Class DatatableJob
|
|||||||
Dim oLogConfig As LogConfig = oJobData.Item("LogConfig")
|
Dim oLogConfig As LogConfig = oJobData.Item("LogConfig")
|
||||||
Dim oCronJobId As Integer = oJobData.Item("CronJobId")
|
Dim oCronJobId As Integer = oJobData.Item("CronJobId")
|
||||||
Dim oCronJobTitle As String = oJobData.Item("CronJobTitle")
|
Dim oCronJobTitle As String = oJobData.Item("CronJobTitle")
|
||||||
Dim oLogger As Logger = oLogConfig.GetLoggerFor("Scheduler")
|
Dim oLogger As Logger = oLogConfig.GetLogger()
|
||||||
|
|
||||||
Dim oResult As New JobResult()
|
Dim oResult As New JobResult()
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Public Class JobListener
|
|||||||
MyBase.New()
|
MyBase.New()
|
||||||
|
|
||||||
_LogConfig = LogConfig
|
_LogConfig = LogConfig
|
||||||
_Logger = LogConfig.GetLoggerFor("Scheduler")
|
_Logger = LogConfig.GetLogger()
|
||||||
_MSSQL = MSSQL
|
_MSSQL = MSSQL
|
||||||
Dataset = ResultDataSet
|
Dataset = ResultDataSet
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -10,22 +10,21 @@ Imports System.ServiceModel.Channels
|
|||||||
Public Class WindowsService
|
Public Class WindowsService
|
||||||
Inherits ServiceBase
|
Inherits ServiceBase
|
||||||
|
|
||||||
Private _ServiceHost As ServiceHost(Of EDMIService)
|
Private ServiceHost As ServiceHost(Of EDMIService)
|
||||||
Private _LogConfig As LogConfig
|
Private LogConfig As LogConfig
|
||||||
Private _LogConfigScheduler As LogConfig
|
Private LogConfigScheduler As LogConfig
|
||||||
Private _Logger As Logger
|
Private Logger As Logger
|
||||||
|
|
||||||
Private _Firebird As Firebird
|
Private Firebird As Firebird
|
||||||
Private _MSSQL_ECM As MSSQLServer
|
Private MSSQL_ECM As MSSQLServer
|
||||||
Private _MSSQL_IDB As MSSQLServer
|
Private MSSQL_IDB As MSSQLServer
|
||||||
|
|
||||||
Private _ConfigManager As ConfigManager(Of Config)
|
Private ConfigManager As ConfigManager(Of Config)
|
||||||
Private _Config As Config
|
Private Config As Config
|
||||||
Private _Path As EDMI.File.Path
|
Private Archive As EDMI.File.Archive
|
||||||
Private _Archive As EDMI.File.Archive
|
Private Filesystem As Filesystem.File
|
||||||
Private _Filesystem As Filesystem.File
|
Private GlobalState As GlobalState
|
||||||
Private _Global As GlobalState
|
Private Scheduler As Scheduler
|
||||||
Private _Scheduler As Scheduler
|
|
||||||
|
|
||||||
Public Sub New()
|
Public Sub New()
|
||||||
ServiceName = SERVICE_NAME
|
ServiceName = SERVICE_NAME
|
||||||
@@ -39,123 +38,127 @@ Public Class WindowsService
|
|||||||
Try
|
Try
|
||||||
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"), FileKeepRangeInDays:=3)
|
LogConfig = New LogConfig(LogConfig.PathType.CustomPath, IO.Path.Combine(oServicePath, "Log"), FileKeepRangeInDays:=3)
|
||||||
_LogConfigScheduler = New LogConfig(LogConfig.PathType.CustomPath, IO.Path.Combine(oServicePath, "Log"), Suffix:="Scheduler", FileKeepRangeInDays:=3)
|
LogConfigScheduler = New LogConfig(LogConfig.PathType.CustomPath, IO.Path.Combine(oServicePath, "Log"), Suffix:="Scheduler", FileKeepRangeInDays:=3)
|
||||||
_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)
|
||||||
|
|
||||||
_Logger.Info("Loading Config")
|
Logger.Info("Loading Config")
|
||||||
_ConfigManager = New ConfigManager(Of Config)(_LogConfig, oServicePath)
|
ConfigManager = New ConfigManager(Of Config)(LogConfig, oServicePath)
|
||||||
_Config = _ConfigManager.Config
|
Config = ConfigManager.Config
|
||||||
_LogConfig.Debug = _ConfigManager.Config.Debug
|
LogConfig.Debug = ConfigManager.Config.Debug
|
||||||
|
|
||||||
Dim oTimer As New Timers.Timer(60000)
|
Dim oTimer As New Timers.Timer(60000)
|
||||||
AddHandler oTimer.Elapsed, Sub()
|
AddHandler oTimer.Elapsed, AddressOf ReloadTimer_Tick
|
||||||
_Logger.Debug("Reloading config..")
|
|
||||||
_ConfigManager.Reload()
|
|
||||||
_Config = _ConfigManager.Config
|
|
||||||
_LogConfig.Debug = _ConfigManager.Config.Debug
|
|
||||||
|
|
||||||
'UpdateTraceLogging()
|
|
||||||
End Sub
|
|
||||||
oTimer.Start()
|
oTimer.Start()
|
||||||
|
|
||||||
_Logger.Debug("Connecting to Databases")
|
Logger.Debug("Connecting to Databases")
|
||||||
|
|
||||||
_Firebird = StartFirebird()
|
Firebird = StartFirebird()
|
||||||
_MSSQL_ECM = StartMSSQL_ECM()
|
MSSQL_ECM = GetMSSQL_ECM(LogConfig)
|
||||||
_MSSQL_IDB = StartMSSQL_IDB()
|
MSSQL_IDB = GetMSSQL_IDB(LogConfig)
|
||||||
|
|
||||||
_Logger.Debug("Initializing EDMI Functions")
|
Logger.Debug("Initializing EDMI Functions")
|
||||||
|
|
||||||
_Archive = New EDMI.File.Archive(_LogConfig)
|
Archive = New EDMI.File.Archive(LogConfig)
|
||||||
_Filesystem = New Filesystem.File(_LogConfig)
|
Filesystem = New Filesystem.File(LogConfig)
|
||||||
_Global = New GlobalState(_LogConfig, _MSSQL_IDB, _MSSQL_ECM)
|
GlobalState = New GlobalState(LogConfig, MSSQL_IDB, MSSQL_ECM)
|
||||||
_Scheduler = New Scheduler(_LogConfigScheduler, _MSSQL_ECM, _Global.TableStore)
|
|
||||||
|
|
||||||
_Logger.Debug("Loading Global Data")
|
Dim oMSSQLServer = GetMSSQL_ECM(LogConfigScheduler)
|
||||||
_Global.LoadObjectStores()
|
Scheduler = New Scheduler(LogConfigScheduler, oMSSQLServer, GlobalState.TableStore)
|
||||||
_Global.LoadConnections()
|
|
||||||
|
|
||||||
_Logger.Debug("Starting Scheduler")
|
Logger.Debug("Loading Global Data")
|
||||||
_Scheduler.Start()
|
GlobalState.LoadObjectStores()
|
||||||
|
GlobalState.LoadConnections()
|
||||||
|
|
||||||
_Logger.Debug("Preparing WCF ServiceHost")
|
Logger.Debug("Starting Scheduler")
|
||||||
EDMIService.MSSQL_ECM = _MSSQL_ECM
|
Scheduler.Start()
|
||||||
EDMIService.MSSQL_IDB = _MSSQL_IDB
|
|
||||||
EDMIService.Firebird = _Firebird
|
|
||||||
EDMIService.LogConfig = _LogConfig
|
|
||||||
EDMIService.AppConfig = _Config
|
|
||||||
EDMIService.EDMIArchive = _Archive
|
|
||||||
EDMIService.Filesystem = _Filesystem
|
|
||||||
EDMIService.GlobalState = _Global
|
|
||||||
EDMIService.Scheduler = _Scheduler
|
|
||||||
|
|
||||||
_Logger.Debug("Starting WCF ServiceHost")
|
Logger.Debug("Preparing WCF ServiceHost")
|
||||||
|
EDMIService.MSSQL_ECM = MSSQL_ECM
|
||||||
|
EDMIService.MSSQL_IDB = MSSQL_IDB
|
||||||
|
EDMIService.Firebird = Firebird
|
||||||
|
EDMIService.LogConfig = LogConfig
|
||||||
|
EDMIService.AppConfig = Config
|
||||||
|
EDMIService.EDMIArchive = Archive
|
||||||
|
EDMIService.Filesystem = Filesystem
|
||||||
|
EDMIService.GlobalState = GlobalState
|
||||||
|
EDMIService.Scheduler = Scheduler
|
||||||
|
|
||||||
|
Logger.Debug("Starting WCF ServiceHost")
|
||||||
|
|
||||||
Dim oBaseAddresses() As Uri = {New Uri(SERVICE_BASE_ADDRESS)}
|
Dim oBaseAddresses() As Uri = {New Uri(SERVICE_BASE_ADDRESS)}
|
||||||
_ServiceHost = New ServiceHost(Of EDMIService)(oBaseAddresses)
|
ServiceHost = New ServiceHost(Of EDMIService)(oBaseAddresses)
|
||||||
_ServiceHost.EnableMetadataExchange(False)
|
ServiceHost.EnableMetadataExchange(False)
|
||||||
|
|
||||||
_Logger.Debug("Listing Endpoints:")
|
Logger.Debug("Listing Endpoints:")
|
||||||
For Each oEndpoint In _ServiceHost.Description.Endpoints
|
For Each oEndpoint In ServiceHost.Description.Endpoints
|
||||||
_Logger.Debug("Name: {0}", oEndpoint.Name)
|
Logger.Debug("Name: {0}", oEndpoint.Name)
|
||||||
_Logger.Debug("Address: {0}", oEndpoint.Address.ToString)
|
Logger.Debug("Address: {0}", oEndpoint.Address.ToString)
|
||||||
_Logger.Debug("Listen Uri: {0}", oEndpoint.ListenUri.AbsoluteUri)
|
Logger.Debug("Listen Uri: {0}", oEndpoint.ListenUri.AbsoluteUri)
|
||||||
_Logger.Debug("Binding: {0}", oEndpoint.Binding.Name)
|
Logger.Debug("Binding: {0}", oEndpoint.Binding.Name)
|
||||||
_Logger.Debug("Contract: {0}", oEndpoint.Contract.Name)
|
Logger.Debug("Contract: {0}", oEndpoint.Contract.Name)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
_ServiceHost.Open()
|
ServiceHost.Open()
|
||||||
|
|
||||||
_Logger.Info("WCF ServiceHost started")
|
Logger.Info("WCF ServiceHost started")
|
||||||
_Logger.Info("Service {0} successfully started", SERVICE_DISPLAY_NAME)
|
Logger.Info("Service {0} successfully started", SERVICE_DISPLAY_NAME)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Warn("Unexpected Error while starting the service: {0}", ex.Message)
|
Logger.Warn("Unexpected Error while starting the service: {0}", ex.Message)
|
||||||
_Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
GracefullyStop()
|
GracefullyStop()
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function StartFirebird() As Firebird
|
Private Sub ReloadTimer_Tick()
|
||||||
_Logger.Debug("Connecting to Firebird")
|
If ConfigManager.Reload() = False Then
|
||||||
|
Logger.Warn("Could not reload config, check the service and config file.")
|
||||||
|
End If
|
||||||
|
|
||||||
If _Config.Firebird_Datasource = String.Empty Then
|
Config = ConfigManager.Config
|
||||||
_Logger.Info("Firebird database not configured. Skipping.")
|
LogConfig.Debug = ConfigManager.Config.Debug
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function StartFirebird() As Firebird
|
||||||
|
Logger.Debug("Connecting to Firebird")
|
||||||
|
|
||||||
|
If Config.Firebird_Datasource = String.Empty Then
|
||||||
|
Logger.Info("Firebird database not configured. Skipping.")
|
||||||
Return Nothing
|
Return Nothing
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Dim oFirebird = New Firebird(
|
Dim oFirebird = New Firebird(
|
||||||
_LogConfig,
|
LogConfig,
|
||||||
_Config.Firebird_Datasource,
|
Config.Firebird_Datasource,
|
||||||
_Config.Firebird_DatabaseName,
|
Config.Firebird_DatabaseName,
|
||||||
_Config.Firebird_DatabaseUser,
|
Config.Firebird_DatabaseUser,
|
||||||
_Config.Firebird_DatabasePassword
|
Config.Firebird_DatabasePassword
|
||||||
)
|
)
|
||||||
|
|
||||||
_Logger.Info("Database connection established.")
|
Logger.Info("Database connection established.")
|
||||||
Return oFirebird
|
Return oFirebird
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Warn("StartFirebird: Could not connect to firebird database.")
|
Logger.Warn("StartFirebird: Could not connect to firebird database.")
|
||||||
_Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
Return Nothing
|
Return Nothing
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function StartMSSQL_ECM() As MSSQLServer
|
Private Function GetMSSQL_ECM(pLogConfig As LogConfig) As MSSQLServer
|
||||||
_Logger.Debug("Connecting to ECM MSSQL")
|
Logger.Debug("Connecting to ECM MSSQL")
|
||||||
Dim oMSSQL = New MSSQLServer(_LogConfig, _Config.ConnectionString_ECM)
|
Dim oMSSQL = New MSSQLServer(pLogConfig, Config.ConnectionString_ECM)
|
||||||
_Logger.Info("Database connection to ECM Database established.")
|
Logger.Info("Database connection to ECM Database established.")
|
||||||
Return oMSSQL
|
Return oMSSQL
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function StartMSSQL_IDB() As MSSQLServer
|
Private Function GetMSSQL_IDB(pLogConfig As LogConfig) As MSSQLServer
|
||||||
_Logger.Debug("Connecting to IDB MSSQL")
|
Logger.Debug("Connecting to IDB MSSQL")
|
||||||
Dim oMSSQL = New MSSQLServer(_LogConfig, _Config.ConnectionString_IDB)
|
Dim oMSSQL = New MSSQLServer(pLogConfig, Config.ConnectionString_IDB)
|
||||||
_Logger.Info("Database connection to IDB Database established.")
|
Logger.Info("Database connection to IDB Database established.")
|
||||||
Return oMSSQL
|
Return oMSSQL
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -164,13 +167,13 @@ Public Class WindowsService
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub GracefullyStop()
|
Private Sub GracefullyStop()
|
||||||
_Logger.Info("Service {0} is stopping!", SERVICE_DISPLAY_NAME)
|
Logger.Info("Service {0} is stopping!", SERVICE_DISPLAY_NAME)
|
||||||
If _ServiceHost IsNot Nothing Then
|
If ServiceHost IsNot Nothing Then
|
||||||
_ServiceHost.Close()
|
ServiceHost.Close()
|
||||||
_ServiceHost = Nothing
|
ServiceHost = Nothing
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Scheduler.Stop()
|
Scheduler.Stop()
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user