Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -52,7 +52,7 @@ HandlerPdfDownload::~HandlerPdfDownload()
bool HandlerPdfDownload::init()
{
INFO_LOG() << "HandlerPdfDownload initialised!";
INFO_LOG(m_logger) << "HandlerPdfDownload initialised!";
return true;
}
@@ -89,7 +89,7 @@ void HandlerPdfDownload::handleServicePortsInformation(const QVector<WebSocketIn
m_webSocket->open(m_hostname, flmPort);
else
{
ERROR_LOG() << "Could not connect to FileManagement WebSocket server.";
ERROR_LOG(m_logger) << "Could not connect to FileManagement WebSocket server.";
m_currentMode = Mode::PORT_REQUEST;
}
}
@@ -139,7 +139,7 @@ void HandlerPdfDownload::onGetPdfListRequest(const rti::core::SampleIdentity &co
void HandlerPdfDownload::onStartPdfDownloadRequest(const rti::core::SampleIdentity &cookie, const StartPdfDownloadRequest &request)
{
ERROR_LOG() <<" onOcPdfDownloadRequest START" ;
ERROR_LOG(m_logger) <<" onOcPdfDownloadRequest START" ;
m_downloadReply = PdfDownloadReply();
m_downloadCookie = cookie;
@@ -150,13 +150,13 @@ void HandlerPdfDownload::onStartPdfDownloadRequest(const rti::core::SampleIdenti
for (int32_t id : request.documentIds())
str.append(QString::number(id) + QStringLiteral(" "));
DEBUG_LOG() << str;
DEBUG_LOG(m_logger) << str;
}
if (m_hostname.isEmpty())
{
QString errorStr = QStringLiteral("Not able to start PDF download. Hostname not set.");
ERROR_LOG() << errorStr;
ERROR_LOG(m_logger) << errorStr;
m_downloadReply.errorString(errorStr.toStdString());
m_fts->startPdfDownloadReply(m_downloadCookie, m_downloadReply);
return;
@@ -200,26 +200,26 @@ void HandlerPdfDownload::onStartPdfDownloadRequest(const rti::core::SampleIdenti
void HandlerPdfDownload::onOcPdfDownloadRequest(const rti::core::SampleIdentity &cookie, const OcPdfDownloadRequest &request)
{
DEBUG_LOG() <<Q_FUNC_INFO<<" START OcPdfDownloadRequest" ;
DEBUG_LOG(m_logger) <<Q_FUNC_INFO<<" START OcPdfDownloadRequest" ;
m_ocPdfDownloadCookie = cookie;
m_ocPdfDownloadReply = Core::FunctionReply();
if(openRemoteDbConnection(QStringLiteral("lts_ets_pro")) == false)
{
QString errorStr = QStringLiteral("Not able to open remote connection to DB");
ERROR_LOG() << errorStr;
ERROR_LOG(m_logger) << errorStr;
m_ocPdfDownloadReply.errorString(errorStr.toStdString());
m_fts->ocPdfDownloadReply(m_ocPdfDownloadCookie, m_ocPdfDownloadReply);
return;
}
DEBUG_LOG() << "Got PDF download request for ids: "<< request.folderId();
DEBUG_LOG(m_logger) << "Got PDF download request for ids: "<< request.folderId();
m_folderId = request.folderId();
if(m_folderId == -1)
{
QString errorStr = QStringLiteral("Not able to start PDF download. Folder id not valid.");
ERROR_LOG() << errorStr;
ERROR_LOG(m_logger) << errorStr;
m_ocPdfDownloadReply.errorString(errorStr.toStdString());
m_fts->ocPdfDownloadReply(m_ocPdfDownloadCookie, m_ocPdfDownloadReply);
return;
@@ -228,7 +228,7 @@ void HandlerPdfDownload::onOcPdfDownloadRequest(const rti::core::SampleIdentity
if (m_hostname.isEmpty())
{
QString errorStr = QStringLiteral("Not able to start PDF download. Hostname not set.");
ERROR_LOG() << errorStr;
ERROR_LOG(m_logger) << errorStr;
m_ocPdfDownloadReply.errorString(errorStr.toStdString());
m_fts->ocPdfDownloadReply(m_ocPdfDownloadCookie, m_ocPdfDownloadReply);
return;
@@ -255,7 +255,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
auto remoteDbIfc = remoteDb->db();
const QString dir = QStringLiteral("%1/OcPdf/%2/").arg(QDir::tempPath()).arg(m_operatorName);
DEBUG_LOG()<<" export path: "<<dir;
DEBUG_LOG(m_logger)<<" export path: "<<dir;
QDir directory(dir);
if(!directory.exists())
directory.mkpath(dir);
@@ -266,7 +266,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
QString strm = QStringLiteral("Select id from flm.flm_folder WHERE name = '" ) + m_operatorName + QStringLiteral("' and '") +
QString::number(m_folderId) + QStringLiteral("' = ANY(path) LIMIT 1;");
DEBUG_LOG() << "folder content ID querry" << strm;
DEBUG_LOG(m_logger) << "folder content ID querry" << strm;
std::unique_ptr<NSqlQuery> query = std::unique_ptr<NSqlQuery>(new NSqlQuery(remoteDbIfc->database(), m_logger));
query->prepare(strm);
@@ -321,7 +321,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
if(idsList.isEmpty())
{
WARNING_LOG()<< " pdf files outdated! ";
WARNING_LOG(m_logger)<< " pdf files outdated! ";
return;
}
@@ -334,7 +334,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
tableName = (QStringLiteral("flm.flm_file_content"));
stmt = (QStringLiteral("SELECT id, name, file_status_id, content, last_modified FROM ") + tableName + where);
DEBUG_LOG() << "### statement: " << stmt;
DEBUG_LOG(m_logger) << "### statement: " << stmt;
query->prepare(stmt);
@@ -353,7 +353,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
if(data.fileStatusId == FileManagement::FileStatus::Deleted)
{
DEBUG_LOG()<< " skip ";
DEBUG_LOG(m_logger)<< " skip ";
continue;
}
dataVec.append(data);
@@ -362,7 +362,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
else
{
const QString errorStr = tr("Not able to export PDF.");
ERROR_LOG() << errorStr;
ERROR_LOG(m_logger) << errorStr;
m_ocPdfDownloadReply.errorString(errorStr.toStdString());
return;
}
@@ -377,7 +377,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
if(fileInfo.exists() && file.remove() == false)
{
QString err = QStringLiteral("Couldn't replace existing file: ") + data.name;
WARNING_LOG()<< err;
WARNING_LOG(m_logger)<< err;
continue;
}
@@ -395,7 +395,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
bool HandlerPdfDownload::openRemoteDbConnection(const QString &remoteDatabaseName)
{
DEBUG_LOG() <<" Open RemoteDb Connection..." ;
DEBUG_LOG(m_logger) <<" Open RemoteDb Connection..." ;
if (m_remoteDbConnection.isValid())
closeDb(m_remoteDbConnection);
@@ -420,10 +420,10 @@ QSqlDatabase HandlerPdfDownload::openDb(const QString &databaseName, bool remote
s->databaseDriver(),
remote ? m_remoteHostName : s->databaseHostname(),
remote ? Settings::remoteDbName() : databaseName);
DEBUG_LOG() << "Trying to open database " << s->databaseHostname() << ":" << databaseName;
DEBUG_LOG(m_logger) << "Trying to open database " << s->databaseHostname() << ":" << databaseName;
if (!dbConnection.isOpen())
{
ERROR_LOG() << "Error opening database " << s->databaseHostname() << ":" << databaseName;
ERROR_LOG(m_logger) << "Error opening database " << s->databaseHostname() << ":" << databaseName;
if (bOk)
*bOk = false;
}
@@ -443,7 +443,7 @@ void HandlerPdfDownload::closeDb(QSqlDatabase &dbConn)
void HandlerPdfDownload::onConnected()
{
INFO_LOG() << "Connected to WebSocket server";
INFO_LOG(m_logger) << "Connected to WebSocket server";
switch (m_currentMode)
{
@@ -458,12 +458,12 @@ void HandlerPdfDownload::onConnected()
void HandlerPdfDownload::onDisconnected()
{
INFO_LOG() << "Disconnected from server.";
INFO_LOG(m_logger) << "Disconnected from server.";
}
void HandlerPdfDownload::onNewDownloadState(int progress, const QString &msg)
{
DEBUG_LOG() << msg;
DEBUG_LOG(m_logger) << msg;
m_downloadReply.replyState(Core::FtReplyState::InProgress);
m_downloadReply.progress(progress);
m_downloadReply.currentStep(msg.toStdString());
@@ -472,7 +472,7 @@ void HandlerPdfDownload::onNewDownloadState(int progress, const QString &msg)
void HandlerPdfDownload::onAllDownloadsFinished()
{
DEBUG_LOG() << "Downloads finished";
DEBUG_LOG(m_logger) << "Downloads finished";
m_downloadReply.replyState(Core::FtReplyState::Completed);
m_downloadReply.currentStep(tr("Downloads finished").toStdString());
m_downloadReply.progress(100);
@@ -481,7 +481,7 @@ void HandlerPdfDownload::onAllDownloadsFinished()
void HandlerPdfDownload::openWebSocket()
{
DEBUG_LOG() << "Opening websocket to: " << m_hostname << ":" << m_currentPort;
DEBUG_LOG(m_logger) << "Opening websocket to: " << m_hostname << ":" << m_currentPort;
m_webSocket->open(m_hostname, m_currentPort);
}