From 8ba358fc936b9d3721aa1fea64a4c00eaaa347a4 Mon Sep 17 00:00:00 2001 From: ulrich Date: Tue, 12 Jan 2021 23:18:10 +0000 Subject: [PATCH] Uebertragung Breadcrumb angefangen, noch in Arbeit --- src/java/de/uhilger/filecms/api/HtmlExportService.java | 36 ++++++++++++++++++++++++++++++------ 1 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/java/de/uhilger/filecms/api/HtmlExportService.java b/src/java/de/uhilger/filecms/api/HtmlExportService.java index b65cc15..9dbee4a 100644 --- a/src/java/de/uhilger/filecms/api/HtmlExportService.java +++ b/src/java/de/uhilger/filecms/api/HtmlExportService.java @@ -20,11 +20,7 @@ package de.uhilger.filecms.api; -import de.uhilger.filecms.data.Bild; -import java.awt.Container; -import java.awt.Image; -import java.awt.MediaTracker; -import java.awt.Toolkit; +import de.uhilger.wbx.Bild; import java.io.BufferedReader; import java.io.File; import java.io.FileFilter; @@ -34,6 +30,7 @@ import java.io.PrintWriter; import java.util.logging.Level; import java.util.logging.Logger; +import net.coobird.thumbnailator.Thumbnails; import org.apache.commons.io.FileUtils; /** @@ -99,6 +96,7 @@ String line = br.readLine(); while(line != null) { w.print(line.replace("htmi", "html")); + w.print("\r\n"); line = br.readLine(); } printFooter(w); @@ -132,6 +130,17 @@ FileUtils.copyFile(stile, new File(outDir, "stile.css"), true); } buildThumbnailImages(outDir, new Bild()); + + File lbDir = new File(catalinaBase, "webapps/jslib/lightbox/"); + FileUtils.copyDirectoryToDirectory(lbDir, outDir); + + File jqDir = new File(catalinaBase, "webapps/jslib/jquery/"); + FileUtils.copyDirectoryToDirectory(jqDir, outDir); + + File lbimgDir = new File(catalinaBase, "webapps/jslib/lightbox/img"); + FileUtils.copyDirectoryToDirectory(lbimgDir, outDir); + + result = "Export nach HTML ausgefuehrt."; } catch (IOException ex) { result = ex.getLocalizedMessage(); @@ -178,6 +187,17 @@ } String outFileName = new File(dir, tnFileName.toString()).getAbsolutePath(); logger.fine("outFileName: " + outFileName); + + try { + Thumbnails.of(absPath) + .size(bild.getVariantenGroesse(Bild.WINZIG), bild.getVariantenGroesse(Bild.WINZIG)) + .keepAspectRatio(true) + .outputQuality(0.7) + .toFile(outFileName); + } catch (IOException ex) { + logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex); + } + /* Image image = Toolkit.getDefaultToolkit().getImage(absPath); MediaTracker mediaTracker = new MediaTracker(new Container()); mediaTracker.addImage(image, 0); @@ -191,7 +211,8 @@ } } catch (InterruptedException | IOException ex) { logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex); - } + } + */ } } } else { @@ -243,11 +264,14 @@ out.print("<!DOCTYPE html><html><head>\r\n"); out.print("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>"); out.print("<link rel=\"stylesheet\" type=\"text/css\" href=\"bootstrap.min.css\">\r\n"); + out.print("<link rel=\"stylesheet\" type=\"text/css\" href=\"lightbox/lightbox.css\">\r\n"); out.print("<link rel=\"stylesheet\" type=\"text/css\" href=\"stile.css\">\r\n"); out.print("</head><body class=\"p-3\">\r\n"); } private void printFooter(PrintWriter out) throws IOException { + out.print("<script src=\"jquery/jquery.min.js\"></script>\r\n"); + out.print("<script src=\"lightbox/lightbox.min.js\"></script>\r\n"); out.print("</body></html>"); } -- Gitblit v1.9.3