This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 96a491efa027e8eb658502b8020884041561eb3e Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Mar 8 14:24:29 2016 +0100 Utilisation de I18nEnumUtil dans les implantations de service --- .../ConsolidateActivitySeineDataResultBuilder.java | 13 +++++++------ .../consolidate/ConsolidateDataServiceTopia.java | 18 +++++++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/observe-services-topia/src/main/java/fr/ird/observe/services/service/actions/consolidate/ConsolidateActivitySeineDataResultBuilder.java b/observe-services-topia/src/main/java/fr/ird/observe/services/service/actions/consolidate/ConsolidateActivitySeineDataResultBuilder.java index 58331b2..1868469 100644 --- a/observe-services-topia/src/main/java/fr/ird/observe/services/service/actions/consolidate/ConsolidateActivitySeineDataResultBuilder.java +++ b/observe-services-topia/src/main/java/fr/ird/observe/services/service/actions/consolidate/ConsolidateActivitySeineDataResultBuilder.java @@ -36,6 +36,7 @@ import fr.ird.observe.entities.seine.NonTargetCatch; import fr.ird.observe.entities.seine.NonTargetLength; import fr.ird.observe.entities.seine.TargetLength; import fr.ird.observe.services.dto.constants.ReferentialLocale; +import fr.ird.observe.services.util.I18nEnumUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -150,7 +151,7 @@ public class ConsolidateActivitySeineDataResultBuilder { element.speciesLabel = speciesLabel; element.propertyName = NonTargetCatch.PROPERTY_MEAN_LENGTH; element.newValue = nonTargetCatch.getMeanLength(); - element.computeValueSource = l(locale, nonTargetCatch.getMeanLengthComputedSource().getI18nKey()); + element.computeValueSource = I18nEnumUtil.getLabel(locale, nonTargetCatch.getMeanLengthComputedSource()); nonTargetCatchModificationBuilder.add(element); break; @@ -162,7 +163,7 @@ public class ConsolidateActivitySeineDataResultBuilder { element.speciesLabel = speciesLabel; element.propertyName = NonTargetCatch.PROPERTY_MEAN_WEIGHT; element.newValue = nonTargetCatch.getMeanWeight(); - element.computeValueSource = l(locale, nonTargetCatch.getMeanWeightComputedSource().getI18nKey()); + element.computeValueSource = I18nEnumUtil.getLabel(locale, nonTargetCatch.getMeanWeightComputedSource()); nonTargetCatchModificationBuilder.add(element); break; @@ -174,7 +175,7 @@ public class ConsolidateActivitySeineDataResultBuilder { element.speciesLabel = speciesLabel; element.propertyName = NonTargetCatch.PROPERTY_CATCH_WEIGHT; element.newValue = nonTargetCatch.getCatchWeight(); - element.computeValueSource = l(locale, nonTargetCatch.getCatchWeightComputedSource().getI18nKey()); + element.computeValueSource = I18nEnumUtil.getLabel(locale, nonTargetCatch.getCatchWeightComputedSource()); nonTargetCatchModificationBuilder.add(element); break; @@ -186,7 +187,7 @@ public class ConsolidateActivitySeineDataResultBuilder { element.speciesLabel = speciesLabel; element.propertyName = NonTargetCatch.PROPERTY_TOTAL_COUNT; element.newValue = nonTargetCatch.getTotalCount(); - element.computeValueSource = l(locale, nonTargetCatch.getTotalCountComputedSource().getI18nKey()); + element.computeValueSource = I18nEnumUtil.getLabel(locale, nonTargetCatch.getTotalCountComputedSource()); nonTargetCatchModificationBuilder.add(element); break; @@ -209,8 +210,8 @@ public class ConsolidateActivitySeineDataResultBuilder { } public ConsolidateActivitySeineDataResultBuilder setSchoolTypeChanged(SchoolTypePersist oldSchoolType, SchoolTypePersist newSchoolType) { - this.oldSchoolType = l(locale, oldSchoolType.getI18nKey()); - this.newSchoolType = l(locale, newSchoolType.getI18nKey()); + this.oldSchoolType = l(locale, I18nEnumUtil.getLabel(oldSchoolType)); + this.newSchoolType = l(locale, I18nEnumUtil.getLabel(newSchoolType)); return this; } diff --git a/observe-services-topia/src/main/java/fr/ird/observe/services/service/actions/consolidate/ConsolidateDataServiceTopia.java b/observe-services-topia/src/main/java/fr/ird/observe/services/service/actions/consolidate/ConsolidateDataServiceTopia.java index 1b3c9a5..443a4dd 100644 --- a/observe-services-topia/src/main/java/fr/ird/observe/services/service/actions/consolidate/ConsolidateDataServiceTopia.java +++ b/observe-services-topia/src/main/java/fr/ird/observe/services/service/actions/consolidate/ConsolidateDataServiceTopia.java @@ -474,7 +474,7 @@ public class ConsolidateDataServiceTopia extends ObserveServiceTopia implements meanLength = totalLength / totalCount; - computedSource = NonTargetCatchComputedValueSourcePersist.FROM_SAMPLE; + computedSource = NonTargetCatchComputedValueSourcePersist.fromSample; } } @@ -483,7 +483,7 @@ public class ConsolidateDataServiceTopia extends ObserveServiceTopia implements // on prend directement la valeur fournie par le référentiel meanLength = lengthWeightParameter.getMeanLength(); - computedSource = NonTargetCatchComputedValueSourcePersist.FROM_REFERENTIEL; + computedSource = NonTargetCatchComputedValueSourcePersist.fromReferentiel; } if (meanLength != null) { @@ -530,7 +530,7 @@ public class ConsolidateDataServiceTopia extends ObserveServiceTopia implements if (totalCount != 0) { nonTargetCatch.setTotalCount(totalCount); - nonTargetCatch.setTotalCountComputedSource(NonTargetCatchComputedValueSourcePersist.FROM_SAMPLE); + nonTargetCatch.setTotalCountComputedSource(NonTargetCatchComputedValueSourcePersist.fromSample); } } @@ -552,14 +552,14 @@ public class ConsolidateDataServiceTopia extends ObserveServiceTopia implements if (nonTargetCatch.getMeanLength() == null) { nonTargetCatch.setMeanLength(lengthWeightParameter.getMeanLength()); - nonTargetCatch.setMeanLengthComputedSource(NonTargetCatchComputedValueSourcePersist.FROM_REFERENTIEL); + nonTargetCatch.setMeanLengthComputedSource(NonTargetCatchComputedValueSourcePersist.fromReferentiel); } if (nonTargetCatch.getMeanWeight() == null) { nonTargetCatch.setMeanWeight(lengthWeightParameter.getMeanWeight()); - nonTargetCatch.setMeanWeightComputedSource(NonTargetCatchComputedValueSourcePersist.FROM_REFERENTIEL); + nonTargetCatch.setMeanWeightComputedSource(NonTargetCatchComputedValueSourcePersist.fromReferentiel); } @@ -584,7 +584,7 @@ public class ConsolidateDataServiceTopia extends ObserveServiceTopia implements // calcul le weight poids à partir de nb estime et du poids moyen catchWeight = meanWeight * (float) totalCount / 1000; nonTargetCatch.setCatchWeight(catchWeight); - nonTargetCatch.setCatchWeightComputedSource(NonTargetCatchComputedValueSourcePersist.FROM_DATA); + nonTargetCatch.setCatchWeightComputedSource(NonTargetCatchComputedValueSourcePersist.fromData); } @@ -593,19 +593,19 @@ public class ConsolidateDataServiceTopia extends ObserveServiceTopia implements // calcul le nb estime à partir du poids estime et du poids moyen totalCount = (int) ((float) 1000 * catchWeight / meanWeight); nonTargetCatch.setTotalCount(totalCount); - nonTargetCatch.setTotalCountComputedSource(NonTargetCatchComputedValueSourcePersist.FROM_DATA); + nonTargetCatch.setTotalCountComputedSource(NonTargetCatchComputedValueSourcePersist.fromData); } if (meanWeight == null && totalCount != null && totalCount != 0 && catchWeight != null && - !NonTargetCatchComputedValueSourcePersist.FROM_SAMPLE.equals(nonTargetCatch.getTotalCountComputedSource())) { + !NonTargetCatchComputedValueSourcePersist.fromSample.equals(nonTargetCatch.getTotalCountComputedSource())) { // calcul le poids moyen à partir de nb estime et du poids estime // uniquement si le nombre estimé ne vient pas des échantillons (voir http://forge.codelutin.com/issues/4670) meanWeight = catchWeight * (float) 1000 / (float) totalCount; nonTargetCatch.setMeanWeight(meanWeight); - nonTargetCatch.setMeanWeightComputedSource(NonTargetCatchComputedValueSourcePersist.FROM_DATA); + nonTargetCatch.setMeanWeightComputedSource(NonTargetCatchComputedValueSourcePersist.fromData); } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.