Author: tchemit Date: 2013-04-18 21:07:23 +0200 (Thu, 18 Apr 2013) New Revision: 826 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/826 Log: reformat code, add license, ... Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingException.java trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java =================================================================== --- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-04-18 18:58:30 UTC (rev 825) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-04-18 19:07:23 UTC (rev 826) @@ -319,7 +319,7 @@ public List<Species> getAllReferentSpecies(TuttiProtocol protocol) { return driver.getAllReferentSpecies(protocol); } - + @Override public Species getSpeciesByReferenceTaxonIdWithVernacularCode(Integer referenceTaxonId) { return driver.getSpeciesByReferenceTaxonIdWithVernacularCode(referenceTaxonId); Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingException.java =================================================================== --- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingException.java 2013-04-18 18:58:30 UTC (rev 825) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingException.java 2013-04-18 19:07:23 UTC (rev 826) @@ -1,12 +1,39 @@ package fr.ifremer.tutti.service.catches; +/* + * #%L + * Tutti :: Service + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import fr.ifremer.tutti.TuttiBusinessException; /** * @author kmorin <kmorin@codelutin.com> + * @since 1.5 */ public class TuttiWeightComputingException extends TuttiBusinessException { + private static final long serialVersionUID = 1L; + public enum CatchType { SPECIES, BENTHOS, MARINE_LITTER } Property changes on: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingException.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java =================================================================== --- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java 2013-04-18 18:58:30 UTC (rev 825) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java 2013-04-18 19:07:23 UTC (rev 826) @@ -190,9 +190,9 @@ try { if (catchBatch != null) { computeCatchBatchWeights(catchBatch, - rootSpeciesBatch, - rootBenthosBatch, - rootMarineLitterBatch); + rootSpeciesBatch, + rootBenthosBatch, + rootMarineLitterBatch); } } catch (TuttiBusinessException e) { result.add(e.getMessage()); @@ -480,9 +480,9 @@ // weight, then set the weight of the sample if (frequencyWeight > categoryWeight) { throw new TuttiWeightComputingException(_ - ("tutti.service.operations.computeWeights.species.error.incoherentCategoryWeight"), - TuttiWeightComputingException.CatchType.SPECIES, - thisIndex); + ("tutti.service.operations.computeWeights.species.error.incoherentCategoryWeight"), + TuttiWeightComputingException.CatchType.SPECIES, + thisIndex); } else if (rowWeight == null) { batch.setComputedWeight(frequencyWeight); @@ -639,7 +639,7 @@ } } if (result == null - && batch.getParentBatch() == null) { + && batch.getParentBatch() == null) { throw new TuttiWeightComputingException( _("tutti.service.operations.computeWeights.benthos.error.noWeight"), TuttiWeightComputingException.CatchType.BENTHOS, @@ -656,13 +656,13 @@ if (rootMarineLitterBatch != null) { List<MarineLitterBatch> children = rootMarineLitterBatch.getChildren(); - for (int i = 0 ; i < children.size() ; i++) { + for (int i = 0; i < children.size(); i++) { MarineLitterBatch batch = children.get(i); if (batch.getWeight() == null) { - throw new TuttiWeightComputingException( - _("tutti.service.operations.computeWeights.marineLitter.error.noWeight"), - TuttiWeightComputingException.CatchType.MARINE_LITTER, - i); + throw new TuttiWeightComputingException( + _("tutti.service.operations.computeWeights.marineLitter.error.noWeight"), + TuttiWeightComputingException.CatchType.MARINE_LITTER, + i); } } } Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java =================================================================== --- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java 2013-04-18 18:58:30 UTC (rev 825) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java 2013-04-18 19:07:23 UTC (rev 826) @@ -1,11 +1,36 @@ package fr.ifremer.tutti.service.catches; +/* + * #%L + * Tutti :: Service + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import com.google.common.collect.Maps; import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import fr.ifremer.tutti.service.*; -import fr.ifremer.tutti.service.catches.TuttiWeightComputingService; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import fr.ifremer.tutti.service.AbstractTuttiService; +import fr.ifremer.tutti.service.PersistenceService; +import fr.ifremer.tutti.service.TuttiDataContext; +import fr.ifremer.tutti.service.TuttiServiceContext; +import fr.ifremer.tutti.service.ValidationService; import org.nuiton.validator.NuitonValidatorResult; import org.nuiton.validator.NuitonValidatorScope; @@ -18,9 +43,6 @@ */ public class ValidateCruiseOperationsService extends AbstractTuttiService { - private static final Log log = - LogFactory.getLog(TuttiWeightComputingService.class); - protected PersistenceService persistenceService; protected ValidationService validationService; Property changes on: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native