branch develop updated (0d405ec6 -> c8ade991)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git from 0d405ec6 fixes #10003 : Plus derepérage dans la liste après déplacer ou archiver new e5bf0e55 Clean code new 0d4320c4 fixes #10015 new 56f21e52 fixes #10016 new a56782c1 fixes #10016 new ab1327b6 fiwes an out of bound exception new c8ade991 fixes #10015 The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit c8ade99126087b65d042a760b62f42a9e3abb96b Author: jcouteau <couteau@codelutin.com> Date: Mon Jul 9 18:24:11 2018 +0200 fixes #10015 commit ab1327b698181967d29efffd39922b98ea9ed3f9 Author: jcouteau <couteau@codelutin.com> Date: Mon Jul 9 17:24:05 2018 +0200 fiwes an out of bound exception commit a56782c1db07aa368f91188eaf2a839cc7a11653 Author: jcouteau <couteau@codelutin.com> Date: Fri Jul 6 16:51:45 2018 +0200 fixes #10016 commit 56f21e525a7060af979b0e3b858dc5a533b1e270 Author: jcouteau <couteau@codelutin.com> Date: Fri Jul 6 16:13:30 2018 +0200 fixes #10016 commit 0d4320c436f02e3282750521d9ebf99eb0dc28b7 Author: jcouteau <couteau@codelutin.com> Date: Fri Jul 6 14:19:06 2018 +0200 fixes #10015 commit e5bf0e55a192af2f78ad4a1434250aaded2946a0 Author: jcouteau <couteau@codelutin.com> Date: Thu Jul 5 15:23:04 2018 +0200 Clean code Summary of changes: .../services/service/EmailServiceImpl.java | 12 +- .../services/service/EmailServiceTest.java | 21 +- .../src/test/resources/emails/test10015-2.eml | 254 +++++++++++++++++++++ .../src/test/resources/emails/test10015.eml | 152 ++++++++++++ .../ui/swing/content/demande/DemandeUIHandler.java | 31 ++- .../demande/actions/LoadFolderEmailsAction.java | 4 +- .../faxtomail/web/job/MailFilterJob.java | 6 - 7 files changed, 464 insertions(+), 16 deletions(-) create mode 100644 faxtomail-service/src/test/resources/emails/test10015-2.eml create mode 100644 faxtomail-service/src/test/resources/emails/test10015.eml -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit e5bf0e55a192af2f78ad4a1434250aaded2946a0 Author: jcouteau <couteau@codelutin.com> Date: Thu Jul 5 15:23:04 2018 +0200 Clean code --- .../main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java b/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java index d4fb8df5..e5d2908a 100644 --- a/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java +++ b/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java @@ -42,7 +42,6 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.decorator.Decorator; -import org.nuiton.topia.persistence.TopiaEntity; import org.nuiton.util.FileUtil; import org.quartz.DisallowConcurrentExecution; import org.quartz.JobExecutionContext; @@ -50,7 +49,6 @@ import org.quartz.JobExecutionException; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.rendering.PDFRenderer; -import javax.imageio.ImageIO; import javax.mail.Address; import javax.mail.Flags; import javax.mail.Folder; @@ -60,11 +58,8 @@ import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Store; import javax.mail.internet.MimeMessage; -import javax.sql.rowset.serial.SerialBlob; import java.awt.image.BufferedImage; -import java.io.ByteArrayOutputStream; import java.nio.charset.Charset; -import java.sql.Blob; import java.text.DateFormat; import java.util.ArrayList; import java.util.Arrays; @@ -73,7 +68,6 @@ import java.util.Date; import java.util.Enumeration; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Properties; import java.util.Set; -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit 0d4320c436f02e3282750521d9ebf99eb0dc28b7 Author: jcouteau <couteau@codelutin.com> Date: Fri Jul 6 14:19:06 2018 +0200 fixes #10015 --- .../services/service/EmailServiceImpl.java | 7 +- .../services/service/EmailServiceTest.java | 12 +- .../src/test/resources/emails/test10015.eml | 152 +++++++++++++++++++++ 3 files changed, 169 insertions(+), 2 deletions(-) diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java index 086f2af0..1efa7668 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java @@ -138,6 +138,7 @@ import java.util.Set; import java.util.UUID; import java.util.regex.Pattern; +import static org.nuiton.i18n.I18n.init; import static org.nuiton.i18n.I18n.t; /** @@ -2320,7 +2321,7 @@ public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailSe float width = image.getWidth(); float height = image.getHeight(); - // get the format of the page + // get the format of the page, deal only with width as if height is more than page size, we will got 2 or more pages... Rectangle format = PageSize.A4; if (width > PageSize.A4.getWidth() && width <= PageSize.A4.getHeight()) { if (height <= PageSize.A4.getWidth()) { @@ -2357,6 +2358,10 @@ public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailSe if (width > PageSize.A0.getWidth()) { format = PageSize.A0.rotate(); } + if (width>PageSize.A0.getHeight()) { + //Plus grand que AO paysage, on met la largeur de l'image générée pour ne pas avoir de texte coupé + format = new Rectangle(width, height); + } Node style = doc.createElement("style"); style.setTextContent("@page { size: " + format.getWidth() + "px " + format.getHeight() + "px; }"); diff --git a/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java b/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java index 071e8636..154de033 100644 --- a/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java +++ b/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java @@ -62,6 +62,7 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -344,13 +345,22 @@ public class EmailServiceTest extends AbstractFaxToMailServiceTest { testConvertHTMLToPdf("test7855"); } + /** + * Test qui ne fail jamais, mais permet de vérifier la génération de PDFs très très larges + */ + @Test + public void test10015() { + testConvertHTMLToPdf("test10015"); + + } + protected void testConvertHTMLToPdf(String emailId) { File tempDirectory = FileUtils.getTempDirectory(); try { File email = new File("src/test/resources/emails/" + emailId + ".eml"); - String emailContent = FileUtils.readFileToString(email); + String emailContent = FileUtils.readFileToString(email, Charset.defaultCharset()); Properties properties = new Properties(); // set the mail.mime.address.strict to false to avoid diff --git a/faxtomail-service/src/test/resources/emails/test10015.eml b/faxtomail-service/src/test/resources/emails/test10015.eml new file mode 100644 index 00000000..cc272fd4 --- /dev/null +++ b/faxtomail-service/src/test/resources/emails/test10015.eml @@ -0,0 +1,152 @@ +Return-Path: <jean.couteau@gmail.com> +X-Original-To: faxtomail-tests@codelutin.com +Delivered-To: faxtomail-tests@codelutin.com +Received: from localhost (localhost [127.0.0.1]) + by bihar.codelutin.com (Postfix) with ESMTP id CE8A19D8C2 + for <faxtomail-tests@codelutin.com>; Thu, 5 Jul 2018 16:37:20 +0200 (CEST) +X-Virus-Scanned: Debian amavisd-new at codelutin.com +X-Spam-Flag: NO +X-Spam-Score: -1.998 +X-Spam-Level: +X-Spam-Status: No, score=-1.998 tagged_above=-1002 required=6.31 + tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, + DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_FONT_SIZE_LARGE=0.001, + HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] + autolearn=ham autolearn_force=no +Authentication-Results: localhost (amavisd-new); dkim=pass (2048-bit key) + header.d=gmail.com +Received: from bihar.codelutin.com ([127.0.0.1]) + by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) + with LMTP id LrXN0w9JlFkA for <faxtomail-tests@codelutin.com>; + Thu, 5 Jul 2018 16:37:18 +0200 (CEST) +Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) + by bihar.codelutin.com (Postfix) with ESMTPS id 9AB4A9D8BF + for <faxtomail-tests@codelutin.com>; Thu, 5 Jul 2018 16:37:18 +0200 (CEST) +Received: by mail-lj1-f176.google.com with SMTP id a6-v6so6848556ljj.7 + for <faxtomail-tests@codelutin.com>; Thu, 05 Jul 2018 07:35:39 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=mime-version:from:date:message-id:subject:to; + bh=nkhUGLmw1BEpvYtmhNk3Q3kM0/5z7XXg4h67d0PFmmg=; + b=ZMypuxCegMSUvWhJwyPawL+3GN4esewxr+P/Y/gshVZH/xGpZE7ZNlBkKcbGxSdbxB + qWSNcBw3QWpphuYa1aZHar33W2LPW7yLip7yObdrpTz9JyWYVr8ccgQ/YUkciBa7W5P7 + VZh9A0uNsHwiBaJ0BFzsbTd9glA46b0OIUmjxK1ZiTPmRAoYQOtIguucMb8IPkoVEwCZ + 8yy3y954VfyM3tPmJ2bhbgJv3DNtjhLgmwmcuxE3LyjILWHq35xwEnrOxLR5FyXp1QWO + mS1vBs1S9jDLAgfXpaRu/M061EpywXGnICdjjiWp+Syoe9cNSH4uqlox3QFKZ/3NPoWH + h4aw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:mime-version:from:date:message-id:subject:to; + bh=nkhUGLmw1BEpvYtmhNk3Q3kM0/5z7XXg4h67d0PFmmg=; + b=qkVum8AEOzJXXYd9Qfgh2hNLcQ7jvFbfoJgBWOh3N2WhYMvXphjww+Gt2dRnqaYl4q + UJHh/9vQiacCuQahVObcORV9VNYmtNzpeevPxEOUz5wPF6FEH3CFaN/IMmw9clRR0Uoh + vAAZ8wh4xF8sfUw1LZUpjYGMqWsaut6jF9NBNE/DHIs7osUrhkIQ/2Ja+TKNuTbkZJxC + Qbnsl0wZY6yH+4lCp7xkymTzvewBhkLtP4KeJJht0ZXhxhvDdXaFPcUwgrqpkrohxgL3 + Js0uomoZL4Y1J16KJlUnoQ3K0VSS3DZ6Yi93Yz98/BadYOihfyx7OatEkEeh2LduoOtB + UuYQ== +X-Gm-Message-State: APt69E3pbWAkueb0Mtg0oFN92+R+iio0/jqONR/sfrKMV5Gsxx9Sc0zR + GQRsm+fhXkGRqy7/EO8WWerNkgXVza9ejw+/YD7wzw== +X-Google-Smtp-Source: AAOMgpdQCN4NKvA5T9PWw1mSIZAwRgP3NEHNnzQAYfyLJOshc+rGPC9M849K+dSHcsFdvpcMKeSQKe7YZjq7LBQ2ivA= +X-Received: by 2002:a2e:5d88:: with SMTP id v8-v6mr4258906lje.137.1530801338150; + Thu, 05 Jul 2018 07:35:38 -0700 (PDT) +MIME-Version: 1.0 +From: Jean Couteau <jean.couteau@gmail.com> +Date: Thu, 5 Jul 2018 16:35:26 +0200 +Message-ID: <CAPkwLvUGrFbQ-qjvYFinnK0Vp+m410U0KnweN60p9_Ds_Tu51w@mail.gmail.com> +Subject: =?UTF-8?B?bWFpbCBkw6lwYXNzZSA/?= +To: faxtomail-tests@codelutin.com +Content-Type: multipart/alternative; boundary="000000000000fb765f0570417562" + +--000000000000fb765f0570417562 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: quoted-printable + +*abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv= +wxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs= +tuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnop= +qrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm= +nopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij= +klmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg= +hijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd= +efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza= +bcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx= +yzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu= +vwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr= +stuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno= +pqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl= +mnopqrstuvwxyzabcdefghijklmnopqr* +stuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno= +pqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl= +mnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnop +*qrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl= +mnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi= +jklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef= +ghijklmnopqrstuvwxyzabcdefghij* +klmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg= +hijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd= +efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza= +bcdefghi +*jklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde= +fghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab= +cdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy= +zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv= +wxyzabcdefghijklmnopqrstuvwxyzabcdefgh* +ijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde= +fghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab= +cd +efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza= +bcdefghijklmnopqr +stuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno= +pqrstuvwxyzabcd +efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza= +bcdefghijklmnopqrstuvwxyz + +--=20 +Jean Couteau +24 rue des Tanneurs +44220 Cou=C3=ABron +FRANCE + +--000000000000fb765f0570417562 +Content-Type: text/html; charset="UTF-8" +Content-Transfer-Encoding: quoted-printable + +<div dir=3D"ltr"><b>abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc= +defghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz= +abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw= +xyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst= +uvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopq= +rstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn= +opqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk= +lmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh= +ijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde= +fghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab= +cdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy= +zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv= +wxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs= +tuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr</b>stuvwxyzabcdefghijkl= +mnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi= +jklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef= +ghijklmnopqrstuvwxyzabcdefghijklmnop<u>qrstuvwxyzabcdefghijklmnopqrstuvwxyz= +abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw= +xyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst= +uvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij</u>klm= +nopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij= +klmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg= +hijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd= +efghi<i>jklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx= +yzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu= +vwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr= +stuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno= +pqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh</i>ijklmnopqrstuvwxyzabcdefgh= +ijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde= +fghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd<font color=3D"#a64d79">= +efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza= +bcdefghijklmnopqr</font>stuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopq= +rstuvwxyzabcdefghijklmnopqrstuvwxyzabcd<font size=3D"6">efghijklmnopqrstuvw= +xyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst= +uvwxyz</font><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr" class= +=3D"gmail_signature">Jean Couteau<br>24 rue des Tanneurs<br>44220 Cou=C3=AB= +ron<br>FRANCE</div></div> + +--000000000000fb765f0570417562-- -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit 56f21e525a7060af979b0e3b858dc5a533b1e270 Author: jcouteau <couteau@codelutin.com> Date: Fri Jul 6 16:13:30 2018 +0200 fixes #10016 --- .../ui/swing/content/demande/DemandeUIHandler.java | 30 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java index f19da07d..6968f405 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java @@ -64,11 +64,14 @@ import org.nuiton.jaxx.application.swing.util.CloseableUI; import org.nuiton.util.beans.BeanMonitor; import javax.swing.*; +import javax.swing.event.AncestorEvent; +import javax.swing.event.AncestorListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.TableCellEditor; import java.awt.*; import java.awt.event.ActionEvent; +import java.awt.event.ComponentEvent; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; @@ -226,7 +229,7 @@ public class DemandeUIHandler extends AbstractFaxToMailUIHandler<DemandeUIModel, initBeanFilterableComboBox(ui.getPriorityComboBox(), getContext().getPriorityCache(), model.getPriority()); initBeanFilterableComboBox(ui.getStatusComboBox(), Arrays.asList(DemandStatus.values()), model.getDemandStatus()); - + // utilisation des etats d'attente défini pour le dossier (si défini) List<DemandType> demandTypes = new ArrayList<DemandType>(); Collection<DemandType> folderDemandTypes = getDemandTypeForFolder(folder); @@ -247,9 +250,28 @@ public class DemandeUIHandler extends AbstractFaxToMailUIHandler<DemandeUIModel, } initBeanFilterableComboBox(ui.getWaitingStateComboBox(), waitingStates, model.getWaitingState()); - final JPanel editorPanel = ui.getMailBodyPanel(); - FaxToMailUIUtil.setEmailContentInTextPane(this, model, editorPanel, getConfig()); - FaxToMailUIUtil.initScrollPaneBars(getUI().getMailBodyScrollPane()); + final JPanel mailBodyPanel = ui.getMailBodyPanel(); + FaxToMailUIUtil.setEmailContentInTextPane(this, model, mailBodyPanel, getConfig()); + final JScrollPane mailBodyScrollPane = getUI().getMailBodyScrollPane(); + FaxToMailUIUtil.initScrollPaneBars(mailBodyScrollPane); + + //resize panel, after set visible, cf. #10016 + mailBodyPanel.addAncestorListener ( new AncestorListener() + { + public void ancestorAdded ( AncestorEvent event ) + { + mailBodyPanel.setMaximumSize(new Dimension(mailBodyScrollPane.getWidth(), Integer.MAX_VALUE)); + mailBodyPanel.setPreferredSize(new Dimension(mailBodyScrollPane.getWidth(), mailBodyPanel.getHeight())); + } + + public void ancestorRemoved ( AncestorEvent event ){ + //Do nothing + } + + public void ancestorMoved ( AncestorEvent event ){ + //Do nothing + } + } ); // init table final JXTable table = ui.getRangeTable(); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit a56782c1db07aa368f91188eaf2a839cc7a11653 Author: jcouteau <couteau@codelutin.com> Date: Fri Jul 6 16:51:45 2018 +0200 fixes #10016 --- .../faxtomail/ui/swing/content/demande/DemandeUIHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java index 6968f405..3e27384b 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java @@ -260,8 +260,9 @@ public class DemandeUIHandler extends AbstractFaxToMailUIHandler<DemandeUIModel, { public void ancestorAdded ( AncestorEvent event ) { - mailBodyPanel.setMaximumSize(new Dimension(mailBodyScrollPane.getWidth(), Integer.MAX_VALUE)); - mailBodyPanel.setPreferredSize(new Dimension(mailBodyScrollPane.getWidth(), mailBodyPanel.getHeight())); + mailBodyPanel.setMaximumSize(new Dimension(mailBodyScrollPane.getWidth()-30, Integer.MAX_VALUE)); + mailBodyPanel.setPreferredSize(new Dimension(mailBodyScrollPane.getWidth()-30, mailBodyPanel.getHeight())); + mailBodyPanel.repaint(); } public void ancestorRemoved ( AncestorEvent event ){ -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit ab1327b698181967d29efffd39922b98ea9ed3f9 Author: jcouteau <couteau@codelutin.com> Date: Mon Jul 9 17:24:05 2018 +0200 fiwes an out of bound exception --- .../ui/swing/content/demande/actions/LoadFolderEmailsAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/LoadFolderEmailsAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/LoadFolderEmailsAction.java index 97e8bdd8..fa0f0964 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/LoadFolderEmailsAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/LoadFolderEmailsAction.java @@ -218,7 +218,7 @@ public class LoadFolderEmailsAction extends AbstractFaxToMailAction<DemandeListU } //si rien de sélectionné = la sélection a disparu => re-sélectionne la première ligne de l'ancienne sélection - if (dataTable.getSelectedRow() < 0 && firstSelectedRowBeforeRefresh > 0) { + if (dataTable.getSelectedRow() < 0 && firstSelectedRowBeforeRefresh > 0 && firstSelectedRowBeforeRefresh < dataTable.getRowCount()) { dataTable.addRowSelectionInterval(firstSelectedRowBeforeRefresh, firstSelectedRowBeforeRefresh); dataTable.scrollRowToVisible(firstSelectedRowBeforeRefresh); } @@ -234,7 +234,7 @@ public class LoadFolderEmailsAction extends AbstractFaxToMailAction<DemandeListU //si on retrouve pas le current email, sélectionne la ligne d'avant refresh dataTable.setRowSelectionInterval(selectedRowBeforeRefresh, selectedRowBeforeRefresh); dataTable.scrollRowToVisible(selectedRowBeforeRefresh); - } else if (selectedRowBeforeRefresh > 1 ){ + } else if (selectedRowBeforeRefresh > 1 && selectedRowBeforeRefresh<dataTable.getRowCount()+1 ){ //si pas possible sélectionne la ligne précédent la ligne d'avant refresh dataTable.setRowSelectionInterval(selectedRowBeforeRefresh-1, selectedRowBeforeRefresh-1); dataTable.scrollRowToVisible(selectedRowBeforeRefresh-1); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit c8ade99126087b65d042a760b62f42a9e3abb96b Author: jcouteau <couteau@codelutin.com> Date: Mon Jul 9 18:24:11 2018 +0200 fixes #10015 --- .../services/service/EmailServiceImpl.java | 5 +- .../services/service/EmailServiceTest.java | 9 + .../src/test/resources/emails/test10015-2.eml | 254 +++++++++++++++++++++ 3 files changed, 266 insertions(+), 2 deletions(-) diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java index 1efa7668..3704ba3d 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java @@ -105,6 +105,7 @@ import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; import javax.mail.internet.MimeUtility; +import java.awt.*; import java.awt.image.BufferedImage; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; @@ -2377,8 +2378,8 @@ public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailSe } head.appendChild(style); - // convert to pdf - ITextRenderer renderer = new ITextRenderer(); + // convert to pdf use 30 dots per point in renderer to prevent long mails to be cropped on the right, cf #10015 + ITextRenderer renderer = new ITextRenderer(30,20); renderer.setDocument(doc, null); renderer.layout(); renderer.createPDF(os); diff --git a/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java b/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java index 154de033..154141be 100644 --- a/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java +++ b/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java @@ -354,6 +354,15 @@ public class EmailServiceTest extends AbstractFaxToMailServiceTest { } + /** + * Test qui ne fail jamais, mais permet de vérifier la génération de PDFs très larges + */ + @Test + public void test10015_2() { + testConvertHTMLToPdf("test10015-2"); + + } + protected void testConvertHTMLToPdf(String emailId) { File tempDirectory = FileUtils.getTempDirectory(); diff --git a/faxtomail-service/src/test/resources/emails/test10015-2.eml b/faxtomail-service/src/test/resources/emails/test10015-2.eml new file mode 100644 index 00000000..d6bb3977 --- /dev/null +++ b/faxtomail-service/src/test/resources/emails/test10015-2.eml @@ -0,0 +1,254 @@ +From: QUINIO Michel <Michel.Quinio@franciaflex.com> +To: ff.adv.test <test.ftmFF@france-fermetures.fr> +Subject: TR: Interrogation technique +Thread-Topic: Interrogation technique +Thread-Index: AdPyZxppWv7zD2BmQKKcftpWfyPN+wlG/MdA +Date: Mon, 9 Jul 2018 12:48:01 +0000 +Message-ID: <E7C76F0CE76FA14287E830E5381C0582F3309398@S8-EXC-P01.mac-groupe.net> +References: <D847078B20AB7B41A6E84E8EAA8DEE931316E26D@APP1337.gha.kfplc.com> +In-Reply-To: <D847078B20AB7B41A6E84E8EAA8DEE931316E26D@APP1337.gha.kfplc.com> +Content-Language: fr-FR +X-MS-Has-Attach: yes +X-MS-TNEF-Correlator: +x-ms-exchange-organization-originalclientipaddress: 192.168.110.18 +x-ms-exchange-organization-originalserveripaddress: fe80::c190:40b7:ff5:893%12 +Content-Type: multipart/mixed; + boundary="_006_E7C76F0CE76FA14287E830E5381C0582F3309398S8EXCP01macgrou_" +MIME-Version: 1.0 + +--_006_E7C76F0CE76FA14287E830E5381C0582F3309398S8EXCP01macgrou_ +Content-Type: multipart/related; + boundary="_005_E7C76F0CE76FA14287E830E5381C0582F3309398S8EXCP01macgrou_"; + type="multipart/alternative" + +--_005_E7C76F0CE76FA14287E830E5381C0582F3309398S8EXCP01macgrou_ +Content-Type: multipart/alternative; + boundary="_000_E7C76F0CE76FA14287E830E5381C0582F3309398S8EXCP01macgrou_" + +--_000_E7C76F0CE76FA14287E830E5381C0582F3309398S8EXCP01macgrou_ +Content-Type: text/plain; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + + + + + +De : Prevost, Fanny [mailto:fanny.prevost@castorama.fr] +Envoy=E9 : mercredi 23 mai 2018 09:35 +=C0 : serviceclients +Cc : Bodin, Christophe; Minerba, ALBAN +Objet : Interrogation technique + + + +Bonjour, + +Je me permet de vous contacter car j'ai mon client, M SUIRE Nicolas qui =E0= + commander en septembre des volets battant. + +Cependant, au moment de les poser il s'est aper=E7u que les pentures livr= +=E9es avec ses volets =E9taient diff=E9rentes du fait de la largeur des vol= +ets. + + +Mon client =E0 des volets de dimension 1200 mm et 1195 mm et pour 5 millim= +=E8tres en moins les pentures sont nettement plus petites ce qui g=EAne for= +tement le rendu final. +De ce fait, nous aimerions vous commander des pentures au bonnes dimensions= + soit les m=EAmes que celles avec un volet d'une largeur de 1200 mm. +Pouvez-vous m'indiquer ce que je dois mettre dans mon bon de commande pour = +nous nous comprenions dans le but d'avoir rapidement les pentures ? + + +Vous trouverez ci-joint le bon de commande initial. + +Dans l'attente de votre r=E9ponse, + +Bien cordialement, + + + +cid:image001.gif@01D3F279.14D42B50 + +Prevost Fanny + +Chef de Rayon Menuiserie ext=E9rieure +ZAC des Sablons + +77410 Claye Souilly + +T=E9l : +33 (0)1 60 94 82 66 + + + + + + +--_000_E7C76F0CE76FA14287E830E5381C0582F3309398S8EXCP01macgrou_ +Content-Type: text/html; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr= +osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" = +xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:= +//www.w3.org/TR/REC-html40"> +<head> +<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-= +1"> +<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)"> +<!--[if !mso]><style>v\:* {behavior:url(#default#VML);} +o\:* {behavior:url(#default#VML);} +w\:* {behavior:url(#default#VML);} +.shape {behavior:url(#default#VML);} +</style><![endif]--><style><!-- +/* Font Definitions */ +@font-face + {font-family:Calibri; + panose-1:2 15 5 2 2 2 4 3 2 4;} +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4;} +@font-face + {font-family:"Century Gothic"; + panose-1:2 11 5 2 2 2 2 2 2 4;} +/* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {margin:0cm; + margin-bottom:.0001pt; + font-size:11.0pt; + font-family:"Calibri","sans-serif"; + mso-fareast-language:EN-US;} +a:link, span.MsoHyperlink + {mso-style-priority:99; + color:#0563C1; + text-decoration:underline;} +a:visited, span.MsoHyperlinkFollowed + {mso-style-priority:99; + color:#954F72; + text-decoration:underline;} +span.EmailStyle17 + {mso-style-type:personal; + font-family:"Calibri","sans-serif"; + color:windowtext;} +span.EmailStyle18 + {mso-style-type:personal-reply; + font-family:"Calibri","sans-serif"; + color:#1F497D;} +.MsoChpDefault + {mso-style-type:export-only; + font-size:10.0pt;} +@page WordSection1 + {size:612.0pt 792.0pt; + margin:70.85pt 70.85pt 70.85pt 70.85pt;} +div.WordSection1 + {page:WordSection1;} +--></style><!--[if gte mso 9]><xml> +<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> +</xml><![endif]--><!--[if gte mso 9]><xml> +<o:shapelayout v:ext=3D"edit"> +<o:idmap v:ext=3D"edit" data=3D"1" /> +</o:shapelayout></xml><![endif]--> +</head> +<body lang=3D"FR" link=3D"#0563C1" vlink=3D"#954F72"> +<div class=3D"WordSection1"> +<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa= +n></p> +<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa= +n></p> +<div> +<div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm = +0cm 0cm"> +<p class=3D"MsoNormal"><b><span style=3D"font-size:10.0pt;font-family:"= +;Tahoma","sans-serif";mso-fareast-language:FR">De :</sp= +an></b><span style=3D"font-size:10.0pt;font-family:"Tahoma","= +;sans-serif";mso-fareast-language:FR"> Prevost, Fanny [mailto:fanny.pr= +evost@castorama.fr] +<br> +<b>Envoy=E9 :</b> mercredi 23 mai 2018 09:35<br> +<b>=C0 :</b> serviceclients<br> +<b>Cc :</b> Bodin, Christophe; Minerba, ALBAN<br> +<b>Objet :</b> Interrogation technique<o:p></o:p></span></p> +</div> +</div> +<p class=3D"MsoNormal"><o:p> </o:p></p> +<p class=3D"MsoNormal">Bonjour, <br> +<br> +Je me permet de vous contacter car j’ai mon client, M SUIRE Nicolas q= +ui =E0 commander en septembre des volets battant.<o:p></o:p></p> +<p class=3D"MsoNormal">Cependant, au moment de les poser il s’est ape= +r=E7u que les pentures livr=E9es avec ses volets =E9taient diff=E9rentes du= + fait de la largeur des volets.<o:p></o:p></p> +<p class=3D"MsoNormal"><br> +Mon client =E0 des volets de dimension 1200 mm et 1195 mm et pour 5 millim= +=E8tres en moins les pentures sont nettement plus petites ce qui g=EAne for= +tement le rendu final.<br> +De ce fait, nous aimerions vous commander des pentures au bonnes dimensions= + soit les m=EAmes que celles avec un volet d’une largeur de 1200 mm.<= +br> +Pouvez-vous m’indiquer ce que je dois mettre dans mon bon de commande= + pour nous nous comprenions dans le but d’avoir rapidement les pentur= +es ?<o:p></o:p></p> +<p class=3D"MsoNormal"><br> +Vous trouverez ci-joint le bon de commande initial.<br> +<br> +Dans l’attente de votre r=E9ponse,<br> +<br> +Bien cordialement,<o:p></o:p></p> +<p class=3D"MsoNormal"><o:p> </o:p></p> +<table class=3D"MsoNormalTable" border=3D"0" cellspacing=3D"0" cellpadding= +=3D"0" align=3D"left" width=3D"720" style=3D"width:540.0pt;border-collapse:= +collapse"> +<tbody> +<tr> +<td width=3D"119" valign=3D"top" style=3D"width:89.3pt;padding:0cm 0cm 0cm = +0cm"> +<p class=3D"MsoNormal" style=3D"line-height:115%;mso-element:frame;mso-elem= +ent-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertical= +:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly"> +<span style=3D"font-family:"Century Gothic","sans-serif"= +;;mso-fareast-language:FR"><o:p></o:p></span></p> +</td> +<td width=3D"601" style=3D"width:450.7pt;padding:0cm 0cm 0cm 0cm"> +<p class=3D"MsoNormal" style=3D"line-height:14.0pt;mso-element:frame;mso-el= +ement-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertic= +al:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly"> +<b><span style=3D"font-family:"Century Gothic","sans-serif&q= +uot;;color:#58585A;mso-fareast-language:FR">Prevost Fanny<o:p></o:p></span>= +</b></p> +<p class=3D"MsoNormal" style=3D"line-height:11.0pt;mso-element:frame;mso-el= +ement-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertic= +al:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly"> +<span style=3D"font-size:10.0pt;font-family:"Century Gothic",&quo= +t;sans-serif";color:#58585A;mso-fareast-language:FR">Chef de Rayon Men= +uiserie ext=E9rieure +<br> +</span><span style=3D"font-size:9.0pt;font-family:"Century Gothic"= +;,"sans-serif";color:#58585A;mso-fareast-language:FR">ZAC des Sab= +lons<o:p></o:p></span></p> +<p class=3D"MsoNormal" style=3D"line-height:11.0pt;mso-element:frame;mso-el= +ement-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertic= +al:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly"> +<span style=3D"font-size:9.0pt;font-family:"Century Gothic","= +;sans-serif";color:#58585A;mso-fareast-language:FR">77410 Claye Souill= +y</span><span style=3D"mso-fareast-language:FR"><o:p></o:p></span></p> +<p class=3D"MsoNormal" style=3D"line-height:11.0pt;mso-element:frame;mso-el= +ement-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertic= +al:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly"> +<span style=3D"font-size:9.0pt;font-family:"Century Gothic","= +;sans-serif";color:#58585A;mso-fareast-language:FR">T=E9l : += +33 (0)1 60 94 82 66</span><b><span style=3D"font-size:8.0pt;font-family:&qu= +ot;Century Gothic","sans-serif";color:#58585A;mso-fareast-la= +nguage:FR"> +<o:p></o:p></span></b></p> +</td> +</tr> +</tbody> +</table> +<p class=3D"MsoNormal"><span style=3D"mso-fareast-language:FR"><o:p> <= +/o:p></span></p> +<p class=3D"MsoNormal"><o:p> </o:p></p> +</div> +</body> +</html> + +--_000_E7C76F0CE76FA14287E830E5381C0582F3309398S8EXCP01macgrou_-- -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm