EDMIService: WIP
This commit is contained in:
parent
a509842616
commit
e6b3a53477
@ -136,8 +136,8 @@ Public Class ClassValidator
|
|||||||
'End If
|
'End If
|
||||||
|
|
||||||
oAttributeValues.Add(New UserAttributeValue With {
|
oAttributeValues.Add(New UserAttributeValue With {
|
||||||
.AttributeName = oIndexName,
|
.Name = oIndexName,
|
||||||
.AttributeValues = WrapIndexValue(oTextBox.Text),
|
.Values = WrapIndexValue(oTextBox.Text),
|
||||||
.ControlName = oTextBox.Name
|
.ControlName = oTextBox.Name
|
||||||
})
|
})
|
||||||
End If
|
End If
|
||||||
@ -152,8 +152,8 @@ Public Class ClassValidator
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
oAttributeValues.Add(New UserAttributeValue With {
|
oAttributeValues.Add(New UserAttributeValue With {
|
||||||
.AttributeName = oIndexName,
|
.Name = oIndexName,
|
||||||
.AttributeValues = WrapIndexValue(oValues),
|
.Values = WrapIndexValue(oValues),
|
||||||
.ControlName = oLookup.Name
|
.ControlName = oLookup.Name
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -166,8 +166,8 @@ Public Class ClassValidator
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
oAttributeValues.Add(New UserAttributeValue With {
|
oAttributeValues.Add(New UserAttributeValue With {
|
||||||
.AttributeName = oIndexName,
|
.Name = oIndexName,
|
||||||
.AttributeValues = WrapIndexValue(cmbSingle.Text),
|
.Values = WrapIndexValue(cmbSingle.Text),
|
||||||
.ControlName = cmbSingle.Name
|
.ControlName = cmbSingle.Name
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -179,8 +179,8 @@ Public Class ClassValidator
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
oAttributeValues.Add(New UserAttributeValue With {
|
oAttributeValues.Add(New UserAttributeValue With {
|
||||||
.AttributeName = oIndexName,
|
.Name = oIndexName,
|
||||||
.AttributeValues = WrapIndexValue(cmb.Text),
|
.Values = WrapIndexValue(cmb.Text),
|
||||||
.ControlName = cmb.Name
|
.ControlName = cmb.Name
|
||||||
})
|
})
|
||||||
End If
|
End If
|
||||||
@ -191,8 +191,8 @@ Public Class ClassValidator
|
|||||||
Dim oIndexName As String = GetIndexName(dtp, "dtp")
|
Dim oIndexName As String = GetIndexName(dtp, "dtp")
|
||||||
|
|
||||||
oAttributeValues.Add(New UserAttributeValue With {
|
oAttributeValues.Add(New UserAttributeValue With {
|
||||||
.AttributeName = oIndexName,
|
.Name = oIndexName,
|
||||||
.AttributeValues = WrapIndexValue(dtp.EditValue.ToString),
|
.Values = WrapIndexValue(dtp.EditValue.ToString),
|
||||||
.ControlName = dtp.Name
|
.ControlName = dtp.Name
|
||||||
})
|
})
|
||||||
End If
|
End If
|
||||||
@ -204,8 +204,8 @@ Public Class ClassValidator
|
|||||||
|
|
||||||
|
|
||||||
oAttributeValues.Add(New UserAttributeValue With {
|
oAttributeValues.Add(New UserAttributeValue With {
|
||||||
.AttributeName = oIndexName,
|
.Name = oIndexName,
|
||||||
.AttributeValues = WrapIndexValue(chk.Checked.ToString),
|
.Values = WrapIndexValue(chk.Checked.ToString),
|
||||||
.ControlName = chk.Name
|
.ControlName = chk.Name
|
||||||
})
|
})
|
||||||
End If
|
End If
|
||||||
|
|||||||
@ -41,8 +41,8 @@ Public Class frmtest
|
|||||||
txtProfileId.Text,
|
txtProfileId.Text,
|
||||||
New List(Of EDMIServiceReference.UserAttributeValue) From {
|
New List(Of EDMIServiceReference.UserAttributeValue) From {
|
||||||
New EDMIServiceReference.UserAttributeValue With {
|
New EDMIServiceReference.UserAttributeValue With {
|
||||||
.AttributeName = "Attribut String1",
|
.Name = "Attribut String1",
|
||||||
.AttributeValues = New List(Of String) From {"SchreiberM"}.ToArray
|
.Values = New List(Of String) From {"SchreiberM"}.ToArray
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"WORK",
|
"WORK",
|
||||||
|
|||||||
@ -22,10 +22,10 @@
|
|||||||
<xs:element name="ArrayOfUserAttributeValue" nillable="true" type="tns:ArrayOfUserAttributeValue" />
|
<xs:element name="ArrayOfUserAttributeValue" nillable="true" type="tns:ArrayOfUserAttributeValue" />
|
||||||
<xs:complexType name="UserAttributeValue">
|
<xs:complexType name="UserAttributeValue">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element minOccurs="0" name="AttributeId" type="xs:int" />
|
|
||||||
<xs:element minOccurs="0" name="AttributeName" nillable="true" type="xs:string" />
|
|
||||||
<xs:element xmlns:q2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="AttributeValues" nillable="true" type="q2:ArrayOfstring" />
|
|
||||||
<xs:element minOccurs="0" name="ControlName" nillable="true" type="xs:string" />
|
<xs:element minOccurs="0" name="ControlName" nillable="true" type="xs:string" />
|
||||||
|
<xs:element minOccurs="0" name="Id" type="xs:int" />
|
||||||
|
<xs:element minOccurs="0" name="Name" nillable="true" type="xs:string" />
|
||||||
|
<xs:element xmlns:q2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="Values" nillable="true" type="q2:ArrayOfstring" />
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
<xs:element name="UserAttributeValue" nillable="true" type="tns:UserAttributeValue" />
|
<xs:element name="UserAttributeValue" nillable="true" type="tns:UserAttributeValue" />
|
||||||
|
|||||||
@ -635,18 +635,18 @@ Namespace EDMIServiceReference
|
|||||||
<System.NonSerializedAttribute()> _
|
<System.NonSerializedAttribute()> _
|
||||||
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
|
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
|
||||||
|
|
||||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
|
||||||
Private AttributeIdField As Integer
|
|
||||||
|
|
||||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
|
||||||
Private AttributeNameField As String
|
|
||||||
|
|
||||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
|
||||||
Private AttributeValuesField() As String
|
|
||||||
|
|
||||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||||
Private ControlNameField As String
|
Private ControlNameField As String
|
||||||
|
|
||||||
|
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||||
|
Private IdField As Integer
|
||||||
|
|
||||||
|
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||||
|
Private NameField As String
|
||||||
|
|
||||||
|
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||||
|
Private ValuesField() As String
|
||||||
|
|
||||||
<Global.System.ComponentModel.BrowsableAttribute(false)> _
|
<Global.System.ComponentModel.BrowsableAttribute(false)> _
|
||||||
Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData
|
Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData
|
||||||
Get
|
Get
|
||||||
@ -657,45 +657,6 @@ Namespace EDMIServiceReference
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
<System.Runtime.Serialization.DataMemberAttribute()> _
|
|
||||||
Public Property AttributeId() As Integer
|
|
||||||
Get
|
|
||||||
Return Me.AttributeIdField
|
|
||||||
End Get
|
|
||||||
Set
|
|
||||||
If (Me.AttributeIdField.Equals(value) <> true) Then
|
|
||||||
Me.AttributeIdField = value
|
|
||||||
Me.RaisePropertyChanged("AttributeId")
|
|
||||||
End If
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<System.Runtime.Serialization.DataMemberAttribute()> _
|
|
||||||
Public Property AttributeName() As String
|
|
||||||
Get
|
|
||||||
Return Me.AttributeNameField
|
|
||||||
End Get
|
|
||||||
Set
|
|
||||||
If (Object.ReferenceEquals(Me.AttributeNameField, value) <> true) Then
|
|
||||||
Me.AttributeNameField = value
|
|
||||||
Me.RaisePropertyChanged("AttributeName")
|
|
||||||
End If
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<System.Runtime.Serialization.DataMemberAttribute()> _
|
|
||||||
Public Property AttributeValues() As String()
|
|
||||||
Get
|
|
||||||
Return Me.AttributeValuesField
|
|
||||||
End Get
|
|
||||||
Set
|
|
||||||
If (Object.ReferenceEquals(Me.AttributeValuesField, value) <> true) Then
|
|
||||||
Me.AttributeValuesField = value
|
|
||||||
Me.RaisePropertyChanged("AttributeValues")
|
|
||||||
End If
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<System.Runtime.Serialization.DataMemberAttribute()> _
|
<System.Runtime.Serialization.DataMemberAttribute()> _
|
||||||
Public Property ControlName() As String
|
Public Property ControlName() As String
|
||||||
Get
|
Get
|
||||||
@ -709,6 +670,45 @@ Namespace EDMIServiceReference
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
<System.Runtime.Serialization.DataMemberAttribute()> _
|
||||||
|
Public Property Id() As Integer
|
||||||
|
Get
|
||||||
|
Return Me.IdField
|
||||||
|
End Get
|
||||||
|
Set
|
||||||
|
If (Me.IdField.Equals(value) <> true) Then
|
||||||
|
Me.IdField = value
|
||||||
|
Me.RaisePropertyChanged("Id")
|
||||||
|
End If
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
<System.Runtime.Serialization.DataMemberAttribute()> _
|
||||||
|
Public Property Name() As String
|
||||||
|
Get
|
||||||
|
Return Me.NameField
|
||||||
|
End Get
|
||||||
|
Set
|
||||||
|
If (Object.ReferenceEquals(Me.NameField, value) <> true) Then
|
||||||
|
Me.NameField = value
|
||||||
|
Me.RaisePropertyChanged("Name")
|
||||||
|
End If
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
<System.Runtime.Serialization.DataMemberAttribute()> _
|
||||||
|
Public Property Values() As String()
|
||||||
|
Get
|
||||||
|
Return Me.ValuesField
|
||||||
|
End Get
|
||||||
|
Set
|
||||||
|
If (Object.ReferenceEquals(Me.ValuesField, value) <> true) Then
|
||||||
|
Me.ValuesField = value
|
||||||
|
Me.RaisePropertyChanged("Values")
|
||||||
|
End If
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
|
Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
|
||||||
|
|
||||||
Protected Sub RaisePropertyChanged(ByVal propertyName As String)
|
Protected Sub RaisePropertyChanged(ByVal propertyName As String)
|
||||||
@ -933,7 +933,7 @@ Namespace EDMIServiceReference
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
|
Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
|
||||||
|
|
||||||
Protected Sub RaisePropertyChanged(ByVal propertyName As String)
|
Protected Sub RaisePropertyChanged(ByVal propertyName As String)
|
||||||
Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
|
Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
|
||||||
If (Not (propertyChanged) Is Nothing) Then
|
If (Not (propertyChanged) Is Nothing) Then
|
||||||
|
|||||||
@ -4,7 +4,7 @@ Imports System.Text.RegularExpressions
|
|||||||
Namespace Modules
|
Namespace Modules
|
||||||
Public Class BaseModule
|
Public Class BaseModule
|
||||||
Friend ReadOnly Logger As Logger
|
Friend ReadOnly Logger As Logger
|
||||||
Private ReadOnly MyRegex As Regex = New Regex("{#(\w+)#([\:\.\w\s_-]+)}+")
|
Private ReadOnly MyRegex As Regex = New Regex("{#(\w+)#([\:\.\w\s_/-]+)}+")
|
||||||
Private ReadOnly SqlPhrases As New List(Of String) From {
|
Private ReadOnly SqlPhrases As New List(Of String) From {
|
||||||
"SELECT ", "UPDATE ", "DELETE ", "EXEC "
|
"SELECT ", "UPDATE ", "DELETE ", "EXEC "
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,9 +12,12 @@ Namespace Modules
|
|||||||
Public Const INT_VALUE_MACHINE = "MACHINE"
|
Public Const INT_VALUE_MACHINE = "MACHINE"
|
||||||
Public Const INT_VALUE_DOMAIN = "DOMAIN"
|
Public Const INT_VALUE_DOMAIN = "DOMAIN"
|
||||||
Public Const INT_VALUE_DATE = "DATE"
|
Public Const INT_VALUE_DATE = "DATE"
|
||||||
Public Const INT_VALUE_DATE_YYYY = "DATE_YYYY"
|
|
||||||
Public Const INT_VALUE_DATE_MM = "DATE_MM"
|
Public Const INT_VALUE_DATE_YYYY = "YYYY"
|
||||||
Public Const INT_VALUE_DATE_DD = "DATE_DD"
|
Public Const INT_VALUE_DATE_MM = "MM"
|
||||||
|
Public Const INT_VALUE_DATE_DD = "DD"
|
||||||
|
Public Const INT_VALUE_DATE_YYYY_MM_DD = "YYYY/MM/DD"
|
||||||
|
Public Const INT_VALUE_DATE_YYYY_MM_DD_2 = "YYYY_MM_DD"
|
||||||
|
|
||||||
Public Property PatternIdentifier As String = "INT" Implements IModule.PatternIdentifier
|
Public Property PatternIdentifier As String = "INT" Implements IModule.PatternIdentifier
|
||||||
Public Property IsComplex As Boolean = False Implements IModule.IsComplex
|
Public Property IsComplex As Boolean = False Implements IModule.IsComplex
|
||||||
@ -28,30 +31,55 @@ Namespace Modules
|
|||||||
Dim oCounter = 0
|
Dim oCounter = 0
|
||||||
Dim oNow As Date = Now
|
Dim oNow As Date = Now
|
||||||
|
|
||||||
|
'TODO: Make date patterns dynamic
|
||||||
|
|
||||||
|
Logger.Trace("Replacing Internal Patterns")
|
||||||
|
|
||||||
' Replace CurrentDate(s)
|
' Replace CurrentDate(s)
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, INT_VALUE_DATE)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, INT_VALUE_DATE_YYYY_MM_DD)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("yyyy-MM-dd"))
|
Logger.Trace("Replacing Pattern [{0}]", INT_VALUE_DATE_YYYY_MM_DD)
|
||||||
|
oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("yyyy/MM/dd"))
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
|
Logger.Trace("Replace Counter: [{0}]", oCounter)
|
||||||
|
|
||||||
|
' Replace CurrentDate(s)
|
||||||
|
While ContainsPatternAndValue(oResult, PatternIdentifier, INT_VALUE_DATE_YYYY_MM_DD_2)
|
||||||
|
Logger.Trace("Replacing Pattern [{0}]", INT_VALUE_DATE_YYYY_MM_DD_2)
|
||||||
|
oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("yyyy_MM_dd"))
|
||||||
|
IncrementCounterOrThrow(oCounter)
|
||||||
|
End While
|
||||||
|
|
||||||
|
Logger.Trace("Replace Counter: [{0}]", oCounter)
|
||||||
|
|
||||||
' Replace Year(s)
|
' Replace Year(s)
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, INT_VALUE_DATE_YYYY)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, INT_VALUE_DATE_YYYY)
|
||||||
|
Logger.Trace("Replacing Pattern [{0}]", INT_VALUE_DATE_YYYY)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("yyyy"))
|
oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("yyyy"))
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
|
Logger.Trace("Replace Counter: [{0}]", oCounter)
|
||||||
|
|
||||||
' Replace Month(s)
|
' Replace Month(s)
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, INT_VALUE_DATE_MM)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, INT_VALUE_DATE_MM)
|
||||||
|
Logger.Trace("Replacing Pattern [{0}]", INT_VALUE_DATE_MM)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("MM"))
|
oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("MM"))
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
|
Logger.Trace("Replace Counter: [{0}]", oCounter)
|
||||||
|
|
||||||
' Replace Day(s)
|
' Replace Day(s)
|
||||||
While ContainsPatternAndValue(oResult, PatternIdentifier, INT_VALUE_DATE_DD)
|
While ContainsPatternAndValue(oResult, PatternIdentifier, INT_VALUE_DATE_DD)
|
||||||
|
Logger.Trace("Replacing Pattern [{0}]", INT_VALUE_DATE_DD)
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("dd"))
|
oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("dd"))
|
||||||
IncrementCounterOrThrow(oCounter)
|
IncrementCounterOrThrow(oCounter)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
|
Logger.Trace("Replace Counter: [{0}]", oCounter)
|
||||||
|
|
||||||
Return oResult
|
Return oResult
|
||||||
End Function
|
End Function
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@ -6,7 +6,6 @@ Imports DigitalData.Modules.Logging
|
|||||||
Imports DigitalData.Modules.Language
|
Imports DigitalData.Modules.Language
|
||||||
Imports DigitalData.Modules
|
Imports DigitalData.Modules
|
||||||
Imports DigitalData.Modules.EDMI
|
Imports DigitalData.Modules.EDMI
|
||||||
Imports DigitalData.Modules.EDMI.File
|
|
||||||
Imports DigitalData.Modules.EDMI.API.Rights
|
Imports DigitalData.Modules.EDMI.API.Rights
|
||||||
Imports DigitalData.Services.EDMIService.Messages
|
Imports DigitalData.Services.EDMIService.Messages
|
||||||
Imports DigitalData.Services.EDMIService.Exceptions
|
Imports DigitalData.Services.EDMIService.Exceptions
|
||||||
|
|||||||
@ -42,8 +42,8 @@ Namespace IDB
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Return pUserAttributes.ToDictionary(
|
Return pUserAttributes.ToDictionary(
|
||||||
Function(attr) attr.AttributeName,
|
Function(attr) attr.Name,
|
||||||
Function(attr) attr.AttributeValues)
|
Function(attr) attr.Values)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function TestObjectIdExists(pObjectId As Long, Optional ByRef IsDeleted As Boolean = False, Optional ByRef IsActive As Boolean = False) As Boolean
|
Public Function TestObjectIdExists(pObjectId As Long, Optional ByRef IsDeleted As Boolean = False, Optional ByRef IsActive As Boolean = False) As Boolean
|
||||||
|
|||||||
@ -8,13 +8,13 @@
|
|||||||
''' Attribute values supplied by the user
|
''' Attribute values supplied by the user
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Class UserAttributeValue
|
Public Class UserAttributeValue
|
||||||
Public Property AttributeName As String
|
Public Property Id As Integer
|
||||||
Public Property AttributeValues As List(Of String)
|
Public Property Name As String
|
||||||
Public Property AttributeId As Integer
|
Public Property Values As List(Of String)
|
||||||
Public Property ControlName As String
|
Public Property ControlName As String
|
||||||
|
|
||||||
Public Overrides Function ToString() As String
|
Public Overrides Function ToString() As String
|
||||||
Return AttributeName
|
Return Name
|
||||||
End Function
|
End Function
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
@ -112,10 +112,10 @@ Namespace Methods.GlobalIndexer.ImportFile
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function GetVirtualPath(pFileInfo As FileInfo, pPathConvention As String, pUser As UserState, pAttributes As List(Of UserAttributeValue), pAutoAttributes As List(Of UserAttributeValue))
|
Private Function GetVirtualPath(pFileInfo As FileInfo, pPathConvention As String, pUser As UserState, pUserAttributes As List(Of UserAttributeValue), pAutoAttributes As List(Of UserAttributeValue))
|
||||||
Logger.Info("Generating virtual path for file [{0}]", pFileInfo.Name)
|
Logger.Info("Generating virtual path for file [{0}]", pFileInfo.Name)
|
||||||
|
|
||||||
Dim oAttributeDict = Helpers.UserAttributesToDictionary(pAttributes)
|
Dim oUserAttributeDict = Helpers.UserAttributesToDictionary(pUserAttributes)
|
||||||
Dim oAutoAttributeDict = Helpers.UserAttributesToDictionary(pAutoAttributes)
|
Dim oAutoAttributeDict = Helpers.UserAttributesToDictionary(pAutoAttributes)
|
||||||
|
|
||||||
If pPathConvention Is Nothing OrElse pPathConvention = String.Empty Then
|
If pPathConvention Is Nothing OrElse pPathConvention = String.Empty Then
|
||||||
@ -124,14 +124,15 @@ Namespace Methods.GlobalIndexer.ImportFile
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oVirtualPath As String = Helpers.GetPlaceholderValue(pPathConvention, pFileInfo, pUser, oAttributeDict, oAutoAttributeDict)
|
Dim oDynamicPath As String = Helpers.GetPlaceholderValue(pPathConvention, pFileInfo, pUser, oUserAttributeDict, oAutoAttributeDict)
|
||||||
Return oVirtualPath
|
Logger.Info("Virtual Path for file [{0}] is [{1}]", pFileInfo.Name, oDynamicPath)
|
||||||
|
Return oDynamicPath
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function GetFilenameByNameconvention(pFileInfo As FileInfo, pNameconvention As String, pUser As UserState, pAttributes As List(Of UserAttributeValue), pAutoAttributes As List(Of UserAttributeValue)) As String
|
Private Function GetFilenameByNameconvention(pFileInfo As FileInfo, pNameconvention As String, pUser As UserState, pUserAttributes As List(Of UserAttributeValue), pAutoAttributes As List(Of UserAttributeValue)) As String
|
||||||
Logger.Info("Generating display filename for file [{0}]", pFileInfo.Name)
|
Logger.Info("Generating display filename for file [{0}]", pFileInfo.Name)
|
||||||
|
|
||||||
Dim oAttributeDict = Helpers.UserAttributesToDictionary(pAttributes)
|
Dim oUserAttributeDict = Helpers.UserAttributesToDictionary(pUserAttributes)
|
||||||
Dim oAutoAttributeDict = Helpers.UserAttributesToDictionary(pAutoAttributes)
|
Dim oAutoAttributeDict = Helpers.UserAttributesToDictionary(pAutoAttributes)
|
||||||
|
|
||||||
If pNameconvention Is Nothing OrElse pNameconvention = String.Empty Then
|
If pNameconvention Is Nothing OrElse pNameconvention = String.Empty Then
|
||||||
@ -140,7 +141,8 @@ Namespace Methods.GlobalIndexer.ImportFile
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oFileName As String = Helpers.GetPlaceholderValue(pNameconvention, pFileInfo, pUser, oAttributeDict, oAutoAttributeDict)
|
Dim oFileName As String = Helpers.GetPlaceholderValue(pNameconvention, pFileInfo, pUser, oUserAttributeDict, oAutoAttributeDict)
|
||||||
|
|
||||||
Return oFileName & pFileInfo.Extension
|
Return oFileName & pFileInfo.Extension
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@ -158,7 +160,7 @@ Namespace Methods.GlobalIndexer.ImportFile
|
|||||||
' Now make the call to the database
|
' Now make the call to the database
|
||||||
Dim oSuccess = Helpers.SetAttributeValue(Connection, Transaction, pObjectId, oAttribute.Key, oValue, User.Language, User.UserName)
|
Dim oSuccess = Helpers.SetAttributeValue(Connection, Transaction, pObjectId, oAttribute.Key, oValue, User.Language, User.UserName)
|
||||||
If oSuccess Then
|
If oSuccess Then
|
||||||
Logger.Info("Attribute [{0}] written with value [{1}]", oAttribute.Key, oAttribute.Value)
|
Logger.Info("Attribute [{0}] written with value [{1}]", oAttribute.Key, oAttribute.Value.First())
|
||||||
Else
|
Else
|
||||||
Logger.Warn("Attribute value could not be written")
|
Logger.Warn("Attribute value could not be written")
|
||||||
End If
|
End If
|
||||||
|
|||||||
@ -77,9 +77,9 @@ Namespace Methods.GlobalIndexer.ImportFile.Steps
|
|||||||
pAutomaticIndex.Value, pFileInfo, pUserState, oAttributeDict, oAutoAttributeDict)
|
pAutomaticIndex.Value, pFileInfo, pUserState, oAttributeDict, oAutoAttributeDict)
|
||||||
|
|
||||||
Return New UserAttributeValue With {
|
Return New UserAttributeValue With {
|
||||||
.AttributeValues = New List(Of String) From {oResult},
|
.Values = New List(Of String) From {oResult},
|
||||||
.AttributeName = pAutomaticIndex.Name,
|
.Name = pAutomaticIndex.Name,
|
||||||
.AttributeId = pAutomaticIndex.Id
|
.Id = pAutomaticIndex.Id
|
||||||
}
|
}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@ -107,9 +107,9 @@ Namespace Methods.GlobalIndexer.ImportFile.Steps
|
|||||||
|
|
||||||
' TODO: Return multiple values
|
' TODO: Return multiple values
|
||||||
Return New UserAttributeValue With {
|
Return New UserAttributeValue With {
|
||||||
.AttributeValues = New List(Of String) From {oValue},
|
.Values = New List(Of String) From {oValue},
|
||||||
.AttributeName = pAutomaticIndex.Name,
|
.Name = pAutomaticIndex.Name,
|
||||||
.AttributeId = pAutomaticIndex.Id
|
.Id = pAutomaticIndex.Id
|
||||||
}
|
}
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Logger.Warn("Automatic Indexing for index failed.")
|
Logger.Warn("Automatic Indexing for index failed.")
|
||||||
|
|||||||
@ -32,21 +32,21 @@ Namespace Methods.GlobalIndexer.ImportFile.Steps
|
|||||||
For Each oProcessingRow As DataRow In PostprocessingSteps.Rows
|
For Each oProcessingRow As DataRow In PostprocessingSteps.Rows
|
||||||
Dim oIndexId = oProcessingRow.ItemEx(Of Integer)("IDXMAN_ID")
|
Dim oIndexId = oProcessingRow.ItemEx(Of Integer)("IDXMAN_ID")
|
||||||
Dim oIndex As UserAttributeValue = pManualAttributes.
|
Dim oIndex As UserAttributeValue = pManualAttributes.
|
||||||
Where(Function(attr) attr.AttributeId = oProcessingRow.ItemEx(Of Integer)("IDXMAN_ID")).
|
Where(Function(attr) attr.Id = oProcessingRow.ItemEx(Of Integer)("IDXMAN_ID")).
|
||||||
FirstOrDefault()
|
FirstOrDefault()
|
||||||
Dim oIndexPosition = pManualAttributes.IndexOf(oIndex)
|
Dim oIndexPosition = pManualAttributes.IndexOf(oIndex)
|
||||||
|
|
||||||
Logger.Info("Postprocessing Index [{0}]", oIndex.AttributeName)
|
Logger.Info("Postprocessing Index [{0}]", oIndex.Name)
|
||||||
|
|
||||||
Dim oValues = GetPostprocessingValue(oIndex.AttributeValues, oProcessingRow)
|
Dim oValues = GetPostprocessingValue(oIndex.Values, oProcessingRow)
|
||||||
|
|
||||||
Logger.Info("New Value for Index [{0}] is [{1}]", oIndex.AttributeName, String.Join(",", oValues))
|
Logger.Info("New Value for Index [{0}] is [{1}]", oIndex.Name, String.Join(",", oValues))
|
||||||
|
|
||||||
' Replace the old AttributeValue with the new one
|
' Replace the old AttributeValue with the new one
|
||||||
oAttributes.Item(oIndexPosition) = New UserAttributeValue With {
|
oAttributes.Item(oIndexPosition) = New UserAttributeValue With {
|
||||||
.AttributeId = oIndexId,
|
.Id = oIndexId,
|
||||||
.AttributeName = oIndex.AttributeName,
|
.Name = oIndex.Name,
|
||||||
.AttributeValues = oValues,
|
.Values = oValues,
|
||||||
.ControlName = oIndex.ControlName
|
.ControlName = oIndex.ControlName
|
||||||
}
|
}
|
||||||
Next
|
Next
|
||||||
|
|||||||
@ -23,7 +23,7 @@ Namespace Methods.GlobalIndexer
|
|||||||
''' Load Profiles for this Import
|
''' Load Profiles for this Import
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Function LoadProfile(pProfileId As Integer) As Profile
|
Public Function LoadProfile(pProfileId As Integer) As Profile
|
||||||
Logger.Debug("Start of Method [LoadAutomaticIndexes]")
|
Logger.Debug("Start of Method [LoadProfile]")
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Dim oProfile = GetDatatable.Run(
|
Dim oProfile = GetDatatable.Run(
|
||||||
@ -44,12 +44,12 @@ Namespace Methods.GlobalIndexer
|
|||||||
.NameConvention = oRow.ItemEx("NAMENKONVENTION", ""),
|
.NameConvention = oRow.ItemEx("NAMENKONVENTION", ""),
|
||||||
.ObjectStore = oRow.ItemEx("OBJECT_STORE", "Work"),
|
.ObjectStore = oRow.ItemEx("OBJECT_STORE", "Work"),
|
||||||
.ShortName = oRow.ItemEx("KURZNAME", ""),
|
.ShortName = oRow.ItemEx("KURZNAME", ""),
|
||||||
.DynamicPath = oRow.ItemEx("DYNAMIC_PATH", "")
|
.DynamicPath = oRow.ItemEx("DYNAMIC_FOLDER", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
Return oProfileObject
|
Return oProfileObject
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
LogAndThrow(ex, "Error while automatic loading indexes!")
|
LogAndThrow(ex, "Error while automatic loading profile!")
|
||||||
Return Nothing
|
Return Nothing
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@ -81,7 +81,7 @@ Public Class DatatableJob
|
|||||||
oResultTable.TableRelationColumn = oParentColumn
|
oResultTable.TableRelationColumn = oParentColumn
|
||||||
End If
|
End If
|
||||||
|
|
||||||
oLogger.Debug("Fetched Datatable [{0}]", oDatatableName)
|
oLogger.Info("Fetched Datatable [{0}]", oDatatableName)
|
||||||
oResult.Tables.Add(oResultTable)
|
oResult.Tables.Add(oResultTable)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
oLogger.Warn("Execute: Error while saving Table: [{0}]", oDatatableName)
|
oLogger.Warn("Execute: Error while saving Table: [{0}]", oDatatableName)
|
||||||
|
|||||||
@ -36,24 +36,35 @@ Public Class WindowsService
|
|||||||
|
|
||||||
Protected Overrides Sub OnStart(ByVal args As String())
|
Protected Overrides Sub OnStart(ByVal args As String())
|
||||||
Try
|
Try
|
||||||
|
' Init
|
||||||
Dim oServicePath As String = AppDomain.CurrentDomain.BaseDirectory
|
Dim oServicePath As String = AppDomain.CurrentDomain.BaseDirectory
|
||||||
|
Dim oServiceVersion As String = My.Application.Info.Version.ToString()
|
||||||
|
|
||||||
|
' Initializing Logger
|
||||||
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)
|
' Log Initial
|
||||||
Logger.Info("ServiceDirectory: {0}", oServicePath)
|
Logger.Info("Service [{0}] is starting...", SERVICE_DISPLAY_NAME)
|
||||||
|
Logger.Info("ServiceDirectory: [{0}]", oServicePath)
|
||||||
|
Logger.Info("Version: [{0}]", oServiceVersion)
|
||||||
|
|
||||||
|
' Initializing Config
|
||||||
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
|
|
||||||
|
|
||||||
|
' Setup Reload-timer for config
|
||||||
Dim oTimer As New Timers.Timer(60000)
|
Dim oTimer As New Timers.Timer(60000)
|
||||||
AddHandler oTimer.Elapsed, AddressOf ReloadTimer_Tick
|
AddHandler oTimer.Elapsed, AddressOf ReloadTimer_Tick
|
||||||
oTimer.Start()
|
oTimer.Start()
|
||||||
|
|
||||||
|
' Setting Debug Flag
|
||||||
|
Logger.Info("Setting DEBUG Flag to [{0}]", ConfigManager.Config.Debug)
|
||||||
|
LogConfig.Debug = ConfigManager.Config.Debug
|
||||||
|
LogConfigScheduler.Debug = ConfigManager.Config.Debug
|
||||||
|
|
||||||
Logger.Debug("Connecting to Databases")
|
Logger.Debug("Connecting to Databases")
|
||||||
|
|
||||||
Firebird = StartFirebird()
|
Firebird = StartFirebird()
|
||||||
@ -61,7 +72,6 @@ Public Class WindowsService
|
|||||||
MSSQL_IDB = GetMSSQL_IDB(LogConfig)
|
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)
|
||||||
GlobalState = New GlobalState(LogConfig, MSSQL_IDB, MSSQL_ECM)
|
GlobalState = New GlobalState(LogConfig, MSSQL_IDB, MSSQL_ECM)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user