Skip to content

Commit

Permalink
Merge pull request #251 from micromata/Release-8.1-SNAPSHOT
Browse files Browse the repository at this point in the history
Release 8.1 snapshot
  • Loading branch information
kreinhard authored Jan 1, 2025
2 parents 8e1797d + 7540b1c commit dfc418f
Show file tree
Hide file tree
Showing 2,571 changed files with 4,291 additions and 3,962 deletions.
5 changes: 2 additions & 3 deletions ToDo.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ docker system df
docker volume ls
docker volume rm <volume-name>

drop table t_fibu_orderbook_storage;
delete from t_flyway_schema_history where version = '2023.11.01';

Orderbooks importieren:
docker cp ~/ProjectForgeBackup/ProjectForge-Orderbook_*.gz projectforge-postgres:/tmp/
Expand All @@ -77,6 +79,3 @@ docker cp ~/ProjectForgeBackup/ProjectForge-Orderbook_*.gz projectforge-postgres
INSERT INTO t_fibu_orderbook_storage (date, serialized_orderbook) VALUES ('2023-11-01', pg_read_binary_file(:'file_path')::bytea);
\set file_path '/tmp/ProjectForge-Orderbook_2023-12-01.gz'
INSERT INTO t_fibu_orderbook_storage (date, serialized_orderbook) VALUES ('2023-12-01', pg_read_binary_file(:'file_path')::bytea);


SELECT date, octet_length(serialized_orderbook) AS byte_count FROM t_fibu_orderbook_storage;
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ commons-io = "2.16.1"
de-micromata-merlin = "1.1.16"
io-dropwizard-metrics-core = "4.2.26"
io-spring-dependency-management = "1.1.6" # io.spring.dependency-management.gradle.plugin
fr-opensagres-xdocreport-poi-xwpf-converter-pdf = "2.0.4"
fr-opensagres-xdocreport-poi-xwpf-converter-pdf = "2.1.0"
jakarta-activation-api = "2.1.3"
jakarta-annotation-api = "3.0.0"
org-eclipse-angus-jakarta-mail = "2.0.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/////////////////////////////////////////////////////////////////////////////
//
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
// This community edition is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published
// by the Free Software Foundation; version 3 of the License.
//
// This community edition is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, see http://www.gnu.org/licenses/.
//
/////////////////////////////////////////////////////////////////////////////

package org.projectforge.plugins.datatransfer

import jakarta.annotation.PostConstruct
import org.projectforge.business.jobs.CronSanityCheckJob
import org.projectforge.framework.jcr.AttachmentsService
import org.projectforge.jobs.AbstractJob
import org.projectforge.jobs.JobExecutionContext
import org.projectforge.plugins.datatransfer.rest.DataTransferAreaPagesRest
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

@Service
class DataTransferSanityCheckJob : AbstractJob("Check data transfer files.") {
@Autowired
private lateinit var attachmentsService: AttachmentsService

@Autowired
private lateinit var dataTransferAreaDao: DataTransferAreaDao

@Autowired
private lateinit var dataTransferAreaPagesRest: DataTransferAreaPagesRest

@Autowired
private lateinit var cronSanityCheckJob: CronSanityCheckJob

@PostConstruct
private fun postConstruct() {
cronSanityCheckJob.registerJob(this)
}

override fun execute(jobContext: JobExecutionContext) {
var areaCounter = 0
var missingInJcrCounter = 0
var orphanedCounter = 0
dataTransferAreaDao.selectAll(checkAccess = false).forEach { area ->
++areaCounter
val areaName = "'${area.displayName}'"
try {
val attachments = attachmentsService.getAttachments(
dataTransferAreaPagesRest.jcrPath!!,
area.id!!,
dataTransferAreaPagesRest.attachmentsAccessChecker,
checkAccess = false,
)
val attachmentsCounter = area.attachmentsCounter ?: 0
if (attachmentsCounter == 0 && attachments.isNullOrEmpty()) {
// No attachments given/expected, nothing to check.
return@forEach
}
jobContext.addMessage("Checking data transfer area $areaName with ${attachmentsCounter} attachments.")
attachments?.forEach { attachment ->
if (attachment.size == 0L) {
jobContext.addWarning("Empty attachment ${attachment.name} in area $areaName.")
}
}
if (attachmentsCounter != attachments?.size) {
jobContext.addWarning("Attachments counter in area $areaName is ${attachmentsCounter}, but found ${attachments?.size} attachments.")
}
val areaAttachmentIds = area.attachmentsIds?.split(" ")?.filter { it.isNotBlank() } ?: emptyList()
val jcrAttachmentIds = attachments?.map { it.fileId.toString() } ?: emptyList()
val missingInJcr = areaAttachmentIds - jcrAttachmentIds
val unknown = jcrAttachmentIds - areaAttachmentIds
if (missingInJcr.isNotEmpty()) {
jobContext.addError("${missingInJcr.size}/$attachmentsCounter attachments missing in JCR for area $areaName: ${missingInJcr.joinToString()}")
missingInJcrCounter += missingInJcr.size
}
if (unknown.isNotEmpty()) {
jobContext.addWarning("${unknown.size} unknown (orphaned) attachments in JCR for area $areaName: ${unknown.joinToString()}")
orphanedCounter += unknown.size
}
} catch (ex: Exception) {
jobContext.addWarning("Error while checking data transfer area $areaName: ${ex.message}")
}
}
if (missingInJcrCounter > 0 || orphanedCounter > 0) {
jobContext.addError("Checked $areaCounter data transfer areas: $missingInJcrCounter missed, $orphanedCounter orphaned attachments.")
}
jobContext.addMessage("Checked $areaCounter data transfer areas.")
}
}
Loading

0 comments on commit dfc418f

Please sign in to comment.