Zooflow: use displayname

This commit is contained in:
Jonathan Jenne 2022-02-11 16:17:57 +01:00
parent 28e1407bf3
commit 8247ae8005
7 changed files with 35 additions and 12 deletions

View File

@ -32,6 +32,7 @@ Namespace DocumentResultList
Public Property TempPath As String = Nothing Public Property TempPath As String = Nothing
Public Property FileHash As String = Nothing Public Property FileHash As String = Nothing
Public Property DocumentType As String = Nothing Public Property DocumentType As String = Nothing
Public Property DisplayFileName As String = Nothing
Public Sub New(pPrimaryKey As Long) Public Sub New(pPrimaryKey As Long)
Id = pPrimaryKey Id = pPrimaryKey

View File

@ -56,15 +56,17 @@ Namespace DocumentResultList
Dim oDocumentInfo As DocumentInfo = Client.GetDocumentInfo(User.UserId, pObjectId) Dim oDocumentInfo As DocumentInfo = Client.GetDocumentInfo(User.UserId, pObjectId)
Dim oFileInfo As New FileInfo(oDocumentInfo.FullPath) Dim oFileInfo As New FileInfo(oDocumentInfo.FullPath)
' Load Doctype Attribute ' Load System Attributes
Dim oDoctype As VariableValue = Client.GetVariableValue(pObjectId, Attributes.ATTRIBUTE_DOCTYPE) Dim oDoctype As VariableValue = Client.GetVariableValue(pObjectId, Attributes.ATTRIBUTE_DOCTYPE)
Dim oDisplayFileName As VariableValue = Client.GetVariableValue(pObjectId, Attributes.ATTRIBUTE_DISPLAY_FILENAME)
Dim oResultDocumentInfo As New Document(pObjectId) With { Dim oResultDocumentInfo As New Document(pObjectId) With {
.Contents = Load_FromDisk(oDocumentInfo.FullPath), .Contents = Load_FromDisk(oDocumentInfo.FullPath),
.AccessRight = oDocumentInfo.AccessRight, .AccessRight = oDocumentInfo.AccessRight,
.FullPath = oDocumentInfo.FullPath, .FullPath = oDocumentInfo.FullPath,
.Extension = oFileInfo.Extension.Substring(1), .Extension = oFileInfo.Extension.Substring(1),
.DocumentType = oDoctype.Value .DocumentType = oDoctype.Value,
.DisplayFileName = oDisplayFileName.Value
} }
Return oResultDocumentInfo Return oResultDocumentInfo
@ -81,8 +83,9 @@ Namespace DocumentResultList
Return Nothing Return Nothing
End If End If
' Load Doctype Attribute ' Load System Attributes
Dim oDoctype As VariableValue = Client.GetVariableValue(pObjectId, Attributes.ATTRIBUTE_DOCTYPE) Dim oDoctype As VariableValue = Client.GetVariableValue(pObjectId, Attributes.ATTRIBUTE_DOCTYPE)
Dim oDisplayFileName As VariableValue = Client.GetVariableValue(pObjectId, Attributes.ATTRIBUTE_DISPLAY_FILENAME)
Dim oResultDocumentInfo As New Document(pObjectId) With { Dim oResultDocumentInfo As New Document(pObjectId) With {
.Contents = oFileObject._FileContents, .Contents = oFileObject._FileContents,
@ -90,7 +93,8 @@ Namespace DocumentResultList
.AccessRight = Rights.AccessRight.FULL, .AccessRight = Rights.AccessRight.FULL,
.FileHash = oFileObject._FileHash, .FileHash = oFileObject._FileHash,
.FullPath = Nothing, .FullPath = Nothing,
.DocumentType = oDoctype.Value .DocumentType = oDoctype.Value,
.DisplayFileName = oDisplayFileName.Value
} }
Return oResultDocumentInfo Return oResultDocumentInfo

View File

@ -315,6 +315,7 @@ Public Class frmDocumentResultList
Private Async Function Watcher_UpdateFile(pFile As DocumentResultList.Watcher.OpenFile, pCreateNewVersion As Boolean) As Task Private Async Function Watcher_UpdateFile(pFile As DocumentResultList.Watcher.OpenFile, pCreateNewVersion As Boolean) As Task
Dim oFileInfo As New FileInfo(pFile.FilePath) Dim oFileInfo As New FileInfo(pFile.FilePath)
Dim oDisplayName As String = pFile.Document.DisplayFileName
Dim oObjectId = Await _IDBClient.UpdateFileAsync(pFile.Document.Id, pFile.FilePath, New Options.UpdateFileOptions With { Dim oObjectId = Await _IDBClient.UpdateFileAsync(pFile.Document.Id, pFile.FilePath, New Options.UpdateFileOptions With {
.CreateNewFileVersion = pCreateNewVersion, .CreateNewFileVersion = pCreateNewVersion,
.Language = Environment.User.Language, .Language = Environment.User.Language,
@ -322,16 +323,17 @@ Public Class frmDocumentResultList
}) })
If IsNothing(oObjectId) Then If IsNothing(oObjectId) Then
MsgBox($"Beim Speichern der Datei '{oFileInfo.Name}' Fehler ist ein Fehler aufgetreten!", MsgBoxStyle.Critical, Text) MsgBox($"Beim Speichern der Datei '{oDisplayName}' Fehler ist ein Fehler aufgetreten!", MsgBoxStyle.Critical, Text)
Else Else
MsgBox($"Die Datei '{oFileInfo.Name}' wurde erfolgreich gespeichert!", MsgBoxStyle.Information, Text) MsgBox($"Die Datei '{oDisplayName}' wurde erfolgreich gespeichert!", MsgBoxStyle.Information, Text)
RaiseEvent NeedsRefresh(Me, Params.ProfileGuid) RaiseEvent NeedsRefresh(Me, Params.ProfileGuid)
End If End If
End Function End Function
Private Async Function Watcher_Ask(pFile As DocumentResultList.Watcher.OpenFile) As Task Private Async Function Watcher_Ask(pFile As DocumentResultList.Watcher.OpenFile) As Task
Dim oFileInfo = New FileInfo(pFile.FilePath) Dim oFileInfo = New FileInfo(pFile.FilePath)
Dim oMessage = $"Die Datei '{oFileInfo.Name}' wurde außerhalb des Systems verändert. Wollen Sie diese Änderung als neue Version in das System übernehmen oder überschreiben?" Dim oDisplayName = pFile.Document.DisplayFileName
Dim oMessage = $"Die Datei '{oDisplayName}' wurde außerhalb des Systems verändert. Wollen Sie diese Änderung als neue Version in das System übernehmen oder überschreiben?"
Dim oMessageBox As New MsgBoxEx(oMessage, "Datei verändert", MessageBoxIcon.Question) Dim oMessageBox As New MsgBoxEx(oMessage, "Datei verändert", MessageBoxIcon.Question)
oMessageBox.SetButtons("Überschreiben", "Neue Version", "Abbrechen") oMessageBox.SetButtons("Überschreiben", "Neue Version", "Abbrechen")

View File

@ -1,6 +1,15 @@
Namespace IDB Namespace IDB
Public Class Attributes Public Class Attributes
Public Const ATTRIBUTE_DOCTYPE = "Doctype" Public Const ATTRIBUTE_DOCTYPE = "Doctype"
Public Const ATTRIBUTE_DYNAMIC_FOLDER = "Dynamic Folder"
Public Const ATTRIBUTE_ORIGIN_FILENAME = "OriginFileName"
Public Const ATTRIBUTE_ORIGIN_CHANGED = "OriginChangedDatetime"
Public Const ATTRIBUTE_ORIGIN_CREATED = "OriginCreationDatetime"
Public Const ATTRIBUTE_DISPLAY_FILENAME = "DisplayFileName"
Public Const ATTRIBUTE_DISPLAY_FILENAME1 = "DisplayFileName1"
End Class End Class
End Namespace End Namespace

