r144 - in trunk: . tutti-persistence tutti-persistence-dev tutti-service tutti-service/src/main/resources/i18n tutti-ui-swing tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species tutti-ui-swing/src/main/resources/i18n
Author: tchemit Date: 2013-01-02 15:22:01 +0100 (Wed, 02 Jan 2013) New Revision: 144 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/144 Log: put protocol in jaxx context + add license on pom + optimize i18n Modified: trunk/pom.xml trunk/tutti-persistence-dev/pom.xml trunk/tutti-persistence/pom.xml trunk/tutti-service/pom.xml trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties trunk/tutti-ui-swing/pom.xml trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2013-01-02 13:44:15 UTC (rev 143) +++ trunk/pom.xml 2013-01-02 14:22:01 UTC (rev 144) @@ -1,4 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + Tutti + %% + 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% + --> + <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -460,6 +482,41 @@ <profiles> <profile> + <id>license-profile</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + + <build> + <defaultGoal>generate-resources</defaultGoal> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>license-maven-plugin</artifactId> + <executions> + <execution> + <id>update-file-header-on-pom</id> + <goals> + <goal>update-file-header</goal> + </goals> + <phase>generate-resources</phase> + <configuration> + <roots><root>${project.basedir}</root></roots> + <includes><include>pom.xml</include></includes> + <addSvnKeyWords>false</addSvnKeyWords> + <verbose>false</verbose> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + + <profile> <id>reporting</id> <activation> <property> Modified: trunk/tutti-persistence/pom.xml =================================================================== --- trunk/tutti-persistence/pom.xml 2013-01-02 13:44:15 UTC (rev 143) +++ trunk/tutti-persistence/pom.xml 2013-01-02 14:22:01 UTC (rev 144) @@ -1,4 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + Tutti :: Persistence API + %% + 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% + --> + <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> Modified: trunk/tutti-persistence-dev/pom.xml =================================================================== --- trunk/tutti-persistence-dev/pom.xml 2013-01-02 13:44:15 UTC (rev 143) +++ trunk/tutti-persistence-dev/pom.xml 2013-01-02 14:22:01 UTC (rev 144) @@ -1,4 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + Tutti :: Persistence Dev (impl) + %% + 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% + --> + <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> Modified: trunk/tutti-service/pom.xml =================================================================== --- trunk/tutti-service/pom.xml 2013-01-02 13:44:15 UTC (rev 143) +++ trunk/tutti-service/pom.xml 2013-01-02 14:22:01 UTC (rev 144) @@ -1,4 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + Tutti :: Service + %% + 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% + --> + <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> 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-01-02 13:44:15 UTC (rev 143) +++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2013-01-02 14:22:01 UTC (rev 144) @@ -4,7 +4,6 @@ tutti.config.license.organizationName=Nom de l'organisation dans la licence tutti.config.tmp.directory=Répertoire temporaire utilisée par l'application (est nettoyé à chaque démarrage de l'application) tutti.property.attachment=Pièce jointe -tutti.property.beaufortScale=Vent beaufort tutti.property.codeMemo=Code Memo tutti.property.country=Pays tutti.property.cruise=Campagne @@ -18,7 +17,6 @@ tutti.property.name=Nom tutti.property.program=Série de campagne tutti.property.protocol=Protocol de saisie -tutti.property.seaState=État de la mer tutti.property.sortedUnsortedCategory=Vrac / Hors Vrac tutti.property.species=Espèce tutti.property.stationNumber=Numéro de station Modified: trunk/tutti-ui-swing/pom.xml =================================================================== --- trunk/tutti-ui-swing/pom.xml 2013-01-02 13:44:15 UTC (rev 143) +++ trunk/tutti-ui-swing/pom.xml 2013-01-02 14:22:01 UTC (rev 144) @@ -1,4 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + Tutti :: UI + %% + 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% + --> + <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -129,8 +151,7 @@ <configuration> <licenseMerges> <licenseMerge> - The Apache Software License, Version 2.0|Apache License, - Version 2.0 + The Apache Software License, Version 2.0|Apache License, Version 2.0 </licenseMerge> <licenseMerge>BSD License|BSD</licenseMerge> </licenseMerges> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-01-02 13:44:15 UTC (rev 143) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-01-02 14:22:01 UTC (rev 144) @@ -27,6 +27,7 @@ import fr.ifremer.tutti.persistence.entities.TuttiEntities; import fr.ifremer.tutti.persistence.entities.data.Cruise; import fr.ifremer.tutti.persistence.entities.data.FishingOperation; +import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol; import fr.ifremer.tutti.service.PersistenceService; import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler; import fr.ifremer.tutti.ui.swing.TuttiUIContext; @@ -82,6 +83,23 @@ Cruise cruise = persistenceService.getCruise(cruiseId); model.setCruise(cruise); + if (getContext().isProtocolFilled()) { + + // load existing protocol + + TuttiProtocol protocol = + persistenceService.getProtocol(getContext().getProtocolId()); + + if (log.isInfoEnabled()) { + log.info("Loading existing protocol: " + protocol); + } + ui.setContextValue(protocol); + } else { + + // remove any previous existing protocol + ui.removeContextValue(TuttiProtocol.class); + } + List<FishingOperation> fishingOperations = persistenceService.getAllFishingOperation(cruiseId); model.setFishingOperation(fishingOperations); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-01-02 13:44:15 UTC (rev 143) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-01-02 14:22:01 UTC (rev 144) @@ -35,6 +35,7 @@ import org.apache.commons.collections.CollectionUtils; import org.nuiton.util.beans.Binder; import org.nuiton.util.beans.BinderFactory; +import org.nuiton.util.beans.BinderModelBuilder; import java.util.Collections; import java.util.List; @@ -231,8 +232,10 @@ protected List<SpeciesBatchRowModel> batchChild; protected static final Binder<SpeciesBatch, SpeciesBatchRowModel> fromBeanBinder = - BinderFactory.newBinder(SpeciesBatch.class, - SpeciesBatchRowModel.class); + BinderModelBuilder. + newDefaultBuilder(SpeciesBatch.class,SpeciesBatchRowModel.class). + addProperty(SpeciesBatch.PROPERTY_SPECIES, SpeciesBatchRowModel.PROPERTY_SPECIES_CATEGORY). + addProperty(SpeciesBatch.PROPERTY_SPECIES, SpeciesBatchRowModel.PROPERTY_SPECIES_CATEGORY).toBinder(); protected static final Binder<SpeciesBatchRowModel, SpeciesBatch> toBeanBinder = BinderFactory.newBinder(SpeciesBatchRowModel.class, @@ -253,6 +256,7 @@ List<SpeciesBatchFrequency> frequencies) { this(); fromBean(aBatch); + setSpeciesCategory(aBatch.getSpecies()); List<SpeciesFrequencyRowModel> frequencyRows = SpeciesFrequencyRowModel.fromBeans(frequencies); frequency.addAll(frequencyRows); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-01-02 13:44:15 UTC (rev 143) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-01-02 14:22:01 UTC (rev 144) @@ -61,11 +61,8 @@ import org.jdesktop.swingx.table.DefaultTableColumnModelExt; import org.nuiton.util.decorator.Decorator; -import javax.swing.SwingUtilities; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumnModel; -import java.awt.Point; -import java.awt.event.MouseEvent; import java.io.Serializable; import java.util.List; import java.util.Set; @@ -344,13 +341,9 @@ List<Species> allSpecies; - if (getContext().isProtocolFilled()) { + TuttiProtocol protocol = ui.getContextValue(TuttiProtocol.class); - // there is a protocol - - TuttiProtocol protocol = - persistenceService.getProtocol(getContext().getProtocolId()); - + if (protocol != null) { // fill sampling order from protocol List<SampleCategoryEnum> sampleCategoryOrder = @@ -372,8 +365,8 @@ protocolSpecy.getSpeciesId()); allSpecies.add(species); } - } else { + // no protocol, use default values samplingOrder = Lists.newArrayList( @@ -409,11 +402,9 @@ { // SpeciesCategory column - Decorator<Species> decorator = getDecorator(Species.class, null); - addSampleCategoryColumnToModel(columnModel, SpeciesBatchTableModel.SPECIES_CATEGORY, - caracteristicDecorator, + getDecorator(Species.class, null), defaultRenderer); } 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-01-02 13:44:15 UTC (rev 143) +++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-02 14:22:01 UTC (rev 144) @@ -22,7 +22,6 @@ tutti.action.pupitri-import=Import PUPITRI tutti.action.reload.actions=Recharger les actions tutti.action.reload.application=Recharger l'application -tutti.action.reload.home=Reload home screen tutti.action.reload.ui=Recharger l'interface graphique tutti.action.removeSpecies=Supprimer l'espèce tutti.action.removeSpeciesSubBatch=Supprimer les lots @@ -39,8 +38,6 @@ tutti.config.category.applications.description=Application tutti.config.category.colors=Couleurs tutti.config.category.colors.description=Couleurs utilisées dans les interfaces graphiques -tutti.config.category.other=Autres -tutti.config.category.other.description=Autres options tutti.config.category.shortcuts=Raccourcis tutti.config.category.shortcuts.description=Liste des raccourcis clavier tutti.config.cruiseId=Identifiant de la dernière campagne utilisée @@ -215,7 +212,6 @@ tutti.table.protocol.species.header.size=Catégorie Tri tutti.table.protocol.species.header.sortedUnsorted=Vrac / Hors Vrac tutti.table.protocol.species.header.speciesId=Espèce -tutti.table.species.batch.header.age=Age tutti.table.species.batch.header.ageCategory=Age tutti.table.species.batch.header.comment=Commentaire tutti.table.species.batch.header.computedNumber=Nombre calculé @@ -224,11 +220,9 @@ tutti.table.species.batch.header.maturityCategory=Maturité tutti.table.species.batch.header.number=Nombre tutti.table.species.batch.header.sexCategory=Sexe -tutti.table.species.batch.header.sizeCategory=Catégorie Taille -tutti.table.species.batch.header.sortedUnsortedCategory=Vrac / Hors Vrac -tutti.table.species.batch.header.speciesByCode=Espèce -tutti.table.species.batch.header.speciesByGenusCode=Espèce -tutti.table.species.batch.header.speciesCategory= +tutti.table.species.batch.header.sizeCategory=Class. Tri +tutti.table.species.batch.header.sortedUnsortedCategory=V/HV +tutti.table.species.batch.header.speciesCategory=Espèce tutti.table.species.batch.header.toConfirm=A Confirmer tutti.table.species.batch.header.weight=Poids tutti.table.species.frequency.header.computedWeight=Poids calculé @@ -239,7 +233,6 @@ tutti.table.species.sampleCategory.header.weight=Poids tutti.timeeditor.H=H tutti.title.about=À propos de Tutti -tutti.title.batchActions=Actions possibles tutti.title.create.cruise=Créer une nouvelle campagne tutti.title.create.program=Créer une nouvelle série de campagne tutti.title.create.protocol=Créer un nouveau protocol de saisie
participants (1)
-
tchemit@users.forge.codelutin.com