Tutti-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
February 2013
- 6 participants
- 236 discussions
r423 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing resources/i18n resources/icons
by tchemit@users.forge.codelutin.com 15 Feb '13
by tchemit@users.forge.codelutin.com 15 Feb '13
15 Feb '13
Author: tchemit
Date: 2013-02-15 17:55:21 +0100 (Fri, 15 Feb 2013)
New Revision: 423
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/423
Log:
continue updater actions
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractMainUITuttiAction.java
trunk/tutti-ui-swing/src/main/resources/icons/action-close-db.png
trunk/tutti-ui-swing/src/main/resources/icons/action-export-db.png
trunk/tutti-ui-swing/src/main/resources/icons/action-install-db.png
trunk/tutti-ui-swing/src/main/resources/icons/action-manage-db.png
trunk/tutti-ui-swing/src/main/resources/icons/action-open-db.png
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateReferentialAction.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractMainUITuttiAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractMainUITuttiAction.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractMainUITuttiAction.java 2013-02-15 16:55:21 UTC (rev 423)
@@ -0,0 +1,43 @@
+package fr.ifremer.tutti.ui.swing;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $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%
+ */
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public abstract class AbstractMainUITuttiAction extends AbstractTuttiAction<TuttiUIContext, MainUI, MainUIHandler> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected AbstractMainUITuttiAction(MainUIHandler handler,
+ String name,
+ String icon,
+ String text,
+ String tip,
+ boolean hideBody) {
+ super(handler, name, icon, text, tip, hideBody);
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractMainUITuttiAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java 2013-02-15 14:49:58 UTC (rev 422)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java 2013-02-15 16:55:21 UTC (rev 423)
@@ -311,27 +311,32 @@
AbstractButton abstractButton = (AbstractButton) component;
Class<? extends AbstractTuttiAction> actionName = (Class<? extends AbstractTuttiAction>) abstractButton.getClientProperty("tuttiAction");
if (actionName != null) {
- Action action = createAction(actionName);
- abstractButton.setAction(action);
+ initAction(abstractButton, actionName);
}
}
-
-// else if (component instanceof JMenuItem) {
-// JMenuItem jMenuItem = (JMenuItem) component;
-// if (jMenuItem.getAction()!=null) {
-// jMenuItem.setIcon();
-// }
-//
-// }
}
}
+ protected void initAction(AbstractButton abstractButton,
+ Class<? extends AbstractTuttiAction> actionName) {
+ Action action = createAction(actionName);
+ abstractButton.setAction(action);
+ }
+
protected <A extends AbstractTuttiAction> A createAction(Class<A> actionName) {
A action = null;
if (actionName != null) {
try {
+
+ AbstractTuttiUIHandler handler = this;
+
+ if (AbstractMainUITuttiAction.class.isAssignableFrom(actionName) &&
+ getContext().getMainUI() != null) {
+ handler = getContext().getMainUI().getHandler();
+ }
+
action = (A) ConstructorUtils.invokeConstructor(
- actionName, this);
+ actionName, handler);
} catch (Exception e) {
throw new RuntimeException(
"Could not instanciate action " + actionName, e);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-02-15 14:49:58 UTC (rev 422)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-02-15 16:55:21 UTC (rev 423)
@@ -54,7 +54,7 @@
private static final Log log =
LogFactory.getLog(TuttiApplicationUpdaterCallBack.class);
- enum UpdateType {
+ public enum UpdateType {
JRE,
TUTTI,
I18N,
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateReferentialAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateReferentialAction.java 2013-02-15 14:49:58 UTC (rev 422)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateReferentialAction.java 2013-02-15 16:55:21 UTC (rev 423)
@@ -41,7 +41,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
*/
-public class UpdateReferentialAction extends AbstractTuttiAction<TuttiUIContext, MainUI, MainUIHandler> {
+public class UpdateReferentialAction extends AbstractMainUITuttiAction {
private static final long serialVersionUID = 1L;
@@ -82,6 +82,11 @@
false,
callback);
+ progressionModel.setMessage("Rechargement de la base de données");
+
+ getContext().setDbLoaded(true);
+ getHandler().reloadPersistenceService();
+
getContext().getActionUI().getModel().setProgressionModel(null);
}
}
\ No newline at end of file
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-02-15 14:49:58 UTC (rev 422)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-02-15 16:55:21 UTC (rev 423)
@@ -27,6 +27,8 @@
tutti.action.cloneProtocol=Cloner
tutti.action.cloneProtocol.tip=Dupliquer le protocole sélectionné
tutti.action.close=Fermer
+tutti.action.closeDb=Fermer la base
+tutti.action.closeDb.tip=Fermer la base de données en cours d'utilisation
tutti.action.computeWeights=Elever les poids
tutti.action.computeWeights.tip=Elever les poids
tutti.action.configuration=Configuration
@@ -55,6 +57,8 @@
tutti.action.exit.tip=Quitter l'application
tutti.action.exportAllCaracteristic=Exporter toutes les caractéristiques
tutti.action.exportAllCaracteristic.tip=Exporter toutes les caractéristiques (sans les affecter à un écran)
+tutti.action.exportDb=Exporter la base
+tutti.action.exportDb.tip=Exporter la base de données au format zip
tutti.action.exportProtocol=Exporter
tutti.action.exportProtocol.tip=Exporter le protocole sélectionné
tutti.action.exportProtocolCaracteristic=Exporter les caractéristiques
@@ -91,6 +95,10 @@
tutti.action.importTemporarySpecies.tip=Importer un référentiel temporaire d'espèces
tutti.action.importTemporaryVessel=Importer
tutti.action.importTemporaryVessel.tip=Importer un référentiel temporaire de navires
+tutti.action.installDb=Installer la base
+tutti.action.installDb.tip=Télécharger puis installer la base de données
+tutti.action.manageDb=Gestion base
+tutti.action.manageDb.tip=Gérer la base de données utilisée par Tutti
tutti.action.newCruise=Nouveau
tutti.action.newCruise.tip=Créer une nouvelle campagne
tutti.action.newFishingOperation.tip=Créer une nouvelle opération de pêche
@@ -99,6 +107,8 @@
tutti.action.newProtocol=Nouveau
tutti.action.newProtocol.tip=Créer un nouveau protocole
tutti.action.ok=Fermer
+tutti.action.openDb=Ouvrir la base
+tutti.action.openDb.tip=Ouvrir la base de données détectée par Tutti
tutti.action.reload.actions=Recharger les actions
tutti.action.reload.application=Recharger l'application
tutti.action.reload.ui=Recharger l'interface graphique
@@ -171,6 +181,10 @@
tutti.flash.information.species.exported.from.protocol=Espèces du protocole exportées dans le fichier %s.
tutti.flash.information.species.imported.in.protocol=Espèces importées dans le protocole depuis le fichier %s.
tutti.flash.information.species.remove.from.protocol=L'espèce %s a été retirée du protocole
+tutti.information.db.loaded=Tutti est connecté à une base de données
+tutti.information.no.db.connected=Aucune base de données connectée à Tutti.
+tutti.information.no.db.exist=Tutti n'a pas trouvée de base à utiliser, vous pouvez l'installer.
+tutti.information.no.db.loaded=Tutti a détecté une base mais elle n'est pas actuellement ouverte.
tutti.label.attachmentEditor.file=Fichier
tutti.label.attachmentEditor.fileComment=Commentaire
tutti.label.attachmentEditor.fileName=Nom
@@ -307,6 +321,8 @@
tutti.legend.splitSpeciesBatchConfiguration=Configuration
tutti.menu.actions=Actions
tutti.menu.actions.tip=Actions
+tutti.menu.administration=Administration
+tutti.menu.administration.tip=Administrer Tutti
tutti.menu.file=Fichier
tutti.menu.file.tip=Fichier
tutti.menu.help=Aide
@@ -443,6 +459,7 @@
tutti.title.editFrequency=Mensuration
tutti.title.home=Sélection de la campagne
tutti.title.import.temporary.referential=importer des référentiels temporaires
+tutti.title.manageDb=Gérer les bases de données
tutti.title.noSelectedCruise=Pas de campagne sélectionné
tutti.title.noSelectedProgram=Pas de série de campagne sélectionné
tutti.title.noSelectedProtocol=Pas de protocol sélectionné
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-close-db.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-close-db.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-export-db.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-export-db.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-install-db.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-install-db.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-manage-db.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-manage-db.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-open-db.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-open-db.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: svn:keywords
+ Author Date Id Revision HeadURL
1
0
r422 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home
by tchemit@users.forge.codelutin.com 15 Feb '13
by tchemit@users.forge.codelutin.com 15 Feb '13
15 Feb '13
Author: tchemit
Date: 2013-02-15 15:49:58 +0100 (Fri, 15 Feb 2013)
New Revision: 422
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/422
Log:
clean validator when quitting home screen
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java 2013-02-15 14:49:24 UTC (rev 421)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java 2013-02-15 14:49:58 UTC (rev 422)
@@ -251,6 +251,7 @@
for (PropertyChangeListener listener : listeners) {
getModel().removePropertyChangeListener(listener);
}
+ clearValidators();
}
public void startExistingProtocolAction(ActionEvent event) {
1
0
r421 - in trunk: tutti-persistence/src/main/java/fr/ifremer/tutti/persistence tutti-service/src/main/java/fr/ifremer/tutti/service tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db
by tchemit@users.forge.codelutin.com 15 Feb '13
by tchemit@users.forge.codelutin.com 15 Feb '13
15 Feb '13
Author: tchemit
Date: 2013-02-15 15:49:24 +0100 (Fri, 15 Feb 2013)
New Revision: 421
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/421
Log:
ajout manage db
Added:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ClosedPersistenceService.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/ManageDbAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/CloseDbAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/ExportDbAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/InstallDbAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/OpenDbAction.java
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiScreen.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-02-15 14:49:24 UTC (rev 421)
@@ -0,0 +1,461 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $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.entities.data.AccidentalBatch;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
+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.PlanktonBatch;
+import fr.ifremer.tutti.persistence.entities.data.Program;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
+import fr.ifremer.tutti.persistence.entities.referential.Country;
+import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
+import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.persistence.entities.referential.Person;
+import fr.ifremer.tutti.persistence.entities.referential.Species;
+import fr.ifremer.tutti.persistence.entities.referential.Vessel;
+import fr.ifremer.tutti.persistence.entities.referential.Zone;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Mock implementation With no persistence at all behind.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class TuttiPersistenceNoDbImpl implements TuttiPersistence {
+
+ @Override
+ public String getImplementationName() {
+ return "Mock persistence service implementation";
+ }
+
+ @Override
+ public List<Zone> getAllProgramZone() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Country> getAllCountry() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<FishingOperationLocation> getAllFishingOperationSubStrata(String zoneId, String strataId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<FishingOperationLocation> getAllFishingOperationLocation(String zoneId, String strataId, String subStrataId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Vessel> getAllScientificVessel() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Vessel> getAllFishingVessel() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Species> getAllSpecies() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Species> getAllReferentSpecies() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Species> getAllSpecies(TuttiProtocol protocol) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Caracteristic> getAllCaracteristic() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Caracteristic getSizeCategoryCaracteristic() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Caracteristic getSexCaracteristic() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Caracteristic getSortedUnsortedCaracteristic() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Caracteristic getMaturityCaracteristic() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Caracteristic getMacroWasteCategoryCaracteristic() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Caracteristic getMacroWasteSizeCategoryCaracteristic() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Gear> getAllScientificGear() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Gear> getAllFishingGear() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Person> getAllPerson() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Person getPerson(Integer personId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Gear getGear(Integer gearCode) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Vessel getVessel(String vesselCode) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public boolean isSortedQualitativeValue(CaracteristicQualitativeValue value) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Species> importTemporarySpecies(List<Species> species) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Vessel> importTemporaryVessel(List<Vessel> vessels) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Person> importTemporaryPerson(List<Person> persons) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Gear> importTemporaryGear(List<Gear> gears) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Program> getAllProgram() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Program getProgram(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Program createProgram(Program bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Program saveProgram(Program bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<Cruise> getAllCruise(String programId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Cruise getCruise(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Cruise createCruise(Cruise bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public Cruise saveCruise(Cruise bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<String> getAllProtocolNames() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<TuttiProtocol> getAllProtocol() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public boolean isProtocolExist(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public TuttiProtocol getProtocol(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public TuttiProtocol createProtocol(TuttiProtocol bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public TuttiProtocol saveProtocol(TuttiProtocol bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public void deleteProtocol(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<FishingOperation> getAllFishingOperation(String cruiseId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public FishingOperation getFishingOperation(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public FishingOperation createFishingOperation(FishingOperation bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public FishingOperation saveFishingOperation(FishingOperation bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public CatchBatch getCatchBatchFromFishingOperation(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public CatchBatch createCatchBatch(CatchBatch bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public CatchBatch saveCatchBatch(CatchBatch bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public SpeciesBatch createSpeciesBatch(SpeciesBatch bean, String parentBatchId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public SpeciesBatch saveSpeciesBatch(SpeciesBatch bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public void deleteSpeciesBatch(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public void deleteSpeciesSubBatch(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public void changeSpeciesBatchSpecies(String batchId, Species species) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<SpeciesBatchFrequency> getAllSpeciesBatchFrequency(String speciesBatchId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<SpeciesBatchFrequency> saveSpeciesBatchFrequency(String speciesBatchId, List<SpeciesBatchFrequency> frequencies) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<BenthosBatch> getAllBenthosBatch(String fishingOperationId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public BenthosBatch getBenthosBatch(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public BenthosBatch createBenthosBatch(BenthosBatch bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public BenthosBatch saveBenthosBatch(BenthosBatch bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public void deleteBenthosBatch(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<PlanktonBatch> getAllPlanktonBatch(String fishingOperationId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public PlanktonBatch getPlanktonBatch(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public PlanktonBatch createPlanktonBatch(PlanktonBatch bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public PlanktonBatch savePlanktonBatch(PlanktonBatch bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public void deletePlanktonBatch(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public MacroWasteBatch getMacroWasteBatch(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) {
+ 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");
+ }
+
+ @Override
+ public AccidentalBatch getAccidentalBatch(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public AccidentalBatch createAccidentalBatch(AccidentalBatch bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public AccidentalBatch saveAccidentalBatch(AccidentalBatch bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public void deleteAccidentalBatch(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public void init() {
+ }
+
+ @Override
+ public void close() throws IOException {
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ClosedPersistenceService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ClosedPersistenceService.java (rev 0)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ClosedPersistenceService.java 2013-02-15 14:49:24 UTC (rev 421)
@@ -0,0 +1,71 @@
+package fr.ifremer.tutti.service;
+
+/*
+ * #%L
+ * Tutti :: Service
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ifremer.tutti.persistence.TuttiPersistenceNoDbImpl;
+import fr.ifremer.tutti.persistence.config.TuttiPersistenceConfig;
+import fr.ifremer.tutti.service.config.TuttiServiceConfig;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Persistence service which always use the mock driver (means db is closed).
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class ClosedPersistenceService extends PersistenceService {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(ClosedPersistenceService.class);
+
+ @Override
+ public void init() {
+
+ if (log.isInfoEnabled()) {
+ log.info("Open persistence driver " + getImplementationName());
+ }
+
+ TuttiServiceConfig serviceConfig = context.getConfig();
+
+ TuttiPersistenceConfig config = serviceConfig.getPersistenceConfig();
+ TuttiPersistenceConfig.setInstance(config);
+
+ driver = new TuttiPersistenceNoDbImpl();
+
+ if (log.isInfoEnabled()) {
+ log.info("Will open persistence driver " +
+ driver.getImplementationName());
+ }
+
+ driver.init();
+ }
+
+ @Override
+ public boolean isDbLoaded() {
+ return false;
+ }
+}
Property changes on: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ClosedPersistenceService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-02-15 14:02:59 UTC (rev 420)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-02-15 14:49:24 UTC (rev 421)
@@ -25,7 +25,7 @@
*/
import fr.ifremer.tutti.persistence.TuttiPersistence;
-import fr.ifremer.tutti.persistence.TuttiPersistenceDevImpl;
+import fr.ifremer.tutti.persistence.TuttiPersistenceNoDbImpl;
import fr.ifremer.tutti.persistence.config.TuttiPersistenceConfig;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
@@ -47,8 +47,6 @@
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
-import fr.ifremer.tutti.persistence.service.ProtocolPersistenceService;
-import fr.ifremer.tutti.persistence.service.ProtocolPersistenceServiceImpl;
import fr.ifremer.tutti.persistence.service.TuttiPersistenceServiceLocator;
import fr.ifremer.tutti.service.config.TuttiServiceConfig;
import org.apache.commons.io.IOUtils;
@@ -56,7 +54,6 @@
import org.apache.commons.logging.LogFactory;
import org.springframework.transaction.annotation.Transactional;
-import java.io.File;
import java.io.IOException;
import java.util.List;
@@ -89,6 +86,10 @@
return "Tutti Persistence Service";
}
+ public boolean isDbLoaded() {
+ return !(driver instanceof TuttiPersistenceNoDbImpl);
+ }
+
@Override
public void init() {
@@ -117,65 +118,67 @@
// still on dev driver
- File storageDirectory = TuttiPersistenceDevImpl.getStorageDirectory(serviceConfig.getApplicationConfig());
+// File storageDirectory = TuttiPersistenceDevImpl.getStorageDirectory(serviceConfig.getApplicationConfig());
- if (log.isWarnEnabled()) {
+// if (log.isWarnEnabled()) {
+//
+// log.warn("--------------------------------------------------------------------");
+// log.warn("");
+// log.warn("Could not find database directory at " + config.getDbDirectory());
+// log.warn("Will still use dev dataStorage in " + storageDirectory);
+// log.warn("");
+// log.warn("--------------------------------------------------------------------");
+// }
- log.warn("--------------------------------------------------------------------");
- log.warn("");
- log.warn("Could not find database directory at " + config.getDbDirectory());
- log.warn("Will still use dev dataStorage in " + storageDirectory);
- log.warn("");
- log.warn("--------------------------------------------------------------------");
- }
+ driver = new TuttiPersistenceNoDbImpl();
- driver = new TuttiPersistenceDevImpl(serviceConfig.getApplicationConfig()) {
+// driver = new TuttiPersistenceDevImpl(serviceConfig.getApplicationConfig()) {
+//
+// ProtocolPersistenceService protocolPersistenceService = new ProtocolPersistenceServiceImpl();
+//
+// @Override
+// public void init() {
+// super.init();
+//
+// protocolPersistenceService.init();
+// }
+//
+// @Override
+// public boolean isProtocolExist(String id) {
+// return protocolPersistenceService.isProtocolExist(id);
+// }
+//
+// @Override
+// public List<String> getAllProtocolNames() {
+// return protocolPersistenceService.getAllProtocolNames();
+// }
+//
+// @Override
+// public List<TuttiProtocol> getAllProtocol() {
+// return protocolPersistenceService.getAllProtocol();
+// }
+//
+// @Override
+// public TuttiProtocol getProtocol(String id) {
+// return protocolPersistenceService.getProtocol(id);
+// }
+//
+// @Override
+// public TuttiProtocol createProtocol(TuttiProtocol bean) {
+// return protocolPersistenceService.createProtocol(bean);
+// }
+//
+// @Override
+// public TuttiProtocol saveProtocol(TuttiProtocol bean) {
+// return protocolPersistenceService.saveProtocol(bean);
+// }
+//
+// @Override
+// public void deleteProtocol(String id) {
+// protocolPersistenceService.deleteProtocol(id);
+// }
+// };
- ProtocolPersistenceService protocolPersistenceService = new ProtocolPersistenceServiceImpl();
-
- @Override
- public void init() {
- super.init();
-
- protocolPersistenceService.init();
- }
-
- @Override
- public boolean isProtocolExist(String id) {
- return protocolPersistenceService.isProtocolExist(id);
- }
-
- @Override
- public List<String> getAllProtocolNames() {
- return protocolPersistenceService.getAllProtocolNames();
- }
-
- @Override
- public List<TuttiProtocol> getAllProtocol() {
- return protocolPersistenceService.getAllProtocol();
- }
-
- @Override
- public TuttiProtocol getProtocol(String id) {
- return protocolPersistenceService.getProtocol(id);
- }
-
- @Override
- public TuttiProtocol createProtocol(TuttiProtocol bean) {
- return protocolPersistenceService.createProtocol(bean);
- }
-
- @Override
- public TuttiProtocol saveProtocol(TuttiProtocol bean) {
- return protocolPersistenceService.saveProtocol(bean);
- }
-
- @Override
- public void deleteProtocol(String id) {
- protocolPersistenceService.deleteProtocol(id);
- }
- };
-
if (log.isInfoEnabled()) {
log.info("Will open persistence driver " +
driver.getImplementationName());
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css 2013-02-15 14:02:59 UTC (rev 420)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css 2013-02-15 14:49:24 UTC (rev 421)
@@ -50,7 +50,17 @@
actionIcon: exit;
}
+#menuActionUpdate {
+ _tuttiAction: {UpdateApplicationAction.class};
+}
+
+#menuActionManageDb {
+ enabled: {model.getScreen() != TuttiScreen.MANAGE_DB};
+ _tuttiAction: {ManageDbAction.class};
+}
+
#menuActions {
+ enabled: {model.isDbLoaded()};
text: "tutti.menu.actions";
toolTipText: "tutti.menu.actions.tip";
mnemonic: A;
@@ -92,10 +102,11 @@
_tuttiAction: {ValidateSelectedCruiseCatchesAction.class};
}
-#menuReferential{
- text: "tutti.menu.referential";
- toolTipText: "tutti.menu.referential.tip";
- mnemonic: S;
+#menuAdministration{
+ enabled: {model.isDbLoaded()};
+ text: "tutti.menu.administration";
+ toolTipText: "tutti.menu.administration.tip";
+ mnemonic: A;
}
#menuImportTemporaryReferential {
@@ -103,11 +114,8 @@
_tuttiAction: {ImportTemporaryReferentialAction.class};
}
-#menuUpdateReferential {
- _tuttiAction: {UpdateReferentialAction.class};
-}
-
#menuSynchronisations {
+ enabled: {model.isDbLoaded()};
text: "tutti.menu.synchronisations";
toolTipText: "tutti.menu.synchronisations.tip";
mnemonic: S;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.jaxx 2013-02-15 14:02:59 UTC (rev 420)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.jaxx 2013-02-15 14:49:24 UTC (rev 421)
@@ -58,7 +58,10 @@
<JMenu id='menuFile'>
<JMenuItem id='menuFileConfiguration'
onActionPerformed="getHandler().showConfig()"/>
+ <JMenuItem id='menuActionUpdate'/>
<JSeparator/>
+ <JMenuItem id='menuActionManageDb'/>
+ <JSeparator/>
<JMenuItem id='menuFileExit'
onActionPerformed='getHandler().closeTutti()'/>
</JMenu>
@@ -72,10 +75,8 @@
<JMenuItem id='menuActionValidateCatches'/>
</JMenu>
- <JMenu id='menuReferential'>
-
+ <JMenu id='menuAdministration'>
<JMenuItem id='menuImportTemporaryReferential'/>
- <JMenuItem id='menuUpdateReferential'/>
</JMenu>
<JMenu id='menuSynchronisations'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2013-02-15 14:02:59 UTC (rev 420)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2013-02-15 14:49:24 UTC (rev 421)
@@ -31,6 +31,7 @@
import fr.ifremer.tutti.ui.swing.config.TuttiApplicationConfig;
import fr.ifremer.tutti.ui.swing.config.TuttiConfigUI;
import fr.ifremer.tutti.ui.swing.content.cruise.EditCruiseUI;
+import fr.ifremer.tutti.ui.swing.content.db.DbManagerUI;
import fr.ifremer.tutti.ui.swing.content.home.SelectCruiseUI;
import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI;
import fr.ifremer.tutti.ui.swing.content.program.EditProgramUI;
@@ -69,7 +70,7 @@
protected JComponent currentBody;
- protected final PersistenceService persistenceService;
+ protected PersistenceService persistenceService;
protected MainUIHandler(TuttiUIContext context, MainUI ui) {
super(context, ui);
@@ -125,8 +126,14 @@
TuttiScreen screen;
- screen = TuttiScreen.SELECT_CRUISE;
+ if (context.isDbExist() && context.isDbLoaded()) {
+ screen = TuttiScreen.SELECT_CRUISE;
+ } else {
+
+ screen = TuttiScreen.MANAGE_DB;
+ }
+
context.setScreen(screen);
}
@@ -310,6 +317,13 @@
Icon icon;
switch (screen) {
default:
+ case MANAGE_DB:
+
+ screenUI = new DbManagerUI(ui);
+ screenTitle = _("tutti.title.manageDb");
+ icon = ui.getMenuActionManageDb().getIcon();
+ break;
+
case SELECT_CRUISE:
screenUI = new SelectCruiseUI(ui);
@@ -462,7 +476,6 @@
title += _("tutti.title.noSelectedProtocol");
-
} else {
// selected protocol
@@ -475,4 +488,15 @@
return title;
}
+ public void reloadPersistenceService() {
+
+ this.persistenceService = context.reloadPersistenceService();
+
+ context.setProgramId(null);
+ context.setProgramId(null);
+ }
+
+ public PersistenceService getPersistenceService() {
+ return persistenceService;
+ }
}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/ManageDbAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/ManageDbAction.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/ManageDbAction.java 2013-02-15 14:49:24 UTC (rev 421)
@@ -0,0 +1,71 @@
+package fr.ifremer.tutti.ui.swing;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $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 org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.awt.event.ActionEvent;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * To manage db in Tutti.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class ManageDbAction extends AbstractChangeScreenAction {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(ManageDbAction.class);
+
+ public ManageDbAction(MainUIHandler handler) {
+ super(handler,
+ "mnanageDb",
+ "manage-db",
+ _("tutti.action.manageDb"),
+ _("tutti.action.manageDb.tip"),
+ true
+ );
+ setMnemonic('P');
+ }
+
+ @Override
+ protected void doAction(ActionEvent e) {
+ if (log.isDebugEnabled()) {
+ log.debug("open manage db screen");
+ }
+ getContext().setScreen(getNextScreen());
+ }
+
+ @Override
+ protected TuttiScreen getNextScreen() {
+ return TuttiScreen.MANAGE_DB;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/ManageDbAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiScreen.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiScreen.java 2013-02-15 14:02:59 UTC (rev 420)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiScreen.java 2013-02-15 14:49:24 UTC (rev 421)
@@ -33,6 +33,13 @@
public enum TuttiScreen {
/**
+ * To manager db used by Tutti.
+ *
+ * @since 1.0
+ */
+ MANAGE_DB,
+
+ /**
* To select program and cruise.
*
* @since 0.1
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-02-15 14:02:59 UTC (rev 420)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-02-15 14:49:24 UTC (rev 421)
@@ -30,9 +30,11 @@
import fr.ifremer.tutti.persistence.RessourceClassLoader;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Program;
+import fr.ifremer.tutti.service.ClosedPersistenceService;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.TuttiService;
import fr.ifremer.tutti.service.TuttiServiceContext;
+import fr.ifremer.tutti.service.TuttiTechnicalException;
import fr.ifremer.tutti.ui.swing.config.TuttiApplicationConfig;
import fr.ifremer.tutti.ui.swing.util.UIMessageNotifier;
import fr.ifremer.tutti.ui.swing.util.action.TuttiActionUI;
@@ -91,6 +93,10 @@
PROPERTY_CRUISE_ID,
PROPERTY_PROTOCOL_ID);
+ public static final String PROPERTY_DB_EXIST = "dbExist";
+
+ public static final String PROPERTY_DB_LOADED = "dbLoaded";
+
/**
* Application context (only one for all the application).
*
@@ -126,6 +132,11 @@
*/
protected final SwingSession swingSession;
+ /**
+ * Erro helper.
+ *
+ * @since 1.0
+ */
protected final TuttiErrorHelper errorHelper;
/**
@@ -174,6 +185,20 @@
private TuttiActionUI actionUI;
+ /**
+ * Flag to know if there is an exsiting db.
+ *
+ * @since 1.0
+ */
+ private boolean dbExist;
+
+ /**
+ * Flag to know if there is a loaded db.
+ *
+ * @since 1.0
+ */
+ private boolean dbLoaded;
+
public static TuttiUIContext newContext(TuttiApplicationConfig config) {
Preconditions.checkNotNull(config);
Preconditions.checkState(applicationContext == null,
@@ -210,9 +235,27 @@
}
public <S extends TuttiService> S getService(Class<S> serviceType) {
+ if (PersistenceService.class.equals(serviceType) && !useRealPersistenceService()) {
+ serviceType = (Class<S>) ClosedPersistenceService.class;
+ }
return serviceContext.getService(serviceType);
}
+ public boolean useRealPersistenceService() {
+ return isDbExist() && isDbLoaded();
+ }
+
+ public PersistenceService reloadPersistenceService() {
+
+ try {
+ serviceContext.close();
+ } catch (IOException e) {
+ throw new TuttiTechnicalException("Could not close services", e);
+ }
+
+ return getService(PersistenceService.class);
+ }
+
public TuttiApplicationConfig getConfig() {
return config;
}
@@ -245,11 +288,28 @@
return StringUtils.isNotBlank(programId);
}
-
public TuttiScreen getScreen() {
return screen;
}
+ public boolean isDbExist() {
+ return dbExist;
+ }
+
+ public void setDbExist(boolean dbExist) {
+ this.dbExist = dbExist;
+ firePropertyChange(PROPERTY_DB_EXIST, null, dbExist);
+ }
+
+ public boolean isDbLoaded() {
+ return dbLoaded;
+ }
+
+ public void setDbLoaded(boolean dbLoaded) {
+ this.dbLoaded = dbLoaded;
+ firePropertyChange(PROPERTY_DB_LOADED, null, dbLoaded);
+ }
+
public void setProgramId(String programId) {
boolean oldProgramFilled = isProgramFilled();
boolean oldCruiseFilled = isCruiseFilled();
@@ -301,7 +361,6 @@
public void init() {
-
try {
config.getServiceConfig().prepareDirectories();
} catch (IOException e) {
@@ -385,70 +444,87 @@
setProtocolId(getConfig().getProtocolId());
}
- //check if programId is sane
- PersistenceService service = getService(PersistenceService.class);
+ boolean dbExists =
+ getConfig().getServiceConfig().getPersistenceConfig().isDbExists();
- if (isProtocolFilled()) {
+ setDbExist(dbExists);
- if (!service.isProtocolExist(protocolId)) {
+ if (!dbExists) {
- // not found in this db
+ setProtocolId(null);
+ setProgramId(null);
+ setCruiseId(null);
+ setDbLoaded(false);
- if (log.isWarnEnabled()) {
- log.warn("Remove invalid protocolId: " + protocolId);
- }
+ } else {
- setProtocolId(null);
- }
- }
+ setDbLoaded(true);
- if (isProgramFilled()) {
+ //check if programId is sane
+ PersistenceService service = getService(PersistenceService.class);
- Program program = service.getProgram(programId);
- if (program == null) {
+ if (isProtocolFilled()) {
- // not found in this db
+ if (!service.isProtocolExist(protocolId)) {
- if (log.isWarnEnabled()) {
- log.warn("Remove invalid programId: " + programId);
+ // not found in this db
+
+ if (log.isWarnEnabled()) {
+ log.warn("Remove invalid protocolId: " + protocolId);
+ }
+
+ setProtocolId(null);
}
+ }
- setProgramId(null);
- setCruiseId(null);
+ if (isProgramFilled()) {
- } else {
+ Program program = service.getProgram(programId);
+ if (program == null) {
- if (log.isInfoEnabled()) {
- log.info("ProgramId valid: " + programId);
- }
+ // not found in this db
- setProgramId(programId);
+ if (log.isWarnEnabled()) {
+ log.warn("Remove invalid programId: " + programId);
+ }
- // test cruiseId
- if (isCruiseFilled()) {
+ setProgramId(null);
+ setCruiseId(null);
- Cruise cruise = service.getCruise(cruiseId);
+ } else {
- if (cruise != null &&
- !cruise.getProgram().getId().equals(programId)) {
-
- // not matchin program, reset cruise id
- cruise = null;
+ if (log.isInfoEnabled()) {
+ log.info("ProgramId valid: " + programId);
}
- if (cruise == null) {
+ setProgramId(programId);
- // not found in this db
+ // test cruiseId
+ if (isCruiseFilled()) {
- if (log.isWarnEnabled()) {
- log.warn("Remove invalid cruiseId: " + cruiseId);
+ Cruise cruise = service.getCruise(cruiseId);
+
+ if (cruise != null &&
+ !cruise.getProgram().getId().equals(programId)) {
+
+ // not matchin program, reset cruise id
+ cruise = null;
}
- setCruiseId(null);
- } else {
+ if (cruise == null) {
- if (log.isInfoEnabled()) {
- log.info("CruiseId valid: " + cruiseId);
+ // not found in this db
+
+ if (log.isWarnEnabled()) {
+ log.warn("Remove invalid cruiseId: " + cruiseId);
+ }
+ setCruiseId(null);
+
+ } else {
+
+ if (log.isInfoEnabled()) {
+ log.info("CruiseId valid: " + cruiseId);
+ }
}
}
}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/CloseDbAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/CloseDbAction.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/CloseDbAction.java 2013-02-15 14:49:24 UTC (rev 421)
@@ -0,0 +1,78 @@
+package fr.ifremer.tutti.ui.swing.content.db;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $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.config.TuttiPersistenceConfig;
+import fr.ifremer.tutti.ui.swing.AbstractMainUITuttiAction;
+import fr.ifremer.tutti.ui.swing.MainUIHandler;
+import fr.ifremer.tutti.ui.swing.TuttiScreen;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.awt.event.ActionEvent;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * To close db attached to Tutti.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class CloseDbAction extends AbstractMainUITuttiAction {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(CloseDbAction.class);
+
+ public CloseDbAction(MainUIHandler handler) {
+ super(handler,
+ "closeDb",
+ "close-db",
+ _("tutti.action.closeDb"),
+ _("tutti.action.closeDb.tip"),
+ true);
+ }
+
+ @Override
+ protected void doAction(ActionEvent event) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Will close db...");
+ }
+
+ String jdbcUrl = TuttiPersistenceConfig.getInstance().getJdbcUrl();
+
+ getContext().setDbLoaded(false);
+
+ getHandler().reloadPersistenceService();
+
+ sendMessage(String.format("La base de données '%s' est fermée.", jdbcUrl));
+
+ // goto the only screen possible in this state
+ getContext().setScreen(TuttiScreen.MANAGE_DB);
+ }
+}
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/CloseDbAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.css 2013-02-15 14:49:24 UTC (rev 421)
@@ -0,0 +1,54 @@
+/*
+ * #%L
+ * Tutti :: UI
+ * $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%
+ */
+#informationLabel {
+ actionIcon: information;
+ text: {handler.updateMessage(model.isDbExist(), model.isDbLoaded())};
+ horizontalAlignment: {JLabel.CENTER};
+}
+
+#installDbButton {
+ enabled: {!model.isDbExist()};
+ _tuttiAction: {InstallDbAction.class};
+}
+
+#openDbButton {
+ enabled: {model.isDbExist() && !model.isDbLoaded()};
+ _tuttiAction: {OpenDbAction.class};
+}
+
+#upgradeDbButton {
+ enabled: {model.isDbExist() && model.isDbLoaded()};
+ _tuttiAction: {UpdateReferentialAction.class};
+}
+
+#closeDbButton {
+ enabled: {model.isDbExist() && model.isDbLoaded()};
+ _tuttiAction: {CloseDbAction.class};
+}
+
+#exportDbButton {
+ enabled: false;
+ /*enabled: {model.isDbExist() && model.isDbLoaded()};*/
+ _tuttiAction: {ExportDbAction.class};
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.css
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.jaxx 2013-02-15 14:49:24 UTC (rev 421)
@@ -0,0 +1,67 @@
+<!--
+ #%L
+ Tutti :: UI
+ $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%
+ -->
+<JPanel id='noDbUITopPanel' layout='{new BorderLayout()}'
+ implements='fr.ifremer.tutti.ui.swing.TuttiUI<TuttiUIContext, DbManagerUIHandler>'>
+
+ <import>
+
+ fr.ifremer.tutti.ui.swing.TuttiUI
+ fr.ifremer.tutti.ui.swing.TuttiUIContext
+ fr.ifremer.tutti.ui.swing.UpdateReferentialAction
+
+ static org.nuiton.i18n.I18n._
+ </import>
+
+ <script><![CDATA[
+
+ public DbManagerUI(TuttiUI parentUI) {
+ JAXXUtil.initContext(this, parentUI);
+ DbManagerUIHandler handler = new DbManagerUIHandler(parentUI.getHandler().getContext(), this);
+ setContextValue(handler);
+ handler.beforeInitUI();
+ }
+
+ protected void $afterCompleteSetup() {
+ handler.afterInitUI();
+ }
+ ]]></script>
+
+ <DbManagerUIHandler id='handler'
+ initializer='getContextValue(DbManagerUIHandler.class)'/>
+
+ <TuttiUIContext id='model'
+ initializer='getContextValue(TuttiUIContext.class)'/>
+
+ <JPanel id='centerPanel' layout='{new BorderLayout()}'
+ constraints='BorderLayout.CENTER'>
+ <JLabel id='informationLabel' constraints='BorderLayout.CENTER'/>
+ <JPanel constraints='BorderLayout.SOUTH' layout='{new GridLayout(0, 1)}'>
+ <JButton id='installDbButton'/>
+ <JButton id='openDbButton'/>
+ <JButton id='upgradeDbButton'/>
+ <JButton id='exportDbButton'/>
+ <JButton id='closeDbButton'/>
+ </JPanel>
+ </JPanel>
+</JPanel>
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.jaxx
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java 2013-02-15 14:49:24 UTC (rev 421)
@@ -0,0 +1,118 @@
+package fr.ifremer.tutti.ui.swing.content.db;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $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.ui.swing.AbstractTuttiUIHandler;
+import fr.ifremer.tutti.ui.swing.TuttiUIContext;
+import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.SwingUtilities;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class DbManagerUIHandler extends AbstractTuttiUIHandler<TuttiUIContext, DbManagerUI> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(DbManagerUIHandler.class);
+
+ public DbManagerUIHandler(TuttiUIContext context, DbManagerUI ui) {
+ super(context, ui);
+ }
+
+ @Override
+ public void beforeInitUI() {
+ context.addPropertyChangeListener(new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ String propertyName = evt.getPropertyName();
+ String message;
+
+
+ }
+ });
+ }
+
+ public String updateMessage(boolean dbExist, boolean dbLoaded) {
+ String message;
+
+ if (dbExist) {
+ if (dbLoaded) {
+
+ // db loaded
+ message = _("tutti.information.db.loaded");
+
+ } else {
+
+ // no db loaded
+ message = _("tutti.information.no.db.loaded");
+ }
+ } else {
+
+ // db does not exist
+ message = "tutti.information.no.db.exist";
+ ui.getInformationLabel().setText(_(message));
+ }
+ return message;
+ }
+
+ @Override
+ public void afterInitUI() {
+
+ initUI(ui);
+
+ ui.applyDataBinding(DbManagerUI.BINDING_INSTALL_DB_BUTTON_ENABLED);
+ ui.applyDataBinding(DbManagerUI.BINDING_OPEN_DB_BUTTON_ENABLED);
+ ui.applyDataBinding(DbManagerUI.BINDING_CLOSE_DB_BUTTON_ENABLED);
+ ui.applyDataBinding(DbManagerUI.BINDING_UPGRADE_DB_BUTTON_ENABLED);
+
+ SwingUtilities.invokeLater(
+ new Runnable() {
+ @Override
+ public void run() {
+ ui.repaint();
+ }
+ }
+ );
+ }
+
+ @Override
+ public void onCloseUI() {
+ }
+
+ @Override
+ public SwingValidator<TuttiUIContext> getValidator() {
+ return null;
+ }
+
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/ExportDbAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/ExportDbAction.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/ExportDbAction.java 2013-02-15 14:49:24 UTC (rev 421)
@@ -0,0 +1,67 @@
+package fr.ifremer.tutti.ui.swing.content.db;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $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.ui.swing.AbstractMainUITuttiAction;
+import fr.ifremer.tutti.ui.swing.MainUIHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.awt.event.ActionEvent;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * To export a db attached to Tutti.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class ExportDbAction extends AbstractMainUITuttiAction {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(ExportDbAction.class);
+
+ public ExportDbAction(MainUIHandler handler) {
+ super(handler,
+ "exportDb",
+ "export-db",
+ _("tutti.action.exportDb"),
+ _("tutti.action.exportDb.tip"),
+ true);
+ }
+
+ @Override
+ protected void doAction(ActionEvent event) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Will export db...");
+ }
+
+ //TODO
+ }
+}
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/ExportDbAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/InstallDbAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/InstallDbAction.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/InstallDbAction.java 2013-02-15 14:49:24 UTC (rev 421)
@@ -0,0 +1,104 @@
+package fr.ifremer.tutti.ui.swing.content.db;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $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.ProgressionModel;
+import fr.ifremer.tutti.persistence.config.TuttiPersistenceConfig;
+import fr.ifremer.tutti.ui.swing.AbstractMainUITuttiAction;
+import fr.ifremer.tutti.ui.swing.MainUIHandler;
+import fr.ifremer.tutti.ui.swing.TuttiApplicationUpdaterCallBack;
+import fr.ifremer.tutti.ui.swing.config.TuttiApplicationConfig;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.ApplicationUpdater;
+
+import java.awt.event.ActionEvent;
+import java.io.File;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * To install db when no db is attached to Tutti.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class InstallDbAction extends AbstractMainUITuttiAction {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(InstallDbAction.class);
+
+ public InstallDbAction(MainUIHandler handler) {
+ super(handler,
+ "installDb",
+ "install-db",
+ _("tutti.action.installDb"),
+ _("tutti.action.installDb.tip"),
+ true);
+ }
+
+ @Override
+ protected void doAction(ActionEvent event) {
+ TuttiApplicationConfig config = getContext().getConfig();
+
+ File current = config.getDataDirectory();
+ String url = config.getUpdateUrl();
+
+ if (log.isInfoEnabled()) {
+ log.info(String.format("Try to install db (current data location: %s), using update url: %s", current, url));
+ }
+ ApplicationUpdater up = new ApplicationUpdater();
+
+ File dest = new File(config.getTuttiBasedir(), "NEW");
+ ProgressionModel progressionModel = new ProgressionModel();
+ getContext().getActionUI().getModel().setProgressionModel(progressionModel);
+ progressionModel.setMessage("Recherche de mises à jour de base");
+
+ TuttiApplicationUpdaterCallBack callback = new TuttiApplicationUpdaterCallBack(getContext(), progressionModel);
+ callback.setTypes(TuttiApplicationUpdaterCallBack.UpdateType.DB);
+
+ up.update(url, current, dest, false, callback);
+
+ sendMessage("Nouvelle base de données installée.");
+
+ String jdbcUrl = TuttiPersistenceConfig.getInstance().getJdbcUrl();
+
+ progressionModel.setMessage(String.format("Ouverture de la base de données *%s*.", jdbcUrl));
+
+ getContext().setDbExist(true);
+
+ // open db
+ new OpenDbAction(getHandler()).actionPerformed(event);
+ }
+
+ @Override
+ protected void releaseAction(ActionEvent event) {
+ super.releaseAction(event);
+ getContext().getActionUI().getModel().setProgressionModel(null);
+ }
+}
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/InstallDbAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/OpenDbAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/OpenDbAction.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/OpenDbAction.java 2013-02-15 14:49:24 UTC (rev 421)
@@ -0,0 +1,73 @@
+package fr.ifremer.tutti.ui.swing.content.db;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $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.config.TuttiPersistenceConfig;
+import fr.ifremer.tutti.ui.swing.AbstractMainUITuttiAction;
+import fr.ifremer.tutti.ui.swing.MainUIHandler;
+import fr.ifremer.tutti.ui.swing.TuttiScreen;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.awt.event.ActionEvent;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * To open existing db.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class OpenDbAction extends AbstractMainUITuttiAction {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(OpenDbAction.class);
+
+ public OpenDbAction(MainUIHandler handler) {
+ super(handler,
+ "openDb",
+ "open-db",
+ _("tutti.action.openDb"),
+ _("tutti.action.openDb.tip"),
+ true);
+ }
+
+ @Override
+ protected void doAction(ActionEvent event) {
+
+ getContext().setDbLoaded(true);
+ getHandler().reloadPersistenceService();
+
+ String jdbcUrl = TuttiPersistenceConfig.getInstance().getJdbcUrl();
+
+ sendMessage(String.format("La base de données '%s' est ouverte.", jdbcUrl));
+
+ getContext().setScreen(TuttiScreen.SELECT_CRUISE);
+ }
+}
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/OpenDbAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0
15 Feb '13
Author: tchemit
Date: 2013-02-15 15:02:59 +0100 (Fri, 15 Feb 2013)
New Revision: 420
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/420
Log:
remove debugger command
Modified:
trunk/tutti-ui-swing/src/main/assembly/min/launch.sh
Modified: trunk/tutti-ui-swing/src/main/assembly/min/launch.sh
===================================================================
--- trunk/tutti-ui-swing/src/main/assembly/min/launch.sh 2013-02-15 10:03:34 UTC (rev 419)
+++ trunk/tutti-ui-swing/src/main/assembly/min/launch.sh 2013-02-15 14:02:59 UTC (rev 420)
@@ -1,7 +1,7 @@
#!/bin/bash
MEMORY="-Xmx1024M"
-TUTTI_JVM_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000"
+#TUTTI_JVM_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000"
REP=$(dirname $0)
1
0
Author: tchemit
Date: 2013-02-15 11:03:34 +0100 (Fri, 15 Feb 2013)
New Revision: 419
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/419
Log:
use last release of adagio
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-02-14 23:59:54 UTC (rev 418)
+++ trunk/pom.xml 2013-02-15 10:03:34 UTC (rev 419)
@@ -138,7 +138,7 @@
<slf4jVersion>1.7.2</slf4jVersion>
- <adagioVersion>3.3.2-SNAPSHOT</adagioVersion>
+ <adagioVersion>3.3.2</adagioVersion>
<msaccessImporterVersion>1.4.1</msaccessImporterVersion>
1
0
See <http://ci.nuiton.org/jenkins/job/tutti/342/changes>
Changes:
[blavenier] Fix :
- saveBatchFrequencies now delete extra batch
- store weights for 'inert' and 'livingNotSorted'
Add :
- ReferentialPersistenceService.getSampleCategoryIds()
Improve :
- Merge CatchBatchPersistenceService and SpeciesBatchPersistenceService into BatchPersistenceService
- batch management now use adagio implementation CatchBatchExtendDao
------------------------------------------
[...truncated 79 lines...]
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/fr/ifremer/adagio/adagi…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/… (602 B at 5.5 KB/sec)
mojoStarted org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-persistence ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target>
mojoSucceeded org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
mojoStarted org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (check-project-files) @ tutti-persistence ---
mojoSucceeded org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
mojoStarted org.nuiton.eugene:eugene-maven-plugin:2.6.1(default)
[INFO]
[INFO] --- eugene-maven-plugin:2.6.1:generate (default) @ tutti-persistence ---
[INFO] Process phase [zargo] for one entry.
[INFO] Expanding 1 xmi file(s) from <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>
[INFO] Will generate <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Copy file <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…> to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Generate one file in 75.758ms.
[INFO] Process phase [xmi] for one entry.
[INFO] Processing XSL tranformation on <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…> for 1 file(s).
[INFO] Will generate <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Copy file <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…> to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Generate one file in 2.249s.
[INFO] Process phase [model] for one entry.
INFO [pool-1-thread-1] (ObjectModelReader.java:273) loadModelProperties - 19 tag values were succesfull imported from <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Apply generator JavaInterfaceTransformer
[INFO] Apply generator SimpleJavaBeanTransformer
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:911) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.data.Program], already found in class-path.
[INFO] Apply generator JavaEnumerationTransformer
mojoSucceeded org.nuiton.eugene:eugene-maven-plugin:2.6.1(default)[INFO] No file generated.
[INFO] Add compile source root : <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Add resource root :Resource {targetPath: null, filtering: false, FileSet {directory: <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…,> PatternSet [includes: {}, excludes: {**/*.java}]}}
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:parserJava (scan-sources) @ tutti-persistence ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
forkedProjectStarted fr.ifremer.tutti:tutti-persistence:1.0-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(get)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:get (get) @ tutti-persistence ---
[INFO] Copying tutti-persistence.properties to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(get)
forkedProjectSucceeded fr.ifremer.tutti:tutti-persistence:1.0-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:gen (scan-sources) @ tutti-persistence ---
[WARNING] bundle fr_FR contains 3/21 empty entries! (use -Di18n.showEmpty to see these entries)
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
mojoStarted org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tutti-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 11 resources
[INFO] Copying 0 resource
mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ tutti-persistence ---
[INFO] Compiling 82 source files to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/cl…>
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] bootstrap class path not set in conjunction with -source 1.6
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[32,44] error: cannot find symbol
[ERROR] symbol: class CatchBatchExtendDao
location: package fr.ifremer.adagio.core.dao.data.batch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[36,54] error: package fr.ifremer.adagio.core.dao.data.batch.validator does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[37,54] error: package fr.ifremer.adagio.core.dao.data.batch.validator does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[38,54] error: package fr.ifremer.adagio.core.dao.data.batch.validator does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[58,72] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidator
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[75,11] error: cannot find symbol
[ERROR] symbol: class CatchBatchExtendDao
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[99,13] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[536,56] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[212,24] error: cannot find symbol
[ERROR] symbol: method getInheritedSortingMeasurements()
location: variable sortingBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[214,20] error: cannot find symbol
[ERROR] symbol: method getInheritedSortingMeasurements()
location: variable sortingBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[92,1] error: method does not override or implement a method from a supertype
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[100,7] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[98,1] error: method does not override or implement a method from a supertype
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[114,11] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationException
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[120,35] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable source of type CatchBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[125,53] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable vracBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[126,50] error: cannot find symbol
[ERROR] symbol: method getWeightBeforeSampling()
location: variable vracBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[132,56] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable speciesBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[133,50] error: cannot find symbol
[ERROR] symbol: method getWeightBeforeSampling()
location: variable speciesBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[139,48] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable inertBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[144,72] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable livingNotItemizedBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[153,50] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable horsVracBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[159,52] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable speciesBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[167,50] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable unsortedBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[270,12] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[270,42] error: cannot find symbol
[ERROR] symbol: method getWeightBeforeSampling()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[271,40] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[274,26] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[275,40] error: cannot find symbol
[ERROR] symbol: method getWeightBeforeSampling()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[297,35] error: cannot find symbol
[ERROR] symbol: method getInheritedReferenceTaxonId()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[432,25] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[567,6] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[567,44] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[570,7] error: cannot find symbol
[ERROR] symbol: variable CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[576,7] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[576,45] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[580,9] error: cannot find symbol
[ERROR] symbol: variable CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[588,4] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[588,42] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[592,6] error: cannot find symbol
[ERROR] symbol: variable CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[597,4] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[597,42] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[600,6] error: cannot find symbol
[INFO] 43 errors
[INFO] -------------------------------------------------------------
mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)
projectFailed fr.ifremer.tutti:tutti-persistence:1.0-SNAPSHOT
sessionEnded
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Tutti ............................................. SUCCESS [6.165s]
[INFO] Tutti :: Persistence .............................. FAILURE [13.074s]
[INFO] Tutti :: Service .................................. SKIPPED
[INFO] Tutti :: UI ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.741s
[INFO] Finished at: Thu Feb 14 16:37:41 CET 2013
[INFO] Final Memory: 28M/116M
[INFO] ------------------------------------------------------------------------
Projects to build: [MavenProject: fr.ifremer:tutti:1.0-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-persistence:1.0-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-service:1.0-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/pom.xml]>
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-service/builds/2013-02-14_16-37-16/archive/fr.ifremer.tutti/tutti-service/1.0-SNAPSHOT/tutti-service-1.0-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-ui-swing/builds/2013-02-14_16-37-16/archive/fr.ifremer.tutti/tutti-ui-swing/1.0-SNAPSHOT/tutti-ui-swing-1.0-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-02-14_16-37-16/archive/fr.ifremer/tutti/1.0-SNAPSHOT/tutti-1.0-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/tutti-1.0-SNAPSHOT-s…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-02-14_16-37-16/archive/fr.ifremer/tutti/1.0-SNAPSHOT/tutti-1.0-SNAPSHOT-site_fr.xml
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-persistence/builds/2013-02-14_16-37-16/archive/fr.ifremer.tutti/tutti-persistence/1.0-SNAPSHOT/tutti-persistence-1.0-SNAPSHOT.pom
Waiting for Jenkins to finish collecting data
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project tutti-persistence: Compilation failure
cause : Compilation failure
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project tutti-persistence: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:98)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:64)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:729)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 27 more
Sending e-mails to: tutti-commits(a)list.forge.codelutin.com blavenier(a)codelutin.com
channel stopped
1
1
15 Feb '13
See <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/3…>
Changes:
[blavenier] Fix :
- saveBatchFrequencies now delete extra batch
- store weights for 'inert' and 'livingNotSorted'
Add :
- ReferentialPersistenceService.getSampleCategoryIds()
Improve :
- Merge CatchBatchPersistenceService and SpeciesBatchPersistenceService into BatchPersistenceService
- batch management now use adagio implementation CatchBatchExtendDao
------------------------------------------
projectStarted fr.ifremer.tutti:tutti-persistence:1.0-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti :: Persistence 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/fr/ifremer/adagio/adagi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/… (2 KB at 4.5 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/fr/ifremer/adagio/adagi…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/… (602 B at 5.5 KB/sec)
mojoStarted org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-persistence ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
mojoSucceeded org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
mojoStarted org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (check-project-files) @ tutti-persistence ---
mojoSucceeded org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
mojoStarted org.nuiton.eugene:eugene-maven-plugin:2.6.1(default)
[INFO]
[INFO] --- eugene-maven-plugin:2.6.1:generate (default) @ tutti-persistence ---
[INFO] Process phase [zargo] for one entry.
[INFO] Expanding 1 xmi file(s) from <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Will generate <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Copy file <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…> to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Generate one file in 75.758ms.
[INFO] Process phase [xmi] for one entry.
[INFO] Processing XSL tranformation on <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…> for 1 file(s).
[INFO] Will generate <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Copy file <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…> to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Generate one file in 2.249s.
[INFO] Process phase [model] for one entry.
INFO [pool-1-thread-1] (ObjectModelReader.java:273) loadModelProperties - 19 tag values were succesfull imported from <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Apply generator JavaInterfaceTransformer
[INFO] Apply generator SimpleJavaBeanTransformer
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:911) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.data.Program], already found in class-path.
[INFO] Apply generator JavaEnumerationTransformer
mojoSucceeded org.nuiton.eugene:eugene-maven-plugin:2.6.1(default)[INFO] No file generated.
[INFO] Add compile source root : <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Add resource root :Resource {targetPath: null, filtering: false, FileSet {directory: <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…,> PatternSet [includes: {}, excludes: {**/*.java}]}}
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:parserJava (scan-sources) @ tutti-persistence ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
forkedProjectStarted fr.ifremer.tutti:tutti-persistence:1.0-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(get)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:get (get) @ tutti-persistence ---
[INFO] Copying tutti-persistence.properties to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(get)
forkedProjectSucceeded fr.ifremer.tutti:tutti-persistence:1.0-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:gen (scan-sources) @ tutti-persistence ---
[WARNING] bundle fr_FR contains 3/21 empty entries! (use -Di18n.showEmpty to see these entries)
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
mojoStarted org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tutti-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 11 resources
[INFO] Copying 0 resource
mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ tutti-persistence ---
[INFO] Compiling 82 source files to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] bootstrap class path not set in conjunction with -source 1.6
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[32,44] error: cannot find symbol
[ERROR] symbol: class CatchBatchExtendDao
location: package fr.ifremer.adagio.core.dao.data.batch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[36,54] error: package fr.ifremer.adagio.core.dao.data.batch.validator does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[37,54] error: package fr.ifremer.adagio.core.dao.data.batch.validator does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[38,54] error: package fr.ifremer.adagio.core.dao.data.batch.validator does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[58,72] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidator
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[75,11] error: cannot find symbol
[ERROR] symbol: class CatchBatchExtendDao
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[99,13] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[536,56] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[212,24] error: cannot find symbol
[ERROR] symbol: method getInheritedSortingMeasurements()
location: variable sortingBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[214,20] error: cannot find symbol
[ERROR] symbol: method getInheritedSortingMeasurements()
location: variable sortingBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[92,1] error: method does not override or implement a method from a supertype
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[100,7] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[98,1] error: method does not override or implement a method from a supertype
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[114,11] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationException
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[120,35] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable source of type CatchBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[125,53] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable vracBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[126,50] error: cannot find symbol
[ERROR] symbol: method getWeightBeforeSampling()
location: variable vracBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[132,56] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable speciesBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[133,50] error: cannot find symbol
[ERROR] symbol: method getWeightBeforeSampling()
location: variable speciesBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[139,48] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable inertBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[144,72] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable livingNotItemizedBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[153,50] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable horsVracBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[159,52] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable speciesBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[167,50] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable unsortedBatch of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[270,12] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[270,42] error: cannot find symbol
[ERROR] symbol: method getWeightBeforeSampling()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[271,40] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[274,26] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[275,40] error: cannot find symbol
[ERROR] symbol: method getWeightBeforeSampling()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[297,35] error: cannot find symbol
[ERROR] symbol: method getInheritedReferenceTaxonId()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[432,25] error: cannot find symbol
[ERROR] symbol: method getWeight()
location: variable source of type SortingBatch
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[567,6] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[567,44] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[570,7] error: cannot find symbol
[ERROR] symbol: variable CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[576,7] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[576,45] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[580,9] error: cannot find symbol
[ERROR] symbol: variable CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[588,4] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[588,42] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[592,6] error: cannot find symbol
[ERROR] symbol: variable CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[597,4] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[597,42] error: cannot find symbol
[ERROR] symbol: class CatchBatchValidationError
location: class BatchPersistenceServiceImpl
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[600,6] error: cannot find symbol
[INFO] 43 errors
[INFO] -------------------------------------------------------------
mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)
projectFailed fr.ifremer.tutti:tutti-persistence:1.0-SNAPSHOT
1
1
r418 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing java/fr/ifremer/tutti/ui/swing/content/operation java/fr/ifremer/tutti/ui/swing/content/operation/catches java/fr/ifremer/tutti/ui/swing/util/editor resources/i18n
by tchemit@users.forge.codelutin.com 14 Feb '13
by tchemit@users.forge.codelutin.com 14 Feb '13
14 Feb '13
Author: tchemit
Date: 2013-02-15 00:59:54 +0100 (Fri, 15 Feb 2013)
New Revision: 418
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/418
Log:
- fix new fishing operation (when need to save previous fishing operation)
- begin to integrate synchro db
- improve update ui
- add missing svn properties and license headers
- continue action api
- fix exceptionHandler when action is running
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiExceptionHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateApplicationAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateReferentialAction.java
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/NewFishingOperationAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiAction.java 2013-02-14 23:55:47 UTC (rev 417)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiAction.java 2013-02-14 23:59:54 UTC (rev 418)
@@ -29,20 +29,16 @@
import fr.ifremer.tutti.service.DecoratorService;
import fr.ifremer.tutti.service.TuttiService;
import fr.ifremer.tutti.ui.swing.config.TuttiApplicationConfig;
+import fr.ifremer.tutti.ui.swing.util.action.TuttiActionUI;
+import fr.ifremer.tutti.ui.swing.util.action.TuttiActionUIModel;
import jaxx.runtime.SwingUtil;
+import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.beans.AbstractBean;
import org.nuiton.util.decorator.Decorator;
import javax.swing.AbstractAction;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JProgressBar;
-import javax.swing.border.EmptyBorder;
-import javax.swing.border.TitledBorder;
-import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.util.Set;
import java.util.Timer;
@@ -50,8 +46,6 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import static org.nuiton.i18n.I18n._;
-
/**
* TODO
*
@@ -72,6 +66,8 @@
private final H handler;
+ private boolean failed;
+
private final boolean hideBody;
private final static Object lock = new Object();
@@ -84,6 +80,7 @@
String text,
String tip,
boolean hideBody) {
+
this.handler = handler;
this.hideBody = hideBody;
putValue(SMALL_ICON, SwingUtil.createActionIcon(icon));
@@ -101,7 +98,7 @@
return (String) getValue("actionName");
}
- protected String getActionDescription() {
+ public String getActionDescription() {
return (String) getValue("actionDescription");
}
@@ -116,6 +113,14 @@
putValue("actionDescription", null);
}
+ public boolean isFailed() {
+ return failed;
+ }
+
+ public void setFailed(boolean failed) {
+ this.failed = failed;
+ }
+
@Override
public final void actionPerformed(final ActionEvent event) {
@@ -123,6 +128,8 @@
log.info("Task [" + this + "] starting");
}
+ setFailed(false);
+
boolean doAction = prepareAction(event);
if (doAction) {
@@ -132,6 +139,7 @@
synchronized (lock) {
useTimer = actions.isEmpty();
+ mainAction = AbstractTuttiAction.this;
actions.add(AbstractTuttiAction.this);
}
@@ -165,17 +173,19 @@
timer = new ActionTimerTask(this);
- t.schedule(timer, 500);
+ t.schedule(timer, 1000);
}
try {
this.doAction(event);
} catch (Throwable e) {
+ setFailed(true);
+
if (log.isErrorEnabled()) {
log.error("Task [" + this + "] error: " + e.getMessage(), e);
}
- throw new TuttiExceptionHandler.TuttiActionException(e);
+ throw new TuttiExceptionHandler.TuttiActionException(this, e);
} finally {
if (log.isInfoEnabled()) {
log.info("Task [" + this + "] done");
@@ -190,7 +200,21 @@
} finally {
synchronized (lock) {
+
+ TuttiActionUI actionUI = AbstractTuttiAction.this.getContext().getActionUI();
+
+ TuttiActionUIModel actionUIModel = actionUI.getModel();
+
+ if (ObjectUtils.equals(AbstractTuttiAction.this, actionUIModel.getAction())) {
+
+ // same action, then remove it (will close dialog as a side effect)
+ actionUIModel.clear();
+ }
actions.remove(AbstractTuttiAction.this);
+
+ if (AbstractTuttiAction.this.equals(getMainAction())) {
+ mainAction = null;
+ }
}
}
}
@@ -226,21 +250,25 @@
private final static Set<Object> actions = Sets.newHashSet();
+ private static AbstractTuttiAction mainAction;
+
+ public static AbstractTuttiAction getMainAction() {
+ return mainAction;
+ }
+
protected static class ActionTimerTask<A extends AbstractTuttiAction> extends TimerTask {
private final Object lock = new Object();
protected boolean canceled;
- private final String actionDescription;
+ private final A action;
- private JDialog d;
+ protected TuttiActionUI actionUI;
- private final A action;
-
public ActionTimerTask(A action) {
this.action = action;
- this.actionDescription = action.getActionDescription();
+ this.actionUI = action.getContext().getActionUI();
}
@Override
@@ -253,41 +281,18 @@
}
} else {
- MainUI ui = action.getContext().getMainUI();
-
-
if (log.isDebugEnabled()) {
log.debug("Task [" + action + "] is started, show waiting dialog");
}
- JPanel panel = new JPanel(new BorderLayout());
- panel.setBorder(new TitledBorder((String) null));
- JLabel label = new JLabel();
- EmptyBorder border = new EmptyBorder(5, 5, 5, 5);
- label.setBorder(border);
- label.setText(_("tutti.message.action.running", actionDescription));
- panel.add(label, BorderLayout.CENTER);
- JProgressBar progressBar = new JProgressBar();
- progressBar.setBorder(border);
- progressBar.setIndeterminate(true);
- panel.add(progressBar, BorderLayout.SOUTH);
-
-
- d = new JDialog(ui, true);
- d.setUndecorated(true);
-// d.setSize(300, 200);
- d.add(panel);
- d.pack();
- SwingUtil.center(ui, d);
-
if (log.isDebugEnabled()) {
log.debug("Try to open dialog (was canceled ? " + canceled + ")");
}
- if (!canceled) {
+ if (!canceled || !action.isFailed()) {
- updateBusyState(ui, true);
+ updateBusyState(true);
- d.setVisible(true);
+ actionUI.getModel().setAction(action);
}
}
}
@@ -302,17 +307,20 @@
}
boolean cancel = super.cancel();
- updateBusyState(action.getContext().getMainUI(), false);
+ updateBusyState(false);
- if (d != null) {
- d.setVisible(false);
+ if (ObjectUtils.equals(action, actionUI.getModel().getAction())) {
+
+ // same action, then remove it (will close dialog as a side effect)
+ actionUI.getModel().clear();
}
return cancel;
}
}
- protected void updateBusyState(MainUI ui, boolean busy) {
+ protected void updateBusyState(boolean busy) {
+ MainUI ui = action.getContext().getMainUI();
if (busy) {
// ui bloquee
if (action.isHideBody()) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2013-02-14 23:55:47 UTC (rev 417)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2013-02-14 23:59:54 UTC (rev 418)
@@ -36,6 +36,7 @@
import fr.ifremer.tutti.ui.swing.content.program.EditProgramUI;
import fr.ifremer.tutti.ui.swing.content.protocol.EditProtocolUI;
import fr.ifremer.tutti.ui.swing.content.referential.ManageTemporaryReferentialUI;
+import fr.ifremer.tutti.ui.swing.util.action.TuttiActionUI;
import jaxx.runtime.swing.AboutPanel;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
@@ -74,6 +75,7 @@
super(context, ui);
this.persistenceService = context.getService(PersistenceService.class);
context.setMainUI(ui);
+ context.setActionUI(new TuttiActionUI(ui, context));
}
protected MainUIHandler(TuttiUIContext context) {
@@ -393,6 +395,11 @@
}
} catch (Exception e) {
+ AbstractTuttiAction mainAction = AbstractTuttiAction.getMainAction();
+ if (mainAction != null) {
+ mainAction.setFailed(true);
+ }
+
TuttiUIContext.getErrorHelper().showErrorDialog(
"Could not change to screen " + screen, e);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-02-14 23:55:47 UTC (rev 417)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-02-14 23:59:54 UTC (rev 418)
@@ -25,7 +25,12 @@
*/
import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+import fr.ifremer.tutti.persistence.ProgressionModel;
+import fr.ifremer.tutti.persistence.service.synchro.ReferentialSynchronizeResult;
+import fr.ifremer.tutti.service.referential.TuttiReferentialSynchronizeService;
+import fr.ifremer.tutti.ui.swing.util.action.TuttiActionUI;
import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -34,6 +39,7 @@
import java.io.File;
import java.io.IOException;
+import java.util.List;
import java.util.Map;
/**
@@ -57,14 +63,17 @@
protected final TuttiUIContext context;
- protected UpdateType[] types;
+ protected List<UpdateType> types;
- public TuttiApplicationUpdaterCallBack(TuttiUIContext context) {
+ protected ProgressionModel progressionModel;
+
+ public TuttiApplicationUpdaterCallBack(TuttiUIContext context, ProgressionModel progressionModel) {
this.context = context;
+ this.progressionModel = progressionModel;
}
public void setTypes(UpdateType... types) {
- this.types = types;
+ this.types = Lists.newArrayList(types);
}
@Override
@@ -84,10 +93,43 @@
}
}
}
+ if (types.contains(UpdateType.DB)) {
+
+ ApplicationUpdater.ApplicationInfo info = getInfo(UpdateType.DB, result);
+ if (info == null) {
+ String message = "Aucune mise à jour de base détectée.";
+ context.showInformationMessage(message);
+ }
+ }
return result;
}
@Override
+ public void startUpdate(ApplicationUpdater.ApplicationInfo info) {
+ if (UpdateType.DB.name().toLowerCase().equals(info.name)) {
+
+ if (Version.VZERO.toString().equals(info.oldVersion)) {
+
+ progressionModel.setMessage("Téléchargement et installation de la base (version " + info.newVersion + ")");
+ } else {
+ progressionModel.setMessage("Téléchargement et mise à jour de la base (version " + info.newVersion + ")");
+ }
+
+ }
+ if (UpdateType.JRE.name().toLowerCase().equals(info.name)) {
+ progressionModel.setMessage("Téléchargement et installation d'une nouvelle JRE (version " + info.newVersion + ")");
+ }
+
+ if (UpdateType.TUTTI.name().toLowerCase().equals(info.name)) {
+ progressionModel.setMessage("Téléchargement et installation d'une nouvelle version de Tutti (version " + info.newVersion + ")");
+ }
+
+ if (UpdateType.I18N.name().toLowerCase().equals(info.name)) {
+ progressionModel.setMessage("Téléchargement et installation d'une nouveau version I18N (version " + info.newVersion + ")");
+ }
+ }
+
+ @Override
public void updateDone(Map<String, ApplicationUpdater.ApplicationInfo> appToUpdate,
Map<String, Exception> appUpdateError) {
@@ -227,17 +269,20 @@
return appUpdateError.get(type.name().toLowerCase());
}
+ protected File getDbDirectory(ApplicationUpdater.ApplicationInfo info) {
+ File[] sources = info.destDir.listFiles();
+ Preconditions.checkState(
+ sources != null && sources.length == 1,
+ "Downloaded db should contains one directory at " + info.destDir);
+ File result = sources[0];
+ return result;
+ }
+
protected void prepareFirstDatabase(ApplicationUpdater.ApplicationInfo info) {
- //TODO copie base au bon endroit pour utilisation directe
if (log.isInfoEnabled()) {
log.info("First time database was downloaded at version: " + info.newVersion);
}
-
- File[] sources = info.destDir.listFiles();
- Preconditions.checkState(
- sources != null && sources.length == 1,
- "Downloaded db should contains one directory at " + info.destDir);
- File source = sources[0];
+ File source = getDbDirectory(info);
File target = context.getConfig().getServiceConfig().getPersistenceConfig().getDbDirectory();
if (log.isInfoEnabled()) {
log.info("Copy from " + source + " to " + target);
@@ -252,7 +297,6 @@
} catch (IOException e) {
throw new RuntimeException("Could not delete temporary directory " + target, e);
}
-
}
protected void synchronizetDatabase(ApplicationUpdater.ApplicationInfo info) {
@@ -260,5 +304,12 @@
if (log.isInfoEnabled()) {
log.info(String.format("A database update was downloaded (oldVersion: %s, newVersion: %s), will launch a referential synchronize operation ", info.oldVersion, info.newVersion));
}
+ TuttiReferentialSynchronizeService service = context.getService(TuttiReferentialSynchronizeService.class);
+ ReferentialSynchronizeResult result = new ReferentialSynchronizeResult();
+ File dbDirectory = getDbDirectory(info);
+
+ TuttiActionUI actionUI = context.getActionUI();
+ actionUI.getModel().setProgressionModel(result.getProgressionModel());
+ service.prepare(dbDirectory, result);
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiExceptionHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiExceptionHandler.java 2013-02-14 23:55:47 UTC (rev 417)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiExceptionHandler.java 2013-02-14 23:59:54 UTC (rev 418)
@@ -48,9 +48,17 @@
private static final long serialVersionUID = 1L;
- public TuttiActionException(Throwable cause) {
+ private final AbstractTuttiAction action;
+
+ public TuttiActionException(AbstractTuttiAction action,
+ Throwable cause) {
super(cause);
+ this.action = action;
}
+
+ public AbstractTuttiAction getAction() {
+ return action;
+ }
}
@Override
@@ -70,16 +78,33 @@
Throwable cause = ex;
+ if (cause instanceof TuttiTechnicalException) {
+ cause = cause.getCause();
+ }
- if (cause instanceof TuttiTechnicalException ||
- cause instanceof TuttiActionException) {
+ boolean backToScreen = false;
+
+ AbstractTuttiAction action = null;
+ if (cause instanceof TuttiActionException) {
+
+ TuttiActionException actionException = (TuttiActionException) cause;
cause = cause.getCause();
+
+ // close action ui
+
+ action = actionException.getAction();
+
+ if (action instanceof AbstractChangeScreenAction) {
+ backToScreen = true;
+ }
+ action.getContext().getActionUI().getModel().setAction(null);
}
-// while (cause != null && !(cause instanceof TuttiTechnicalException)) {
-// cause = cause.getCause();
-// }
TuttiUIContext.getErrorHelper().showErrorDialog(cause.getMessage(), ex);
+
+ if (backToScreen) {
+ action.getContext().setScreen(TuttiScreen.SELECT_CRUISE);
+ }
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-02-14 23:55:47 UTC (rev 417)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-02-14 23:59:54 UTC (rev 418)
@@ -35,6 +35,7 @@
import fr.ifremer.tutti.service.TuttiServiceContext;
import fr.ifremer.tutti.ui.swing.config.TuttiApplicationConfig;
import fr.ifremer.tutti.ui.swing.util.UIMessageNotifier;
+import fr.ifremer.tutti.ui.swing.util.action.TuttiActionUI;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
@@ -171,6 +172,8 @@
private MainUI mainUI;
+ private TuttiActionUI actionUI;
+
public static TuttiUIContext newContext(TuttiApplicationConfig config) {
Preconditions.checkNotNull(config);
Preconditions.checkState(applicationContext == null,
@@ -192,7 +195,7 @@
this.resourceLoader = new RessourceClassLoader(Thread.currentThread().getContextClassLoader());
this.serviceContext = new TuttiServiceContext(resourceLoader, config.getServiceConfig());
this.swingSession = new SwingSession(getConfig().getUIConfigFile(), false);
- this.errorHelper= new TuttiErrorHelper(this);
+ this.errorHelper = new TuttiErrorHelper(this);
UIMessageNotifier logMessageNotifier = new UIMessageNotifier() {
@Override
@@ -358,6 +361,8 @@
I18n.init(new UserI18nInitializer(
i18nDirectory, new DefaultI18nInitializer("tutti-i18n")),
i18nLocale);
+
+ setActionUI(new TuttiActionUI(null, this));
}
public void open() {
@@ -490,6 +495,16 @@
removePropertyChangeListener(listener);
}
setMainUI(null);
+ if (actionUI != null) {
+
+ // close action ui
+ actionUI.getModel().setProgressionModel(null);
+ actionUI.getModel().setAction(null);
+
+// // hide it
+// actionUI.setVisible(false);
+ }
+ setActionUI(null);
}
protected void saveContextToConfig() {
@@ -525,4 +540,12 @@
public MainUI getMainUI() {
return mainUI;
}
+
+ public void setActionUI(TuttiActionUI actionUI) {
+ this.actionUI = actionUI;
+ }
+
+ public TuttiActionUI getActionUI() {
+ return actionUI;
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateApplicationAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateApplicationAction.java 2013-02-14 23:55:47 UTC (rev 417)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateApplicationAction.java 2013-02-14 23:59:54 UTC (rev 418)
@@ -24,6 +24,7 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.ProgressionModel;
import fr.ifremer.tutti.ui.swing.config.TuttiApplicationConfig;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -79,8 +80,12 @@
}
ApplicationUpdater up = new ApplicationUpdater();
+ ProgressionModel progressionModel = new ProgressionModel();
+ getContext().getActionUI().getModel().setProgressionModel(progressionModel);
+ progressionModel.setMessage("Recherche de mises à jour de JRE / Tutti / I18N");
+
TuttiApplicationUpdaterCallBack callback =
- new TuttiApplicationUpdaterCallBack(getContext());
+ new TuttiApplicationUpdaterCallBack(getContext(), progressionModel);
callback.setTypes(TuttiApplicationUpdaterCallBack.UpdateType.JRE,
TuttiApplicationUpdaterCallBack.UpdateType.I18N,
@@ -90,6 +95,7 @@
dest,
false,
callback);
+ getContext().getActionUI().getModel().setProgressionModel(null);
}
}
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateReferentialAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateReferentialAction.java 2013-02-14 23:55:47 UTC (rev 417)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateReferentialAction.java 2013-02-14 23:59:54 UTC (rev 418)
@@ -24,6 +24,7 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.ProgressionModel;
import fr.ifremer.tutti.ui.swing.config.TuttiApplicationConfig;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -70,12 +71,17 @@
ApplicationUpdater up = new ApplicationUpdater();
File dest = new File(config.getTuttiBasedir(), "NEW");
- TuttiApplicationUpdaterCallBack callback = new TuttiApplicationUpdaterCallBack(getContext());
+ ProgressionModel progressionModel = new ProgressionModel();
+ getContext().getActionUI().getModel().setProgressionModel(progressionModel);
+ progressionModel.setMessage("Recherche de mises à jour de base");
+ TuttiApplicationUpdaterCallBack callback = new TuttiApplicationUpdaterCallBack(getContext(), progressionModel);
callback.setTypes(TuttiApplicationUpdaterCallBack.UpdateType.DB);
up.update(url,
current,
dest,
false,
callback);
+
+ getContext().getActionUI().getModel().setProgressionModel(null);
}
}
\ No newline at end of file
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-02-14 23:55:47 UTC (rev 417)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-02-14 23:59:54 UTC (rev 418)
@@ -40,6 +40,7 @@
import fr.ifremer.tutti.ui.swing.content.operation.fishing.gearshooting.GearShootingTabUI;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology.HydrologyTabUI;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
+import jaxx.runtime.SwingUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.decorator.Decorator;
@@ -150,6 +151,15 @@
true);
}
+ protected EditFishingOperationAction(FishingOperationsUIHandler handler,
+ String name,
+ String icon,
+ String text,
+ String tip,
+ boolean hideBody) {
+ super(handler, name,icon,text,tip,hideBody);
+ }
+
public void setFishingOperation(FishingOperation fishingOperation) {
this.fishingOperation = fishingOperation;
}
@@ -179,7 +189,6 @@
return saveCatchBatchAction;
}
-
@Override
protected boolean prepareAction(ActionEvent event) {
boolean canContinue = super.prepareAction(event);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/NewFishingOperationAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/NewFishingOperationAction.java 2013-02-14 23:55:47 UTC (rev 417)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/NewFishingOperationAction.java 2013-02-14 23:59:54 UTC (rev 418)
@@ -28,7 +28,6 @@
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
-import fr.ifremer.tutti.ui.swing.AbstractTuttiAction;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import java.awt.event.ActionEvent;
@@ -42,17 +41,10 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
*/
-public class NewFishingOperationAction extends AbstractTuttiAction<FishingOperationsUIModel, FishingOperationsUI, FishingOperationsUIHandler> {
+public class NewFishingOperationAction extends EditFishingOperationAction {
private static final long serialVersionUID = 1L;
- /**
- * Delegate action to edit new FishingOperation.
- *
- * @since 1.0
- */
- protected EditFishingOperationAction editFishingOperationAction;
-
public NewFishingOperationAction(FishingOperationsUIHandler handler) {
super(handler,
"newFishingOperation",
@@ -101,16 +93,8 @@
newFishingOperation.setGearShootingStartDate(null);
newFishingOperation.setGearShootingEndDate(null);
+ setFishingOperation(newFishingOperation);
- getEditFishingOperationAction().setFishingOperation(newFishingOperation);
- getEditFishingOperationAction().actionPerformed(event);
-
+ super.doAction(event);
}
-
- public EditFishingOperationAction getEditFishingOperationAction() {
- if (editFishingOperationAction == null) {
- editFishingOperationAction = new EditFishingOperationAction(getHandler());
- }
- return editFishingOperationAction;
- }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-02-14 23:55:47 UTC (rev 417)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-02-14 23:59:54 UTC (rev 418)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches;
+/*
+ * #%L
+ * Tutti :: UI
+ * $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.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.AbstractTuttiAction;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SampleCategory;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java 2013-02-14 23:55:47 UTC (rev 417)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java 2013-02-14 23:59:54 UTC (rev 418)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.util.editor;
+/*
+ * #%L
+ * Tutti :: UI
+ * $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.ui.swing.util.TuttiComputedOrNotData;
import java.awt.Component;
import java.awt.event.FocusEvent;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-02-14 23:55:47 UTC (rev 417)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-02-14 23:59:54 UTC (rev 418)
@@ -98,6 +98,7 @@
tutti.action.newProgram.tip=Créer une nouvelle série de campagne
tutti.action.newProtocol=Nouveau
tutti.action.newProtocol.tip=Créer un nouveau protocole
+tutti.action.ok=Fermer
tutti.action.reload.actions=Recharger les actions
tutti.action.reload.application=Recharger l'application
tutti.action.reload.ui=Recharger l'interface graphique
1
0
r417 - trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/referential
by tchemit@users.forge.codelutin.com 14 Feb '13
by tchemit@users.forge.codelutin.com 14 Feb '13
14 Feb '13
Author: tchemit
Date: 2013-02-15 00:55:47 +0100 (Fri, 15 Feb 2013)
New Revision: 417
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/417
Log:
add synchro service
Added:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/referential/TuttiReferentialSynchronizeService.java
Added: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/referential/TuttiReferentialSynchronizeService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/referential/TuttiReferentialSynchronizeService.java (rev 0)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/referential/TuttiReferentialSynchronizeService.java 2013-02-14 23:55:47 UTC (rev 417)
@@ -0,0 +1,83 @@
+package fr.ifremer.tutti.service.referential;
+
+/*
+ * #%L
+ * Tutti :: Service
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ifremer.tutti.persistence.config.TuttiPersistenceConfig;
+import fr.ifremer.tutti.persistence.entities.TuttiEntities;
+import fr.ifremer.tutti.persistence.service.TuttiPersistenceServiceLocator;
+import fr.ifremer.tutti.persistence.service.synchro.ReferentialSynchronizeResult;
+import fr.ifremer.tutti.persistence.service.synchro.ReferentialSynchronizeService;
+import fr.ifremer.tutti.service.AbstractTuttiService;
+import fr.ifremer.tutti.service.PersistenceService;
+import fr.ifremer.tutti.service.TuttiServiceContext;
+
+import java.io.File;
+import java.util.Properties;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class TuttiReferentialSynchronizeService extends AbstractTuttiService {
+
+ protected PersistenceService persistenceService;
+
+ protected ReferentialSynchronizeService synchroService;
+
+ @Override
+ public void setServiceContext(TuttiServiceContext context) {
+ super.setServiceContext(context);
+ synchroService = TuttiPersistenceServiceLocator.getReferentialSynchronizeService();
+ persistenceService = getService(PersistenceService.class);
+ }
+
+ public void prepare(File dbDirectory, ReferentialSynchronizeResult result) {
+ Properties remoteConnectionProperties = getRemoteProperties(dbDirectory);
+ synchroService.prepare(remoteConnectionProperties, result);
+ }
+
+ public void synchronize(File dbDirectory,
+ ReferentialSynchronizeResult result) {
+ Properties remoteConnectionProperties = getRemoteProperties(dbDirectory);
+ synchroService.synchronize(remoteConnectionProperties, result);
+ }
+
+ protected Properties getRemoteProperties(File dbDirectory) {
+ Properties remoteConnectionProperties = new Properties();
+ TuttiPersistenceConfig persistenceConfig =
+ context.getConfig().getPersistenceConfig();
+
+ String jdbcUrl = TuttiEntities.getJdbcUrl(dbDirectory,
+ persistenceConfig.getDbName());
+
+ TuttiEntities.fillConnectionProperties(remoteConnectionProperties,
+ jdbcUrl,
+ persistenceConfig.getJdbcUsername(),
+ persistenceConfig.getJdbcPassword());
+ return remoteConnectionProperties;
+ }
+
+
+}
Property changes on: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/referential/TuttiReferentialSynchronizeService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0
r416 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util: . action
by tchemit@users.forge.codelutin.com 14 Feb '13
by tchemit@users.forge.codelutin.com 14 Feb '13
14 Feb '13
Author: tchemit
Date: 2013-02-15 00:55:36 +0100 (Fri, 15 Feb 2013)
New Revision: 416
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/416
Log:
add action package
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIModel.java
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUI.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUI.css 2013-02-14 23:55:36 UTC (rev 416)
@@ -0,0 +1,61 @@
+/*
+ * #%L
+ * Tutti :: UI
+ * $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%
+ */
+#globalPanel {
+ border: {new TitledBorder((String) null)};
+}
+
+#globalActionLabel {
+ border: {new EmptyBorder(5, 5, 5, 5)};
+}
+
+#globalProgressBar {
+ indeterminate: true;
+}
+
+#taskPanel {
+ visible: false;
+ border: {new TitledBorder((String) null)};
+}
+
+#taskProgressBar {
+ indeterminate: false;
+}
+
+#taskActionLabel {
+ border: {new EmptyBorder(5, 5, 5, 5)};
+}
+
+#informationPanel {
+ visible: false;
+ border: {new TitledBorder((String) null)};
+}
+
+#informationLabel {
+ border: {new EmptyBorder(5, 5, 5, 5)};
+}
+
+#okAction {
+ actionIcon: information;
+ text: "tutti.action.ok";
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUI.css
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUI.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUI.jaxx 2013-02-14 23:55:36 UTC (rev 416)
@@ -0,0 +1,72 @@
+<!--
+ #%L
+ Tutti :: UI
+ $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%
+ -->
+<JDialog layout='{new BorderLayout()}' width='300' height='200' modal='true' undecorated='true'
+ implements='fr.ifremer.tutti.ui.swing.TuttiUI<TuttiActionUIModel, TuttiActionUIHandler>'>
+ <import>
+
+ fr.ifremer.tutti.ui.swing.TuttiUI
+ fr.ifremer.tutti.ui.swing.TuttiUIContext
+
+ javax.swing.border.EmptyBorder
+
+ static org.nuiton.i18n.I18n._
+ </import>
+
+ <script><![CDATA[
+
+ public TuttiActionUI(JFrame frame, TuttiUIContext context) {
+ super(frame, true);
+ TuttiActionUIHandler handler = new TuttiActionUIHandler(context, this);
+ setContextValue(handler);
+ handler.beforeInitUI();
+ }
+
+ protected void $afterCompleteSetup() {
+ handler.afterInitUI();
+ }
+ ]]></script>
+
+ <TuttiActionUIHandler id='handler'
+ initializer='getContextValue(TuttiActionUIHandler.class)'/>
+
+ <TuttiActionUIModel id='model'
+ initializer='getContextValue(TuttiActionUIModel.class)'/>
+
+
+ <JPanel id='globalPanel' constraints='BorderLayout.NORTH'
+ layout='{new BorderLayout()}'>
+ <JLabel id='globalActionLabel' constraints='BorderLayout.CENTER'/>
+ <JProgressBar id='globalProgressBar' constraints='BorderLayout.SOUTH'/>
+ </JPanel>
+ <JPanel id='taskPanel' constraints='BorderLayout.CENTER'
+ layout='{new BorderLayout()}'>
+ <JLabel id='taskActionLabel' constraints='BorderLayout.CENTER'/>
+ <JProgressBar id='taskProgressBar' constraints='BorderLayout.SOUTH'/>
+ </JPanel>
+ <!--JPanel id='informationPanel' constraints='BorderLayout.SOUTH'
+ layout='{new BorderLayout()}'>
+ <JLabel id='informationLabel' constraints='BorderLayout.CENTER'/>
+ <JButton id='okAction' constraints='BorderLayout.SOUTH' onActionPerformed='handler.closeAction()'/>
+ </JPanel-->
+</JDialog>
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUI.jaxx
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java 2013-02-14 23:55:36 UTC (rev 416)
@@ -0,0 +1,185 @@
+package fr.ifremer.tutti.ui.swing.util.action;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $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.ProgressionModel;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiAction;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
+import fr.ifremer.tutti.ui.swing.TuttiUIContext;
+import jaxx.runtime.SwingUtil;
+import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.SwingUtilities;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class TuttiActionUIHandler extends AbstractTuttiUIHandler<TuttiActionUIModel, TuttiActionUI> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(TuttiActionUIHandler.class);
+
+
+ public TuttiActionUIHandler(TuttiUIContext context, TuttiActionUI ui) {
+ super(context, ui);
+ }
+
+ protected PropertyChangeListener progressionListener = new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ String propertyName = evt.getPropertyName();
+ if (ProgressionModel.PROPERTY_MESSAGE.equals(propertyName)) {
+
+ // change message
+ ui.getTaskActionLabel().setText((String) evt.getNewValue());
+ } else if (ProgressionModel.PROPERTY_TOTAL.equals(propertyName)) {
+
+ // change total progressbar max
+ ui.getTaskProgressBar().setMaximum((Integer) evt.getNewValue());
+
+ } else if (ProgressionModel.PROPERTY_MESSAGE.equals(propertyName)) {
+
+ // change value of progress bar
+ ui.getTaskProgressBar().setValue((Integer) evt.getNewValue());
+ }
+ }
+ };
+
+ //------------------------------------------------------------------------//
+ //-- AbstractTuttiUIHandler methods --//
+ //------------------------------------------------------------------------//
+
+ protected void hideAction() {
+ getModel().setProgressionModel(null);
+ ui.setVisible(false);
+ }
+
+ @Override
+ public void beforeInitUI() {
+ TuttiActionUIModel model = new TuttiActionUIModel();
+ ui.setContextValue(model);
+
+ model.addPropertyChangeListener(TuttiActionUIModel.PROPERTY_ACTION, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ // udpate global label
+ AbstractTuttiAction action = (AbstractTuttiAction) evt.getNewValue();
+
+ if (log.isInfoEnabled()) {
+ log.info("Action to use: " + action);
+ }
+ if (action == null || action.isFailed()) {
+
+ // stoping action
+
+ if (SwingUtilities.isEventDispatchThread()) {
+
+ hideAction();
+ } else {
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ hideAction();
+ }
+ });
+ }
+ } else {
+
+ // starting action
+ if (ui.getOwner() != null) {
+
+ SwingUtil.center(ui.getOwner(), ui);
+ }
+ // new action
+ ui.getGlobalActionLabel().setText(_("tutti.message.action.running", action.getActionDescription()));
+ ui.pack();
+ ui.setVisible(true);
+ }
+ }
+ });
+
+ model.addPropertyChangeListener(TuttiActionUIModel.PROPERTY_PROGRESSION_MODEL, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ // change progression model
+
+ ProgressionModel oldValue = (ProgressionModel) evt.getOldValue();
+ ProgressionModel newValue = (ProgressionModel) evt.getNewValue();
+
+ if (log.isInfoEnabled()) {
+ log.info("progression model: " + newValue);
+ }
+ if (oldValue != null) {
+ oldValue.removePropertyChangeListener(progressionListener);
+ }
+
+ if (newValue == null) {
+
+ // remove progression model
+// ui.getGlobalProgressBar().setVisible(true);
+ ui.getTaskPanel().setVisible(false);
+ } else {
+
+ // use progression model
+// ui.getGlobalProgressBar().setVisible(false);
+ ui.getTaskPanel().setVisible(true);
+
+ newValue.addPropertyChangeListener(progressionListener);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void afterInitUI() {
+
+ initUI(ui);
+ }
+
+ @Override
+ public void onCloseUI() {
+
+ }
+
+ @Override
+ public SwingValidator<TuttiActionUIModel> getValidator() {
+ return null;
+ }
+
+ public void closeAction() {
+ getModel().clear();
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIModel.java 2013-02-14 23:55:36 UTC (rev 416)
@@ -0,0 +1,71 @@
+package fr.ifremer.tutti.ui.swing.util.action;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $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.ProgressionModel;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiAction;
+import org.jdesktop.beans.AbstractSerializableBean;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class TuttiActionUIModel extends AbstractSerializableBean {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_ACTION = "action";
+
+ public static final String PROPERTY_PROGRESSION_MODEL = "progressionModel";
+
+ protected AbstractTuttiAction action;
+
+ protected ProgressionModel progressionModel;
+
+ public ProgressionModel getProgressionModel() {
+ return progressionModel;
+ }
+
+ public void setProgressionModel(ProgressionModel progressionModel) {
+ Object oldValue = getProgressionModel();
+ this.progressionModel = progressionModel;
+ firePropertyChange(PROPERTY_PROGRESSION_MODEL, oldValue, progressionModel);
+ }
+
+ public AbstractTuttiAction getAction() {
+ return action;
+ }
+
+ public void setAction(AbstractTuttiAction action) {
+ Object oldValue = getAction();
+ this.action = action;
+ firePropertyChange(PROPERTY_ACTION, oldValue, action);
+ }
+
+ public void clear() {
+ setProgressionModel(null);
+ setAction(null);
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0