FOP-Config: Projektspezifischer Konfigurationsordner und erweitertes Logging
- Project-Modell um optionales fop_config_dir Feld erweitert - TransformationJob verwendet nun projektspezifischen FOP-Config-Pfad - Saxon und FOP stdout/stderr werden nun im Debug-Level geloggt - UI-Elemente für FOP-Config-Ordner-Auswahl hinzugefügt - AppSettings und MainWindow unterstützen neues Feld beim Laden/Speichern 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
+20
-1
@@ -35,6 +35,7 @@ class TransformationJob:
|
||||
diff_pdf_path: Path,
|
||||
diff_pdf_params: list[str],
|
||||
xsl_id: tuple | None = None,
|
||||
fop_config_dir: Path | None = None,
|
||||
):
|
||||
"""
|
||||
Initialisiert einen Transformations-Job.
|
||||
@@ -50,6 +51,7 @@ class TransformationJob:
|
||||
diff_pdf_path: Pfad zur diff-pdf Binary
|
||||
diff_pdf_params: Standard-Parameter für diff-pdf
|
||||
xsl_id: ID der XSL-Datei (als Tuple)
|
||||
fop_config_dir: Optionaler Pfad zum FOP-Config-Verzeichnis (überschreibt Standardpfad)
|
||||
"""
|
||||
self.project_dir = project_dir
|
||||
self.xml_file = xml_file # Relativ
|
||||
@@ -61,6 +63,7 @@ class TransformationJob:
|
||||
self.java_vm_path = java_vm_path
|
||||
self.saxon_jar_path = saxon_jar_path
|
||||
self.apache_fop_dir = apache_fop_dir
|
||||
self.fop_config_dir = fop_config_dir
|
||||
self.diff_pdf_path = diff_pdf_path
|
||||
self.diff_pdf_params = diff_pdf_params
|
||||
|
||||
@@ -98,7 +101,11 @@ class TransformationJob:
|
||||
else:
|
||||
self.fop_cmd = self.apache_fop_dir / "fop"
|
||||
|
||||
self.fop_conf = self.apache_fop_dir / "conf" / "fop.xconf"
|
||||
# FOP-Konfigurationsdatei: Verwende fop_config_dir falls angegeben, sonst Standardpfad
|
||||
if self.fop_config_dir:
|
||||
self.fop_conf = self.fop_config_dir / "fop.xconf"
|
||||
else:
|
||||
self.fop_conf = self.apache_fop_dir / "conf" / "fop.xconf"
|
||||
|
||||
def is_up_to_date(self) -> bool:
|
||||
"""
|
||||
@@ -200,6 +207,12 @@ class TransformationJob:
|
||||
timeout=120, # 2 Minuten Timeout
|
||||
)
|
||||
|
||||
# Saxon Ausgaben loggen
|
||||
if result.stdout:
|
||||
logger.debug(f"Saxon StdOut:\n{result.stdout}")
|
||||
if result.stderr:
|
||||
logger.debug(f"Saxon StdErr:\n{result.stderr}")
|
||||
|
||||
if result.returncode == 0:
|
||||
logger.info(f"Saxon-Transformation erfolgreich: {self.xml_file.name}")
|
||||
return True, "Erfolgreich"
|
||||
@@ -266,6 +279,12 @@ class TransformationJob:
|
||||
timeout=180, # 3 Minuten Timeout
|
||||
)
|
||||
|
||||
# Apache FOP Ausgaben loggen
|
||||
if result.stdout:
|
||||
logger.debug(f"FOP StdOut:\n{result.stdout}")
|
||||
if result.stderr:
|
||||
logger.debug(f"FOP StdErr:\n{result.stderr}")
|
||||
|
||||
# Temporäre FO-Datei löschen
|
||||
if self.temp_fo.exists():
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user