EDMIService: WIP

This commit is contained in:
Jonathan Jenne
2021-12-09 16:28:26 +01:00
parent a509842616
commit e6b3a53477
15 changed files with 147 additions and 108 deletions

View File

@@ -112,10 +112,10 @@ Namespace Methods.GlobalIndexer.ImportFile
End Try
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)
Dim oAttributeDict = Helpers.UserAttributesToDictionary(pAttributes)
Dim oUserAttributeDict = Helpers.UserAttributesToDictionary(pUserAttributes)
Dim oAutoAttributeDict = Helpers.UserAttributesToDictionary(pAutoAttributes)
If pPathConvention Is Nothing OrElse pPathConvention = String.Empty Then
@@ -124,14 +124,15 @@ Namespace Methods.GlobalIndexer.ImportFile
End If
Dim oVirtualPath As String = Helpers.GetPlaceholderValue(pPathConvention, pFileInfo, pUser, oAttributeDict, oAutoAttributeDict)
Return oVirtualPath
Dim oDynamicPath As String = Helpers.GetPlaceholderValue(pPathConvention, pFileInfo, pUser, oUserAttributeDict, oAutoAttributeDict)
Logger.Info("Virtual Path for file [{0}] is [{1}]", pFileInfo.Name, oDynamicPath)
Return oDynamicPath
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)
Dim oAttributeDict = Helpers.UserAttributesToDictionary(pAttributes)
Dim oUserAttributeDict = Helpers.UserAttributesToDictionary(pUserAttributes)
Dim oAutoAttributeDict = Helpers.UserAttributesToDictionary(pAutoAttributes)
If pNameconvention Is Nothing OrElse pNameconvention = String.Empty Then
@@ -140,7 +141,8 @@ Namespace Methods.GlobalIndexer.ImportFile
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
End Function
@@ -158,7 +160,7 @@ Namespace Methods.GlobalIndexer.ImportFile
' Now make the call to the database
Dim oSuccess = Helpers.SetAttributeValue(Connection, Transaction, pObjectId, oAttribute.Key, oValue, User.Language, User.UserName)
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
Logger.Warn("Attribute value could not be written")
End If