r1795 - in trunk: wao-services/src/main/java/fr/ifremer/wao/services/service/csv/operations wao-services/src/main/resources/i18n wao-web/src/main/java/fr/ifremer/wao/web/action
Author: bleny Date: 2014-04-02 10:57:00 +0200 (Wed, 02 Apr 2014) New Revision: 1795 Url: http://forge.codelutin.com/projects/wao/repository/revisions/1795 Log: refs #4483 fix error messages about DCF5codes not displayed while importing sampling plan Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/operations/DCF5CodesParserFormatter.java trunk/wao-services/src/main/resources/i18n/wao-services_en_GB.properties trunk/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/AbstractDownloadCsvAction.java Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/operations/DCF5CodesParserFormatter.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/operations/DCF5CodesParserFormatter.java 2014-04-02 08:50:25 UTC (rev 1794) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/operations/DCF5CodesParserFormatter.java 2014-04-02 08:57:00 UTC (rev 1795) @@ -29,8 +29,8 @@ import fr.ifremer.wao.services.service.administration.ReferentialService; import fr.ifremer.wao.services.service.administration.UnknownFishingGearDcfCodeException; import fr.ifremer.wao.services.service.administration.UnknownTargetSpeciesDcfCodeException; -import org.nuiton.csv.ImportRuntimeException; import org.nuiton.csv.ValueParserFormatter; +import org.nuiton.i18n.I18n; import org.nuiton.util.StringUtil; import java.util.ArrayList; @@ -57,15 +57,14 @@ @Override public List<DCF5Code> parse(String codes) { - // FIXME brendan 20/03/14 la gestion d'exception fait qu'on a pas le message d'erreur dans l'UI try { Collection<DCF5Code> dcf5Codes = referentialService.getDcf5Codes(codes); List<DCF5Code> value = new ArrayList<>(dcf5Codes); return value; } catch (UnknownFishingGearDcfCodeException e) { - throw new ImportRuntimeException(e.getMessage(), e); + throw new IllegalArgumentException(I18n.t("wao.import.sampleRow.failure.unknownFishingGearDcfCode", e.getCode()), e); } catch (UnknownTargetSpeciesDcfCodeException e) { - throw new ImportRuntimeException(e); + throw new IllegalArgumentException(I18n.t("wao.import.sampleRow.failure.unknownTargetSpeciesDcfCode", e.getCode()), e); } } } Modified: trunk/wao-services/src/main/resources/i18n/wao-services_en_GB.properties =================================================================== --- trunk/wao-services/src/main/resources/i18n/wao-services_en_GB.properties 2014-04-02 08:50:25 UTC (rev 1794) +++ trunk/wao-services/src/main/resources/i18n/wao-services_en_GB.properties 2014-04-02 08:57:00 UTC (rev 1795) @@ -48,5 +48,7 @@ wao.import.sampleRow.failure.missingSampleRowCode=You must precise a code for the sample row wao.import.sampleRow.failure.wrongFishingZone=There is no fishing zone with the code '%s' wao.import.sampleRow.failure.wrongSampleRowCodeFormat=The sample row code '%s' is not compliant with the format "YYYY_PIIII" +wao.import.sampleRow.failure.unknownFishingGearDcfCode=Unknown fishing gear code\: %s +wao.import.sampleRow.failure.unknownTargetSpeciesDcfCode=Unknown target species code\: %s wao.validation.sampleRow.conflictOnObserver=Observer %s cannot be associated to the line %s because he has to observer, on the same day, for row %s wao.validation.sampleRow.observerNotInCompany=Observer %s doesn't work for company %s Modified: trunk/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties =================================================================== --- trunk/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties 2014-04-02 08:50:25 UTC (rev 1794) +++ trunk/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties 2014-04-02 08:57:00 UTC (rev 1795) @@ -48,5 +48,7 @@ wao.import.sampleRow.failure.missingSampleRowCode=Il faut préciser un code pour a ligne du plan wao.import.sampleRow.failure.wrongFishingZone=Le code '%s' ne correspond à aucune zone de pêche connue du référentiel wao.import.sampleRow.failure.wrongSampleRowCodeFormat=Le code '%s' n'est pas un code de ligne valide selon le format "AAAA_PIIII" +wao.import.sampleRow.failure.unknownFishingGearDcfCode=Le code engin %s est inconnu du référentiel +wao.import.sampleRow.failure.unknownTargetSpeciesDcfCode=Le code espèce cible %s est inconnu du référentiel wao.validation.sampleRow.conflictOnObserver=L'observateur %s ne peut être associé à la ligne %s car il doit observer, le même jour, pour la ligne %s wao.validation.sampleRow.observerNotInCompany=L'observateur %s ne fait pas parti de la société %s Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/AbstractDownloadCsvAction.java =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/AbstractDownloadCsvAction.java 2014-04-02 08:50:25 UTC (rev 1794) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/AbstractDownloadCsvAction.java 2014-04-02 08:57:00 UTC (rev 1795) @@ -40,7 +40,7 @@ private static final long serialVersionUID = 1L; - protected SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-dd-MM_HHhmm"); + protected SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-dd-MM_HH-mm"); public abstract String getFileName();
participants (1)
-
bleny@users.forge.codelutin.com