14-08-2023

This commit is contained in:
Jonathan Jenne
2023-08-14 16:48:21 +02:00
parent d5e7ed90be
commit 3fa731fe5f
5 changed files with 28 additions and 23 deletions

View File

@@ -10,8 +10,6 @@ Namespace Sharepoint
Inherits BaseModule
Implements ISync
Private Const STRING1_PLACEHOLDER = "[String1]"
Public Overrides Property Name As String = "Sharepoint Sync"
Public Overrides Property IsLoggedIn As Boolean
@@ -45,23 +43,14 @@ Namespace Sharepoint
Logger.Info("ExtDocId: [{0}]", oDocument.Id)
Dim oFileName = ConvertFilenameToSlug(oDocument.Name)
Dim oSubPath = FileEx.CreateDateDirectory(Config.OutputDirectory)
If oSubPath Is Nothing Then
Throw New ApplicationException("Output sub path could not be created!")
End If
Dim oFilePath = Path.Combine(oSubPath, oFileName)
Logger.Debug("Subdirectory [{0}] created.", oSubPath)
Dim oTempFileName = GetFinalFileName(oDocument.Name, oDocument.Id)
Dim oFilePath = GetFinalFilePath(oTempFileName)
If CopyFileToOutputPath(oDocument.Data, oFilePath) = False Then
Throw New ApplicationException("File could not be created in output path!")
End If
Dim oSQL = String.Format(Config.SQLQueryExport, oDocument.Id, oFileName)
If oSQL.Contains(STRING1_PLACEHOLDER) Then
oSQL.Replace(STRING1_PLACEHOLDER, oDocument.Path)
End If
Await Database.ExecuteNonQueryAsync(oSQL)
Catch ex As Exception
@@ -70,8 +59,6 @@ Namespace Sharepoint
End Try
Next
'TODO
AddInfoEntry("Finished Sync.")
Catch ex As Exception
Logger.Error(ex)