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.GUIs.GlobalIndexer
|
||||
Imports WINDREAMLib
|
||||
Imports System.IO
|
||||
|
||||
''' <summary>
|
||||
''' 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_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
|
||||
|
||||
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)
|
||||
oResult = ReplacePattern(oResult, PATTERN_INT, CURRENT_DOC_ID)
|
||||
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)
|
||||
Return oResult
|
||||
Catch ex As Exception
|
||||
@ -220,7 +266,7 @@ Public Class ClassPatterns
|
||||
LOGGER.Debug("Found Control [{0}], continuing with setting value..", oFoundControl.Name)
|
||||
If TypeOf (oFoundControl) Is LookupControl3 Then
|
||||
LOGGER.Debug("oTypeString LookupControl3")
|
||||
ElseIf TypeOf (oFoundControl) Is Checkbox Then
|
||||
ElseIf TypeOf (oFoundControl) Is CheckBox Then
|
||||
LOGGER.Debug("oTypeString CheckBox")
|
||||
ElseIf TypeOf (oFoundControl) Is TextEdit Then
|
||||
LOGGER.Debug("oTypeString TextEdit")
|
||||
@ -402,7 +448,22 @@ Public Class ClassPatterns
|
||||
|
||||
Return results
|
||||
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
|
||||
Dim elements As MatchCollection = regex.Matches(input)
|
||||
|
||||
|
||||
@ -168,8 +168,8 @@
|
||||
<Reference Include="DigitalData.Controls.LookupGrid">
|
||||
<HintPath>..\..\..\2_DLL Projekte\DDMonorepo\Controls.LookupGrid\bin\Debug\DigitalData.Controls.LookupGrid.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.GUIs.Common, Version=2.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DigitalData.GUIs.Common.2.6.2\lib\net462\DigitalData.GUIs.Common.dll</HintPath>
|
||||
<Reference Include="DigitalData.GUIs.Common">
|
||||
<HintPath>..\..\..\2_DLL Projekte\DDMonorepo\GUIs.Common\bin\Debug\DigitalData.GUIs.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.GUIs.GlobalIndexer">
|
||||
<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:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.7.4.2")>
|
||||
<Assembly: AssemblyVersion("2.7.4.3")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
|
||||
<Assembly: NeutralResourcesLanguageAttribute("")>
|
||||
File diff suppressed because it is too large
Load Diff
@ -624,8 +624,7 @@ Public Class frmAdministration
|
||||
.SQLConnection = oConnection,
|
||||
.PlaceholdersManual = oPlaceholders,
|
||||
.PlaceholdersManualTitle = "Manueller Index",
|
||||
.PlaceholdersManualPrefix = "CTRL",
|
||||
.PlaceholdersWindream = SourceAttributes
|
||||
.PlaceholdersManualPrefix = "CTRL"
|
||||
}
|
||||
|
||||
Dim oResult = oForm2.ShowDialog()
|
||||
@ -661,8 +660,7 @@ Public Class frmAdministration
|
||||
.SQLCommand = oSQLCommand,
|
||||
.SQLConnection = oConnection,
|
||||
.PlaceholdersManual = oPlaceholders,
|
||||
.PlaceholdersManualPrefix = "CTRL",
|
||||
.PlaceholdersWindream = SourceAttributes
|
||||
.PlaceholdersManualPrefix = "CTRL"
|
||||
}
|
||||
|
||||
Dim oResult = oForm2.ShowDialog()
|
||||
|
||||
@ -2326,6 +2326,7 @@ Public Class frmIndex
|
||||
oSqlResult = ClassPatterns.ReplaceInternalValues(oSqlResult)
|
||||
oSqlResult = ClassPatterns.ReplaceUserValues(oSqlResult, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_DOKART_ID)
|
||||
|
||||
|
||||
If oSqlResult <> String.Empty Then
|
||||
_Logger.Debug("oSqlResult after Replace [" & oSqlResult & "]")
|
||||
End If
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user