Interfaces/Jobs: add new method FilterPropertyMap
This commit is contained in:
@@ -299,7 +299,8 @@ Public Class ImportZUGFeRDFiles
|
||||
' Check the document against the configured property map and return:
|
||||
' - a List of valid properties
|
||||
' - a List of missing properties
|
||||
Dim oPropertyMap = GetPropertyMapFor(oArgs, oDocument.Specification)
|
||||
|
||||
Dim oPropertyMap = _zugferd.FilterPropertyMap(oArgs.PropertyMap, oDocument.Specification)
|
||||
Dim oCheckResult = _zugferd.PropertyValues.CheckPropertyValues(oDocument.SchemaObject, oPropertyMap, oMessageId)
|
||||
|
||||
_logger.Info("Properties checked: [{0}] missing properties / [{1}] valid properties found.", oCheckResult.MissingProperties.Count, oCheckResult.ValidProperties.Count)
|
||||
@@ -619,20 +620,6 @@ Public Class ImportZUGFeRDFiles
|
||||
_firebird.ExecuteNonQueryWithConnection(oCommand, pConnections.FirebirdConnection, Firebird.TransactionMode.ExternalTransaction, pConnections.FirebirdTransaction)
|
||||
End Sub
|
||||
|
||||
Private Function GetPropertyMapFor(pWorkerArgs As WorkerArgs, pSpecification As String) As Dictionary(Of String, XmlItemProperty)
|
||||
Dim oPropertyMap = DoGetPropertyMapFor(pWorkerArgs, pSpecification)
|
||||
|
||||
_logger.Debug("Found [{0}] Properties for Specification [{1}].", oPropertyMap.Count, pSpecification)
|
||||
|
||||
' If no properties were found, fall back to the default specification before giving up
|
||||
If oPropertyMap.Count = 0 Then
|
||||
_logger.Warn("No Properties found for Specification [{0}]. Loading default property map!", pSpecification)
|
||||
Return DoGetPropertyMapFor(pWorkerArgs, ZUGFeRDInterface.ZUGFERD_SPEC_DEFAULT)
|
||||
End If
|
||||
|
||||
Return oPropertyMap
|
||||
End Function
|
||||
|
||||
Private Function DoGetPropertyMapFor(pWorkerArgs As WorkerArgs, pSpecification As String) As Dictionary(Of String, XmlItemProperty)
|
||||
Return pWorkerArgs.PropertyMap.
|
||||
Where(Function(kv) kv.Value.Specification = pSpecification).
|
||||
|
||||
Reference in New Issue
Block a user