V 2.7.4.3 Dateinamen in SQL Editor
This commit is contained in:
parent
cf19eb5402
commit
c6d49b988b
@ -4,6 +4,7 @@ Imports DigitalData.Controls.LookupGrid
|
|||||||
Imports DigitalData.Modules.Base
|
Imports DigitalData.Modules.Base
|
||||||
Imports DigitalData.GUIs.GlobalIndexer
|
Imports DigitalData.GUIs.GlobalIndexer
|
||||||
Imports WINDREAMLib
|
Imports WINDREAMLib
|
||||||
|
Imports System.IO
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Defines common Functions for Checking for and replacing placeholders.
|
''' Defines common Functions for Checking for and replacing placeholders.
|
||||||
@ -42,6 +43,11 @@ Public Class ClassPatterns
|
|||||||
Public Const INT_VALUE_WMDocID = "WMDocID"
|
Public Const INT_VALUE_WMDocID = "WMDocID"
|
||||||
Public Const INT_VALUE_IDBID = "IDBObjID"
|
Public Const INT_VALUE_IDBID = "IDBObjID"
|
||||||
|
|
||||||
|
Public Const INT_VALUE_FILENAME_EXT = "FILENAME_EXT"
|
||||||
|
Public Const INT_VALUE_FILENAME = "FILENAME_ONLY"
|
||||||
|
Public Const INT_VALUE_FILEEXT = "FILE_EXT"
|
||||||
|
Public Const INT_VALUE_FILE_DATE = "FILE_DATE"
|
||||||
|
|
||||||
Public Const MAX_TRY_COUNT = 20
|
Public Const MAX_TRY_COUNT = 20
|
||||||
|
|
||||||
Private Shared ReadOnly regex As Regex = New Regex("{#(\w+)#([\.\w\d\s_-]+)}+")
|
Private Shared ReadOnly regex As Regex = New Regex("{#(\w+)#([\.\w\d\s_-]+)}+")
|
||||||
@ -103,6 +109,46 @@ Public Class ClassPatterns
|
|||||||
While ContainsPatternAndValue(oResult, PATTERN_INT, INT_VALUE_IDBID)
|
While ContainsPatternAndValue(oResult, PATTERN_INT, INT_VALUE_IDBID)
|
||||||
oResult = ReplacePattern(oResult, PATTERN_INT, CURRENT_DOC_ID)
|
oResult = ReplacePattern(oResult, PATTERN_INT, CURRENT_DOC_ID)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
|
While ContainsPatternAndValue(oResult, PATTERN_INT, INT_VALUE_FILENAME_EXT)
|
||||||
|
If Not IsNothing(CURRENT_WORKFILE) Then
|
||||||
|
If File.Exists(CURRENT_WORKFILE) Then
|
||||||
|
Dim oFileName As String = Path.GetFileName(CURRENT_WORKFILE)
|
||||||
|
oResult = ReplacePlaceholder(PATTERN_INT, oResult, INT_VALUE_FILENAME_EXT, oFileName)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End While
|
||||||
|
|
||||||
|
While ContainsPatternAndValue(oResult, PATTERN_INT, INT_VALUE_FILENAME)
|
||||||
|
If Not IsNothing(CURRENT_WORKFILE) Then
|
||||||
|
If File.Exists(CURRENT_WORKFILE) Then
|
||||||
|
Dim oFileNameOnly As String = Path.GetFileNameWithoutExtension(CURRENT_WORKFILE)
|
||||||
|
oResult = ReplacePlaceholder(PATTERN_INT, oResult, INT_VALUE_FILENAME, oFileNameOnly)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End While
|
||||||
|
|
||||||
|
While ContainsPatternAndValue(oResult, PATTERN_INT, INT_VALUE_FILEEXT)
|
||||||
|
If Not IsNothing(CURRENT_WORKFILE) Then
|
||||||
|
If File.Exists(CURRENT_WORKFILE) Then
|
||||||
|
Dim oFileExt As String = Path.GetExtension(CURRENT_WORKFILE).Substring(1)
|
||||||
|
oResult = ReplacePlaceholder(PATTERN_INT, oResult, INT_VALUE_FILEEXT, oFileExt)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End While
|
||||||
|
|
||||||
|
While ContainsPatternAndValue(oResult, PATTERN_INT, INT_VALUE_FILE_DATE)
|
||||||
|
If Not IsNothing(CURRENT_WORKFILE) Then
|
||||||
|
If File.Exists(CURRENT_WORKFILE) Then
|
||||||
|
Dim oCreationDate As DateTime = File.GetCreationTime(CURRENT_WORKFILE)
|
||||||
|
Dim oDateOnlyString As String = oCreationDate.ToString("yyyy-MM-dd")
|
||||||
|
oResult = ReplacePlaceholder(PATTERN_INT, oResult, INT_VALUE_FILE_DATE, oDateOnlyString)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End While
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LOGGER.Debug("sql after ReplaceInternalValues: " & input)
|
LOGGER.Debug("sql after ReplaceInternalValues: " & input)
|
||||||
Return oResult
|
Return oResult
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@ -220,7 +266,7 @@ Public Class ClassPatterns
|
|||||||
LOGGER.Debug("Found Control [{0}], continuing with setting value..", oFoundControl.Name)
|
LOGGER.Debug("Found Control [{0}], continuing with setting value..", oFoundControl.Name)
|
||||||
If TypeOf (oFoundControl) Is LookupControl3 Then
|
If TypeOf (oFoundControl) Is LookupControl3 Then
|
||||||
LOGGER.Debug("oTypeString LookupControl3")
|
LOGGER.Debug("oTypeString LookupControl3")
|
||||||
ElseIf TypeOf (oFoundControl) Is Checkbox Then
|
ElseIf TypeOf (oFoundControl) Is CheckBox Then
|
||||||
LOGGER.Debug("oTypeString CheckBox")
|
LOGGER.Debug("oTypeString CheckBox")
|
||||||
ElseIf TypeOf (oFoundControl) Is TextEdit Then
|
ElseIf TypeOf (oFoundControl) Is TextEdit Then
|
||||||
LOGGER.Debug("oTypeString TextEdit")
|
LOGGER.Debug("oTypeString TextEdit")
|
||||||
@ -402,7 +448,22 @@ Public Class ClassPatterns
|
|||||||
|
|
||||||
Return results
|
Return results
|
||||||
End Function
|
End Function
|
||||||
|
''' <summary>
|
||||||
|
''' Ersetzt alle Vorkommen eines Platzhalters im Texttemplate.
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="pInput">Der ursprüngliche Text mit Platzhaltern.</param>
|
||||||
|
''' <param name="pPlaceholder">Der Platzhalter, z. B. "FILENAME_EXT".</param>
|
||||||
|
''' <param name="pReplacement">Der zu ersetzende Wert.</param>
|
||||||
|
''' <returns>Der aktualisierte Text.</returns>
|
||||||
|
Public Shared Function ReplacePlaceholder(pPattern As String, pInput As String, pPlaceholder As String, pReplacement As String) As String
|
||||||
|
' Erzeuge das Regex-Muster für den Platzhalter (z. B. {#INT#FILENAME_EXT})
|
||||||
|
Dim pattern As String = "\{#" & pPattern & "#" & Regex.Escape(pPlaceholder) & "\}"
|
||||||
|
|
||||||
|
' Ersetze alle Vorkommen mit dem angegebenen Wert
|
||||||
|
Dim result As String = Regex.Replace(pInput, pattern, pReplacement, RegexOptions.IgnoreCase)
|
||||||
|
|
||||||
|
Return result
|
||||||
|
End Function
|
||||||
Public Shared Function ReplacePattern(input As String, type As String, replacement As String) As String
|
Public Shared Function ReplacePattern(input As String, type As String, replacement As String) As String
|
||||||
Dim elements As MatchCollection = regex.Matches(input)
|
Dim elements As MatchCollection = regex.Matches(input)
|
||||||
|
|
||||||
|
|||||||
@ -168,8 +168,8 @@
|
|||||||
<Reference Include="DigitalData.Controls.LookupGrid">
|
<Reference Include="DigitalData.Controls.LookupGrid">
|
||||||
<HintPath>..\..\..\2_DLL Projekte\DDMonorepo\Controls.LookupGrid\bin\Debug\DigitalData.Controls.LookupGrid.dll</HintPath>
|
<HintPath>..\..\..\2_DLL Projekte\DDMonorepo\Controls.LookupGrid\bin\Debug\DigitalData.Controls.LookupGrid.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DigitalData.GUIs.Common, Version=2.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DigitalData.GUIs.Common">
|
||||||
<HintPath>..\packages\DigitalData.GUIs.Common.2.6.2\lib\net462\DigitalData.GUIs.Common.dll</HintPath>
|
<HintPath>..\..\..\2_DLL Projekte\DDMonorepo\GUIs.Common\bin\Debug\DigitalData.GUIs.Common.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DigitalData.GUIs.GlobalIndexer">
|
<Reference Include="DigitalData.GUIs.GlobalIndexer">
|
||||||
<HintPath>..\..\..\2_DLL Projekte\DDMonorepo\GUIs.GlobalIndexer\bin\Debug\DigitalData.GUIs.GlobalIndexer.dll</HintPath>
|
<HintPath>..\..\..\2_DLL Projekte\DDMonorepo\GUIs.GlobalIndexer\bin\Debug\DigitalData.GUIs.GlobalIndexer.dll</HintPath>
|
||||||
|
|||||||
@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.7.4.2")>
|
<Assembly: AssemblyVersion("2.7.4.3")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||||
|
|
||||||
<Assembly: NeutralResourcesLanguageAttribute("")>
|
<Assembly: NeutralResourcesLanguageAttribute("")>
|
||||||
File diff suppressed because it is too large
Load Diff
@ -624,8 +624,7 @@ Public Class frmAdministration
|
|||||||
.SQLConnection = oConnection,
|
.SQLConnection = oConnection,
|
||||||
.PlaceholdersManual = oPlaceholders,
|
.PlaceholdersManual = oPlaceholders,
|
||||||
.PlaceholdersManualTitle = "Manueller Index",
|
.PlaceholdersManualTitle = "Manueller Index",
|
||||||
.PlaceholdersManualPrefix = "CTRL",
|
.PlaceholdersManualPrefix = "CTRL"
|
||||||
.PlaceholdersWindream = SourceAttributes
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Dim oResult = oForm2.ShowDialog()
|
Dim oResult = oForm2.ShowDialog()
|
||||||
@ -661,8 +660,7 @@ Public Class frmAdministration
|
|||||||
.SQLCommand = oSQLCommand,
|
.SQLCommand = oSQLCommand,
|
||||||
.SQLConnection = oConnection,
|
.SQLConnection = oConnection,
|
||||||
.PlaceholdersManual = oPlaceholders,
|
.PlaceholdersManual = oPlaceholders,
|
||||||
.PlaceholdersManualPrefix = "CTRL",
|
.PlaceholdersManualPrefix = "CTRL"
|
||||||
.PlaceholdersWindream = SourceAttributes
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Dim oResult = oForm2.ShowDialog()
|
Dim oResult = oForm2.ShowDialog()
|
||||||
|
|||||||
@ -2326,6 +2326,7 @@ Public Class frmIndex
|
|||||||
oSqlResult = ClassPatterns.ReplaceInternalValues(oSqlResult)
|
oSqlResult = ClassPatterns.ReplaceInternalValues(oSqlResult)
|
||||||
oSqlResult = ClassPatterns.ReplaceUserValues(oSqlResult, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_DOKART_ID)
|
oSqlResult = ClassPatterns.ReplaceUserValues(oSqlResult, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_DOKART_ID)
|
||||||
|
|
||||||
|
|
||||||
If oSqlResult <> String.Empty Then
|
If oSqlResult <> String.Empty Then
|
||||||
_Logger.Debug("oSqlResult after Replace [" & oSqlResult & "]")
|
_Logger.Debug("oSqlResult after Replace [" & oSqlResult & "]")
|
||||||
End If
|
End If
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user