This is an automated email from the git hooks/post-receive script. New commit to branch feature/6688 in repository tutti. See http://git.codelutin.com/tutti.git commit 90d909e5629265923f8c04e88187b90acce59b97 Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Feb 20 20:35:49 2015 +0100 add engin_id + fix computed flag (they must be nullable) --- .../consumer/CsvConsumerForOperation.java | 19 ++++---- .../service/genericformat/csv/OperationModel.java | 7 +-- .../service/genericformat/csv/OperationRow.java | 54 +++++++++++----------- 3 files changed, 41 insertions(+), 39 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/consumer/CsvConsumerForOperation.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/consumer/CsvConsumerForOperation.java index 28940e9..91512d7 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/consumer/CsvConsumerForOperation.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/consumer/CsvConsumerForOperation.java @@ -9,6 +9,7 @@ import fr.ifremer.tutti.service.genericformat.GenericFormatImportEntityParserFac import fr.ifremer.tutti.service.genericformat.GenericFormatImportValidationHelper; import fr.ifremer.tutti.service.genericformat.csv.OperationModel; import fr.ifremer.tutti.service.genericformat.csv.OperationRow; +import org.apache.commons.lang3.BooleanUtils; import org.nuiton.csv.ImportRow; import org.nuiton.validator.NuitonValidatorResult; @@ -73,34 +74,34 @@ public class CsvConsumerForOperation extends CsvComsumer<OperationRow, Operation CatchBatch catchBatch = bean.getCatchBatch(); - if (bean.isCatchTotalWeightComputed()) { + if (BooleanUtils.toBooleanDefaultIfNull(bean.getCatchTotalWeightComputed(), false)) { catchBatch.setCatchTotalWeight(null); } - if (bean.isCatchTotalRejectedWeightComputed()) { + if (BooleanUtils.toBooleanDefaultIfNull(bean.getCatchTotalRejectedWeightComputed(), false)) { catchBatch.setCatchTotalRejectedWeight(null); } - if (bean.isSpeciesTotalSortedWeightComputed()) { + if (BooleanUtils.toBooleanDefaultIfNull(bean.getSpeciesTotalSortedWeightComputed(), false)) { catchBatch.setSpeciesTotalSortedWeight(null); } - if (bean.isSpeciesTotalInertWeightComputed()) { + if (BooleanUtils.toBooleanDefaultIfNull(bean.getSpeciesTotalInertWeightComputed(), false)) { catchBatch.setSpeciesTotalInertWeight(null); } - if (bean.isSpeciesTotalLivingNotItemizedWeightComputed()) { + if (BooleanUtils.toBooleanDefaultIfNull(bean.getSpeciesTotalLivingNotItemizedWeightComputed(), false)) { catchBatch.setSpeciesTotalLivingNotItemizedWeight(null); } - if (bean.isBenthosTotalSortedWeightComputed()) { + if (BooleanUtils.toBooleanDefaultIfNull(bean.getBenthosTotalSortedWeightComputed(), false)) { catchBatch.setBenthosTotalSortedWeight(null); } - if (bean.isBenthosTotalInertWeightComputed()) { + if (BooleanUtils.toBooleanDefaultIfNull(bean.getBenthosTotalInertWeightComputed(), false)) { catchBatch.setBenthosTotalInertWeight(null); } - if (bean.isBenthosTotalLivingNotItemizedWeightComputed()) { + if (BooleanUtils.toBooleanDefaultIfNull(bean.getBenthosTotalLivingNotItemizedWeightComputed(), false)) { catchBatch.setBenthosTotalLivingNotItemizedWeight(null); } - if (bean.isMarineLitterTotalWeightComputed()) { + if (BooleanUtils.toBooleanDefaultIfNull(bean.getMarineLitterTotalWeightComputed(), false)) { catchBatch.setMarineLitterTotalWeight(null); } diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationModel.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationModel.java index 3c7d9a6..9ce2ab2 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationModel.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationModel.java @@ -24,7 +24,6 @@ package fr.ifremer.tutti.service.genericformat.csv; import fr.ifremer.tutti.persistence.entities.data.Cruise; import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import fr.ifremer.tutti.persistence.entities.referential.Gear; import fr.ifremer.tutti.service.csv.AbstractTuttiImportExportModel; import fr.ifremer.tutti.service.csv.TuttiCsvUtil; import fr.ifremer.tutti.service.genericformat.GenericFormatImportEntityParserFactory; @@ -74,7 +73,7 @@ public class OperationModel extends AbstractTuttiImportExportModel<OperationRow> newColumnForExport("Id_Operation", FishingOperation.PROPERTY_FISHING_OPERATION_NUMBER, TuttiCsvUtil.INTEGER); newColumnForExport("Poche", FishingOperation.PROPERTY_MULTIRIG_AGGREGATION); newNullableColumnForExport("Engin", FishingOperation.PROPERTY_GEAR, TuttiCsvUtil.GEAR_FORMATTER); - newNullableColumnForExport("Rang_Engin", FishingOperation.PROPERTY_GEAR + "." + Gear.PROPERTY_RANK_ORDER, TuttiCsvUtil.SHORT); + newNullableColumnForExport("Rang_Engin", OperationRow.PROPERTY_GEAR_RANK_ORDER, TuttiCsvUtil.SHORT); newColumnForExport("Navire", FishingOperation.PROPERTY_VESSEL, TuttiCsvUtil.VESSEL_FORMATTER); newColumnForExport("DateDeb", FishingOperation.PROPERTY_GEAR_SHOOTING_START_DATE, TuttiCsvUtil.DAY_TIME_SECOND); @@ -153,6 +152,7 @@ public class OperationModel extends AbstractTuttiImportExportModel<OperationRow> newNullableColumnForExport("Poids_Total_Macro_Dechet_Calcule", OperationRow.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT_COMPUTED, TuttiCsvUtil.BOOLEAN); newColumnForExport("Serie_Id", Cruise.PROPERTY_PROGRAM, TuttiCsvUtil.PROGRAM_TECHNICAL_FORMATTER); + newColumnForExport("Engin_Id", FishingOperation.PROPERTY_GEAR, TuttiCsvUtil.GEAR_TECHNICAL_FORMATTER); newColumnForExport("Navire_Id", FishingOperation.PROPERTY_VESSEL, TuttiCsvUtil.VESSEL_TECHNICAL_FORMATTER); newColumnForExport("Strate_Id", FishingOperation.PROPERTY_STRATA, TuttiCsvUtil.FISHING_OPERATION_STRATA_TECHNICAL_FORMATTER); newColumnForExport("Sous_Strate_Id", FishingOperation.PROPERTY_SUB_STRATA, TuttiCsvUtil.FISHING_OPERATION_SUB_STRATA_TECHNICAL_FORMATTER); @@ -172,7 +172,7 @@ public class OperationModel extends AbstractTuttiImportExportModel<OperationRow> newMandatoryColumn("Id_Operation", FishingOperation.PROPERTY_FISHING_OPERATION_NUMBER, TuttiCsvUtil.INTEGER); newMandatoryColumn("Poche", FishingOperation.PROPERTY_MULTIRIG_AGGREGATION); newIgnoredColumn("Engin"); - newIgnoredColumn("Rang_Engin"); + newMandatoryColumn("Rang_Engin", OperationRow.PROPERTY_GEAR_RANK_ORDER, TuttiCsvUtil.SHORT); newIgnoredColumn("Navire"); newMandatoryColumn("DateDeb", FishingOperation.PROPERTY_GEAR_SHOOTING_START_DATE, TuttiCsvUtil.DAY_TIME_SECOND); @@ -250,6 +250,7 @@ public class OperationModel extends AbstractTuttiImportExportModel<OperationRow> newMandatoryColumn("Poids_Total_Macro_Dechet_Calcule", OperationRow.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT_COMPUTED, TuttiCsvUtil.PRIMITIVE_BOOLEAN); newMandatoryColumn("Serie_Id", Cruise.PROPERTY_PROGRAM, parserFactory.getProgramParser()); + newMandatoryColumn("Engib_Id", FishingOperation.PROPERTY_GEAR, parserFactory.getGearParser()); newMandatoryColumn("Navire_Id", FishingOperation.PROPERTY_VESSEL, parserFactory.getVesselParser()); newMandatoryColumn("Strate_Id", FishingOperation.PROPERTY_STRATA, parserFactory.getFishingOperationStrataParser()); newMandatoryColumn("Sous_Strate_Id", FishingOperation.PROPERTY_SUB_STRATA, parserFactory.getFishingOperationSubStrataParser()); diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationRow.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationRow.java index b8da4c3..7e1c766 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationRow.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationRow.java @@ -123,23 +123,23 @@ public class OperationRow extends RowWithOperationContextSupport { protected CatchBatch catchBatch; - protected boolean catchTotalWeightComputed; + protected Boolean catchTotalWeightComputed; - protected boolean catchTotalRejectedWeightComputed; + protected Boolean catchTotalRejectedWeightComputed; - protected boolean speciesTotalSortedWeightComputed; + protected Boolean speciesTotalSortedWeightComputed; - protected boolean speciesTotalInertWeightComputed; + protected Boolean speciesTotalInertWeightComputed; - protected boolean speciesTotalLivingNotItemizedWeightComputed; + protected Boolean speciesTotalLivingNotItemizedWeightComputed; - protected boolean benthosTotalSortedWeightComputed; + protected Boolean benthosTotalSortedWeightComputed; - protected boolean benthosTotalInertWeightComputed; + protected Boolean benthosTotalInertWeightComputed; - protected boolean benthosTotalLivingNotItemizedWeightComputed; + protected Boolean benthosTotalLivingNotItemizedWeightComputed; - protected boolean marineLitterTotalWeightComputed; + protected Boolean marineLitterTotalWeightComputed; public static OperationRow newEmptyInstance() { @@ -490,75 +490,75 @@ public class OperationRow extends RowWithOperationContextSupport { return true; } - public boolean isCatchTotalWeightComputed() { + public Boolean getCatchTotalWeightComputed() { return catchTotalWeightComputed; } - public boolean isCatchTotalRejectedWeightComputed() { + public Boolean getCatchTotalRejectedWeightComputed() { return catchTotalRejectedWeightComputed; } - public boolean isSpeciesTotalSortedWeightComputed() { + public Boolean getSpeciesTotalSortedWeightComputed() { return speciesTotalSortedWeightComputed; } - public boolean isSpeciesTotalInertWeightComputed() { + public Boolean getSpeciesTotalInertWeightComputed() { return speciesTotalInertWeightComputed; } - public boolean isSpeciesTotalLivingNotItemizedWeightComputed() { + public Boolean getSpeciesTotalLivingNotItemizedWeightComputed() { return speciesTotalLivingNotItemizedWeightComputed; } - public boolean isBenthosTotalSortedWeightComputed() { + public Boolean getBenthosTotalSortedWeightComputed() { return benthosTotalSortedWeightComputed; } - public boolean isBenthosTotalInertWeightComputed() { + public Boolean getBenthosTotalInertWeightComputed() { return benthosTotalInertWeightComputed; } - public boolean isBenthosTotalLivingNotItemizedWeightComputed() { + public Boolean getBenthosTotalLivingNotItemizedWeightComputed() { return benthosTotalLivingNotItemizedWeightComputed; } - public boolean isMarineLitterTotalWeightComputed() { + public Boolean getMarineLitterTotalWeightComputed() { return marineLitterTotalWeightComputed; } - public void setCatchTotalWeightComputed(boolean catchTotalWeightComputed) { + public void setCatchTotalWeightComputed(Boolean catchTotalWeightComputed) { this.catchTotalWeightComputed = catchTotalWeightComputed; } - public void setCatchTotalRejectedWeightComputed(boolean catchTotalRejectedWeightComputed) { + public void setCatchTotalRejectedWeightComputed(Boolean catchTotalRejectedWeightComputed) { this.catchTotalRejectedWeightComputed = catchTotalRejectedWeightComputed; } - public void setSpeciesTotalSortedWeightComputed(boolean speciesTotalSortedWeightComputed) { + public void setSpeciesTotalSortedWeightComputed(Boolean speciesTotalSortedWeightComputed) { this.speciesTotalSortedWeightComputed = speciesTotalSortedWeightComputed; } - public void setSpeciesTotalInertWeightComputed(boolean speciesTotalInertWeightComputed) { + public void setSpeciesTotalInertWeightComputed(Boolean speciesTotalInertWeightComputed) { this.speciesTotalInertWeightComputed = speciesTotalInertWeightComputed; } - public void setSpeciesTotalLivingNotItemizedWeightComputed(boolean speciesTotalLivingNotItemizedWeightComputed) { + public void setSpeciesTotalLivingNotItemizedWeightComputed(Boolean speciesTotalLivingNotItemizedWeightComputed) { this.speciesTotalLivingNotItemizedWeightComputed = speciesTotalLivingNotItemizedWeightComputed; } - public void setBenthosTotalSortedWeightComputed(boolean benthosTotalSortedWeightComputed) { + public void setBenthosTotalSortedWeightComputed(Boolean benthosTotalSortedWeightComputed) { this.benthosTotalSortedWeightComputed = benthosTotalSortedWeightComputed; } - public void setBenthosTotalInertWeightComputed(boolean benthosTotalInertWeightComputed) { + public void setBenthosTotalInertWeightComputed(Boolean benthosTotalInertWeightComputed) { this.benthosTotalInertWeightComputed = benthosTotalInertWeightComputed; } - public void setBenthosTotalLivingNotItemizedWeightComputed(boolean benthosTotalLivingNotItemizedWeightComputed) { + public void setBenthosTotalLivingNotItemizedWeightComputed(Boolean benthosTotalLivingNotItemizedWeightComputed) { this.benthosTotalLivingNotItemizedWeightComputed = benthosTotalLivingNotItemizedWeightComputed; } - public void setMarineLitterTotalWeightComputed(boolean marineLitterTotalWeightComputed) { + public void setMarineLitterTotalWeightComputed(Boolean marineLitterTotalWeightComputed) { this.marineLitterTotalWeightComputed = marineLitterTotalWeightComputed; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.