fix: Task-Typen und Export für App-Kompatibilität korrigiert

Historische Typnummern angeglichen und base_type für benutzerdefinierte Tasks ergänzt. React im Vaadin-Dev-Modus deaktiviert und Lockdatei bereinigt. Version auf 0.9.3 und Docker-Image auf wfe aktualisiert sowie Windows-Zeilenenden im Maven-Wrapper übernommen.
This commit is contained in:
Sven committed 2026-10-07 13:46:05 +02:00
1 parent 525e775d1c
commit 93ba40c476
10 files changed
+243 -1104

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@
set -euo pipefail set -euo pipefail
readonly SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" readonly SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
readonly REGISTRY_IMAGE="registry.assecutor.org/ait" readonly REGISTRY_IMAGE="registry.assecutor.org/wfe"
readonly BACKEND_DIR="${SCRIPT_DIR}" readonly BACKEND_DIR="${SCRIPT_DIR}"
usage() { usage() {
Vendored
+189 -189
View File
@@ -1,189 +1,189 @@
<# : batch portion <# : batch portion
@REM ---------------------------------------------------------------------------- @REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one @REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file @REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information @REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file @REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the @REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance @REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at @REM with the License. You may obtain a copy of the License at
@REM @REM
@REM http://www.apache.org/licenses/LICENSE-2.0 @REM http://www.apache.org/licenses/LICENSE-2.0
@REM @REM
@REM Unless required by applicable law or agreed to in writing, @REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an @REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the @REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations @REM specific language governing permissions and limitations
@REM under the License. @REM under the License.
@REM ---------------------------------------------------------------------------- @REM ----------------------------------------------------------------------------
@REM ---------------------------------------------------------------------------- @REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.4 @REM Apache Maven Wrapper startup batch script, version 3.3.4
@REM @REM
@REM Optional ENV vars @REM Optional ENV vars
@REM MVNW_REPOURL - repo url base for downloading maven distribution @REM MVNW_REPOURL - repo url base for downloading maven distribution
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven @REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output @REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ---------------------------------------------------------------------------- @REM ----------------------------------------------------------------------------
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) @IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__= @SET __MVNW_CMD__=
@SET __MVNW_ERROR__= @SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% @SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath= @SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( @FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
) )
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% @SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE= @SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__= @SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME= @SET MVNW_USERNAME=
@SET MVNW_PASSWORD= @SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" ("%__MVNW_CMD__%" %*) @IF NOT "%__MVNW_CMD__%"=="" ("%__MVNW_CMD__%" %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1 @echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF @GOTO :EOF
: end batch / begin powershell #> : end batch / begin powershell #>
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") { if ($env:MVNW_VERBOSE -eq "true") {
$VerbosePreference = "Continue" $VerbosePreference = "Continue"
} }
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties # calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl $distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) { if (!$distributionUrl) {
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
} }
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
"maven-mvnd-*" { "maven-mvnd-*" {
$USE_MVND = $true $USE_MVND = $true
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
$MVN_CMD = "mvnd.cmd" $MVN_CMD = "mvnd.cmd"
break break
} }
default { default {
$USE_MVND = $false $USE_MVND = $false
$MVN_CMD = $script -replace '^mvnw','mvn' $MVN_CMD = $script -replace '^mvnw','mvn'
break break
} }
} }
# apply MVNW_REPOURL and calculate MAVEN_HOME # apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash> # maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) { if ($env:MVNW_REPOURL) {
$MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" } $MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')" $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')"
} }
$distributionUrlName = $distributionUrl -replace '^.*/','' $distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' $distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
$MAVEN_M2_PATH = "$HOME/.m2" $MAVEN_M2_PATH = "$HOME/.m2"
if ($env:MAVEN_USER_HOME) { if ($env:MAVEN_USER_HOME) {
$MAVEN_M2_PATH = "$env:MAVEN_USER_HOME" $MAVEN_M2_PATH = "$env:MAVEN_USER_HOME"
} }
if (-not (Test-Path -Path $MAVEN_M2_PATH)) { if (-not (Test-Path -Path $MAVEN_M2_PATH)) {
New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null
} }
$MAVEN_WRAPPER_DISTS = $null $MAVEN_WRAPPER_DISTS = $null
if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) { if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) {
$MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists" $MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists"
} else { } else {
$MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists" $MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists"
} }
$MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain" $MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain"
$MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' $MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" $MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
exit $? exit $?
} }
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
} }
# prepare tmp dir # prepare tmp dir
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile $TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" $TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null $TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
trap { trap {
if ($TMP_DOWNLOAD_DIR.Exists) { if ($TMP_DOWNLOAD_DIR.Exists) {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
} }
} }
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
# Download and Install Apache Maven # Download and Install Apache Maven
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
Write-Verbose "Downloading from: $distributionUrl" Write-Verbose "Downloading from: $distributionUrl"
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
$webclient = New-Object System.Net.WebClient $webclient = New-Object System.Net.WebClient
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
} }
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null $webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
# If specified, validate the SHA-256 sum of the Maven distribution zip file # If specified, validate the SHA-256 sum of the Maven distribution zip file
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum $distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
if ($distributionSha256Sum) { if ($distributionSha256Sum) {
if ($USE_MVND) { if ($USE_MVND) {
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
} }
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
} }
} }
# unzip and move # unzip and move
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
# Find the actual extracted directory name (handles snapshots where filename != directory name) # Find the actual extracted directory name (handles snapshots where filename != directory name)
$actualDistributionDir = "" $actualDistributionDir = ""
# First try the expected directory name (for regular distributions) # First try the expected directory name (for regular distributions)
$expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain" $expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain"
$expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD" $expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD"
if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) { if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) {
$actualDistributionDir = $distributionUrlNameMain $actualDistributionDir = $distributionUrlNameMain
} }
# If not found, search for any directory with the Maven executable (for snapshots) # If not found, search for any directory with the Maven executable (for snapshots)
if (!$actualDistributionDir) { if (!$actualDistributionDir) {
Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object { Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object {
$testPath = Join-Path $_.FullName "bin/$MVN_CMD" $testPath = Join-Path $_.FullName "bin/$MVN_CMD"
if (Test-Path -Path $testPath -PathType Leaf) { if (Test-Path -Path $testPath -PathType Leaf) {
$actualDistributionDir = $_.Name $actualDistributionDir = $_.Name
} }
} }
} }
if (!$actualDistributionDir) { if (!$actualDistributionDir) {
Write-Error "Could not find Maven distribution directory in extracted archive" Write-Error "Could not find Maven distribution directory in extracted archive"
} }
Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir" Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir"
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -NewName $MAVEN_HOME_NAME | Out-Null Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -NewName $MAVEN_HOME_NAME | Out-Null
try { try {
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
} catch { } catch {
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
Write-Error "fail to move MAVEN_HOME" Write-Error "fail to move MAVEN_HOME"
} }
} finally { } finally {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
} }
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
-893
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -13,7 +13,7 @@
<groupId>de.assecutor</groupId> <groupId>de.assecutor</groupId>
<artifactId>tasklist-editor</artifactId> <artifactId>tasklist-editor</artifactId>
<version>0.9.2</version> <version>0.9.3</version>
<name>TaskList Editor</name> <name>TaskList Editor</name>
<description>n8n-inspired editor for task list workflows</description> <description>n8n-inspired editor for task list workflows</description>
@@ -55,13 +55,17 @@ public class BlockTypeRegistry {
List.of() List.of()
)); ));
// Die Typnummern 2–11 entsprechen der historischen Task-Typ-Belegung
// der stadtbote-App (2 = Unterschrift, 3 = Ankunft, 4 = Fotos,
// 5 = Barcode, 7–9 = Texteingaben, 11 = Statusauswahl). Neue, im
// Editor eingeführte Typen werden ab 12 aufsteigend nummeriert.
register(new BlockType( register(new BlockType(
"ankunft-melden", "ankunft-melden",
"Ankunft melden", "Ankunft melden",
"Erfasst die Ankunft am Einsatzort (Bestätigungsschaltfläche).", "Erfasst die Ankunft am Einsatzort (Bestätigungsschaltfläche).",
"vaadin:map-marker", "vaadin:map-marker",
"#2563eb", "#2563eb",
1, 3,
1, 1, 1, 1,
List.of( List.of(
PropertyDefinition.bool("track", "GPS-Position erfassen", true), PropertyDefinition.bool("track", "GPS-Position erfassen", true),
@@ -92,7 +96,7 @@ public class BlockTypeRegistry {
"Nimmt eine Anzahl von Fotos auf.", "Nimmt eine Anzahl von Fotos auf.",
"vaadin:camera", "vaadin:camera",
"#059669", "#059669",
3, 4,
1, 1, 1, 1,
List.of( List.of(
PropertyDefinition.number("min", "Mindestanzahl Fotos", 1), PropertyDefinition.number("min", "Mindestanzahl Fotos", 1),
@@ -155,7 +159,7 @@ public class BlockTypeRegistry {
"Einfache Bestätigung per Häkchen ohne weitere Eingabe.", "Einfache Bestätigung per Häkchen ohne weitere Eingabe.",
"vaadin:check-square-o", "vaadin:check-square-o",
"#16a34a", "#16a34a",
6, 12,
1, 1, 1, 1,
List.of( List.of(
PropertyDefinition.bool("opt", "Optionale Aufgabe", false), PropertyDefinition.bool("opt", "Optionale Aufgabe", false),
@@ -194,17 +198,16 @@ public class BlockTypeRegistry {
) )
)); ));
// Listen-Tasks: erfassen mehrerer gleichartiger Werte. Die Anzahl wird // Listen-Tasks: erfassen mehrerer gleichartiger Werte über
// analog zu "Fotos aufnehmen" über min/max gesteuert. Diese Typen haben // vordefinierte Eingabefelder. Wie alle im Editor neu eingeführten
// (noch) keinen Handler in der stadtbote-App und liegen daher oberhalb // Typen liegen sie oberhalb des historischen App-Bereichs (2–11).
// des dort genutzten Bereichs (1–11).
register(new BlockType( register(new BlockType(
"text-liste-erfassen", "text-liste-erfassen",
"Liste von Texten erfassen", "Liste von Texten erfassen",
"Erfasst mehrere Texteinträge über vordefinierte Eingabefelder.", "Erfasst mehrere Texteinträge über vordefinierte Eingabefelder.",
"vaadin:lines-list", "vaadin:lines-list",
"#4338ca", "#4338ca",
12, 13,
1, 1, 1, 1,
List.of( List.of(
PropertyDefinition.fieldList("fields", "Textfelder (Titel + Platzhalter)"), PropertyDefinition.fieldList("fields", "Textfelder (Titel + Platzhalter)"),
@@ -218,7 +221,7 @@ public class BlockTypeRegistry {
"Erfasst mehrere numerische Werte über vordefinierte Eingabefelder.", "Erfasst mehrere numerische Werte über vordefinierte Eingabefelder.",
"vaadin:list-ol", "vaadin:list-ol",
"#0369a1", "#0369a1",
13, 14,
1, 1, 1, 1,
List.of( List.of(
PropertyDefinition.fieldList("fields", "Zahlenfelder (Titel + Platzhalter)"), PropertyDefinition.fieldList("fields", "Zahlenfelder (Titel + Platzhalter)"),
@@ -232,7 +235,7 @@ public class BlockTypeRegistry {
"Lässt mehrere vordefinierte Optionen per Checkbox ankreuzen.", "Lässt mehrere vordefinierte Optionen per Checkbox ankreuzen.",
"vaadin:tasks", "vaadin:tasks",
"#15803d", "#15803d",
14, 15,
1, 1, 1, 1,
List.of( List.of(
PropertyDefinition.nameList("entries", "Name der Checkboxen"), PropertyDefinition.nameList("entries", "Name der Checkboxen"),
@@ -266,7 +269,7 @@ public class BlockTypeRegistry {
return Optional.ofNullable(types.get(id)); return Optional.ofNullable(types.get(id));
} }
/** Die festen Standard-Typen (Typnummer 1–8), auf denen eigene Typen aufbauen. */ /** Die festen Standard-Typen (Typnummer < 1000), auf denen eigene Typen aufbauen. */
public List<BlockType> baseTypes() { public List<BlockType> baseTypes() {
return types.values().stream() return types.values().stream()
.filter(t -> t.taskType() >= 1 && t.taskType() < CUSTOM_TYPE_START) .filter(t -> t.taskType() >= 1 && t.taskType() < CUSTOM_TYPE_START)
@@ -16,7 +16,7 @@ import java.util.List;
* erscheinen. * erscheinen.
*/ */
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({"s_id", "type", "topic", "opt", "reenter", "min", "max", @JsonPropertyOrder({"s_id", "type", "base_type", "topic", "opt", "reenter", "min", "max",
"max_len", "rt", "track", "txt", "task_arrival", "task_fin_work", "entries", "choices", "fields", "script"}) "max_len", "rt", "track", "txt", "task_arrival", "task_fin_work", "entries", "choices", "fields", "script"})
public class TaskDto { public class TaskDto {
@@ -25,6 +25,15 @@ public class TaskDto {
private int type; private int type;
/**
* Typnummer des Basis-Typs bei benutzerdefinierten Typen
* ({@code type >= }{@link BlockTypeRegistry#CUSTOM_TYPE_START}); die App
* stellt solche Tasks wie ihren Basis-Typ dar. Bei Standard-Typen
* {@code null} und damit nicht im JSON enthalten.
*/
@JsonProperty("base_type")
private Integer baseType;
private String topic; private String topic;
private Boolean opt; private Boolean opt;
@@ -47,10 +56,10 @@ public class TaskDto {
private List<TaskEntryDto> entries; private List<TaskEntryDto> entries;
/** Auswahloptionen eines Status-Tasks (Typ 6). */ /** Auswahloptionen eines Status-Tasks (Typ 11). */
private List<ChoiceDto> choices; private List<ChoiceDto> choices;
/** Eingabefelder eines Listen-Text-Tasks (Typ 12). */ /** Eingabefelder einer Text-/Zahlen-Liste (Typ 13/14). */
private List<FieldDto> fields; private List<FieldDto> fields;
/** Logik-Graph eines Script-Blocks (Drawflow-Definition als JSON). */ /** Logik-Graph eines Script-Blocks (Drawflow-Definition als JSON). */
@@ -72,6 +81,14 @@ public class TaskDto {
this.type = type; this.type = type;
} }
public Integer getBaseType() {
return baseType;
}
public void setBaseType(Integer baseType) {
this.baseType = baseType;
}
public String getTopic() { public String getTopic() {
return topic; return topic;
} }
@@ -32,9 +32,11 @@ import java.util.Set;
public class TaskListExporter { public class TaskListExporter {
private final ObjectMapper objectMapper; private final ObjectMapper objectMapper;
private final BlockTypeRegistry registry;
public TaskListExporter(ObjectMapper objectMapper) { public TaskListExporter(ObjectMapper objectMapper, BlockTypeRegistry registry) {
this.objectMapper = objectMapper; this.objectMapper = objectMapper;
this.registry = registry;
} }
public List<TaskDto> export(String drawflowJson, Map<Integer, BlockInstance> instances) { public List<TaskDto> export(String drawflowJson, Map<Integer, BlockInstance> instances) {
@@ -225,6 +227,13 @@ public class TaskListExporter {
private TaskDto toTask(BlockInstance instance) { private TaskDto toTask(BlockInstance instance) {
TaskDto task = new TaskDto(); TaskDto task = new TaskDto();
task.setType(instance.type().taskType()); task.setType(instance.type().taskType());
// Benutzerdefinierte Typen verhalten sich in der App wie ihr
// Basis-Typ; dessen Typnummer wird als base_type mit exportiert.
if (instance.type().taskType() >= BlockTypeRegistry.CUSTOM_TYPE_START
&& instance.type().baseTypeId() != null) {
registry.find(instance.type().baseTypeId())
.ifPresent(base -> task.setBaseType(base.taskType()));
}
String topic = instance.topic(); String topic = instance.topic();
task.setTopic(topic == null || topic.isBlank() ? instance.type().label() : topic); task.setTopic(topic == null || topic.isBlank() ? instance.type().label() : topic);
@@ -64,7 +64,7 @@ public class TaskListImporter {
private Map<String, Object> valuesFor(BlockType type, TaskDto task) { private Map<String, Object> valuesFor(BlockType type, TaskDto task) {
Map<String, Object> values = new LinkedHashMap<>(); Map<String, Object> values = new LinkedHashMap<>();
for (PropertyDefinition def : type.properties()) { for (PropertyDefinition def : type.properties()) {
// Listen-Eigenschaften (Typ 12–14) werden anhand ihres // Listen-Eigenschaften (Typ 13–15) werden anhand ihres
// Property-Typs in die vom Zeilen-Editor erwartete Struktur // Property-Typs in die vom Zeilen-Editor erwartete Struktur
// (Liste aus {title}/{title,placeholder}-Maps) zurückgewandelt. // (Liste aus {title}/{title,placeholder}-Maps) zurückgewandelt.
Object value = switch (def.type()) { Object value = switch (def.type()) {
@@ -95,7 +95,7 @@ public class TaskListImporter {
}; };
} }
/** {@code fields}-Array (Typ 12/13) zurück in Zeilen mit Titel + Platzhalter. */ /** {@code fields}-Array (Typ 13/14) zurück in Zeilen mit Titel + Platzhalter. */
private List<Map<String, Object>> fieldRows(TaskDto task) { private List<Map<String, Object>> fieldRows(TaskDto task) {
List<Map<String, Object>> rows = new ArrayList<>(); List<Map<String, Object>> rows = new ArrayList<>();
if (task.getFields() == null) { if (task.getFields() == null) {
@@ -111,7 +111,7 @@ public class TaskListImporter {
return rows; return rows;
} }
/** {@code entries}-Array (Typ 14) zurück in Zeilen mit Namen ({@code title}). */ /** {@code entries}-Array (Typ 15) zurück in Zeilen mit Namen ({@code title}). */
private List<Map<String, Object>> entryRows(TaskDto task) { private List<Map<String, Object>> entryRows(TaskDto task) {
List<Map<String, Object>> rows = new ArrayList<>(); List<Map<String, Object>> rows = new ArrayList<>();
if (task.getEntries() == null) { if (task.getEntries() == null) {
@@ -230,9 +230,9 @@ public class WorkflowAssistantService {
(boolean) erlaubt erneutes Bearbeiten. (boolean) erlaubt erneutes Bearbeiten.
- Listenfelder: - Listenfelder:
* "fields": Array aus {"title": "...", "placeholder": "...", "required": true|false} * "fields": Array aus {"title": "...", "placeholder": "...", "required": true|false}
(Text-/Zahlenlisten, Typ 12/13). (Text-/Zahlenlisten, Typ 13/14).
* "entries": Array aus {"code": <fortlaufend ab 1>, "text": "...", "required": true|false} * "entries": Array aus {"code": <fortlaufend ab 1>, "text": "...", "required": true|false}
(Checkbox-Liste, Typ 14). (Checkbox-Liste, Typ 15).
* "choices": Array aus {"txt": "...", "ret": <fortlaufend ab 1>} * "choices": Array aus {"txt": "...", "ret": <fortlaufend ab 1>}
(Statusauswahl, Typ 11). (Statusauswahl, Typ 11).
Kennzeichne Einträge nur dann mit "required": true, wenn der Benutzer sie Kennzeichne Einträge nur dann mit "required": true, wenn der Benutzer sie
@@ -6,6 +6,9 @@ tasklist.app-version=@project.version@
vaadin.launch-browser=true vaadin.launch-browser=true
vaadin.allowed-packages=de.assecutor.tasklisteditor vaadin.allowed-packages=de.assecutor.tasklisteditor
# Lit-/Router-Modus statt React (muss zum reactEnable=false im pom.xml passen,
# damit der Dev-Modus beim IDE-Start kein React-Frontend generiert).
vaadin.react.enable=false
management.endpoints.web.exposure.include=health,info management.endpoints.web.exposure.include=health,info
management.endpoint.health.probes.enabled=true management.endpoint.health.probes.enabled=true