From tchemit@users.forge.codelutin.com Fri Feb 15 15:49:24 2013
From: tchemit@users.forge.codelutin.com
To: tutti-commits@list.forge.codelutin.com
Subject: [Tutti-commits] 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
Date: Fri, 15 Feb 2013 15:49:24 +0100
Message-ID: <20130215144924.676C9159D1@nuiton.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0436954184898751995=="

--===============0436954184898751995==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

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/TuttiPe=
rsistenceNoDbImpl.java
   trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ClosedPersisten=
ceService.java
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/ManageDbActio=
n.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/Cl=
oseDbAction.java
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/Db=
ManagerUI.css
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/Db=
ManagerUI.jaxx
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/Db=
ManagerUIHandler.java
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/Ex=
portDbAction.java
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/In=
stallDbAction.java
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/Op=
enDbAction.java
Modified:
   trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceServ=
ice.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.j=
ava
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContex=
t.java

Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/Tut=
tiPersistenceNoDbImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiP=
ersistenceNoDbImpl.java	                        (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiP=
ersistenceNoDbImpl.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=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * 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.CaracteristicQualit=
ativeValue;
+import fr.ifremer.tutti.persistence.entities.referential.Country;
+import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLoc=
ation;
+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@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(Strin=
g zoneId) {
+        throw new RuntimeException("method not implemented");
+    }
+
+    @Override
+    public List<FishingOperationLocation> getAllFishingOperationSubStrata(St=
ring zoneId, String strataId) {
+        throw new RuntimeException("method not implemented");
+    }
+
+    @Override
+    public List<FishingOperationLocation> getAllFishingOperationLocation(Str=
ing 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 va=
lue) {
+        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 fishingOperation=
Id) {
+        throw new RuntimeException("method not implemented");
+    }
+
+    @Override
+    public SpeciesBatch createSpeciesBatch(SpeciesBatch bean, String parentB=
atchId) {
+        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 sp=
eciesBatchId) {
+        throw new RuntimeException("method not implemented");
+    }
+
+    @Override
+    public List<SpeciesBatchFrequency> saveSpeciesBatchFrequency(String spec=
iesBatchId, 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 fishingOperati=
onId) {
+        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 fishingOperati=
onId) {
+        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/p=
ersistence/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/ClosedPersi=
stenceService.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ClosedPersiste=
nceService.java	                        (rev 0)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ClosedPersiste=
nceService.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=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * 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@codelutin.com>
+ * @since 1.0
+ */
+public class ClosedPersistenceService extends PersistenceService {
+
+    /** Logger. */
+    private static final Log log =3D
+            LogFactory.getLog(ClosedPersistenceService.class);
+
+    @Override
+    public void init() {
+
+        if (log.isInfoEnabled()) {
+            log.info("Open persistence driver " + getImplementationName());
+        }
+
+        TuttiServiceConfig serviceConfig =3D context.getConfig();
+
+        TuttiPersistenceConfig config =3D serviceConfig.getPersistenceConfig=
();
+        TuttiPersistenceConfig.setInstance(config);
+
+        driver =3D 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/servi=
ce/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/Persiste=
nceService.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceSer=
vice.java	2013-02-15 14:02:59 UTC (rev 420)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceSer=
vice.java	2013-02-15 14:49:24 UTC (rev 421)
@@ -25,7 +25,7 @@
  */
=20
 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;
=20
-import java.io.File;
 import java.io.IOException;
 import java.util.List;
=20
@@ -89,6 +86,10 @@
         return "Tutti Persistence Service";
     }
=20
+    public boolean isDbLoaded() {
+        return !(driver instanceof TuttiPersistenceNoDbImpl);
+    }
+
     @Override
     public void init() {
=20
@@ -117,65 +118,67 @@
=20
             // still on dev driver
=20
-            File storageDirectory =3D TuttiPersistenceDevImpl.getStorageDire=
ctory(serviceConfig.getApplicationConfig());
+//            File storageDirectory =3D TuttiPersistenceDevImpl.getStorageDi=
rectory(serviceConfig.getApplicationConfig());
=20
-            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 " + storageDir=
ectory);
+//                log.warn("");
+//                log.warn("------------------------------------------------=
--------------------");
+//            }
=20
-                log.warn("--------------------------------------------------=
------------------");
-                log.warn("");
-                log.warn("Could not find database directory at " + config.ge=
tDbDirectory());
-                log.warn("Will still use dev dataStorage in " + storageDirec=
tory);
-                log.warn("");
-                log.warn("--------------------------------------------------=
------------------");
-            }
+            driver =3D new TuttiPersistenceNoDbImpl();
=20
-            driver =3D new TuttiPersistenceDevImpl(serviceConfig.getApplicat=
ionConfig()) {
+//            driver =3D new TuttiPersistenceDevImpl(serviceConfig.getApplic=
ationConfig()) {
+//
+//                ProtocolPersistenceService protocolPersistenceService =3D =
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);
+//                }
+//            };
=20
-                ProtocolPersistenceService protocolPersistenceService =3D ne=
w 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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css	2=
013-02-15 14:02:59 UTC (rev 420)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css	2=
013-02-15 14:49:24 UTC (rev 421)
@@ -50,7 +50,17 @@
   actionIcon: exit;
 }
=20
+#menuActionUpdate {
+  _tuttiAction: {UpdateApplicationAction.class};
+}
+
+#menuActionManageDb {
+  enabled: {model.getScreen() !=3D 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};
 }
=20
-#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;
 }