View File

@ -242,6 +242,10 @@
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Modules.Base\Base\Base.vbproj">
<Project>{6ea0c51f-c2b1-4462-8198-3de0b32b74f8}</Project>
<Name>Base</Name>
</ProjectReference>
<ProjectReference Include="..\Modules.Config\Config.vbproj"> <ProjectReference Include="..\Modules.Config\Config.vbproj">
<Project>{44982F9B-6116-44E2-85D0-F39650B1EF99}</Project> <Project>{44982F9B-6116-44E2-85D0-F39650B1EF99}</Project>
<Name>Config</Name> <Name>Config</Name>

View File

@ -6,6 +6,7 @@ Imports DigitalData.Modules.Language
Imports DigitalData.Services.EDMIService.Methods.Database Imports DigitalData.Services.EDMIService.Methods.Database
Imports DigitalData.Services.EDMIService.Methods.IDB Imports DigitalData.Services.EDMIService.Methods.IDB
Imports DigitalData.Modules.ZooFlow.State Imports DigitalData.Modules.ZooFlow.State
Imports DigitalData.Modules.Base.IDB
Namespace Methods.GlobalIndexer.ImportFile Namespace Methods.GlobalIndexer.ImportFile
Public Class ImportFileMethod Public Class ImportFileMethod
@ -86,9 +87,10 @@ Namespace Methods.GlobalIndexer.ImportFile
Logger.Info("Collecting Attributes for ObjectId [{0}]", oResponse.ObjectId) Logger.Info("Collecting Attributes for ObjectId [{0}]", oResponse.ObjectId)
Dim oFinalAttributes As New Dictionary(Of String, List(Of String)) From { Dim oFinalAttributes As New Dictionary(Of String, List(Of String)) From {
{"DisplayFileName", New List(Of String) From {oDisplayFilename}}, {Attributes.ATTRIBUTE_DISPLAY_FILENAME, New List(Of String) From {oDisplayFilename}},
{"Dynamic Folder", New List(Of String) From {oDynamicFilePath}} {Attributes.ATTRIBUTE_DYNAMIC_FOLDER, New List(Of String) From {oDynamicFilePath}}
} }
oFinalAttributes = oFinalAttributes. oFinalAttributes = oFinalAttributes.
Concat(Helpers.UserAttributesToDictionary(oUserAttributes)). Concat(Helpers.UserAttributesToDictionary(oUserAttributes)).
Concat(Helpers.UserAttributesToDictionary(oAutoAttributes)). Concat(Helpers.UserAttributesToDictionary(oAutoAttributes)).

View File

@ -1,4 +1,5 @@
Imports System.Data.SqlClient Imports System.Data.SqlClient
Imports DigitalData.Modules.Base.IDB
Imports DigitalData.Modules.Database Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Database.MSSQLServer.TransactionMode Imports DigitalData.Modules.Database.MSSQLServer.TransactionMode
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
@ -105,9 +106,9 @@ Namespace Methods.IDB.NewFile
'--------------------------------------------------------------------------- '---------------------------------------------------------------------------
Dim oSystemAttributes As New Dictionary(Of String, Object) From { Dim oSystemAttributes As New Dictionary(Of String, Object) From {
{"OriginFileName", pData.File.FileName}, {Attributes.ATTRIBUTE_ORIGIN_FILENAME, pData.File.FileName},
{"OriginCreationDatetime", pData.File.FileCreatedAt}, {Attributes.ATTRIBUTE_ORIGIN_CREATED, pData.File.FileCreatedAt},
{"OriginChangedDatetime", pData.File.FileChangedAt} {Attributes.ATTRIBUTE_ORIGIN_CHANGED, pData.File.FileChangedAt}
} }
For Each oAttribute As KeyValuePair(Of String, Object) In oSystemAttributes For Each oAttribute As KeyValuePair(Of String, Object) In oSystemAttributes