branch develop updated (d7915e5 -> eb099f7)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git from d7915e5 Merge branch 'feature/1316-Rendre-utilisable-la-selection-de-compte' into develop new 15845a6 refs #1361 correction sur affichage des erreurs d'import new eb099f7 refs #1314 monté de version des libs The 2 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 eb099f7f9b20c4ecd77e1f803e118ea718355f13 Author: David Cossé <cosse@codelutin.com> Date: Thu Jul 7 18:06:58 2016 +0200 refs #1314 monté de version des libs commit 15845a629a7b976d519695128d4fa0dd60b661c5 Author: David Cossé <cosse@codelutin.com> Date: Thu Jul 7 17:55:50 2016 +0200 refs #1361 correction sur affichage des erreurs d'import Summary of changes: README.txt | 10 +++ .../org/chorem/lima/business/ImportResult.java | 2 + .../lima/business/ejb/ImportServiceImpl.java | 4 +- .../resources/i18n/lima-business_fr_FR.properties | 2 +- lima-server/src/license/THIRD-PARTY.properties | 6 +- lima-swing/src/license/THIRD-PARTY.properties | 6 +- .../chorem/lima/ui/importexport/ImportExport.java | 99 +++++++++------------- .../resources/i18n/lima-swing_fr_FR.properties | 2 +- pom.xml | 10 +-- 9 files changed, 67 insertions(+), 74 deletions(-) create mode 100644 README.txt -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 15845a629a7b976d519695128d4fa0dd60b661c5 Author: David Cossé <cosse@codelutin.com> Date: Thu Jul 7 17:55:50 2016 +0200 refs #1361 correction sur affichage des erreurs d'import --- .../org/chorem/lima/business/ImportResult.java | 2 + .../lima/business/ejb/ImportServiceImpl.java | 4 +- .../resources/i18n/lima-business_fr_FR.properties | 2 +- .../chorem/lima/ui/importexport/ImportExport.java | 99 +++++++++------------- .../resources/i18n/lima-swing_fr_FR.properties | 2 +- 5 files changed, 46 insertions(+), 63 deletions(-) diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java b/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java index 62e2690..8cec320 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java @@ -83,12 +83,14 @@ public class ImportResult implements Serializable{ public void addException(LimaException e) { allExceptions = allExceptions == null ? new HashMap<Integer, LimaException>() : allExceptions; allExceptions.put(this.lineIndex, e); + nbIgnored++; lineIndex++; } public void addInitException(LimaException e) { allExceptions = allExceptions == null ? new HashMap<Integer, LimaException>() : allExceptions; allExceptions.put(1, e); + nbIgnored++; lineIndex++; } diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java index 9d77b9d..e9b4e0c 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java @@ -880,7 +880,7 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ @Override public ImportExportResults importEntryBookFromEbp(String contents) { ImportExportResults results = new ImportExportResults(); - ImportResult result = results.createAddAndGetImportResult(Account.class); + ImportResult result = results.createAddAndGetImportResult(EntryBook.class); if (StringUtils.isBlank(contents)) { result.addException(new NoDataToImportException()); @@ -958,7 +958,7 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ @Override public ImportExportResults importEntriesFromEbp(String contents) { ImportExportResults results = new ImportExportResults(); - ImportResult result = results.createAddAndGetImportResult(Account.class); + ImportResult result = results.createAddAndGetImportResult(Entry.class); // use for logs long before = System.currentTimeMillis(); diff --git a/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties b/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties index 64845a1..17c85be 100644 --- a/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties +++ b/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties @@ -99,7 +99,7 @@ lima-business.financialtransaction.retainedearnings.voucher=Selon décision AG lima-business.import.ebpmissingaccount=Échec \: Compte %s inexistant. \nCréer tous les comptes avant d'importer les écritures. lima-business.import.entries.error.lockedEntryBook= lima-business.import.entries.error.lockedFinancialPeriod= -lima-business.import.entriesoutofdatesrange=Attention \: Cette entrée %s ne fait partie d'aucune période ouverte. Entrée non importée lima-business.import.noaccount\=Erreur \: Ce fichier ne contient aucun compte. +lima-business.import.entriesoutofdatesrange=Attention \: Cette entrée %s ne fait partie d'aucune période ouverte. Entrée non importée. lima.config.configFileName.description=Nom du fichier de configuration de Lima lima.config.currency.description= lima.config.currency.label= diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java b/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java index d0d0c47..6dfe168 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java @@ -65,16 +65,8 @@ import org.chorem.lima.enums.ImportExportEnum; import org.chorem.lima.util.ErrorHelper; import org.jdesktop.swingx.painter.BusyPainter; -import javax.swing.JComboBox; -import javax.swing.JFileChooser; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.SwingWorker; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; +import javax.swing.*; +import java.awt.*; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; @@ -221,7 +213,7 @@ public class ImportExport { } else { throw new LimaTechnicalException("Can't open file from path" + importFilePath); } - log.info("Precessing import:" + importFileUrl.getPath() + " " + importFilePath + " " + importFileUrl.getFile()); + log.info("Processing import:" + importFileUrl.getPath() + " " + importFilePath + " " + importFileUrl.getFile()); processImportExport(verbose, importExportChoice, defaultCharset, null, importFileUrl); } } @@ -231,7 +223,7 @@ public class ImportExport { if (exportFilePath != null) { // if null ==> cancel export File file = new File(exportFilePath); if (file.getParentFile().exists()) { - log.info("Precessing export:" + exportFilePath); + log.info("Processing export:" + exportFilePath); processImportExport(verbose, importExportChoice, Charsets.UTF_8, exportFilePath, null); } else { throw new LimaTechnicalException("Targeted directory can not be found."); @@ -393,34 +385,27 @@ public class ImportExport { } } - DisplayImportExportResultMessage(message, false); + displayImportExportResultMessage(message, false); } protected void ComputeImportResultMessage(List<ImportResult> resultList) { StringBuilder message = new StringBuilder(); message.append(t("lima.import.terminated") + "\n"); - StringBuilder errorMessage = null; for (ImportResult result : resultList) { Class fromSource = result.getFromSource(); message.append("Import "); message.append(getFromSourceMessage(fromSource)); - message.append(t("lima.import.report", result.getNbCreated(), result.getNbUpdated(), result.getNbIgnored()) + "\n"); - Map<Integer, LimaException> exceptionsByLine = result.getAllExceptionsByLine(); - errorMessage = displayErrorMessage(exceptionsByLine); - // message is null if import failed - if (errorMessage == null) { - break; - } else { - message.append(errorMessage.toString()); - } - } + message.append(result.getAllExceptionsByLine().size() > 0 ? "Des erreurs sont survenues lors de l'import, veuillez regarder le fichier de log pour plus de détails.\n" : "Aucune erreur rencontrée\n"); + message.append(t("lima.import.report", result.getNbCreated(), result.getNbIgnored(), result.getNbUpdated())); - if (errorMessage != null) { - DisplayImportExportResultMessage(message, true); + logErrorMessage(result, fromSource); } + + displayImportExportResultMessage(message, true); + } - protected void DisplayImportExportResultMessage(StringBuilder message, Boolean importMode) { + protected void displayImportExportResultMessage(StringBuilder message, Boolean importMode) { if (log.isDebugEnabled()){ log.debug(message.toString()); } @@ -433,60 +418,56 @@ public class ImportExport { JOptionPane.INFORMATION_MESSAGE); } - protected StringBuilder displayErrorMessage(Map<Integer, LimaException> exceptionsByLine) { - StringBuilder result = new StringBuilder(); + protected void logErrorMessage(ImportResult result,Class fromSource) { + Map<Integer, LimaException> exceptionsByLine = result.getAllExceptionsByLine(); if (exceptionsByLine != null) { + StringBuilder errorMessage = new StringBuilder(); + errorMessage.append("\n" + "Import " + getFromSourceMessage(fromSource)); + errorMessage.append("\n" + t("lima.import.report", result.getNbCreated(), result.getNbIgnored(), result.getNbUpdated())); + for (Map.Entry<Integer, LimaException> e:exceptionsByLine.entrySet()) { - result.append(t("lima.import.line", e.getKey()) + "\n"); - LimaException importException = e.getValue(); + String message = "\n" + t("lima.import.line", e.getKey()) + "%s"; + String error; + LimaException importException = e.getValue(); if (importException instanceof InvalidAccountNumberException) { - result.append(t("lima.account.error.invalidAccountNumber", ((InvalidAccountNumberException) importException).getAccountNumber()) + "\n"); + error = t("lima.account.error.invalidAccountNumber", ((InvalidAccountNumberException) importException).getAccountNumber()); } else if (importException instanceof NotNumberAccountNumberException) { - result.append(t("lima.account.error.notNumberAccountNumber", ((NotNumberAccountNumberException) importException).getAccountNumber()) + "\n"); + error = t("lima.account.error.notNumberAccountNumber", ((NotNumberAccountNumberException) importException).getAccountNumber()); } else if (importException instanceof NotAllowedLabelException) { - result.append(t("lima.error.notAllowedLabel", ((NotAllowedLabelException) importException).getLabel()) + "\n"); + error = t("lima.error.notAllowedLabel", ((NotAllowedLabelException) importException).getLabel()); } else if (importException instanceof MoreOneUnlockFiscalPeriodException) { - result.append(t("lima.fiscalPeriod.error.moreOneUnlockFiscalPeriod", ((MoreOneUnlockFiscalPeriodException) importException).getBeginDate(), ((MoreOneUnlockFiscalPeriodException) importException).getEndDate()) + "\n"); + error = t("lima.fiscalPeriod.error.moreOneUnlockFiscalPeriod", ((MoreOneUnlockFiscalPeriodException) importException).getBeginDate(), ((MoreOneUnlockFiscalPeriodException) importException).getEndDate()); } else if (importException instanceof BeginAfterEndFiscalPeriodException) { - result.append(t("lima.fiscalPeriod.error.beginAfterEndFiscalPeriod", ((BeginAfterEndFiscalPeriodException) importException).getFiscalPeriod().getBeginDate(), ((BeginAfterEndFiscalPeriodException) importException).getFiscalPeriod().getEndDate()) + "\n"); + error = t("lima.fiscalPeriod.error.beginAfterEndFiscalPeriod", ((BeginAfterEndFiscalPeriodException) importException).getFiscalPeriod().getBeginDate(), ((BeginAfterEndFiscalPeriodException) importException).getFiscalPeriod().getEndDate()); } else if (importException instanceof NotBeginNextDayOfLastFiscalPeriodException) { - result.append(t("lima.fiscalPeriod.error.notBeginNextDayOfLastFiscalPeriod", ((NotBeginNextDayOfLastFiscalPeriodException) importException).getFiscalPeriod().getBeginDate(), ((NotBeginNextDayOfLastFiscalPeriodException) importException).getFiscalPeriod().getEndDate()) + "\n"); + error = t("lima.fiscalPeriod.error.notBeginNextDayOfLastFiscalPeriod", ((NotBeginNextDayOfLastFiscalPeriodException) importException).getFiscalPeriod().getBeginDate(), ((NotBeginNextDayOfLastFiscalPeriodException) importException).getFiscalPeriod().getEndDate()); } else if (importException instanceof LockedFinancialPeriodException) { - result.append(t("lima.fiscalPeriod.error.lockedFinancialPeriod") + "\n"); + error = t("lima.fiscalPeriod.error.lockedFinancialPeriod"); } else if (importException instanceof LockedEntryBookException) { - result.append(t("lima.entryBook.error.lockedEntryBook", ((LockedEntryBookException) importException).getClosedPeriodicEntryBook().getFinancialPeriod().getBeginDate(), ((LockedEntryBookException) importException).getClosedPeriodicEntryBook().getFinancialPeriod().getEndDate()) + "\n"); + error = t("lima.entryBook.error.lockedEntryBook", ((LockedEntryBookException) importException).getClosedPeriodicEntryBook().getFinancialPeriod().getBeginDate(), ((LockedEntryBookException) importException).getClosedPeriodicEntryBook().getFinancialPeriod().getEndDate()); } else if (importException instanceof AlreadyExistFinancialStatementException) { - result.append(t("lima.financialStatement.error.alreadyExistFinancialStatement", ((AlreadyExistFinancialStatementException) importException).getFinancialStatementLabel()) + "\n"); + error = t("lima.financialStatement.error.alreadyExistFinancialStatement", ((AlreadyExistFinancialStatementException) importException).getFinancialStatementLabel()); } else if (importException instanceof AlreadyExistVatStatementException) { - result.append(t("lima.vatStatement.error.alreadyExistVatStatement", ((AlreadyExistVatStatementException) importException).getVatStatementLabel()) + "\n"); + error = t("lima.vatStatement.error.alreadyExistVatStatement", ((AlreadyExistVatStatementException) importException).getVatStatementLabel()); } else if (importException instanceof NoFiscalPeriodFoundException) { - result.append(t("lima.error.noFiscalPeriodFound") + "\n"); + error = t("lima.error.noFiscalPeriodFound"); } else if (importException instanceof BeforeFirstFiscalPeriodException) { - result.append(t("lima.entries.add.transaction.error.beforeFirstFiscalPeriod", ((BeforeFirstFiscalPeriodException) importException).getDate()) + "\n"); + error = t("lima.entries.add.transaction.error.beforeFirstFiscalPeriod", ((BeforeFirstFiscalPeriodException) importException).getDate()); } else if (importException instanceof AfterLastFiscalPeriodException) { - result.append(t("lima.entries.add.transaction.error.afterLastFiscalPeriod", ((AfterLastFiscalPeriodException) importException).getDate()) + "\n"); + error = t("lima.entries.add.transaction.error.afterLastFiscalPeriod", ((AfterLastFiscalPeriodException) importException).getDate()); } else if (importException instanceof NoDataToImportException) { - errorHelper.showErrorMessage(t("lima.import.error.noDataToImport")); - log.warn(t("lima.import.error.noDataToImport")); - result = null; - break; + error = t("lima.import.error.noDataToImport"); } else if (importException instanceof ImportFileException){ - errorHelper.showErrorMessage(((ImportFileException) importException).getDetailMessage()); - log.warn(((ImportFileException) importException).getDetailMessage()); - result = null; - break; + error = ((ImportFileException) importException).getDetailMessage(); } else { - result.append(t("lima.import.error.unknown") + "\n"); + error = importException.getMessage(); } - try { - throw importException; - } catch (LimaException ex) { - log.error(ex); + if (StringUtils.isNotEmpty(error)) { + errorMessage.append(String.format(message, error)); } - } + log.error(errorMessage.toString()); } - return result; } /** diff --git a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties index c16da55..4f261ab 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties @@ -450,7 +450,7 @@ lima.importExport.all=Tout lima.importExport.csv=Import/Export CSV lima.importExport.ebp=Import/Export EBP lima.importExport.encoding.choice=Choix de l'encodage -lima.importExport.entry=des entrées terminé. +lima.importExport.entry=des écritures terminé. lima.importExport.entryBook=des journaux terminé. lima.importExport.entryBooks.default=Journaux par défaut lima.importExport.export=Exporter -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit eb099f7f9b20c4ecd77e1f803e118ea718355f13 Author: David Cossé <cosse@codelutin.com> Date: Thu Jul 7 18:06:58 2016 +0200 refs #1314 monté de version des libs --- README.txt | 10 ++++++++++ lima-server/src/license/THIRD-PARTY.properties | 6 +++--- lima-swing/src/license/THIRD-PARTY.properties | 6 +++--- pom.xml | 10 +++++----- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..38ab94f --- /dev/null +++ b/README.txt @@ -0,0 +1,10 @@ +pour lancer lima:: + + cd lima-swing; mvn -Prun + +pour réinitialiser la base de données de Lima: +supprimer le dossier: + /Users/userX/.lima + +Site de documentation: + http://maven-site.chorem.org/lima/ diff --git a/lima-server/src/license/THIRD-PARTY.properties b/lima-server/src/license/THIRD-PARTY.properties index cb43d73..39c1368 100644 --- a/lima-server/src/license/THIRD-PARTY.properties +++ b/lima-server/src/license/THIRD-PARTY.properties @@ -14,10 +14,10 @@ # - CDDL 1.1 # - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 # - Common Development and Distribution License -# - Common Public License Version 1.0 # - Eclipse Distribution License (EDL), Version 1.0 # - Eclipse Public License (EPL), Version 1.0 # - Eclipse Public License - Version 1.0 +# - Eclipse Public License 1.0 # - Eclipse Public License v1.0 # - GNU General Lesser Public License (LGPL) version 3.0 # - GNU General Public Library @@ -28,6 +28,7 @@ # - GPL2 w/ CPE # - General Public License (GPL) # - HSQLDB License, a BSD open source license +# - ICU License # - LGPL 2.1 # - Lesser General Public License (LGPL) # - Lesser General Public License (LGPL) v 3.0 @@ -45,7 +46,7 @@ # Please fill the missing licenses for dependencies : # # -#Tue Jul 05 13:45:32 CEST 2016 +#Tue Jul 05 14:36:37 CEST 2016 commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0 dom4j--dom4j--1.6.1=jdomlicence jakarta-regexp--jakarta-regexp--1.4=The Apache Software License, Version 2.0 @@ -61,4 +62,3 @@ org.springframework--spring-context--3.0.6.RELEASE=The Apache Software License, org.springframework--spring-core--3.0.6.RELEASE=The Apache Software License, Version 2.0 org.springframework--spring-expression--3.0.6.RELEASE=The Apache Software License, Version 2.0 stax--stax--1.2.0=The Apache Software License, Version 2.0 -xml-apis--xml-apis--1.3.02=The Apache Software License, Version 2.0 diff --git a/lima-swing/src/license/THIRD-PARTY.properties b/lima-swing/src/license/THIRD-PARTY.properties index 296b8d4..16a9826 100644 --- a/lima-swing/src/license/THIRD-PARTY.properties +++ b/lima-swing/src/license/THIRD-PARTY.properties @@ -15,10 +15,10 @@ # - CDDL 1.1 # - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 # - Common Development and Distribution License -# - Common Public License Version 1.0 # - Eclipse Distribution License (EDL), Version 1.0 # - Eclipse Public License (EPL), Version 1.0 # - Eclipse Public License - Version 1.0 +# - Eclipse Public License 1.0 # - Eclipse Public License v1.0 # - GNU General Lesser Public License (LGPL) version 3.0 # - GNU General Public Library @@ -30,6 +30,7 @@ # - GPLv2+CE # - General Public License (GPL) # - HSQLDB License, a BSD open source license +# - ICU License # - LGPL 2.1 # - Lesser General Public License (LGPL) # - Lesser General Public License (LGPL) v 3.0 @@ -47,7 +48,7 @@ # Please fill the missing licenses for dependencies : # # -#Tue Jul 05 13:49:05 CEST 2016 +#Tue Jul 05 14:36:56 CEST 2016 commons-jxpath--commons-jxpath--1.3=The Apache Software License, Version 2.0 commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0 dom4j--dom4j--1.6.1=jdomlicence @@ -64,4 +65,3 @@ org.springframework--spring-context--3.0.6.RELEASE=The Apache Software License, org.springframework--spring-core--3.0.6.RELEASE=The Apache Software License, Version 2.0 org.springframework--spring-expression--3.0.6.RELEASE=The Apache Software License, Version 2.0 stax--stax--1.2.0=The Apache Software License, Version 2.0 -xml-apis--xml-apis--1.3.02=The Apache Software License, Version 2.0 diff --git a/pom.xml b/pom.xml index d2a3cd0..9b33ef9 100644 --- a/pom.xml +++ b/pom.xml @@ -172,21 +172,21 @@ <commonsLoggingVersion>1.2</commonsLoggingVersion> <commonsLangVersion>2.6</commonsLangVersion> <dom4jVersion>1.6.1</dom4jVersion> - <googleGuavaVersion>18.0</googleGuavaVersion> + <googleGuavaVersion>19.0</googleGuavaVersion> <!-- h2Version 1.4.180 is beta, and db created with 1.3 are not compatible yet so don't use it for the moment--> <h2Version>1.3.176</h2Version> <hibernateVersion>4.3.11.Final</hibernateVersion> <itextVersion>4.2.1</itextVersion> - <jasperreportsVersion>6.2.0</jasperreportsVersion> + <jasperreportsVersion>6.3.0</jasperreportsVersion> <javaxServletVersion>3.1.0</javaxServletVersion> - <jaxxVersion>2.26</jaxxVersion> + <jaxxVersion>2.29</jaxxVersion> <jbossTransactionVersion>1.0.0.Final</jbossTransactionVersion> <jdomVersion>2.0.5</jdomVersion> <jettyPluginVersion>9.2.3.v20140905</jettyPluginVersion> - <junitVersion>4.11</junitVersion> + <junitVersion>4.12</junitVersion> <log4jVersion>1.2.17</log4jVersion> <openejbJavaeeApiVersion>6.0-6</openejbJavaeeApiVersion> - <openEjbVersion>4.7.2</openEjbVersion> + <openEjbVersion>4.7.4</openEjbVersion> <pdfboxVersion>1.8.7</pdfboxVersion> <slf4jVersion>1.7.13</slf4jVersion> <swinglabsVersion>3.0.4</swinglabsVersion> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm