Author: tchemit Date: 2013-03-29 01:30:05 +0100 (Fri, 29 Mar 2013) New Revision: 710 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/710 Log: refs #1865: [MACRODECHET] - Gestion de la saisie des Macrod?\195?\169chets Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceService.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceImpl.java trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceReadTest.java trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceWriteTest.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchRowModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchTableModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java Removed: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceReadTest.java trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceWriteTest.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchRowModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchTableModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIModel.java Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiBeanUIModel.java trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-03-29 00:30:05 UTC (rev 710) @@ -30,7 +30,7 @@ import fr.ifremer.tutti.persistence.entities.data.CatchBatch; import fr.ifremer.tutti.persistence.entities.data.Cruise; import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch; +import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch; import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch; import fr.ifremer.tutti.persistence.entities.data.Program; import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch; @@ -83,9 +83,7 @@ List<TuttiLocation> getAllProgramZone(); /** - * @return all countries (used by a {@link Cruise}). - * @see {@link Cruise#getCountry()} - * @see {@link Cruise#setCountry(TuttiLocation)} + * @return all countries. * @since 0.1 */ List<TuttiLocation> getAllCountry(); @@ -210,9 +208,9 @@ Caracteristic getAgeCaracteristic(); - Caracteristic getMacroWasteCategoryCaracteristic(); + Caracteristic getMarineLitterCategoryCaracteristic(); - Caracteristic getMacroWasteSizeCategoryCaracteristic(); + Caracteristic getMarineLitterSizeCategoryCaracteristic(); List<Gear> getAllScientificGear(); @@ -550,21 +548,29 @@ void deletePlanktonBatch(String id); //------------------------------------------------------------------------// - //-- Macrodechet Batch methods --// + //-- MarineLitter Batch methods --// //------------------------------------------------------------------------// - List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId); + /** + * Get the batch parent of all root {@link MarineLitterBatch} for the given + * fishing operation. + * <p/> + * <strong>Note:</strong> All childs of the batch should be loaded here. + * + * @param fishingOperationId if of the fishing operation to seek + * @return the list of root {@link MarineLitterBatch} + * @since 1.3 + */ + BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId); - MacroWasteBatch getMacroWasteBatch(String id); - @Transactional(readOnly = false) - MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean); + MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean); @Transactional(readOnly = false) - MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean); + MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean); @Transactional(readOnly = false) - void deleteMacroWasteBatch(String id); + void deleteMarineLitterBatch(String id); //------------------------------------------------------------------------// //-- Accidentel Batch methods --// Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-03-29 00:30:05 UTC (rev 710) @@ -33,7 +33,7 @@ import fr.ifremer.tutti.persistence.entities.data.CatchBatch; import fr.ifremer.tutti.persistence.entities.data.Cruise; import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch; +import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch; import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch; import fr.ifremer.tutti.persistence.entities.data.Program; import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch; @@ -53,7 +53,7 @@ import fr.ifremer.tutti.persistence.service.CatchBatchPersistenceService; import fr.ifremer.tutti.persistence.service.CruisePersistenceService; import fr.ifremer.tutti.persistence.service.FishingOperationPersistenceService; -import fr.ifremer.tutti.persistence.service.MacroWasteBatchPersistenceService; +import fr.ifremer.tutti.persistence.service.MarineLitterBatchPersistenceService; import fr.ifremer.tutti.persistence.service.PlanktonBatchPersistenceService; import fr.ifremer.tutti.persistence.service.ProgramPersistenceService; import fr.ifremer.tutti.persistence.service.ProtocolPersistenceService; @@ -105,7 +105,7 @@ protected PlanktonBatchPersistenceService planktonBatchService; @Autowired - protected MacroWasteBatchPersistenceService macroWasteBatchService; + protected MarineLitterBatchPersistenceService marineLitterBatchService; @Autowired protected AccidentalBatchPersistenceService accidentalBatchService; @@ -142,7 +142,7 @@ speciesBatchService.init(); benthosBatchService.init(); planktonBatchService.init(); - macroWasteBatchService.init(); + marineLitterBatchService.init(); accidentalBatchService.init(); protocolService.init(); attachmentService.init(); @@ -162,7 +162,7 @@ speciesBatchService.close(); benthosBatchService.close(); planktonBatchService.close(); - macroWasteBatchService.close(); + marineLitterBatchService.close(); accidentalBatchService.close(); protocolService.close(); attachmentService.close(); @@ -305,13 +305,13 @@ } @Override - public Caracteristic getMacroWasteCategoryCaracteristic() { - return referentialService.getMacroWasteCategoryCaracteristic(); + public Caracteristic getMarineLitterCategoryCaracteristic() { + return referentialService.getMarineLitterCategoryCaracteristic(); } @Override - public Caracteristic getMacroWasteSizeCategoryCaracteristic() { - return referentialService.getMacroWasteSizeCategoryCaracteristic(); + public Caracteristic getMarineLitterSizeCategoryCaracteristic() { + return referentialService.getMarineLitterSizeCategoryCaracteristic(); } @Override @@ -654,34 +654,29 @@ } //------------------------------------------------------------------------// - //-- Macrodechet Batch methods --// + //-- MarineLitter Batch methods --// //------------------------------------------------------------------------// @Override - public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) { - return macroWasteBatchService.getAllMacroWasteBatch(fishingOperationId); + public BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId) { + return marineLitterBatchService.getRootMarineLitterBatch(fishingOperationId); } @Override - public MacroWasteBatch getMacroWasteBatch(String id) { - return macroWasteBatchService.getMacroWasteBatch(id); + public MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean) { + return marineLitterBatchService.createMarineLitterBatch(bean); } @Override - public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) { - return macroWasteBatchService.createMacroWasteBatch(bean); + public MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean) { + return marineLitterBatchService.saveMarineLitterBatch(bean); } @Override - public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) { - return macroWasteBatchService.saveMacroWasteBatch(bean); + public void deleteMarineLitterBatch(String id) { + marineLitterBatchService.deleteMarineLitterBatch(id); } - @Override - public void deleteMacroWasteBatch(String id) { - macroWasteBatchService.deleteMacroWasteBatch(id); - } - //------------------------------------------------------------------------// //-- Accidental Batch methods --// //------------------------------------------------------------------------// Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-03-29 00:30:05 UTC (rev 710) @@ -30,7 +30,7 @@ import fr.ifremer.tutti.persistence.entities.data.CatchBatch; import fr.ifremer.tutti.persistence.entities.data.Cruise; import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch; +import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch; import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch; import fr.ifremer.tutti.persistence.entities.data.Program; import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch; @@ -162,12 +162,12 @@ } @Override - public Caracteristic getMacroWasteCategoryCaracteristic() { + public Caracteristic getMarineLitterCategoryCaracteristic() { throw new RuntimeException("method not implemented"); } @Override - public Caracteristic getMacroWasteSizeCategoryCaracteristic() { + public Caracteristic getMarineLitterSizeCategoryCaracteristic() { throw new RuntimeException("method not implemented"); } @@ -447,31 +447,26 @@ } @Override - public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) { + public BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId) { throw new RuntimeException("method not implemented"); } @Override - public MacroWasteBatch getMacroWasteBatch(String id) { + public MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean) { throw new RuntimeException("method not implemented"); } @Override - public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) { + public MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean) { throw new RuntimeException("method not implemented"); } @Override - public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) { + public void deleteMarineLitterBatch(String id) { throw new RuntimeException("method not implemented"); } @Override - public void deleteMacroWasteBatch(String id) { - throw new RuntimeException("method not implemented"); - } - - @Override public List<AccidentalBatch> getAllAccidentalBatch(String fishingOperationId) { throw new RuntimeException("method not implemented"); } Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java 2013-03-29 00:30:05 UTC (rev 710) @@ -118,6 +118,10 @@ return Maps.uniqueIndex(list, GET_ID); } + public static <B extends IdAware> Map<Integer, B> splitByIdAsInt(Iterable<B> list) { + return Maps.uniqueIndex(list, GET_ID_AS_INT); + } + public static Map<String, Species> splitByTaxonId(Iterable<Species> list) { return Maps.uniqueIndex(list, GET_TAXON_ID); } @@ -140,6 +144,13 @@ } }; + public static final Function<IdAware, Integer > GET_ID_AS_INT = new Function<IdAware, Integer >() { + @Override + public Integer apply(IdAware input) { + return input.getIdAsInt(); + } + }; + public static <B extends IdAware> boolean isNew(B bean) { return bean.getId() == null; } Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java 2013-03-29 00:30:05 UTC (rev 710) @@ -1,54 +0,0 @@ -package fr.ifremer.tutti.persistence.service; - -/* - * #%L - * Tutti :: Persistence API - * $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.persistence.TuttiPersistenceServiceImplementor; -import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -/** - * CRUD of {@link MacroWasteBatch} entity. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -@Transactional(readOnly = true) -public interface MacroWasteBatchPersistenceService extends TuttiPersistenceServiceImplementor { - - List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId); - - MacroWasteBatch getMacroWasteBatch(String id); - - @Transactional(readOnly = false) - MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean); - - @Transactional(readOnly = false) - MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean); - - @Transactional(readOnly = false) - void deleteMacroWasteBatch(String id); -} Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java 2013-03-29 00:30:05 UTC (rev 710) @@ -1,73 +0,0 @@ -package fr.ifremer.tutti.persistence.service; - -/* - * #%L - * Tutti :: Persistence API - * $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.Lists; -import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -@Service("macroWasteBatchPersistenceService") -public class MacroWasteBatchPersistenceServiceImpl extends AbstractPersistenceService implements MacroWasteBatchPersistenceService { - - /** Logger. */ - private static final Log log = - LogFactory.getLog(MacroWasteBatchPersistenceServiceImpl.class); - - @Override - public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) { - List<MacroWasteBatch> result = Lists.newArrayList(); - - // TODO BL - - return result; - } - - @Override - public MacroWasteBatch getMacroWasteBatch(String id) { - return null; - } - - @Override - public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) { - return null; - } - - @Override - public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) { - return null; - } - - @Override - public void deleteMacroWasteBatch(String id) { - } -} Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceService.java (from rev 709, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java) =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceService.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceService.java 2013-03-29 00:30:05 UTC (rev 710) @@ -0,0 +1,61 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence API + * $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.persistence.TuttiPersistenceServiceImplementor; +import fr.ifremer.tutti.persistence.entities.data.BatchContainer; +import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch; +import org.springframework.transaction.annotation.Transactional; + +/** + * CRUD of {@link MarineLitterBatch} entity. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Transactional(readOnly = true) +public interface MarineLitterBatchPersistenceService extends TuttiPersistenceServiceImplementor { + + /** + * Get the batch parent of all root {@link MarineLitterBatch} for the given + * fishing operation. + * <p/> + * <strong>Note:</strong> All childs of the batch should be loaded here. + * + * @param fishingOperationId if of the fishing operation to seek + * @return the list of root {@link MarineLitterBatch} + * @since 1.3 + */ + BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId); + + @Transactional(readOnly = false) + MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean); + + @Transactional(readOnly = false) + MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean); + + @Transactional(readOnly = false) + void deleteMarineLitterBatch(String id); +} Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceImpl.java (from rev 709, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java) =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceImpl.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceImpl.java 2013-03-29 00:30:05 UTC (rev 710) @@ -0,0 +1,176 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence API + * $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.base.Preconditions; +import fr.ifremer.adagio.core.dao.data.batch.Batch; +import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao; +import fr.ifremer.adagio.core.dao.data.batch.SortingBatch; +import fr.ifremer.adagio.core.dao.data.measure.QuantificationMeasurement; +import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValue; +import fr.ifremer.tutti.persistence.entities.TuttiEntities; +import fr.ifremer.tutti.persistence.entities.data.BatchContainer; +import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch; +import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; +import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue; +import fr.ifremer.tutti.persistence.service.batch.BatchPersistenceHelper; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.Map; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Service("marineLitterBatchPersistenceService") +public class MarineLitterBatchPersistenceServiceImpl extends AbstractPersistenceService implements MarineLitterBatchPersistenceService { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(MarineLitterBatchPersistenceServiceImpl.class); + + @Resource(name = "referentialPersistenceService") + protected ReferentialPersistenceService referentialService; + + @Resource(name = "catchBatchDao") + protected CatchBatchExtendDao catchBatchDao; + + @Resource(name = "batchPersistenceHelper") + protected BatchPersistenceHelper batchHelper; + + Integer marineLitterType; + + Integer marineLitterSizeCategory; + + Map<Integer, CaracteristicQualitativeValue> marineLitterCategoryCaracteristicValues; + + Map<Integer, CaracteristicQualitativeValue> marineLitterSizeCategoryCaracteristicValues; + + @Override + public void init() { + super.init(); + + Caracteristic marineLitterCategoryCaracteristic = referentialService.getMarineLitterCategoryCaracteristic(); + marineLitterType = marineLitterCategoryCaracteristic.getIdAsInt(); + marineLitterCategoryCaracteristicValues = TuttiEntities.splitByIdAsInt(marineLitterCategoryCaracteristic.getQualitativeValue()); + + Caracteristic marineLitterSizeCategoryCaracteristic = referentialService.getMarineLitterSizeCategoryCaracteristic(); + marineLitterSizeCategory = marineLitterSizeCategoryCaracteristic.getIdAsInt(); + marineLitterSizeCategoryCaracteristicValues = TuttiEntities.splitByIdAsInt(marineLitterSizeCategoryCaracteristic.getQualitativeValue()); + } + + @Override + public BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId) { + Preconditions.checkNotNull(fishingOperationId); + + // Load batch tree + Integer catchBatchId = catchBatchDao.getIdByFishingOperationId(Integer.valueOf(fishingOperationId)); + Preconditions.checkNotNull(catchBatchId); + + fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); + Preconditions.checkNotNull(catchBatch); + + Collection<Batch> catchBatchChilds = catchBatch.getChildBatchs(); + + // Vrac / Marine Litter + SortingBatch vracMarineLitterBatch = catchBatchDao.getSortingBatch( + catchBatchChilds, + "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID, + "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_MARINE_LITTER); + + // container of speciesBatch is arbitraty put on vrac type (there is + // no common ancestor for all species batch). + BatchContainer<MarineLitterBatch> result = new BatchContainer<>(); + result.setId(vracMarineLitterBatch.getId()); + + for (Batch batch1 : vracMarineLitterBatch.getChildBatchs()) { + SortingBatch source = (SortingBatch) batch1; + + MarineLitterBatch target = new MarineLitterBatch(); + entityToMacroWasteBatch(source, target); + result.addChildren(target); + + if (log.isInfoEnabled()) { + log.info("Loaded CatchBatch MarineLetter > " + + target.getMarineLitterCategory().getName() + " / " + + target.getMarineLitterSizeCategory().getName() + " : " + + target.getId()); + } + } + + return result; + } + + @Override + public MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean) { + return null; + } + + @Override + public MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean) { + return null; + } + + @Override + public void deleteMarineLitterBatch(String id) { + } + + public MarineLitterBatch entityToMacroWasteBatch(SortingBatch source, + MarineLitterBatch target) { + + target.setId(source.getId().toString()); + + // Individual count + target.setNumber(source.getIndividualCount()); + + // Weight + target.setWeight(source.getWeight()); + + // Comments + target.setComment(source.getComments()); + + // Should have 2 quantification measurements + + for (QuantificationMeasurement measurement : source.getQuantificationMeasurements()) { + Integer pmfmId = measurement.getPmfm().getId(); + if (marineLitterType.equals(pmfmId)) { + QualitativeValue qualitativeValue = measurement.getQualitativeValue(); + Integer id = qualitativeValue.getId(); + CaracteristicQualitativeValue value = marineLitterCategoryCaracteristicValues.get(id); + target.setMarineLitterCategory(value); + } else if (marineLitterSizeCategory.equals(pmfmId)) { + QualitativeValue qualitativeValue = measurement.getQualitativeValue(); + Integer id = qualitativeValue.getId(); + CaracteristicQualitativeValue value = marineLitterSizeCategoryCaracteristicValues.get(id); + target.setMarineLitterSizeCategory(value); + } + } + return target; + } +} Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java 2013-03-29 00:30:05 UTC (rev 710) @@ -64,8 +64,6 @@ /** * @return all countries (used by a {@link Cruise}). - * @see {@link Cruise#getCountry()} - * @see {@link Cruise#setCountry(TuttiLocation)} * @since 0.1 */ @Cacheable(value = "countries") @@ -204,9 +202,9 @@ Caracteristic getAgeCaracteristic(); - Caracteristic getMacroWasteCategoryCaracteristic(); + Caracteristic getMarineLitterCategoryCaracteristic(); - Caracteristic getMacroWasteSizeCategoryCaracteristic(); + Caracteristic getMarineLitterSizeCategoryCaracteristic(); List<Gear> getAllScientificGear(); Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-03-29 00:30:05 UTC (rev 710) @@ -532,14 +532,14 @@ } @Override - public Caracteristic getMacroWasteCategoryCaracteristic() { + public Caracteristic getMarineLitterCategoryCaracteristic() { Integer pmfmId = enumeration.PMFM_ID_MARINE_LITTER_TYPE; Caracteristic result = thisService.getCaracteristic(pmfmId); return result; } @Override - public Caracteristic getMacroWasteSizeCategoryCaracteristic() { + public Caracteristic getMarineLitterSizeCategoryCaracteristic() { Integer pmfmId = enumeration.PMFM_ID_MARINE_LITTER_SIZE_CATEGORY; Caracteristic result = thisService.getCaracteristic(pmfmId); return result; Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-03-29 00:30:05 UTC (rev 710) @@ -161,6 +161,9 @@ @Value("${QualitativeValueId.SORTING_TYPE_BENTHOS}") public final Integer QUALITATIVE_ID_SORTING_TYPE_BENTHOS = null; + @Value("${QualitativeValueId.SORTING_TYPE_MARINE_LITTER}") + public final Integer QUALITATIVE_ID_SORTING_TYPE_MARINE_LITTER= null; + @Value("${StatusCode.ENABLE}") public final String STATUS_VALID_CODE = null; Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java 2013-03-29 00:30:05 UTC (rev 710) @@ -100,9 +100,9 @@ PlanktonBatchPersistenceService.class); } - public static MacroWasteBatchPersistenceService getMacroWasteBatchPersistenceService() { - return getPersistenceService("macroWasteBatchPersistenceService", - MacroWasteBatchPersistenceService.class); + public static MarineLitterBatchPersistenceService getMarineLitterBatchPersistenceService() { + return getPersistenceService("marineLitterBatchPersistenceService", + MarineLitterBatchPersistenceService.class); } public static AccidentalBatchPersistenceService getAccidentalBatchPersistenceService() { Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-03-29 00:30:05 UTC (rev 710) @@ -24,15 +24,12 @@ * #L% */ - import com.google.common.collect.Lists; import fr.ifremer.adagio.core.dao.data.batch.Batch; import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao; import fr.ifremer.adagio.core.dao.data.batch.SortingBatch; -import fr.ifremer.adagio.core.dao.data.batch.validator.CatchBatchQuickFix; import fr.ifremer.adagio.core.dao.data.batch.validator.CatchBatchValidationError; import fr.ifremer.adagio.core.dao.data.batch.validator.CatchBatchValidator; -import fr.ifremer.adagio.core.dao.data.measure.SortingMeasurement; import fr.ifremer.tutti.persistence.service.CatchBatchPersistenceService; import fr.ifremer.tutti.persistence.service.TuttiEnumerationFile; import org.apache.commons.logging.Log; @@ -71,7 +68,7 @@ @Override public List<CatchBatchValidationError> validate(fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch) { List<CatchBatchValidationError> errors = Lists.newArrayList(); - validate(catchBatch.getChildBatchs(), errors, 1); + validate(catchBatch.getChildBatchs(), errors); return errors; } @@ -80,8 +77,7 @@ // ------------------------------------------------------------------------// protected void validate(Collection<Batch> batchs, - List<CatchBatchValidationError> errors, - int treeLevel) { + List<CatchBatchValidationError> errors) { // Vrac SortingBatch vracBatch = catchBatchDao.getSortingBatch(batchs, @@ -92,14 +88,14 @@ } if (vracBatch == null) { - addError(errors, n_("tutti.persistence.batch.validation.vracNotFound"), null); + addError(errors, n_("tutti.persistence.batch.validation.vracNotFound")); } else { // Vrac > Species SortingBatch speciesBatch = catchBatchDao.getSortingBatch(vracBatch.getChildBatchs(), "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); if (speciesBatch == null) { - addError(errors, n_("tutti.persistence.batch.validation.vracSpeciesNotFound"), null); + addError(errors, n_("tutti.persistence.batch.validation.vracSpeciesNotFound")); } else { // Vrac > Species > Inert SortingBatch inertBatch = catchBatchDao.getSortingBatch(speciesBatch.getChildBatchs(), @@ -122,7 +118,7 @@ "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS); if (benthosBatch == null) { - addWarning(errors, n_("tutti.persistence.batch.validation.vracBenthosNotFound")); + addError(errors, n_("tutti.persistence.batch.validation.vracBenthosNotFound")); } else { // Vrac > Benthos > Inert SortingBatch inertBatch = catchBatchDao.getSortingBatch(benthosBatch.getChildBatchs(), @@ -156,6 +152,7 @@ addWarning(errors, n_("tutti.persistence.batch.validation.horsVracSpeciesNotFound")); } + // Hors Vrac > Benthos SortingBatch benthosBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(), "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS); @@ -172,118 +169,14 @@ if (unsortedBatch == null) { addWarning(errors, n_("tutti.persistence.batch.validation.unsortedNotFound")); } - - // May be, the tree is an old structure - if (vracBatch == null && horsVracBatch == null && unsortedBatch == null) { - boolean allBatchHasSpecies = true; - boolean allBatchHasVrac = true; - boolean someBatchHasSortingMeasurement = false; - for (Batch batch1 : batchs) { - SortingBatch batch = (SortingBatch) batch1; - if (batch.getReferenceTaxon() == null) { - allBatchHasSpecies = false; - break; - } - if (allBatchHasVrac && batch.getSortingMeasurements() != null) { - if (batch.getSortingMeasurements().size() > 1) { - allBatchHasVrac = false; - someBatchHasSortingMeasurement = true; - } else if (batch.getSortingMeasurements().size() == 1) { - someBatchHasSortingMeasurement = true; - SortingMeasurement sm = batch.getSortingMeasurements().iterator().next(); - if (!enumeration.PMFM_ID_SORTED_UNSORTED.equals(sm.getPmfm().getId()) - || sm.getQualitativeValue() == null - || !enumeration.QUALITATIVE_VRAC_ID.equals(sm.getQualitativeValue().getId())) { - allBatchHasVrac = false; - } - } - } - } - if (allBatchHasSpecies && !someBatchHasSortingMeasurement) { - errors.clear(); - addError(errors, - n_("tutti.persistence.batch.validation.onlySpeciesBatchStructure"), - null); - - } else if (allBatchHasSpecies && allBatchHasVrac) { - errors.clear(); - addError(errors, - n_("tutti.persistence.batch.validation.onlySpeciesBatchStructure"), - null); - } - } } -// /** -// * Repair tree batch, when only species have been found under the cacth batch. -// * This append typically with CGFS cruise. -// * -// * @param catchBatch -// * @return -// */ -// protected CatchBatch repairHistoricalData(CatchBatch catchBatch, -// boolean batchHasVracSortingMeasurement) { -// Preconditions.checkNotNull(catchBatch); -// Preconditions.checkNotNull(catchBatch.getId()); -// Preconditions.checkNotNull(catchBatch.getFishingOperation()); -// Preconditions.checkNotNull(catchBatch.getFishingOperation().getId()); -// -// // Copy catch batch children -// Collection<Batch> speciesBatchChilds = Sets.newHashSet(); -// speciesBatchChilds.addAll(catchBatch.getChildBatchs()); -// catchBatch.setChildBatchs(new HashSet<Batch>()); -// -// // Clean catch batch -// batchService.cleanEntity(catchBatch, true); -// -// SortingBatch speciesBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(), -// "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID, -// "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); -// if (speciesBatch == null) { -// throw new DataIntegrityViolationException("Invalid batch tree format. Could not retrieve 'Vrac>Species' batch."); -// } -// -// // For all species batch : set the batch 'Vrac>Species' as new parent -// for (Batch speciesBatchChild : speciesBatchChilds) { -// SortingBatch batch = (SortingBatch) speciesBatchChild; -// batch.setParentBatch(speciesBatch); -// -// if (batchHasVracSortingMeasurement) { -// // Remove redundant 'Vrac' sorting measurement -// SortingMeasurement sm = catchBatchDao.getSortingMeasurement(batch, enumeration.PMFM_ID_SORTED_UNSORTED, null, false); -// batch.getSortingMeasurements().remove(sm); -// } -// -// batch.setExhaustiveInventory(Boolean.TRUE); -// -// // Add an offset into the rank order, because of special batchs 'Biota' (=live) and 'Inert' -// short rankOrder = (short) (batch.getRankOrder() + 2); -// batch.setRankOrder(rankOrder); -// -// //FIXME-TC We should do nothing with this: this is not our problem... -// //TODO What to do with weird comments! categorie_individu -// // Reset comments if set to "taxon" -// if (batch.getComments() != null && "taxon".equals(batch.getComments())) { -// batch.setComments(null); -// } -// -// speciesBatch.getChildBatchs().add(batch); -// } -// -// // Save mofidifications : -// catchBatchDao.update(catchBatch); -// -// return catchBatch; -// } - protected void addError(List<CatchBatchValidationError> errors, - String messageKey, - CatchBatchQuickFix quickFix) { + String messageKey) { CatchBatchValidationError error = new CatchBatchValidationError( messageKey, _(messageKey), CatchBatchValidationError.GRAVITY_ERROR); - error.setQuickFixes(Lists.newArrayList(quickFix)); errors.add(error); } Modified: trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties =================================================================== --- trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties 2013-03-29 00:30:05 UTC (rev 710) @@ -379,7 +379,7 @@ QualitativeValueId.SORTING_TYPE_SPECIES=2147 QualitativeValueId.SORTING_TYPE_BENTHOS=2148 QualitativeValueId.SORTING_TYPE_PLANCTON=2149 -QualitativeValueId.SORTING_TYPE_MACRO_WASTE=2150 +QualitativeValueId.SORTING_TYPE_MARINE_LITTER=2150 QualitativeValueId.SORTING_TYPE_ACCIDENTAL_CATCH=2151 Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties =================================================================== --- trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties 2013-03-29 00:30:05 UTC (rev 710) @@ -33,7 +33,7 @@ fr.ifremer.tutti.persistence.entities.data.Cruise.attribute.headOfSortRoom.stereotype=ordered fr.ifremer.tutti.persistence.entities.data.FishingOperation.attribute.recorderPerson.stereotype=ordered -fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch.attribute.macroWasteCategory.stereotype=ordered +fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch.attribute.marineLitterCategory.stereotype=ordered fr.ifremer.tutti.persistence.entities.data.SpeciesBatch.attribute.childBatchs.stereotype=ordered fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol.attribute.gearUseFeaturePmfmId.stereotype=ordered Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo =================================================================== (Binary files differ) Deleted: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceReadTest.java =================================================================== --- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceReadTest.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceReadTest.java 2013-03-29 00:30:05 UTC (rev 710) @@ -1,62 +0,0 @@ -package fr.ifremer.tutti.persistence.service; - -/* - * #%L - * Tutti :: Persistence API - * $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.persistence.DatabaseResource; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; - -/** - * To test {@link MacroWasteBatchPersistenceService} for read operation. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -@Ignore -public class MacroWasteBatchPersistenceServiceReadTest { - - @ClassRule - public static final DatabaseResource dbResource = DatabaseResource.readDb(); - - protected MacroWasteBatchPersistenceService service; - - @Before - public void setUp() throws Exception { - service = TuttiPersistenceServiceLocator.getMacroWasteBatchPersistenceService(); - } - - @Test - public void getAllMacroWasteBatch(/*String fishingOperationId*/) { - - } - - @Test - public void getMacroWasteBatch(/*String id*/) { - - } - -} Deleted: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceWriteTest.java =================================================================== --- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceWriteTest.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceWriteTest.java 2013-03-29 00:30:05 UTC (rev 710) @@ -1,65 +0,0 @@ -package fr.ifremer.tutti.persistence.service; - -/* - * #%L - * Tutti :: Persistence API - * $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.persistence.DatabaseResource; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; - -/** - * To test {@link MacroWasteBatchPersistenceService} for write operation. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -@Ignore -public class MacroWasteBatchPersistenceServiceWriteTest { - - @ClassRule - public static final DatabaseResource dbResource = DatabaseResource.writeDb(); - - protected MacroWasteBatchPersistenceService service; - - @Before - public void setUp() throws Exception { - service = TuttiPersistenceServiceLocator.getMacroWasteBatchPersistenceService(); - } - - @Test - public void createMacroWasteBatch(/*MacroWasteBatch bean*/) { - - } - - @Test - public void saveMacroWasteBatch(/*MacroWasteBatch bean*/) { - - } - - @Test - public void deleteMacroWasteBatch(/*String id*/) { - } -} Copied: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceReadTest.java (from rev 709, trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceReadTest.java) =================================================================== --- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceReadTest.java (rev 0) +++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceReadTest.java 2013-03-29 00:30:05 UTC (rev 710) @@ -0,0 +1,56 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence API + * $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.persistence.DatabaseResource; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; + +/** + * To test {@link MarineLitterBatchPersistenceService} for read operation. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Ignore +public class MarineLitterBatchPersistenceServiceReadTest { + + @ClassRule + public static final DatabaseResource dbResource = DatabaseResource.readDb(); + + protected MarineLitterBatchPersistenceService service; + + @Before + public void setUp() throws Exception { + service = TuttiPersistenceServiceLocator.getMarineLitterBatchPersistenceService(); + } + + @Test + public void getAllRootMarineLitterBatch(/*String fishingOperationId*/) { + + } +} Copied: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceWriteTest.java (from rev 709, trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceWriteTest.java) =================================================================== --- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceWriteTest.java (rev 0) +++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceWriteTest.java 2013-03-29 00:30:05 UTC (rev 710) @@ -0,0 +1,65 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence API + * $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.persistence.DatabaseResource; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; + +/** + * To test {@link MarineLitterBatchPersistenceService} for write operation. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Ignore +public class MarineLitterBatchPersistenceServiceWriteTest { + + @ClassRule + public static final DatabaseResource dbResource = DatabaseResource.writeDb(); + + protected MarineLitterBatchPersistenceService service; + + @Before + public void setUp() throws Exception { + service = TuttiPersistenceServiceLocator.getMarineLitterBatchPersistenceService(); + } + + @Test + public void createMarineLitterBatch(/*MarineLitterBatch bean*/) { + + } + + @Test + public void saveMarineLitterBatch(/*MarineLitterBatch bean*/) { + + } + + @Test + public void deleteMarineLitterBatch(/*String id*/) { + } +} Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java =================================================================== --- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java 2013-03-29 00:30:05 UTC (rev 710) @@ -273,13 +273,13 @@ @Test public void getMacroWasteCategoryCaracteristic() { - Caracteristic result = service.getMacroWasteCategoryCaracteristic(); + Caracteristic result = service.getMarineLitterCategoryCaracteristic(); assertCaracteristicQualitative(result, 21); } @Test public void getMacroWasteSizeCategoryCaracteristic() { - Caracteristic result = service.getMacroWasteSizeCategoryCaracteristic(); + Caracteristic result = service.getMarineLitterSizeCategoryCaracteristic(); assertCaracteristicQualitative(result, 6); } Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java =================================================================== --- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java 2013-03-29 00:30:05 UTC (rev 710) @@ -188,10 +188,10 @@ getLastUpdateDate(TuttiTable.GEAR, internalDb, getSqlDate(2012, 12, 18)); getLastUpdateDate(TuttiTable.LOCATION_CLASSIFICATION, internalDb, getSqlDate(2010, 10, 26)); getLastUpdateDate(TuttiTable.LOCATION_LEVEL, internalDb, getSqlDate(2013, 1, 28)); - getLastUpdateDate(TuttiTable.LOCATION, internalDb, getSqlDate(2013, 2, 27)); + getLastUpdateDate(TuttiTable.LOCATION, internalDb, getSqlDate(2013, 3, 29)); getLastUpdateDate(TuttiTable.TAXONOMIC_LEVEL, internalDb, getSqlDate(2012, 4, 18)); getLastUpdateDate(TuttiTable.REFERENCE_TAXON, internalDb, getSqlDate(2013, 1, 21)); - getLastUpdateDate(TuttiTable.TAXON_NAME, internalDb, getSqlDate(2013, 2, 26)); + getLastUpdateDate(TuttiTable.TAXON_NAME, internalDb, getSqlDate(2013, 3, 29)); getLastUpdateDate(TuttiTable.TAXON_GROUP_TYPE, internalDb, getSqlDate(2012, 5, 24)); getLastUpdateDate(TuttiTable.TAXON_GROUP, internalDb, getSqlDate(2013, 1, 16)); getLastUpdateDate(TuttiTable.ROUND_WEIGHT_CONVERSION, internalDb, getSqlDate(2012, 10, 4)); Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java =================================================================== --- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2013-03-29 00:30:05 UTC (rev 710) @@ -158,7 +158,7 @@ n_("tutti.property.species"); n_("tutti.property.genusSpecies"); n_("tutti.property.sortedUnsortedCategory"); - n_("tutti.property.macroWasteCategory"); + n_("tutti.property.marineLitterCategory"); n_("tutti.property.attachment"); n_("tutti.property.multirigAggregation"); n_("tutti.property.caracteristic"); 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-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-03-29 00:30:05 UTC (rev 710) @@ -37,7 +37,7 @@ import fr.ifremer.tutti.persistence.entities.data.CatchBatch; import fr.ifremer.tutti.persistence.entities.data.Cruise; import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch; +import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch; import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch; import fr.ifremer.tutti.persistence.entities.data.Program; import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch; @@ -403,13 +403,13 @@ } @Override - public Caracteristic getMacroWasteCategoryCaracteristic() { - return driver.getMacroWasteCategoryCaracteristic(); + public Caracteristic getMarineLitterCategoryCaracteristic() { + return driver.getMarineLitterCategoryCaracteristic(); } @Override - public Caracteristic getMacroWasteSizeCategoryCaracteristic() { - return driver.getMacroWasteSizeCategoryCaracteristic(); + public Caracteristic getMarineLitterSizeCategoryCaracteristic() { + return driver.getMarineLitterSizeCategoryCaracteristic(); } @Override @@ -752,29 +752,25 @@ //-- Macrodechet Batch methods --// //------------------------------------------------------------------------// - @Override - public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) { - return driver.getAllMacroWasteBatch(fishingOperationId); - } @Override - public MacroWasteBatch getMacroWasteBatch(String id) { - return driver.getMacroWasteBatch(id); + public BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId) { + return driver.getRootMarineLitterBatch(fishingOperationId); } @Override - public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) { - return driver.createMacroWasteBatch(bean); + public MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean) { + return driver.createMarineLitterBatch(bean); } @Override - public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) { - return driver.saveMacroWasteBatch(bean); + public MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean) { + return driver.saveMarineLitterBatch(bean); } @Override - public void deleteMacroWasteBatch(String id) { - driver.deleteMacroWasteBatch(id); + public void deleteMarineLitterBatch(String id) { + driver.deleteMarineLitterBatch(id); } //------------------------------------------------------------------------// Modified: trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties =================================================================== --- trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties 2013-03-29 00:30:05 UTC (rev 710) @@ -22,7 +22,7 @@ tutti.property.internationalRegistrationCode= tutti.property.label= tutti.property.lastName= -tutti.property.macroWasteCategory= +tutti.property.marineLitterCategory= tutti.property.matrixName= tutti.property.methodName= tutti.property.multirigAggregation= Modified: trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties =================================================================== --- trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2013-03-29 00:30:05 UTC (rev 710) @@ -22,7 +22,7 @@ tutti.property.internationalRegistrationCode=Immatriculation internationale (ou nationale si non trouvée) tutti.property.label=Code tutti.property.lastName=Nom de Famille -tutti.property.macroWasteCategory=Type de macro déchet +tutti.property.marineLitterCategory=Type de macro déchet tutti.property.matrixName=Support tutti.property.methodName=Méthode tutti.property.multirigAggregation=Numéro de poche Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties =================================================================== --- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-03-29 00:30:05 UTC (rev 710) @@ -61,7 +61,7 @@ tutti.editCatchBatch.field.catchTotalSortedWeight.help=editCatchBatch.html\#fields tutti.editCatchBatch.field.catchTotalUnsortedWeight.help=editCatchBatch.html\#fields tutti.editCatchBatch.field.catchTotalWeight.help=editCatchBatch.html\#fields -tutti.editCatchBatch.field.macroWasteTotalWeight.help=editCatchBatch.html\#fields +tutti.editCatchBatch.field.marineLitterTotalWeight.help=editCatchBatch.html\#fields tutti.editCatchBatch.field.speciesTotalSampleSortedWeight.help=editCatchBatch.html\#fields tutti.editCatchBatch.field.speciesTotalSortedWeight.help=editCatchBatch.html\#fields tutti.editCatchBatch.field.speciesTotalUnsortedWeight.help=editCatchBatch.html\#fields @@ -239,5 +239,5 @@ tutti.splitSpeciesBatch.help=splitSpeciesBatch.html tuttihelp.config.help=config.help tuttihelp.editAccidentalBatch.help=editAccidentalBatch.html -tuttihelp.editMacroWasteBatch.help=editMacroWasteBatch.html +tuttihelp.editMarineLitterBatch.help=editMarineLitterBatch.html tuttihelp.editPlanktonBatch.help=editPlanktonBatch.html Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties =================================================================== --- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-03-29 00:30:05 UTC (rev 710) @@ -70,7 +70,7 @@ tutti.editCatchBatch.field.catchTotalSortedWeight.help=editCatchBatch.html\#fields tutti.editCatchBatch.field.catchTotalUnsortedWeight.help=editCatchBatch.html\#fields tutti.editCatchBatch.field.catchTotalWeight.help=editCatchBatch.html\#fields -tutti.editCatchBatch.field.macroWasteTotalWeight.help=editCatchBatch.html\#fields +tutti.editCatchBatch.field.marineLitterTotalWeight.help=editCatchBatch.html\#fields tutti.editCatchBatch.field.speciesTotalSampleSortedWeight.help=editCatchBatch.html\#fields tutti.editCatchBatch.field.speciesTotalSortedWeight.help=editCatchBatch.html\#fields tutti.editCatchBatch.field.speciesTotalUnsortedWeight.help=editCatchBatch.html\#fields @@ -248,5 +248,5 @@ tutti.splitSpeciesBatch.help=splitSpeciesBatch.html tuttihelp.config.help=config.help tuttihelp.editAccidentalBatch.help=editAccidentalBatch.html -tuttihelp.editMacroWasteBatch.help=editMacroWasteBatch.html +tuttihelp.editMarineLitterBatch.help=editMarineLitterBatch.html tuttihelp.editPlanktonBatch.help=editPlanktonBatch.html Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-03-29 00:30:05 UTC (rev 710) @@ -558,7 +558,7 @@ ui.getSpeciesTabFishingOperationReminderLabel().setTitle(fishingOperationText); ui.getBenthosTabFishingOperationReminderLabel().setTitle(fishingOperationText); // ui.getPlanktonTabFishingOperationReminderLabel().setTitle(fishingOperationText); -// ui.getMacroWasteTabFishingOperationReminderLabel().setTitle(fishingOperationText); +// ui.getMarineLitterTabFishingOperationReminderLabel().setTitle(fishingOperationText); // ui.getAccidentalTabFishingOperationReminderLabel().setTitle(fishingOperationText); if (loadOtherTabs) { @@ -568,7 +568,7 @@ ui.getSpeciesTabContent().getHandler().selectFishingOperation(batch == null ? null : bean); ui.getBenthosTabContent().getHandler().selectFishingOperation(batch == null ? null : bean); // ui.getPlanktonTabContent().getHandler().selectFishingOperation(bean); -// ui.getMacroWasteTabContent().getHandler().selectFishingOperation(bean); +// ui.getMarineLitterTabContent().getHandler().selectFishingOperation(bean); // ui.getAccidentalTabContent().getHandler().selectFishingOperation(bean); } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-03-29 00:30:05 UTC (rev 710) @@ -264,19 +264,19 @@ } -#macroWasteTable { - border: {BorderFactory.createTitledBorder(_("tutti.editCatchBatch.legend.macroWaste"))}; +#marineLitterTable { + border: {BorderFactory.createTitledBorder(_("tutti.editCatchBatch.legend.marineLitter"))}; } -#macroWasteTotalWeightLabel { - text: "tutti.editCatchBatch.field.macroWasteTotalWeight"; - toolTipText: {"tutti.editCatchBatch.field.macroWasteTotalWeight.tip"}; - labelFor: {macroWasteTotalWeightField}; +#marineLitterTotalWeightLabel { + text: "tutti.editCatchBatch.field.marineLitterTotalWeight"; + toolTipText: {"tutti.editCatchBatch.field.marineLitterTotalWeight.tip"}; + labelFor: {marineLitterTotalWeightField}; _strongStyle: true; - _help: {"tutti.editCatchBatch.field.macroWasteTotalWeight.help"}; + _help: {"tutti.editCatchBatch.field.marineLitterTotalWeight.help"}; } -#macroWasteTotalWeightField { +#marineLitterTotalWeightField { _computed: true; } @@ -284,7 +284,7 @@ enabled: {false}; } -#macroWasteTab { +#marineLitterTab { enabled: {false}; } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-03-29 00:30:05 UTC (rev 710) @@ -33,7 +33,7 @@ fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.frequency.BenthosFrequencyUI fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.create.CreateBenthosBatchUI fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.split.SplitBenthosBatchUI - fr.ifremer.tutti.ui.swing.content.operation.catches.macrowaste.MacroWasteBatchUI + fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.MarineLitterBatchUI fr.ifremer.tutti.ui.swing.content.operation.catches.plankton.PlanktonBatchUI fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyUI @@ -88,8 +88,8 @@ <field name='benthosTotalSortedWeight' component='benthosTotalSortedWeightField'/> - <field name='macroWasteTotalWeight' - component='macroWasteTotalWeightField'/> + <field name='marineLitterTotalWeight' + component='marineLitterTotalWeightField'/> </BeanValidator> <CardLayout2Ext id='speciesTabPanelLayout' @@ -280,15 +280,15 @@ </row> <row> <cell columns='2'> - <Table id='macroWasteTable' fill='both'> + <Table id='marineLitterTable' fill='both'> <!-- Poids total Macro dechet --> <row> <cell anchor='west'> - <JLabel id='macroWasteTotalWeightLabel'/> + <JLabel id='marineLitterTotalWeightLabel'/> </cell> <cell weightx='1.0'> - <JTextField id='macroWasteTotalWeightField'/> + <JTextField id='marineLitterTotalWeightField'/> </cell> </row> @@ -352,9 +352,9 @@ <PlanktonBatchUI id='planktonTabContent' constructorParams='this'/> </JXTitledPanel--> </tab> - <tab id='macroWasteTab' title='tutti.label.tab.macroDechet'> - <!--JXTitledPanel id='macroWasteTabFishingOperationReminderLabel'> - <MacroWasteBatchUI id='macroWasteTabContent' constructorParams='this'/> + <tab id='marineLitterTab' title='tutti.label.tab.marineLitter'> + <!--JXTitledPanel id='marineLitterTabFishingOperationReminderLabel'> + <MarineLitterBatchUI id='marineLitterTabContent' constructorParams='this'/> </JXTitledPanel--> </tab> <tab id='accidentalTab' title='tutti.label.tab.accidentel'> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-03-29 00:30:05 UTC (rev 710) @@ -142,7 +142,7 @@ closeUI(ui.getSpeciesTabContent()); closeUI(ui.getBenthosTabContent()); // closeUI(ui.getPlanktonTabContent()); -// closeUI(ui.getMacroWasteTabContent()); +// closeUI(ui.getMarineLitterTabContent()); // closeUI(ui.getAccidentalTabContent()); } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-03-29 00:30:05 UTC (rev 710) @@ -110,7 +110,7 @@ public static final String PROPERTY_PLANKTON_TOTAL_SAMPLE_WEIGHT = "planktonTotalSampleWeight"; - public static final String PROPERTY_MACRO_WASTE_TOTAL_WEIGHT = "macroWasteTotalWeight"; + public static final String PROPERTY_MARINE_LITTER_TOTAL_WEIGHT = "marineLitterTotalWeight"; public static final String PROPERTY_FISHING_OPERATION = "fishingOperation"; @@ -148,7 +148,7 @@ protected Float planktonTotalSampleWeight; - protected Float macroWasteTotalWeight; + protected Float marineLitterTotalWeight; protected TuttiComputedOrNotData<Float> catchTotalComputedOrNotWeight = new TuttiComputedOrNotData<Float>(); @@ -561,17 +561,17 @@ } //------------------------------------------------------------------------// - //-- Macro Waste --// + //-- Marine Litter --// //------------------------------------------------------------------------// - public Float getMacroWasteTotalWeight() { - return macroWasteTotalWeight; + public Float getMarineLitterTotalWeight() { + return marineLitterTotalWeight; } - public void setMacroWasteTotalWeight(Float macroWasteTotalWeight) { - Object oldValue = getMacroWasteTotalWeight(); - this.macroWasteTotalWeight = macroWasteTotalWeight; - firePropertyChange(PROPERTY_MACRO_WASTE_TOTAL_WEIGHT, oldValue, macroWasteTotalWeight); + public void setMarineLitterTotalWeight(Float marineLitterTotalWeight) { + Object oldValue = getMarineLitterTotalWeight(); + this.marineLitterTotalWeight = marineLitterTotalWeight; + firePropertyChange(PROPERTY_MARINE_LITTER_TOTAL_WEIGHT, oldValue, marineLitterTotalWeight); } //------------------------------------------------------------------------// Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchRowModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchRowModel.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchRowModel.java 2013-03-29 00:30:05 UTC (rev 710) @@ -1,216 +0,0 @@ -package fr.ifremer.tutti.ui.swing.content.operation.catches.macrowaste; - -/* - * #%L - * Tutti :: UI - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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.Lists; -import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum; -import fr.ifremer.tutti.persistence.entities.data.Attachment; -import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch; -import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue; -import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel; -import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware; -import fr.ifremer.tutti.ui.swing.util.comment.CommentModelAware; -import org.nuiton.util.beans.Binder; -import org.nuiton.util.beans.BinderFactory; - -import java.util.Collection; -import java.util.List; - -/** - * Define a benthos batch row. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class MacroWasteBatchRowModel extends AbstractTuttiBeanUIModel<MacroWasteBatch, MacroWasteBatchRowModel> implements AttachmentModelAware, CommentModelAware { - - private static final long serialVersionUID = 1L; - - public static final String PROPERTY_MACRO_WASTE_CATEGORY = "macroWasteCategory"; - - public static final String PROPERTY_MACRO_WASTE_SIZE_CATEGORY = "macroWasteSizeCategory"; - - public static final String PROPERTY_WEIGHT = "weight"; - - public static final String PROPERTY_NUMBER = "number"; - - /** - * MacroWaste category. - * - * @since 0.2 - */ - protected CaracteristicQualitativeValue macroWasteCategory; - - /** - * MacroWaste size category. - * - * @since 0.3 - */ - protected CaracteristicQualitativeValue macroWasteSizeCategory; - - /** - * Observed weight. - * - * @since 0.2 - */ - protected Float weight; - - /** - * Observed number. - * - * @since 0.3 - */ - protected Integer number; - - /** - * Comment on this batch. - * - * @since 0.2 - */ - protected String comment; - - /** - * Attachments (should never be null). - * - * @since 0.2 - */ - protected final List<Attachment> attachment = Lists.newArrayList(); - - protected static final Binder<MacroWasteBatch, MacroWasteBatchRowModel> fromBeanBinder = - BinderFactory.newBinder(MacroWasteBatch.class, - MacroWasteBatchRowModel.class); - - protected static final Binder<MacroWasteBatchRowModel, MacroWasteBatch> toBeanBinder = - BinderFactory.newBinder(MacroWasteBatchRowModel.class, - MacroWasteBatch.class); - - public MacroWasteBatchRowModel() { - super(MacroWasteBatch.class, fromBeanBinder, toBeanBinder); - } - - public MacroWasteBatchRowModel(MacroWasteBatch aBatch) { - this(); - fromBean(aBatch); - } - - public CaracteristicQualitativeValue getMacroWasteCategory() { - return macroWasteCategory; - } - - public void setMacroWasteCategory(CaracteristicQualitativeValue macroWasteCategory) { - Object oldValue = getMacroWasteCategory(); - this.macroWasteCategory = macroWasteCategory; - firePropertyChange(PROPERTY_MACRO_WASTE_CATEGORY, oldValue, macroWasteCategory); - } - - public CaracteristicQualitativeValue getMacroWasteSizeCategory() { - return macroWasteSizeCategory; - } - - public void setMacroWasteSizeCategory(CaracteristicQualitativeValue macroWasteSizeCategory) { - Object oldValue = getMacroWasteSizeCategory(); - this.macroWasteSizeCategory = macroWasteSizeCategory; - firePropertyChange(PROPERTY_MACRO_WASTE_SIZE_CATEGORY, oldValue, macroWasteSizeCategory); - } - - public Float getWeight() { - return weight; - } - - public void setWeight(Float weight) { - Object oldValue = getWeight(); - this.weight = weight; - firePropertyChange(PROPERTY_WEIGHT, oldValue, weight); - } - - public Integer getNumber() { - return number; - } - - public void setNumber(Integer number) { - Object oldValue = getNumber(); - this.number = number; - firePropertyChange(PROPERTY_NUMBER, oldValue, number); - } - - //------------------------------------------------------------------------// - //-- CommentModelAware --// - //------------------------------------------------------------------------// - - @Override - public String getComment() { - return comment; - } - - @Override - public void setComment(String comment) { - Object oldValue = getComment(); - this.comment = comment; - firePropertyChange(PROPERTY_COMMENT, oldValue, comment); - } - - //------------------------------------------------------------------------// - //-- AttachmentModelAware --// - //------------------------------------------------------------------------// - - @Override - public AttachementObjectTypeEnum getObjectType() { - return AttachementObjectTypeEnum.SAMPLE; - } - - @Override - public String getObjectId() { - return getId(); - } - - @Override - public List<Attachment> getAttachment() { - return attachment; - } - - @Override - public void addAllAttachment(Collection<Attachment> attachments) { - this.attachment.addAll(attachments); - firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment()); - } - - @Override - public void addAttachment(Attachment attachment) { - this.attachment.add(attachment); - firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment()); - } - - @Override - public void removeAllAttachment(Collection<Attachment> attachments) { - this.attachment.removeAll(attachments); - firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment()); - } - - @Override - public void removeAttachment(Attachment attachment) { - this.attachment.remove(attachment); - firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment()); - } -} Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchTableModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchTableModel.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchTableModel.java 2013-03-29 00:30:05 UTC (rev 710) @@ -1,86 +0,0 @@ -package fr.ifremer.tutti.ui.swing.content.operation.catches.macrowaste; - -/* - * #%L - * Tutti :: UI - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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.ui.swing.util.table.AbstractTuttiTableModel; -import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier; -import org.jdesktop.swingx.table.TableColumnModelExt; - -import static org.nuiton.i18n.I18n.n_; - -/** - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class MacroWasteBatchTableModel extends AbstractTuttiTableModel<MacroWasteBatchRowModel> { - - private static final long serialVersionUID = 1L; - - public static final ColumnIdentifier<MacroWasteBatchRowModel> MACRO_WASTE_CATEGORY = ColumnIdentifier.newId( - MacroWasteBatchRowModel.PROPERTY_MACRO_WASTE_CATEGORY, - n_("tutti.editMacroWasteBatch.table.header.macroWasteCategory"), - n_("tutti.editMacroWasteBatch.table.header.macroWasteCategory")); - - public static final ColumnIdentifier<MacroWasteBatchRowModel> MACRO_WASTE_SIZE_CATEGORY = ColumnIdentifier.newId( - MacroWasteBatchRowModel.PROPERTY_MACRO_WASTE_SIZE_CATEGORY, - n_("tutti.editMacroWasteBatch.table.header.macroWasteSizeCategory"), - n_("tutti.editMacroWasteBatch.table.header.macroWasteSizeCategory")); - - public static final ColumnIdentifier<MacroWasteBatchRowModel> WEIGHT = ColumnIdentifier.newId( - MacroWasteBatchRowModel.PROPERTY_WEIGHT, - n_("tutti.editMacroWasteBatch.table.header.weight"), - n_("tutti.editMacroWasteBatch.table.header.weight")); - - public static final ColumnIdentifier<MacroWasteBatchRowModel> NUMBER = ColumnIdentifier.newId( - MacroWasteBatchRowModel.PROPERTY_NUMBER, - n_("tutti.editMacroWasteBatch.table.header.number"), - n_("tutti.editMacroWasteBatch.table.header.number")); - - public static final ColumnIdentifier<MacroWasteBatchRowModel> COMMENT = ColumnIdentifier.newId( - MacroWasteBatchRowModel.PROPERTY_COMMENT, - n_("tutti.editMacroWasteBatch.table.header.comment"), - n_("tutti.editMacroWasteBatch.table.header.comment")); - - public static final ColumnIdentifier<MacroWasteBatchRowModel> ATTACHMENT = ColumnIdentifier.newId( - MacroWasteBatchRowModel.PROPERTY_ATTACHMENT, - n_("tutti.editMacroWasteBatch.table.header.file"), - n_("tutti.editMacroWasteBatch.table.header.file")); - - public MacroWasteBatchTableModel(TableColumnModelExt columnModel) { - super(columnModel, true, true); - - setNoneEditableCols(); - } - - @Override - public MacroWasteBatchRowModel createNewRow() { - MacroWasteBatchRowModel result = new MacroWasteBatchRowModel(); - - // by default empty row is not valid - result.setValid(false); - return result; - } - -} \ No newline at end of file Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.css 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.css 2013-03-29 00:30:05 UTC (rev 710) @@ -1,53 +0,0 @@ -/* - * #%L - * Tutti :: UI - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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% - */ - -NumberEditor { - autoPopup: {handler.getConfig().isAutoPopupNumberEditor()}; - showPopupButton: {handler.getConfig().isShowNumberEditorButton()}; - bean: {model}; - showReset: true; -} - -#editMacroWasteBatchTopPanel { - _help: {"tuttihelp.editMacroWasteBatch.help"}; -} - -#macroWasteTotalWeightLabel { - text: "tutti.editCatchBatch.field.macroWasteTotalWeight"; - labelFor: {macroWasteTotalWeightField}; -} - -#macroWasteTotalWeightField { - property: macroWasteTotalWeight; - model: {model.getMacroWasteTotalWeight()}; - useFloat: false; - numberPattern: {INT_6_DIGITS_PATTERN}; -} - -#table { - selectionMode: {ListSelectionModel.SINGLE_SELECTION}; - selectionBackground: {null}; - selectionForeground: {Color.BLACK}; - sortable: false; -} Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.jaxx 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.jaxx 2013-03-29 00:30:05 UTC (rev 710) @@ -1,88 +0,0 @@ -<!-- - #%L - Tutti :: UI - $Id$ - $HeadURL$ - %% - Copyright (C) 2012 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% - --> -<JPanel id='editMacroWasteBatchTopPanel' layout='{new BorderLayout()}' - decorator='help' - implements='fr.ifremer.tutti.ui.swing.util.TuttiUI<MacroWasteBatchUIModel, MacroWasteBatchUIHandler>'> - - <import> - fr.ifremer.tutti.ui.swing.TuttiHelpBroker - fr.ifremer.tutti.ui.swing.TuttiUIContext - fr.ifremer.tutti.ui.swing.util.TuttiUI - - jaxx.runtime.swing.editor.NumberEditor - - org.jdesktop.swingx.JXTable - - javax.swing.ListSelectionModel - - java.awt.Color - - static org.nuiton.i18n.I18n._ - </import> - - <script><![CDATA[ - -public MacroWasteBatchUI(TuttiUI<?,?> parentUI) { - JAXXUtil.initContext(this, parentUI); - MacroWasteBatchUIHandler handler = new MacroWasteBatchUIHandler(parentUI, this); - setContextValue(handler); - handler.beforeInitUI(); -} - -protected void $afterCompleteSetup() { handler.afterInitUI(); } - ]]></script> - - <MacroWasteBatchUIHandler id='handler' - initializer='getContextValue(MacroWasteBatchUIHandler.class)'/> - - <MacroWasteBatchUIModel id='model' - initializer='getContextValue(MacroWasteBatchUIModel.class)'/> - - <BeanValidator id='validator' bean='model' - uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> - <field name='macroWasteTotalWeight' component='macroWasteTotalWeightField'/> - </BeanValidator> - - <TuttiHelpBroker id='broker' - constructorParams='"tuttihelp.editMacroWasteBatch.help"'/> - - <Table id='form' fill='both' constraints='BorderLayout.NORTH'> - - <!-- Poids total --> - <row> - <cell anchor='west'> - <JLabel id='macroWasteTotalWeightLabel'/> - </cell> - <cell weightx='1.0'> - <NumberEditor id='macroWasteTotalWeightField' constructorParams='this'/> - </cell> - </row> - </Table> - - <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'> - <JXTable id='table' - onFocusLost='handler.saveSelectedRowIfRequired(event);'/> - </JScrollPane> - -</JPanel> \ No newline at end of file Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIHandler.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIHandler.java 2013-03-29 00:30:05 UTC (rev 710) @@ -1,305 +0,0 @@ -package fr.ifremer.tutti.ui.swing.content.operation.catches.macrowaste; - -/* - * #%L - * Tutti :: UI - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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.Lists; -import fr.ifremer.tutti.persistence.entities.TuttiEntities; -import fr.ifremer.tutti.persistence.entities.data.Attachment; -import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch; -import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue; -import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler; -import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; -import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; -import fr.ifremer.tutti.ui.swing.util.TuttiUI; -import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellEditor; -import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellRenderer; -import fr.ifremer.tutti.ui.swing.util.comment.CommentCellEditor; -import fr.ifremer.tutti.ui.swing.util.comment.CommentCellRenderer; -import jaxx.runtime.validator.swing.SwingValidator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.jdesktop.swingx.JXTable; -import org.jdesktop.swingx.table.DefaultTableColumnModelExt; -import org.nuiton.util.decorator.Decorator; - -import java.util.List; - -/** - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class MacroWasteBatchUIHandler extends AbstractTuttiBatchTableUIHandler<MacroWasteBatchRowModel, MacroWasteBatchUIModel, MacroWasteBatchUI> { - - /** Logger. */ - private static final Log log = - LogFactory.getLog(MacroWasteBatchUIHandler.class); - - public MacroWasteBatchUIHandler(TuttiUI<?, ?> parentUi, MacroWasteBatchUI ui) { - super(parentUi, ui, - MacroWasteBatchRowModel.PROPERTY_MACRO_WASTE_CATEGORY, - MacroWasteBatchRowModel.PROPERTY_MACRO_WASTE_SIZE_CATEGORY, - MacroWasteBatchRowModel.PROPERTY_WEIGHT, - MacroWasteBatchRowModel.PROPERTY_NUMBER, - MacroWasteBatchRowModel.PROPERTY_COMMENT); - } - - //------------------------------------------------------------------------// - //-- AbstractTuttiBatchTableUIHandler methods --// - //------------------------------------------------------------------------// - - @Override - public void selectFishingOperation(FishingOperation bean) { - - boolean empty = bean == null; - - MacroWasteBatchUIModel model = getModel(); - - List<MacroWasteBatchRowModel> rows; - - if (empty) { - rows = null; - } else { - - if (log.isInfoEnabled()) { - log.info("Get macroWaste batch for fishingOperation: " + - bean.getId()); - } - rows = Lists.newArrayList(); - - if (!TuttiEntities.isNew(bean)) { - List<MacroWasteBatch> catches = - persistenceService.getAllMacroWasteBatch(bean.getId()); - for (MacroWasteBatch aBatch : catches) { - MacroWasteBatchRowModel entry = - new MacroWasteBatchRowModel(aBatch); - rows.add(entry); - } - } - } - model.setRows(rows); - } - - //------------------------------------------------------------------------// - //-- AbstractTuttiTableUIHandler methods --// - //------------------------------------------------------------------------// - - @Override - public MacroWasteBatchTableModel getTableModel() { - return (MacroWasteBatchTableModel) getTable().getModel(); - } - - @Override - public JXTable getTable() { - return ui.getTable(); - } - - @Override - protected boolean isRowValid(MacroWasteBatchRowModel row) { - boolean result = row.getMacroWasteCategory() != null && - row.getMacroWasteSizeCategory() != null && - row.getWeight() != null; - return result; - } - - @Override - protected void onRowModified(int rowIndex, - MacroWasteBatchRowModel row, - String propertyName, - Object oldValue, - Object newValue) { - recomputeRowValidState(row); - } - - @Override - protected void saveSelectedRowIfRequired(TuttiBeanMonitor<MacroWasteBatchRowModel> rowMonitor, - MacroWasteBatchRowModel row) { - - if (row != null) { - - if (row.isValid()) { - // there is a valid bean attached to the monitor - - if (rowMonitor.wasModified()) { - - // monitored bean was modified, save it - if (log.isInfoEnabled()) { - log.info("Row " + row + " was modified, will save it"); - } - - saveRow(row); - - // clear modified flag on the monitor - rowMonitor.clearModified(); - } - } else { - - // row is not valid can not save it - - MacroWasteBatch catchBean = row.toBean(); - - if (!TuttiEntities.isNew(catchBean)) { - - // remove this - persistenceService.deleteMacroWasteBatch(catchBean.getId()); - } - } - } - } - - //------------------------------------------------------------------------// - //-- AbstractTuttiUIHandler methods --// - //------------------------------------------------------------------------// - - @Override - public SwingValidator<MacroWasteBatchUIModel> getValidator() { - return ui.getValidator(); - } - - @Override - public void beforeInitUI() { - - if (log.isInfoEnabled()) { - log.info("beforeInit: " + ui); - } - - EditCatchesUIModel catchesUIModel = - ui.getContextValue(EditCatchesUIModel.class); - - MacroWasteBatchUIModel model = new MacroWasteBatchUIModel(catchesUIModel); - ui.setContextValue(model); - } - - @Override - public void afterInitUI() { - - if (log.isInfoEnabled()) { - log.info("afterInit: " + ui); - } - - initUI(ui); - - JXTable table = getTable(); - - // create table column model - DefaultTableColumnModelExt columnModel = - new DefaultTableColumnModelExt(); - - { - // MacroWaste Category column - - Decorator<CaracteristicQualitativeValue> decorator = getDecorator( - CaracteristicQualitativeValue.class, null); - - addComboDataColumnToModel(columnModel, - MacroWasteBatchTableModel.MACRO_WASTE_CATEGORY, - decorator, persistenceService.getMacroWasteCategoryCaracteristic().getQualitativeValue()); - } - - { - // MacroWaste Size Category column - - Decorator<CaracteristicQualitativeValue> decorator = getDecorator( - CaracteristicQualitativeValue.class, null); - - addComboDataColumnToModel(columnModel, - MacroWasteBatchTableModel.MACRO_WASTE_SIZE_CATEGORY, - decorator, persistenceService.getMacroWasteSizeCategoryCaracteristic().getQualitativeValue()); - } - - { // Weight column - - addFloatColumnToModel(columnModel, - MacroWasteBatchTableModel.WEIGHT, - TuttiUI.DECIMAL3_PATTERN); - } - - { // Number column - - addIntegerColumnToModel(columnModel, - MacroWasteBatchTableModel.NUMBER, - TuttiUI.INT_3_DIGITS_PATTERN); - } - - { // Comment column - - addColumnToModel(columnModel, - CommentCellEditor.newEditor(ui), - CommentCellRenderer.newRender(), - MacroWasteBatchTableModel.COMMENT); - } - - { // File column - - addColumnToModel(columnModel, - AttachmentCellEditor.newEditor(ui), - AttachmentCellRenderer.newRender(getDecorator(Attachment.class, null)), - MacroWasteBatchTableModel.ATTACHMENT); - } - - // create table model - MacroWasteBatchTableModel tableModel = - new MacroWasteBatchTableModel(columnModel); - - table.setModel(tableModel); - table.setColumnModel(columnModel); - - initBatchTable(table, columnModel, tableModel); - } - - @Override - public void onCloseUI() { - if (log.isDebugEnabled()) { - log.debug("closing: " + ui); - } - } - - //------------------------------------------------------------------------// - //-- Public methods --// - //------------------------------------------------------------------------// - - //------------------------------------------------------------------------// - //-- Internal methods --// - //------------------------------------------------------------------------// - - protected void saveRow(MacroWasteBatchRowModel row) { - - MacroWasteBatch catchBean = row.toBean(); - - FishingOperation fishingOperation = getModel().getFishingOperation(); - catchBean.setFishingOperation(fishingOperation); - if (log.isInfoEnabled()) { - log.info("Selected fishingOperation: " + fishingOperation.getId()); - } - - if (TuttiEntities.isNew(catchBean)) { - - catchBean = persistenceService.createMacroWasteBatch(catchBean); - row.setId(catchBean.getId()); - } else { - persistenceService.saveMacroWasteBatch(catchBean); - } - } -} \ No newline at end of file Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIModel.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIModel.java 2013-03-29 00:30:05 UTC (rev 710) @@ -1,50 +0,0 @@ -package fr.ifremer.tutti.ui.swing.content.operation.catches.macrowaste; - -/* - * #%L - * Tutti :: UI - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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.ui.swing.content.operation.AbstractTuttiBatchUIModel; -import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; - -/** - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class MacroWasteBatchUIModel extends AbstractTuttiBatchUIModel<MacroWasteBatchRowModel, MacroWasteBatchUIModel> { - - private static final long serialVersionUID = 1L; - - public MacroWasteBatchUIModel(EditCatchesUIModel catchesUIModel) { - super(catchesUIModel, - EditCatchesUIModel.PROPERTY_MACRO_WASTE_TOTAL_WEIGHT); - } - - public Float getMacroWasteTotalWeight() { - return catchesUIModel.getMacroWasteTotalWeight(); - } - - public void setMacroWasteTotalWeight(Float macroWasteTotalWeight) { - catchesUIModel.setMacroWasteTotalWeight(macroWasteTotalWeight); - } -} \ No newline at end of file Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchRowModel.java (from rev 709, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchRowModel.java) =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchRowModel.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchRowModel.java 2013-03-29 00:30:05 UTC (rev 710) @@ -0,0 +1,216 @@ +package fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter; + +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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.Lists; +import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum; +import fr.ifremer.tutti.persistence.entities.data.Attachment; +import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch; +import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue; +import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel; +import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware; +import fr.ifremer.tutti.ui.swing.util.comment.CommentModelAware; +import org.nuiton.util.beans.Binder; +import org.nuiton.util.beans.BinderFactory; + +import java.util.Collection; +import java.util.List; + +/** + * Define a MarineLitter batch row. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class MarineLitterBatchRowModel extends AbstractTuttiBeanUIModel<MarineLitterBatch, MarineLitterBatchRowModel> implements AttachmentModelAware, CommentModelAware { + + private static final long serialVersionUID = 1L; + + public static final String PROPERTY_MARINE_LITTER_CATEGORY = "marineLitterCategory"; + + public static final String PROPERTY_MARINE_LITTER_SIZE_CATEGORY = "marineLitterSizeCategory"; + + public static final String PROPERTY_WEIGHT = "weight"; + + public static final String PROPERTY_NUMBER = "number"; + + /** + * MarineLitter category. + * + * @since 0.2 + */ + protected CaracteristicQualitativeValue marineLitterCategory; + + /** + * MarineLitter size category. + * + * @since 0.3 + */ + protected CaracteristicQualitativeValue marineLitterSizeCategory; + + /** + * Observed weight. + * + * @since 0.2 + */ + protected Float weight; + + /** + * Observed number. + * + * @since 0.3 + */ + protected Integer number; + + /** + * Comment on this batch. + * + * @since 0.2 + */ + protected String comment; + + /** + * Attachments (should never be null). + * + * @since 0.2 + */ + protected final List<Attachment> attachment = Lists.newArrayList(); + + protected static final Binder<MarineLitterBatch, MarineLitterBatchRowModel> fromBeanBinder = + BinderFactory.newBinder(MarineLitterBatch.class, + MarineLitterBatchRowModel.class); + + protected static final Binder<MarineLitterBatchRowModel, MarineLitterBatch> toBeanBinder = + BinderFactory.newBinder(MarineLitterBatchRowModel.class, + MarineLitterBatch.class); + + public MarineLitterBatchRowModel() { + super(MarineLitterBatch.class, fromBeanBinder, toBeanBinder); + } + + public MarineLitterBatchRowModel(MarineLitterBatch aBatch) { + this(); + fromBean(aBatch); + } + + public CaracteristicQualitativeValue getMarineLitterCategory() { + return marineLitterCategory; + } + + public void setMarineLitterCategory(CaracteristicQualitativeValue marineLitterCategory) { + Object oldValue = getMarineLitterCategory(); + this.marineLitterCategory = marineLitterCategory; + firePropertyChange(PROPERTY_MARINE_LITTER_CATEGORY, oldValue, marineLitterCategory); + } + + public CaracteristicQualitativeValue getMarineLitterSizeCategory() { + return marineLitterSizeCategory; + } + + public void setMarineLitterSizeCategory(CaracteristicQualitativeValue marineLitterSizeCategory) { + Object oldValue = getMarineLitterSizeCategory(); + this.marineLitterSizeCategory = marineLitterSizeCategory; + firePropertyChange(PROPERTY_MARINE_LITTER_SIZE_CATEGORY, oldValue, marineLitterSizeCategory); + } + + public Float getWeight() { + return weight; + } + + public void setWeight(Float weight) { + Object oldValue = getWeight(); + this.weight = weight; + firePropertyChange(PROPERTY_WEIGHT, oldValue, weight); + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + Object oldValue = getNumber(); + this.number = number; + firePropertyChange(PROPERTY_NUMBER, oldValue, number); + } + + //------------------------------------------------------------------------// + //-- CommentModelAware --// + //------------------------------------------------------------------------// + + @Override + public String getComment() { + return comment; + } + + @Override + public void setComment(String comment) { + Object oldValue = getComment(); + this.comment = comment; + firePropertyChange(PROPERTY_COMMENT, oldValue, comment); + } + + //------------------------------------------------------------------------// + //-- AttachmentModelAware --// + //------------------------------------------------------------------------// + + @Override + public AttachementObjectTypeEnum getObjectType() { + return AttachementObjectTypeEnum.SAMPLE; + } + + @Override + public String getObjectId() { + return getId(); + } + + @Override + public List<Attachment> getAttachment() { + return attachment; + } + + @Override + public void addAllAttachment(Collection<Attachment> attachments) { + this.attachment.addAll(attachments); + firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment()); + } + + @Override + public void addAttachment(Attachment attachment) { + this.attachment.add(attachment); + firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment()); + } + + @Override + public void removeAllAttachment(Collection<Attachment> attachments) { + this.attachment.removeAll(attachments); + firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment()); + } + + @Override + public void removeAttachment(Attachment attachment) { + this.attachment.remove(attachment); + firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment()); + } +} Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchTableModel.java (from rev 709, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchTableModel.java) =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchTableModel.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchTableModel.java 2013-03-29 00:30:05 UTC (rev 710) @@ -0,0 +1,86 @@ +package fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter; + +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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.ui.swing.util.table.AbstractTuttiTableModel; +import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier; +import org.jdesktop.swingx.table.TableColumnModelExt; + +import static org.nuiton.i18n.I18n.n_; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class MarineLitterBatchTableModel extends AbstractTuttiTableModel<MarineLitterBatchRowModel> { + + private static final long serialVersionUID = 1L; + + public static final ColumnIdentifier<MarineLitterBatchRowModel> MACRO_WASTE_CATEGORY = ColumnIdentifier.newId( + MarineLitterBatchRowModel.PROPERTY_MARINE_LITTER_CATEGORY, + n_("tutti.editMarineLitterBatch.table.header.marineLitterCategory"), + n_("tutti.editMarineLitterBatch.table.header.marineLitterCategory")); + + public static final ColumnIdentifier<MarineLitterBatchRowModel> MACRO_WASTE_SIZE_CATEGORY = ColumnIdentifier.newId( + MarineLitterBatchRowModel.PROPERTY_MARINE_LITTER_SIZE_CATEGORY, + n_("tutti.editMarineLitterBatch.table.header.marineLitterSizeCategory"), + n_("tutti.editMarineLitterBatch.table.header.marineLitterSizeCategory")); + + public static final ColumnIdentifier<MarineLitterBatchRowModel> WEIGHT = ColumnIdentifier.newId( + MarineLitterBatchRowModel.PROPERTY_WEIGHT, + n_("tutti.editMarineLitterBatch.table.header.weight"), + n_("tutti.editMarineLitterBatch.table.header.weight")); + + public static final ColumnIdentifier<MarineLitterBatchRowModel> NUMBER = ColumnIdentifier.newId( + MarineLitterBatchRowModel.PROPERTY_NUMBER, + n_("tutti.editMarineLitterBatch.table.header.number"), + n_("tutti.editMarineLitterBatch.table.header.number")); + + public static final ColumnIdentifier<MarineLitterBatchRowModel> COMMENT = ColumnIdentifier.newId( + MarineLitterBatchRowModel.PROPERTY_COMMENT, + n_("tutti.editMarineLitterBatch.table.header.comment"), + n_("tutti.editMarineLitterBatch.table.header.comment")); + + public static final ColumnIdentifier<MarineLitterBatchRowModel> ATTACHMENT = ColumnIdentifier.newId( + MarineLitterBatchRowModel.PROPERTY_ATTACHMENT, + n_("tutti.editMarineLitterBatch.table.header.file"), + n_("tutti.editMarineLitterBatch.table.header.file")); + + public MarineLitterBatchTableModel(TableColumnModelExt columnModel) { + super(columnModel, true, true); + + setNoneEditableCols(); + } + + @Override + public MarineLitterBatchRowModel createNewRow() { + MarineLitterBatchRowModel result = new MarineLitterBatchRowModel(); + + // by default empty row is not valid + result.setValid(false); + return result; + } + +} \ No newline at end of file Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css (from rev 709, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.css) =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css 2013-03-29 00:30:05 UTC (rev 710) @@ -0,0 +1,53 @@ +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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% + */ + +NumberEditor { + autoPopup: {handler.getConfig().isAutoPopupNumberEditor()}; + showPopupButton: {handler.getConfig().isShowNumberEditorButton()}; + bean: {model}; + showReset: true; +} + +#editMarineLitterBatchTopPanel { + _help: {"tuttihelp.editMarineLitterBatch.help"}; +} + +#marineLitterTotalWeightLabel { + text: "tutti.editCatchBatch.field.marineLitterTotalWeight"; + labelFor: {marineLitterTotalWeightField}; +} + +#marineLitterTotalWeightField { + property: marineLitterTotalWeight; + model: {model.getMarineLitterTotalWeight()}; + useFloat: false; + numberPattern: {INT_6_DIGITS_PATTERN}; +} + +#table { + selectionMode: {ListSelectionModel.SINGLE_SELECTION}; + selectionBackground: {null}; + selectionForeground: {Color.BLACK}; + sortable: false; +} Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx (from rev 709, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.jaxx) =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx 2013-03-29 00:30:05 UTC (rev 710) @@ -0,0 +1,88 @@ +<!-- + #%L + Tutti :: UI + $Id$ + $HeadURL$ + %% + Copyright (C) 2012 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% + --> +<JPanel id='editMarineLitterBatchTopPanel' layout='{new BorderLayout()}' + decorator='help' + implements='fr.ifremer.tutti.ui.swing.util.TuttiUI<MarineLitterBatchUIModel, MarineLitterBatchUIHandler>'> + + <import> + fr.ifremer.tutti.ui.swing.TuttiHelpBroker + fr.ifremer.tutti.ui.swing.TuttiUIContext + fr.ifremer.tutti.ui.swing.util.TuttiUI + + jaxx.runtime.swing.editor.NumberEditor + + org.jdesktop.swingx.JXTable + + javax.swing.ListSelectionModel + + java.awt.Color + + static org.nuiton.i18n.I18n._ + </import> + + <script><![CDATA[ + +public MarineLitterBatchUI(TuttiUI<?,?> parentUI) { + JAXXUtil.initContext(this, parentUI); + MarineLitterBatchUIHandler handler = new MarineLitterBatchUIHandler(parentUI, this); + setContextValue(handler); + handler.beforeInitUI(); +} + +protected void $afterCompleteSetup() { handler.afterInitUI(); } + ]]></script> + + <MarineLitterBatchUIHandler id='handler' + initializer='getContextValue(MarineLitterBatchUIHandler.class)'/> + + <MarineLitterBatchUIModel id='model' + initializer='getContextValue(MarineLitterBatchUIModel.class)'/> + + <BeanValidator id='validator' bean='model' + uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> + <field name='marineLitterTotalWeight' component='marineLitterTotalWeightField'/> + </BeanValidator> + + <TuttiHelpBroker id='broker' + constructorParams='"tuttihelp.editMarineLitterBatch.help"'/> + + <Table id='form' fill='both' constraints='BorderLayout.NORTH'> + + <!-- Poids total --> + <row> + <cell anchor='west'> + <JLabel id='marineLitterTotalWeightLabel'/> + </cell> + <cell weightx='1.0'> + <NumberEditor id='marineLitterTotalWeightField' constructorParams='this'/> + </cell> + </row> + </Table> + + <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'> + <JXTable id='table' + onFocusLost='handler.saveSelectedRowIfRequired(event);'/> + </JScrollPane> + +</JPanel> \ No newline at end of file Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java (from rev 709, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIHandler.java) =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java 2013-03-29 00:30:05 UTC (rev 710) @@ -0,0 +1,307 @@ +package fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter; + +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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.Lists; +import fr.ifremer.tutti.persistence.entities.TuttiEntities; +import fr.ifremer.tutti.persistence.entities.data.Attachment; +import fr.ifremer.tutti.persistence.entities.data.BatchContainer; +import fr.ifremer.tutti.persistence.entities.data.FishingOperation; +import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch; +import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue; +import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; +import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; +import fr.ifremer.tutti.ui.swing.util.TuttiUI; +import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellEditor; +import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellRenderer; +import fr.ifremer.tutti.ui.swing.util.comment.CommentCellEditor; +import fr.ifremer.tutti.ui.swing.util.comment.CommentCellRenderer; +import jaxx.runtime.validator.swing.SwingValidator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jdesktop.swingx.JXTable; +import org.jdesktop.swingx.table.DefaultTableColumnModelExt; +import org.nuiton.util.decorator.Decorator; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class MarineLitterBatchUIHandler extends AbstractTuttiBatchTableUIHandler<MarineLitterBatchRowModel, MarineLitterBatchUIModel, MarineLitterBatchUI> { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(MarineLitterBatchUIHandler.class); + + public MarineLitterBatchUIHandler(TuttiUI<?, ?> parentUi, MarineLitterBatchUI ui) { + super(parentUi, ui, + MarineLitterBatchRowModel.PROPERTY_MARINE_LITTER_CATEGORY, + MarineLitterBatchRowModel.PROPERTY_MARINE_LITTER_SIZE_CATEGORY, + MarineLitterBatchRowModel.PROPERTY_WEIGHT, + MarineLitterBatchRowModel.PROPERTY_NUMBER, + MarineLitterBatchRowModel.PROPERTY_COMMENT); + } + + //------------------------------------------------------------------------// + //-- AbstractTuttiBatchTableUIHandler methods --// + //------------------------------------------------------------------------// + + @Override + public void selectFishingOperation(FishingOperation bean) { + + boolean empty = bean == null; + + MarineLitterBatchUIModel model = getModel(); + + List<MarineLitterBatchRowModel> rows; + + if (empty) { + rows = null; + } else { + + if (log.isInfoEnabled()) { + log.info("Get marineLitter batch for fishingOperation: " + + bean.getId()); + } + rows = Lists.newArrayList(); + + if (!TuttiEntities.isNew(bean)) { + BatchContainer<MarineLitterBatch> batchContainer = + persistenceService.getRootMarineLitterBatch(bean.getId()); + + for (MarineLitterBatch aBatch : batchContainer.getChildren()) { + MarineLitterBatchRowModel entry = + new MarineLitterBatchRowModel(aBatch); + rows.add(entry); + } + } + } + model.setRows(rows); + } + + //------------------------------------------------------------------------// + //-- AbstractTuttiTableUIHandler methods --// + //------------------------------------------------------------------------// + + @Override + public MarineLitterBatchTableModel getTableModel() { + return (MarineLitterBatchTableModel) getTable().getModel(); + } + + @Override + public JXTable getTable() { + return ui.getTable(); + } + + @Override + protected boolean isRowValid(MarineLitterBatchRowModel row) { + boolean result = row.getMarineLitterCategory() != null && + row.getMarineLitterSizeCategory() != null && + row.getWeight() != null; + return result; + } + + @Override + protected void onRowModified(int rowIndex, + MarineLitterBatchRowModel row, + String propertyName, + Object oldValue, + Object newValue) { + recomputeRowValidState(row); + } + + @Override + protected void saveSelectedRowIfRequired(TuttiBeanMonitor<MarineLitterBatchRowModel> rowMonitor, + MarineLitterBatchRowModel row) { + + if (row != null) { + + if (row.isValid()) { + // there is a valid bean attached to the monitor + + if (rowMonitor.wasModified()) { + + // monitored bean was modified, save it + if (log.isInfoEnabled()) { + log.info("Row " + row + " was modified, will save it"); + } + + saveRow(row); + + // clear modified flag on the monitor + rowMonitor.clearModified(); + } + } else { + + // row is not valid can not save it + + MarineLitterBatch catchBean = row.toBean(); + + if (!TuttiEntities.isNew(catchBean)) { + + // remove this + persistenceService.deleteMarineLitterBatch(catchBean.getId()); + } + } + } + } + + //------------------------------------------------------------------------// + //-- AbstractTuttiUIHandler methods --// + //------------------------------------------------------------------------// + + @Override + public SwingValidator<MarineLitterBatchUIModel> getValidator() { + return ui.getValidator(); + } + + @Override + public void beforeInitUI() { + + if (log.isInfoEnabled()) { + log.info("beforeInit: " + ui); + } + + EditCatchesUIModel catchesUIModel = + ui.getContextValue(EditCatchesUIModel.class); + + MarineLitterBatchUIModel model = new MarineLitterBatchUIModel(catchesUIModel); + ui.setContextValue(model); + } + + @Override + public void afterInitUI() { + + if (log.isInfoEnabled()) { + log.info("afterInit: " + ui); + } + + initUI(ui); + + JXTable table = getTable(); + + // create table column model + DefaultTableColumnModelExt columnModel = + new DefaultTableColumnModelExt(); + + { + // MarineLitter Category column + + Decorator<CaracteristicQualitativeValue> decorator = getDecorator( + CaracteristicQualitativeValue.class, null); + + addComboDataColumnToModel(columnModel, + MarineLitterBatchTableModel.MACRO_WASTE_CATEGORY, + decorator, persistenceService.getMarineLitterCategoryCaracteristic().getQualitativeValue()); + } + + { + // MarineLitter Size Category column + + Decorator<CaracteristicQualitativeValue> decorator = getDecorator( + CaracteristicQualitativeValue.class, null); + + addComboDataColumnToModel(columnModel, + MarineLitterBatchTableModel.MACRO_WASTE_SIZE_CATEGORY, + decorator, persistenceService.getMarineLitterSizeCategoryCaracteristic().getQualitativeValue()); + } + + { // Weight column + + addFloatColumnToModel(columnModel, + MarineLitterBatchTableModel.WEIGHT, + TuttiUI.DECIMAL3_PATTERN); + } + + { // Number column + + addIntegerColumnToModel(columnModel, + MarineLitterBatchTableModel.NUMBER, + TuttiUI.INT_3_DIGITS_PATTERN); + } + + { // Comment column + + addColumnToModel(columnModel, + CommentCellEditor.newEditor(ui), + CommentCellRenderer.newRender(), + MarineLitterBatchTableModel.COMMENT); + } + + { // File column + + addColumnToModel(columnModel, + AttachmentCellEditor.newEditor(ui), + AttachmentCellRenderer.newRender(getDecorator(Attachment.class, null)), + MarineLitterBatchTableModel.ATTACHMENT); + } + + // create table model + MarineLitterBatchTableModel tableModel = + new MarineLitterBatchTableModel(columnModel); + + table.setModel(tableModel); + table.setColumnModel(columnModel); + + initBatchTable(table, columnModel, tableModel); + } + + @Override + public void onCloseUI() { + if (log.isDebugEnabled()) { + log.debug("closing: " + ui); + } + } + + //------------------------------------------------------------------------// + //-- Public methods --// + //------------------------------------------------------------------------// + + //------------------------------------------------------------------------// + //-- Internal methods --// + //------------------------------------------------------------------------// + + protected void saveRow(MarineLitterBatchRowModel row) { + + MarineLitterBatch catchBean = row.toBean(); + + FishingOperation fishingOperation = getModel().getFishingOperation(); + catchBean.setFishingOperation(fishingOperation); + if (log.isInfoEnabled()) { + log.info("Selected fishingOperation: " + fishingOperation.getId()); + } + + if (TuttiEntities.isNew(catchBean)) { + + catchBean = persistenceService.createMarineLitterBatch(catchBean); + row.setId(catchBean.getId()); + } else { + persistenceService.saveMarineLitterBatch(catchBean); + } + } +} \ No newline at end of file Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java (from rev 709, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIModel.java) =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java 2013-03-29 00:30:05 UTC (rev 710) @@ -0,0 +1,50 @@ +package fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter; + +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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.ui.swing.content.operation.AbstractTuttiBatchUIModel; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class MarineLitterBatchUIModel extends AbstractTuttiBatchUIModel<MarineLitterBatchRowModel, MarineLitterBatchUIModel> { + + private static final long serialVersionUID = 1L; + + public MarineLitterBatchUIModel(EditCatchesUIModel catchesUIModel) { + super(catchesUIModel, + EditCatchesUIModel.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT); + } + + public Float getMarineLitterTotalWeight() { + return catchesUIModel.getMarineLitterTotalWeight(); + } + + public void setMarineLitterTotalWeight(Float marineLitterTotalWeight) { + catchesUIModel.setMarineLitterTotalWeight(marineLitterTotalWeight); + } +} \ No newline at end of file Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiBeanUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiBeanUIModel.java 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiBeanUIModel.java 2013-03-29 00:30:05 UTC (rev 710) @@ -75,6 +75,20 @@ return result; } + @Override + public Integer getIdAsInt() { + return id == null ? null : Integer.valueOf(id); + } + + @Override + public void setId(Integer id) { + if (id == null) { + this.id = null; + } else { + this.id = id.toString(); + } + } + protected E newEntity() { try { E result = entityType.newInstance(); Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties =================================================================== --- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-03-29 00:30:05 UTC (rev 710) @@ -307,8 +307,8 @@ tutti.editCatchBatch.field.catchTotalUnsortedWeight.tip= tutti.editCatchBatch.field.catchTotalWeight= tutti.editCatchBatch.field.catchTotalWeight.tip= -tutti.editCatchBatch.field.macroWasteTotalWeight= -tutti.editCatchBatch.field.macroWasteTotalWeight.tip= +tutti.editCatchBatch.field.marineLitterTotalWeight= +tutti.editCatchBatch.field.marineLitterTotalWeight.tip= tutti.editCatchBatch.field.speciesTotalSampleSortedWeight= tutti.editCatchBatch.field.speciesTotalSampleSortedWeight.tip= tutti.editCatchBatch.field.speciesTotalSortedWeight= @@ -318,7 +318,7 @@ tutti.editCatchBatch.field.speciesTotalWeight= tutti.editCatchBatch.field.speciesTotalWeight.tip= tutti.editCatchBatch.legend.benthos= -tutti.editCatchBatch.legend.macroWaste= +tutti.editCatchBatch.legend.marineLitter= tutti.editCatchBatch.legend.species= tutti.editCatchBatch.legend.total= tutti.editCruise.action.closeEditCruise= @@ -461,12 +461,12 @@ tutti.editFishingOperation.label.traitReminder.inCreation= tutti.editFishingOperation.pane.other= tutti.editFishingOperation.tab.general= -tutti.editMacroWasteBatch.table.header.comment= -tutti.editMacroWasteBatch.table.header.file= -tutti.editMacroWasteBatch.table.header.macroWasteCategory= -tutti.editMacroWasteBatch.table.header.macroWasteSizeCategory= -tutti.editMacroWasteBatch.table.header.number= -tutti.editMacroWasteBatch.table.header.weight= +tutti.editMarineLitterBatch.table.header.comment= +tutti.editMarineLitterBatch.table.header.file= +tutti.editMarineLitterBatch.table.header.marineLitterCategory= +tutti.editMarineLitterBatch.table.header.marineLitterSizeCategory= +tutti.editMarineLitterBatch.table.header.number= +tutti.editMarineLitterBatch.table.header.weight= tutti.editPlanktonBatch.table.header.comment= tutti.editPlanktonBatch.table.header.file= tutti.editPlanktonBatch.table.header.sampleWeight= @@ -738,7 +738,7 @@ tutti.label.tab.catches= tutti.label.tab.catchesCaracteristics= tutti.label.tab.fishingOperation= -tutti.label.tab.macroDechet= +tutti.label.tab.marineLitter= tutti.label.tab.observationIndividuel= tutti.label.tab.plancton= tutti.label.tab.species= Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties =================================================================== --- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-03-28 15:34:45 UTC (rev 709) +++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-03-29 00:30:05 UTC (rev 710) @@ -316,8 +316,8 @@ tutti.editCatchBatch.field.catchTotalUnsortedWeight.tip= tutti.editCatchBatch.field.catchTotalWeight=Poids TOTAL (kg) tutti.editCatchBatch.field.catchTotalWeight.tip= -tutti.editCatchBatch.field.macroWasteTotalWeight=Poids TOTAL (kg) -tutti.editCatchBatch.field.macroWasteTotalWeight.tip= +tutti.editCatchBatch.field.marineLitterTotalWeight=Poids TOTAL (kg) +tutti.editCatchBatch.field.marineLitterTotalWeight.tip= tutti.editCatchBatch.field.speciesTotalInertWeight=Poids inerte trié (kg) tutti.editCatchBatch.field.speciesTotalLivingNotItemizedWeight=Poids vivant non détaillé trié (kg) tutti.editCatchBatch.field.speciesTotalSampleSortedWeight=Poids VRAC trié (kg) @@ -329,7 +329,7 @@ tutti.editCatchBatch.field.speciesTotalWeight=Poids TOTAL (kg) tutti.editCatchBatch.field.speciesTotalWeight.tip= tutti.editCatchBatch.legend.benthos=Benthos -tutti.editCatchBatch.legend.macroWaste=Macro déchets +tutti.editCatchBatch.legend.marineLitter=Macro déchets tutti.editCatchBatch.legend.species=Espèces tutti.editCatchBatch.legend.total=Capture tutti.editCruise.action.closeEditCruise=Fermer @@ -468,12 +468,12 @@ tutti.editFishingOperation.label.traitReminder.inCreation=en cours de création tutti.editFishingOperation.pane.other=Autres caractéristiques tutti.editFishingOperation.tab.general=Trait -tutti.editMacroWasteBatch.table.header.comment=Commentaire -tutti.editMacroWasteBatch.table.header.file=Pièces jointes -tutti.editMacroWasteBatch.table.header.macroWasteCategory=Catégorie -tutti.editMacroWasteBatch.table.header.macroWasteSizeCategory=Catégorie de taille -tutti.editMacroWasteBatch.table.header.number=Nombre -tutti.editMacroWasteBatch.table.header.weight=Poids +tutti.editMarineLitterBatch.table.header.comment=Commentaire +tutti.editMarineLitterBatch.table.header.file=Pièces jointes +tutti.editMarineLitterBatch.table.header.marineLitterCategory=Catégorie +tutti.editMarineLitterBatch.table.header.marineLitterSizeCategory=Catégorie de taille +tutti.editMarineLitterBatch.table.header.number=Nombre +tutti.editMarineLitterBatch.table.header.weight=Poids tutti.editPlanktonBatch.table.header.comment=Commentaire tutti.editPlanktonBatch.table.header.file=Pièces jointes tutti.editPlanktonBatch.table.header.sampleWeight=Poids échantillonné @@ -743,7 +743,7 @@ tutti.label.tab.catches=Captures tutti.label.tab.catchesCaracteristics=Résumé tutti.label.tab.fishingOperation=Trait -tutti.label.tab.macroDechet=Macro déchets +tutti.label.tab.marineLitter=Macro déchets tutti.label.tab.observationIndividuel=Observations individuelles tutti.label.tab.plancton=Plancton tutti.label.tab.species=Espèces