=20
 #menuImportTemporaryReferential {
@@ -103,11 +114,8 @@
   _tuttiAction: {ImportTemporaryReferentialAction.class};
 }
=20
-#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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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=3D'menuFile'>
       <JMenuItem id=3D'menuFileConfiguration'
                  onActionPerformed=3D"getHandler().showConfig()"/>
+      <JMenuItem id=3D'menuActionUpdate'/>
       <JSeparator/>
+      <JMenuItem id=3D'menuActionManageDb'/>
+      <JSeparator/>
       <JMenuItem id=3D'menuFileExit'
                  onActionPerformed=3D'getHandler().closeTutti()'/>
     </JMenu>
@@ -72,10 +75,8 @@
       <JMenuItem id=3D'menuActionValidateCatches'/>
     </JMenu>
=20
-    <JMenu id=3D'menuReferential'>
-
+    <JMenu id=3D'menuAdministration'>
       <JMenuItem id=3D'menuImportTemporaryReferential'/>
-      <JMenuItem id=3D'menuUpdateReferential'/>
     </JMenu>
=20
     <JMenu id=3D'menuSynchronisations'>

Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI=
Handler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandle=
r.java	2013-02-15 14:02:59 UTC (rev 420)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandle=
r.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 @@
=20
     protected JComponent currentBody;
=20
-    protected final PersistenceService persistenceService;
+    protected PersistenceService persistenceService;
=20
     protected MainUIHandler(TuttiUIContext context, MainUI ui) {
         super(context, ui);
@@ -125,8 +126,14 @@
=20
         TuttiScreen screen;
=20
-        screen =3D TuttiScreen.SELECT_CRUISE;
+        if (context.isDbExist() && context.isDbLoaded()) {
=20
+            screen =3D TuttiScreen.SELECT_CRUISE;
+        } else {
+
+            screen =3D TuttiScreen.MANAGE_DB;
+        }
+
         context.setScreen(screen);
     }
=20
@@ -310,6 +317,13 @@
                 Icon icon;
                 switch (screen) {
                     default:
+                    case MANAGE_DB:
+
+                        screenUI =3D new DbManagerUI(ui);
+                        screenTitle =3D _("tutti.title.manageDb");
+                        icon =3D ui.getMenuActionManageDb().getIcon();
+                        break;
+
                     case SELECT_CRUISE:
=20
                         screenUI =3D new SelectCruiseUI(ui);
@@ -462,7 +476,6 @@
=20
                 title +=3D _("tutti.title.noSelectedProtocol");
=20
-
             } else {
=20
                 // selected protocol
@@ -475,4 +488,15 @@
         return title;
     }
=20
+    public void reloadPersistenceService() {
+
+        this.persistenceService =3D 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/ManageDbA=
ction.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/ManageDbActi=
on.java	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/ManageDbActi=
on.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=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * 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@codelutin.com>
+ * @since 1.0
+ */
+public class ManageDbAction extends AbstractChangeScreenAction {
+
+    private static final long serialVersionUID =3D 1L;
+
+    /** Logger. */
+    private static final Log log =3D 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/s=
wing/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/TuttiS=
creen.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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 {
=20
     /**
+     * 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/TuttiU=
IContext.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIConte=
xt.java	2013-02-15 14:02:59 UTC (rev 420)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIConte=
xt.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);
=20
+    public static final String PROPERTY_DB_EXIST =3D "dbExist";
+
+    public static final String PROPERTY_DB_LOADED =3D "dbLoaded";
+
     /**
      * Application context (only one for all the application).
      *
@@ -126,6 +132,11 @@
      */
     protected final SwingSession swingSession;
=20
+    /**
+     * Erro helper.
+     *
+     * @since 1.0
+     */
     protected final TuttiErrorHelper errorHelper;
=20
     /**
@@ -174,6 +185,20 @@
=20
     private TuttiActionUI actionUI;
=20
+    /**
+     * 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 =3D=3D null,
@@ -210,9 +235,27 @@
     }
=20
     public <S extends TuttiService> S getService(Class<S> serviceType) {
+        if (PersistenceService.class.equals(serviceType) && !useRealPersiste=
nceService()) {
+            serviceType =3D (Class<S>) ClosedPersistenceService.class;
+        }
         return serviceContext.getService(serviceType);
     }
=20
+    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);
     }
=20
-
     public TuttiScreen getScreen() {
         return screen;
     }
=20
+    public boolean isDbExist() {
+        return dbExist;
+    }
+
+    public void setDbExist(boolean dbExist) {
+        this.dbExist =3D dbExist;
+        firePropertyChange(PROPERTY_DB_EXIST, null, dbExist);
+    }
+
+    public boolean isDbLoaded() {
+        return dbLoaded;
+    }
+
+    public void setDbLoaded(boolean dbLoaded) {
+        this.dbLoaded =3D dbLoaded;
+        firePropertyChange(PROPERTY_DB_LOADED, null, dbLoaded);
+    }
+
     public void setProgramId(String programId) {
         boolean oldProgramFilled =3D isProgramFilled();
         boolean oldCruiseFilled =3D isCruiseFilled();
@@ -301,7 +361,6 @@
=20
     public void init() {
=20
-
         try {
             config.getServiceConfig().prepareDirectories();
         } catch (IOException e) {
@@ -385,70 +444,87 @@
             setProtocolId(getConfig().getProtocolId());
         }
=20
-        //check if programId is sane
-        PersistenceService service =3D getService(PersistenceService.class);
+        boolean dbExists =3D
+                getConfig().getServiceConfig().getPersistenceConfig().isDbEx=
ists();
=20
-        if (isProtocolFilled()) {
+        setDbExist(dbExists);
=20
-            if (!service.isProtocolExist(protocolId)) {
+        if (!dbExists) {
=20
-                // not found in this db
+            setProtocolId(null);
+            setProgramId(null);
+            setCruiseId(null);
+            setDbLoaded(false);
=20
-                if (log.isWarnEnabled()) {
-                    log.warn("Remove invalid protocolId: " + protocolId);
-                }
+        } else {
=20
-                setProtocolId(null);
-            }
-        }
+            setDbLoaded(true);
=20
-        if (isProgramFilled()) {
+            //check if programId is sane
+            PersistenceService service =3D getService(PersistenceService.cla=
ss);
=20
-            Program program =3D service.getProgram(programId);
-            if (program =3D=3D null) {
+            if (isProtocolFilled()) {
=20
-                // not found in this db
+                if (!service.isProtocolExist(protocolId)) {
=20
-                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);
                 }
+            }
=20
-                setProgramId(null);
-                setCruiseId(null);
+            if (isProgramFilled()) {
=20
-            } else {
+                Program program =3D service.getProgram(programId);
+                if (program =3D=3D null) {
=20
-                if (log.isInfoEnabled()) {
-                    log.info("ProgramId valid: " + programId);
-                }
+                    // not found in this db
=20
-                setProgramId(programId);
+                    if (log.isWarnEnabled()) {
+                        log.warn("Remove invalid programId: " + programId);
+                    }
=20
-                // test cruiseId
-                if (isCruiseFilled()) {
+                    setProgramId(null);
+                    setCruiseId(null);
=20
-                    Cruise cruise =3D service.getCruise(cruiseId);
+                } else {
=20
-                    if (cruise !=3D null &&
-                        !cruise.getProgram().getId().equals(programId)) {
-
-                        // not matchin program, reset cruise id
-                        cruise =3D null;
+                    if (log.isInfoEnabled()) {
+                        log.info("ProgramId valid: " + programId);
                     }
=20
-                    if (cruise =3D=3D null) {
+                    setProgramId(programId);
=20
-                        // not found in this db
+                    // test cruiseId
+                    if (isCruiseFilled()) {
=20
-                        if (log.isWarnEnabled()) {
-                            log.warn("Remove invalid cruiseId: " + cruiseId);
+                        Cruise cruise =3D service.getCruise(cruiseId);
+
+                        if (cruise !=3D null &&
+                            !cruise.getProgram().getId().equals(programId)) {
+
+                            // not matchin program, reset cruise id
+                            cruise =3D null;
                         }
-                        setCruiseId(null);
=20
-                    } else {
+                        if (cruise =3D=3D null) {
=20
-                        if (log.isInfoEnabled()) {
-                            log.info("CruiseId valid: " + cruiseId);
+                            // not found in this db
+
+                            if (log.isWarnEnabled()) {
+                                log.warn("Remove invalid cruiseId: " + cruis=
eId);
+                            }
+                            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/d=
b/CloseDbAction.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/C=
loseDbAction.java	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/C=
loseDbAction.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=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * 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@codelutin.com>
+ * @since 1.0
+ */
+public class CloseDbAction extends AbstractMainUITuttiAction {
+
+    private static final long serialVersionUID =3D 1L;
+
+    /** Logger. */
+    private static final Log log =3D 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 =3D TuttiPersistenceConfig.getInstance().getJdbcUrl();
+
+        getContext().setDbLoaded(false);
+
+        getHandler().reloadPersistenceService();
+
+        sendMessage(String.format("La base de donn=C3=A9es '%s' est ferm=C3=
=A9e.", 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/s=
wing/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/d=
b/DbManagerUI.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/D=
bManagerUI.css	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/D=
bManagerUI.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=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * 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/s=
wing/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/d=
b/DbManagerUI.jaxx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/D=
bManagerUI.jaxx	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/D=
bManagerUI.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=20
+  License, or (at your option) any later version.
+ =20
+  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.
+ =20
+  You should have received a copy of the GNU General Public=20
+  License along with this program.  If not, see
+  <http://www.gnu.org/licenses/gpl-3.0.html>.
+  #L%
+  -->
+<JPanel id=3D'noDbUITopPanel' layout=3D'{new BorderLayout()}'
+        implements=3D'fr.ifremer.tutti.ui.swing.TuttiUI&lt;TuttiUIContext, D=
bManagerUIHandler&gt;'>
+
+  <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 =3D new DbManagerUIHandler(parentUI.getHa=
ndler().getContext(), this);
+        setContextValue(handler);
+        handler.beforeInitUI();
+    }
+
+    protected void $afterCompleteSetup() {
+        handler.afterInitUI();
+    }
+  ]]></script>
+
+  <DbManagerUIHandler id=3D'handler'
+                      initializer=3D'getContextValue(DbManagerUIHandler.clas=
s)'/>
+
+  <TuttiUIContext id=3D'model'
+                  initializer=3D'getContextValue(TuttiUIContext.class)'/>
+
+  <JPanel id=3D'centerPanel' layout=3D'{new BorderLayout()}'
+          constraints=3D'BorderLayout.CENTER'>
+    <JLabel id=3D'informationLabel' constraints=3D'BorderLayout.CENTER'/>
+    <JPanel constraints=3D'BorderLayout.SOUTH' layout=3D'{new GridLayout(0, =
1)}'>
+      <JButton id=3D'installDbButton'/>
+      <JButton id=3D'openDbButton'/>
+      <JButton id=3D'upgradeDbButton'/>
+      <JButton id=3D'exportDbButton'/>
+      <JButton id=3D'closeDbButton'/>
+    </JPanel>
+  </JPanel>
+</JPanel>
\ No newline at end of file


Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/s=
wing/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/d=
b/DbManagerUIHandler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/D=
bManagerUIHandler.java	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/D=
bManagerUIHandler.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=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * 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@codelutin.com>
+ * @since 1.0
+ */
+public class DbManagerUIHandler extends AbstractTuttiUIHandler<TuttiUIContex=
t, DbManagerUI> {
+
+    /** Logger. */
+    private static final Log log =3D
+            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 =3D evt.getPropertyName();
+                String message;
+
+
+            }
+        });
+    }
+
+    public String updateMessage(boolean dbExist, boolean dbLoaded) {
+        String message;
+
+        if (dbExist) {
+            if (dbLoaded) {
+
+                // db loaded
+                message =3D _("tutti.information.db.loaded");
+
+            } else {
+
+                // no db loaded
+                message =3D _("tutti.information.no.db.loaded");
+            }
+        } else {
+
+            // db does not exist
+            message =3D "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/s=
wing/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/d=
b/ExportDbAction.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/E=
xportDbAction.java	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/E=
xportDbAction.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=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * 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@codelutin.com>
+ * @since 1.0
+ */
+public class ExportDbAction extends AbstractMainUITuttiAction {
+
+    private static final long serialVersionUID =3D 1L;
+
+    /** Logger. */
+    private static final Log log =3D 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/s=
wing/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/d=
b/InstallDbAction.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/I=
nstallDbAction.java	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/I=
nstallDbAction.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=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * 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@codelutin.com>
+ * @since 1.0
+ */
+public class InstallDbAction extends AbstractMainUITuttiAction {
+
+    private static final long serialVersionUID =3D 1L;
+
+    /** Logger. */
+    private static final Log log =3D
+            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 =3D getContext().getConfig();
+
+        File current =3D config.getDataDirectory();
+        String url =3D 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 =3D new ApplicationUpdater();
+
+        File dest =3D new File(config.getTuttiBasedir(), "NEW");
+        ProgressionModel progressionModel =3D new ProgressionModel();
+        getContext().getActionUI().getModel().setProgressionModel(progressio=
nModel);
+        progressionModel.setMessage("Recherche de mises =C3=A0 jour de base"=
);
+
+        TuttiApplicationUpdaterCallBack callback =3D new TuttiApplicationUpd=
aterCallBack(getContext(), progressionModel);
+        callback.setTypes(TuttiApplicationUpdaterCallBack.UpdateType.DB);
+
+        up.update(url, current, dest, false, callback);
+
+        sendMessage("Nouvelle base de donn=C3=A9es install=C3=A9e.");
+
+        String jdbcUrl =3D TuttiPersistenceConfig.getInstance().getJdbcUrl();
+
+        progressionModel.setMessage(String.format("Ouverture de la base de d=
onn=C3=A9es *%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/s=
wing/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/d=
b/OpenDbAction.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/O=
penDbAction.java	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/O=
penDbAction.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=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * 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@codelutin.com>
+ * @since 1.0
+ */
+public class OpenDbAction extends AbstractMainUITuttiAction {
+
+    private static final long serialVersionUID =3D 1L;
+
+    /** Logger. */
+    private static final Log log =3D
+            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 =3D TuttiPersistenceConfig.getInstance().getJdbcUrl();
+
+        sendMessage(String.format("La base de donn=C3=A9es '%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/s=
wing/content/db/OpenDbAction.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision HeadURL
Added: svn:eol-style
   + native


--===============0436954184898751995==--


