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
January 2013
- 4 participants
- 143 discussions
10 Jan '13
Author: kmorin
Date: 2013-01-10 15:54:02 +0100 (Thu, 10 Jan 2013)
New Revision: 167
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/167
Log:
refs #1908 [CONSOLIDATION] Mise en place des deux contextes de validation (pour les captures)
Added:
trunk/tutti-ui-swing/src/main/resources/icons/action-table-error.png
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-table-error.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-table-error.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
r166 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing
by kmorin@users.forge.codelutin.com 10 Jan '13
by kmorin@users.forge.codelutin.com 10 Jan '13
10 Jan '13
Author: kmorin
Date: 2013-01-10 15:50:43 +0100 (Thu, 10 Jan 2013)
New Revision: 166
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/166
Log:
refs #1908 [CONSOLIDATION] Mise en place des deux contextes de validation (pour les captures)
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java
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-01-10 13:42:09 UTC (rev 165)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2013-01-10 14:50:43 UTC (rev 166)
@@ -36,25 +36,21 @@
import fr.ifremer.tutti.ui.swing.content.program.EditProgramUI;
import fr.ifremer.tutti.ui.swing.content.protocol.EditProtocolUI;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
-import jaxx.runtime.swing.AboutPanel;
-import jaxx.runtime.swing.ErrorDialogUI;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.ApplicationConfig;
-import org.nuiton.widget.SwingSession;
-
-import javax.swing.JComponent;
import java.awt.Desktop;
-import java.awt.Insets;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.net.URL;
import java.util.Calendar;
+import javax.swing.JComponent;
import javax.swing.JToolBar;
+import jaxx.runtime.swing.AboutPanel;
+import jaxx.runtime.swing.ErrorDialogUI;
import jaxx.runtime.validator.swing.SwingValidator;
-import jaxx.runtime.validator.swing.SwingValidatorMessageWidget;
-
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import static org.nuiton.i18n.I18n._;
+import org.nuiton.util.ApplicationConfig;
+import org.nuiton.widget.SwingSession;
/**
* @author tchemit <chemit(a)codelutin.com>
1
0
r165 - in trunk: . tutti-persistence/src/main/xmi tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence tutti-persistence-adagio/src/main/resources tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor
by tchemit@users.forge.codelutin.com 10 Jan '13
by tchemit@users.forge.codelutin.com 10 Jan '13
10 Jan '13
Author: tchemit
Date: 2013-01-10 14:42:09 +0100 (Thu, 10 Jan 2013)
New Revision: 165
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/165
Log:
continue queries + remove caracteristic booleanType and textType
Added:
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseFixtures.java
Modified:
trunk/pom.xml
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java
trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/HydrologicCaracteristicUtil.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CaracteristicValueEditor.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CaracteristicValueRenderer.java
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-10 13:15:31 UTC (rev 164)
+++ trunk/pom.xml 2013-01-10 13:42:09 UTC (rev 165)
@@ -124,7 +124,7 @@
<h2Version>1.3.168</h2Version>
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
- <jaxxVersion>2.5.10-SNAPSHOT</jaxxVersion>
+ <jaxxVersion>2.5.9</jaxxVersion>
<swingXVersion>1.6.4</swingXVersion>
<xworkVersion>2.3.7</xworkVersion>
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-10 13:15:31 UTC (rev 164)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-10 13:42:09 UTC (rev 165)
@@ -193,17 +193,22 @@
List<Vessel> result = Lists.newArrayList();
while (list.hasNext()) {
Object[] source = list.next();
- Vessel target = new Vessel();
- target.setId((String) source[0]);
- target.setRegistrationCode((String) source[1]);
- target.setInternalRegistrationCode((String) source[2]);
- target.setName((String) source[3]);
- setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target);
+ Vessel target = loadVessel(source);
result.add(target);
}
return result;
}
+ protected Vessel loadVessel(Object[] source) {
+ Vessel target = new Vessel();
+ target.setId((String) source[0]);
+ target.setRegistrationCode((String) source[1]);
+ target.setInternalRegistrationCode((String) source[2]);
+ target.setName((String) source[3]);
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target);
+ return target;
+ }
+
@Override
public List<Gear> getAllScientificGear() {
@@ -249,12 +254,7 @@
List<Person> result = Lists.newArrayList();
while (list.hasNext()) {
Object[] source = list.next();
- Person target = new Person();
- target.setId(String.valueOf(source[0]));
- target.setFirstName(String.valueOf(source[1]));
- target.setLastName(String.valueOf(source[2]));
- target.setDepartment(String.valueOf(source[3]));
- setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target);
+ Person target = loadPerson(source);
result.add(target);
}
return result;
@@ -540,12 +540,41 @@
public Cruise getCruise(String id) {
Object[] source = queryUnique(
"cruise",
- "cruiseId", StringType.INSTANCE, id);
+ "cruiseId", StringType.INSTANCE, id,
+ "locationLevelId", IntegerType.INSTANCE, getEnumerationIntegerCode("LocationLevelId.PAYS_ISO3"));
Cruise result = new Cruise();
- result.setId((String) source[0]);
- result.setName((String) source[1]);
+ result.setId(id);
+ String programCode = (String) source[0];
+ Program program = getProgram(programCode);
+ result.setProgram(program);
+
+ result.setYear((Integer) source[1]);
+ result.setName((String) source[2]);
+
+ String countryId = String.valueOf(source[3]);
+ String countryLabel = (String) source[4];
+ String countryName = (String) source[5];
+ Country c = new Country();
+ c.setId(countryId);
+ c.setName(countryName);
+ c.setLabel(countryLabel);
+ result.setCountry(c);
+
+ result.setBeginDate((Date) source[6]);
+ result.setEndDate((Date) source[7]);
+
+ String vesselCode = (String) source[8];
+ Vessel vessel = getVessel(vesselCode);
+ result.setVessel(Lists.newArrayList(vessel));
+
+ Integer managerId = (Integer) source[9];
+ Person manager = getPerson(managerId);
+ result.setHeadOfMission(Lists.newArrayList(manager));
+
+ result.setComment((String) source[10]);
+
// get secondary gears
Iterator<Object[]> list = queryList(
"allCruiseSecondaryGears",
@@ -561,11 +590,36 @@
gears.add(target);
}
result.setGear(gears);
+ return result;
+ }
+ protected Vessel getVessel(String vesselCode) {
+ Object[] source = queryUnique(
+ "vessel",
+ "vesselCode", StringType.INSTANCE, vesselCode,
+ "refDate", DateType.INSTANCE, new Date());
+ Vessel result = loadVessel(source);
+ return result;
+ }
+ protected Person getPerson(Integer personId) {
+ Object[] source = queryUnique(
+ "person",
+ "personId", IntegerType.INSTANCE, personId);
+ Person result = loadPerson(source);
return result;
}
+ protected Person loadPerson(Object[] source) {
+ Person target = new Person();
+ target.setId(String.valueOf(source[0]));
+ target.setFirstName((String) source[1]);
+ target.setLastName((String) source[2]);
+ target.setDepartment((String) source[3]);
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target);
+ return target;
+ }
+
@Override
public Cruise createCruise(Cruise bean) {
throw new UnsupportedOperationException();
@@ -874,7 +928,8 @@
Integer pmfmId) {
Preconditions.checkNotNull(caracteristic, "Caracteristic can not be null");
Preconditions.checkNotNull(pmfmId, "pmfmId can not be null");
- Preconditions.checkArgument(caracteristic.isQualitativeType(), "Caracteristic must be a qualitativeValue type");
+ Preconditions.checkArgument(caracteristic.isQualitativeType(),
+ "Caracteristic must be a qualitativeValue type");
Iterator<Object[]> sources = queryList(
"pmfmQualitativeValues",
@@ -917,9 +972,11 @@
target.setMethodName(String.valueOf(source[4]));
target.setNumberType(Boolean.valueOf(source[5].toString()));
target.setQualitativeType(Boolean.valueOf(source[6].toString()));
-
- target.setUnit(String.valueOf(source[7]));
- setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[8], target);
+ target.setSignifFiguresNumber(Integer.valueOf(source[7].toString()));
+ target.setMaximumNumberDecimals(Integer.valueOf(source[8].toString()));
+ target.setPrecision(Float.valueOf(source[9].toString()));
+ target.setUnit(String.valueOf(source[10]));
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[11], target);
return target;
}
Modified: trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-10 13:15:31 UTC (rev 164)
+++ trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-10 13:42:09 UTC (rev 165)
@@ -86,30 +86,30 @@
<!-- Get a detail cruise [DAT-04] -->
<query cacheable="true" name="cruise">
<![CDATA[
- select
- sc.program.code as programCode,
- year(sc.departureDateTime) as year,
- -- partialSerie - pas stockée sous H2 ??
- sc.name,
- lh.locationHierarchyPk.parent.label as countryLabel,
- lh.locationHierarchyPk.parent.name as countryName,
- sc.departureDateTime,
- sc.returnDateTime,
- sc.vessel.code as vesselCode,
- mp.lastname as managerLastname,
- mp.firstname as managerFirstName,
- coalesce(sc.comments, ft.comments) as comments
-from
- ScientificCruiseImpl sc
- left outer join sc.fishingTrips ft
- left outer join sc.managerPerson mp,
- LocationHierarchyImpl lh
-where 1=1
- and sc.id = 100000 -- :scientificCruiseId
- and lh.locationHierarchyPk.location.id = ft.departureLocation.id
- and lh.locationHierarchyPk.parent.locationLevel.id = 21 -- locationLevel=Pays ISO 3
+ SELECT
+ sc.program.code AS programCode,
+ year(sc.departureDateTime) AS year,
+ sc.name,
+ lh.locationHierarchyPk.parent.location.id AS countryId,
+ lh.locationHierarchyPk.parent.location.label AS countryLabel,
+ lh.locationHierarchyPk.parent.location.name AS countryName,
+ sc.departureDateTime,
+ sc.returnDateTime,
+ sc.vessel.code as vesselCode,
+ mp.id as managerId,
+ coalesce(sc.comments, ft.comments) as comments
+ FROM
+ ScientificCruiseImpl sc
+ LEFT OUTER JOIN sc.fishingTrips ft
+ LEFT OUTER JOIN sc.managerPerson mp,
+ LocationHierarchyImpl lh
+ WHERE
+ sc.id = :cruiseId
+ AND lh.locationHierarchyPk.location.id = ft.departureLocation.id
+ AND lh.locationHierarchyPk.parent.locationLevel.id = :countryLocationLevel
]]>
- <query-param name="programCode" type="java.lang.String"/>
+ <query-param name="cruiseId" type="java.lang.String"/>
+ <query-param name="countryLocationLevel" type="java.lang.Integer"/>
</query>
<!-- Get all program zones [REF-01] -->
@@ -179,6 +179,41 @@
<query-param name="refDate" type="java.util.Date"/>
</query>
+ <!-- Get a vessel for a given vesselType [REF-03] et [REF-04]-->
+ <query cacheable="true" name="vessel">
+ <![CDATA[
+ SELECT
+ v.code AS vesselCode,
+ vrp.registrationCode AS nationalRegistrationCode,
+ vrp.internationalRegistrationCode as internationalRegistrationCode,
+ vf.name AS vesselName,
+ v.status AS status
+ FROM
+ VesselImpl v
+ INNER JOIN v.vesselRegistrationPeriods AS vrp
+ LEFT OUTER JOIN v.vesselFeatures AS vf
+ WHERE v.code = :vesselCode
+ AND v.status.code IN (1, 2)
+ AND vrp.vesselRegistrationPeriodPk.startDateTime =
+ (
+ SELECT MAX(vrp2.vesselRegistrationPeriodPk.startDateTime)
+ FROM VesselRegistrationPeriodImpl vrp2 WHERE
+ vrp2.vesselRegistrationPeriodPk.vessel.code = v.code
+ AND (vrp2.vesselRegistrationPeriodPk.startDateTime <= :refDate OR :refDate IS NULL)
+ GROUP BY vrp2.vesselRegistrationPeriodPk.vessel.code
+ )
+ AND vf.startDateTime =
+ (
+ SELECT MAX(vf2.startDateTime)
+ FROM VesselFeaturesImpl vf2 WHERE
+ vf2.vessel.code = v.code
+ AND (vf2.startDateTime <= :refDate OR :refDate IS NULL)
+ GROUP BY vf2.vessel.code
+ )]]>
+ <query-param name="vesselCode" type="java.lang.String"/>
+ <query-param name="refDate" type="java.util.Date"/>
+ </query>
+
<!-- Get all gears [REF-05] and [REF-06] -->
<query cacheable="true" name="allGears">
<![CDATA[
@@ -210,6 +245,22 @@
]]>
</query>
+ <!-- Get one persons [REF-07] -->
+ <query cacheable="true" name="person">
+ <![CDATA[
+ SELECT DISTINCT
+ p.id,
+ p.firstname,
+ p.lastname,
+ p.department,
+ p.status
+ FROM
+ PersonImpl p
+ WHERE p.id = :personId
+ ]]>
+ <query-param name="personId" type="java.lang.Integer"/>
+ </query>
+
<!-- TODO Fix it! Get all species [REF-08] -->
<query cacheable="true" name="allSpecies">
<![CDATA[
@@ -461,6 +512,9 @@
p.method.name AS methodName,
p.parameter.isAlphanumeric AS isAlphanumeric,
p.parameter.isQualitative AS isQualitative,
+ p.signifFiguresNumber,
+ p.maximumNumberDecimals,
+ p.precision,
p.unit.symbol AS symbol,
p.status AS status
FROM PmfmImpl p
@@ -481,6 +535,9 @@
p.method.name AS methodName,
p.parameter.isAlphanumeric AS isAlphanumeric,
p.parameter.isQualitative AS isQualitative,
+ p.signifFiguresNumber,
+ p.maximumNumberDecimals,
+ p.precision,
p.unit.symbol AS symbol,
p.status AS status
FROM PmfmImpl p
Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java 2013-01-10 13:15:31 UTC (rev 164)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java 2013-01-10 13:42:09 UTC (rev 165)
@@ -24,11 +24,15 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Program;
+import org.junit.Assert;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
+import java.util.List;
+
/**
* To test operations around {@link Program}.
*
@@ -43,12 +47,18 @@
@Test
public void getAllCruise(/*String programId*/) {
-
+ String programCode = dbResource.getFixtures().programCode();
+ List<Cruise> result = dbResource.getDriver().getAllCruise(programCode);
+ Assert.assertNotNull(result);
+ Assert.assertEquals(1, result.size());
}
@Test
public void getCruise(/*String id*/) {
+ String cruiseId = dbResource.getFixtures().cruiseId();
+ Cruise result = dbResource.getDriver().getCruise(cruiseId);
+ Assert.assertNotNull(result);
}
@Test
Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseFixtures.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseFixtures.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseFixtures.java 2013-01-10 13:42:09 UTC (rev 165)
@@ -0,0 +1,42 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $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%
+ */
+
+/**
+ * Fixtures for the allegro db.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class DatabaseFixtures {
+
+ public String programCode() {
+ return "CAM-CGFS";
+ }
+
+ public String cruiseId() {
+ return "100000";
+ }
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseFixtures.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java 2013-01-10 13:15:31 UTC (rev 164)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java 2013-01-10 13:42:09 UTC (rev 165)
@@ -60,6 +60,8 @@
protected TuttiPersistence driver;
+ protected DatabaseFixtures fixtures;
+
public TuttiPersistenceAdagioConfig getConfig() {
return config;
}
@@ -68,6 +70,10 @@
return driver;
}
+ public DatabaseFixtures getFixtures() {
+ return fixtures;
+ }
+
@Override
public Statement apply(final Statement base, final Description description) {
@@ -101,6 +107,7 @@
log.info("Prepare test " + testClass);
}
+ fixtures = new DatabaseFixtures();
config = createConfig(testClass, "");
if (log.isDebugEnabled()) {
Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java 2013-01-10 13:15:31 UTC (rev 164)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java 2013-01-10 13:42:09 UTC (rev 165)
@@ -52,7 +52,7 @@
@Test
public void getProgram(/*String id*/) {
- String programCode = "CAM-CGFS";
+ String programCode = dbResource.getFixtures().programCode();
Program actual = dbResource.getDriver().getProgram(programCode);
Assert.assertNotNull(actual);
Assert.assertNotNull(actual.getId());
Modified: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java
===================================================================
--- trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2013-01-10 13:15:31 UTC (rev 164)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2013-01-10 13:42:09 UTC (rev 165)
@@ -235,7 +235,7 @@
Caracteristic ca;
ca = createQualitativeCaracteristic("Vent Beaufort",
- CaracteristicEnum.FishingOperationEnvironment.name());
+ CaracteristicEnum.FishingOperationEnvironment.name());
createCaracteristicQualitativeValue(ca, "Calme");
createCaracteristicQualitativeValue(ca, "Très légère brise");
@@ -247,7 +247,7 @@
createCaracteristicQualitativeValue(ca, "Fort coup de vent");
ca = createQualitativeCaracteristic("État de la mer",
- CaracteristicEnum.FishingOperationEnvironment.name());
+ CaracteristicEnum.FishingOperationEnvironment.name());
createCaracteristicQualitativeValue(ca, "Mer calme");
createCaracteristicQualitativeValue(ca, "Mer agitée");
@@ -269,11 +269,17 @@
CaracteristicEnum.FishingOperationGear.name());
createNumberCaracteristic("Longueur bras",
CaracteristicEnum.FishingOperationGear.name());
- createBooleanCaracteristic("Systeme cul ferme",
- CaracteristicEnum.FishingOperationGear.name());
- createBooleanCaracteristic("Géométrie mesurée",
- CaracteristicEnum.FishingOperationGear.name());
+ ca = createQualitativeCaracteristic("Systeme cul ferme",
+ CaracteristicEnum.FishingOperationGear.name());
+ createCaracteristicQualitativeValue(ca, "Oui");
+ createCaracteristicQualitativeValue(ca, "Non");
+
+ ca = createQualitativeCaracteristic("Géométrie mesurée",
+ CaracteristicEnum.FishingOperationGear.name());
+ createCaracteristicQualitativeValue(ca, "Oui");
+ createCaracteristicQualitativeValue(ca, "Non");
+
createNumberCaracteristic("Température Surface_S",
CaracteristicEnum.FishingOperationHydrologic_surfaceTemperature.name());
createNumberCaracteristic("Température Surface_E",
@@ -372,7 +378,7 @@
createCaracteristicQualitativeValue(ca, "piece");
ca = createQualitativeCaracteristic("MacroWaste Size category",
- CaracteristicEnum.MacroWasteSizeCategory.name());
+ CaracteristicEnum.MacroWasteSizeCategory.name());
createCaracteristicQualitativeValue(ca, "<5*5cm = 25cm²");
createCaracteristicQualitativeValue(ca, "<10*10cm = 100cm²");
createCaracteristicQualitativeValue(ca, "<20*20cm = 400cm²");
@@ -423,16 +429,6 @@
return ca;
}
- protected Caracteristic createBooleanCaracteristic(String name, String category) {
- Caracteristic ca = new Caracteristic();
- ca.setId(UUID.randomUUID().toString());
- ca.setName(name);
- ca.setCategory(category);
- ca.setBooleanType(true);
- cache.put(Caracteristic.class, ca);
- return ca;
- }
-
protected Caracteristic createNumberCaracteristic(String name, String category) {
Caracteristic ca = new Caracteristic();
ca.setId(UUID.randomUUID().toString());
@@ -443,16 +439,6 @@
return ca;
}
- protected Caracteristic createTextCaracteristic(String name, String category) {
- Caracteristic ca = new Caracteristic();
- ca.setId(UUID.randomUUID().toString());
- ca.setName(name);
- ca.setCategory(category);
- ca.setTextType(true);
- cache.put(Caracteristic.class, ca);
- return ca;
- }
-
public <B extends IdAware> List<B> getData(Class<B> entityType) {
List<B> result = (List<B>) cache.get(entityType);
return result;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/HydrologicCaracteristicUtil.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/HydrologicCaracteristicUtil.java 2013-01-10 13:15:31 UTC (rev 164)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/HydrologicCaracteristicUtil.java 2013-01-10 13:42:09 UTC (rev 165)
@@ -52,11 +52,12 @@
caracteristic.setId(name);
if (toClone != null) {
caracteristic.setCategory(toClone.getCategory());
- caracteristic.setBooleanType(toClone.isBooleanType());
+ caracteristic.setPrecision(toClone.getPrecision());
+ caracteristic.setMaximumNumberDecimals(toClone.getMaximumNumberDecimals());
+ caracteristic.setSignifFiguresNumber(toClone.getSignifFiguresNumber());
caracteristic.setNumberType(toClone.isNumberType());
caracteristic.setQualitativeType(toClone.isQualitativeType());
caracteristic.setQualitativeValue(toClone.getQualitativeValue());
- caracteristic.setTextType(toClone.isTextType());
caracteristic.setUnit(toClone.getUnit());
}
return caracteristic;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CaracteristicValueEditor.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CaracteristicValueEditor.java 2013-01-10 13:15:31 UTC (rev 164)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CaracteristicValueEditor.java 2013-01-10 13:42:09 UTC (rev 165)
@@ -88,10 +88,7 @@
Caracteristic caracteristic = (Caracteristic) table.getModel().getValueAt(row, caracteristicColumn);
if (caracteristic != null) {
- if (caracteristic.isBooleanType()) {
- editor = table.getDefaultEditor(Boolean.class);
-
- } else if (caracteristic.isNumberType()) {
+ if (caracteristic.isNumberType()) {
NumberCellEditor<Float> editor =
JAXXWidgetUtil.newNumberTableCellEditor(Float.class, false);
editor.getNumberEditor().setSelectAllTextOnError(true);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CaracteristicValueRenderer.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CaracteristicValueRenderer.java 2013-01-10 13:15:31 UTC (rev 164)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CaracteristicValueRenderer.java 2013-01-10 13:42:09 UTC (rev 165)
@@ -64,10 +64,7 @@
TableCellRenderer renderer = table.getDefaultRenderer(Object.class);
Caracteristic caracteristic = (Caracteristic) table.getModel().getValueAt(row, caracteristicColumn);
if (caracteristic != null) {
- if (caracteristic.isBooleanType()) {
- renderer = table.getDefaultRenderer(Boolean.class);
-
- } else if (caracteristic.isQualitativeType()) {
+ if (caracteristic.isQualitativeType()) {
renderer = new DecoratorTableCellRenderer(decorator);
}
}
1
0
r164 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: . content/operation content/operation/fishing/environment content/operation/fishing/gearshooting content/operation/fishing/hydrology util util/editor util/table
by kmorin@users.forge.codelutin.com 10 Jan '13
by kmorin@users.forge.codelutin.com 10 Jan '13
10 Jan '13
Author: kmorin
Date: 2013-01-10 14:15:31 +0100 (Thu, 10 Jan 2013)
New Revision: 164
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/164
Log:
refs #1908 [CONSOLIDATION] Mise en place des deux contextes de validation (pour les captures)
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/SwingValidatorMessageWidget.java
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/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/content/operation/EditFishingOperationUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CaracteristicValueEditor.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
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-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -34,31 +34,6 @@
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import fr.ifremer.tutti.ui.swing.util.UIMessageNotifier;
import fr.ifremer.tutti.ui.swing.util.editor.SimpleTimeEditor;
-import jaxx.runtime.JAXXUtil;
-import jaxx.runtime.SwingUtil;
-import jaxx.runtime.swing.editor.NumberEditor;
-import jaxx.runtime.swing.editor.bean.BeanComboBox;
-import jaxx.runtime.swing.editor.bean.BeanDoubleList;
-import jaxx.runtime.swing.renderer.DecoratorListCellRenderer;
-import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jdesktop.swingx.JXDatePicker;
-import org.nuiton.util.decorator.Decorator;
-import org.nuiton.util.decorator.JXPathDecorator;
-import org.nuiton.validator.bean.simple.SimpleBeanValidator;
-
-import javax.swing.AbstractAction;
-import javax.swing.JComponent;
-import javax.swing.JDialog;
-import javax.swing.JList;
-import javax.swing.JRootPane;
-import javax.swing.KeyStroke;
-import javax.swing.ListCellRenderer;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.text.JTextComponent;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Frame;
@@ -74,6 +49,30 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import javax.swing.AbstractAction;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.JList;
+import javax.swing.JRootPane;
+import javax.swing.KeyStroke;
+import javax.swing.ListCellRenderer;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.text.JTextComponent;
+import jaxx.runtime.JAXXUtil;
+import jaxx.runtime.SwingUtil;
+import jaxx.runtime.swing.editor.NumberEditor;
+import jaxx.runtime.swing.editor.bean.BeanComboBox;
+import jaxx.runtime.swing.editor.bean.BeanDoubleList;
+import jaxx.runtime.swing.renderer.DecoratorListCellRenderer;
+import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXDatePicker;
+import org.nuiton.util.decorator.Decorator;
+import org.nuiton.util.decorator.JXPathDecorator;
+import org.nuiton.validator.bean.simple.SimpleBeanValidator;
/**
* Contract of any UI handler.
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-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css 2013-01-10 13:15:31 UTC (rev 164)
@@ -131,3 +131,13 @@
actionIcon: about;
mnemonic: A;
}
+
+#bottomBar {
+ floatable: false;
+ margin: {new java.awt.Insets(0, 0, 0, 5)};
+ borderPainted: false;
+}
+
+#validatorMessageWidget {
+ focusPainted: false;
+}
\ No newline at end of file
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-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.jaxx 2013-01-10 13:15:31 UTC (rev 164)
@@ -29,6 +29,8 @@
java.awt.BorderLayout
javax.swing.JFrame
org.jdesktop.swingx.JXTitledPanel
+ jaxx.runtime.validator.swing.SwingValidator
+ fr.ifremer.tutti.ui.swing.util.SwingValidatorMessageWidget
</import>
<TuttiUIContext id='model'
@@ -48,6 +50,14 @@
protected void $afterCompleteSetup() {
getHandler().afterInitUI();
}
+
+ public void registerValidator(SwingValidator validator) {
+ handler.registerValidator(validator);
+ }
+
+ public void clearValidators() {
+ handler.clearValidators();
+ }
]]></script>
@@ -90,6 +100,10 @@
</JMenu>
</JMenuBar>
+ <JToolBar id='bottomBar'>
+ <SwingValidatorMessageWidget id='validatorMessageWidget'/>
+ </JToolBar>
+
<JXTitledPanel id='body' constraints='BorderLayout.CENTER' decorator='boxed'/>
<!-- status message bar -->
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-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -45,10 +45,14 @@
import javax.swing.JComponent;
import java.awt.Desktop;
+import java.awt.Insets;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.net.URL;
import java.util.Calendar;
+import javax.swing.JToolBar;
+import jaxx.runtime.validator.swing.SwingValidator;
+import jaxx.runtime.validator.swing.SwingValidatorMessageWidget;
import static org.nuiton.i18n.I18n._;
@@ -94,6 +98,7 @@
}
}
});
+ ui.setContextValue(ui, MainUI.class.getName());
}
@Override
@@ -110,6 +115,9 @@
//SwingUtil.getLayer(ui.getBody()).setUI(new BetaLayerUI());
changeTitle();
+
+ JToolBar bar = ui.getBottomBar();
+ ui.getStatus().addWidget(bar, 0);
TuttiScreen screen;
@@ -271,6 +279,14 @@
ui.getStatus().setStatus(message);
}
+ public void registerValidator(SwingValidator validator) {
+ ui.getValidatorMessageWidget().registerValidator(validator);
+ }
+
+ public void clearValidators() {
+ ui.getValidatorMessageWidget().clearValidators();
+ }
+
//------------------------------------------------------------------------//
//-- Internal methods --//
//------------------------------------------------------------------------//
@@ -357,7 +373,7 @@
// validate catches
screenTitle = _("tutti.title.validate.operations", getSelectedCruiseTitle());
}
- screenUI = new FishingOperationsUI(context);
+ screenUI = new FishingOperationsUI(ui);
break;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-01-10 13:15:31 UTC (rev 164)
@@ -59,6 +59,7 @@
<script><![CDATA[
public EditFishingOperationUI(FishingOperationsUI parentUI) {
+ JAXXUtil.initContext(this, parentUI);
EditFishingOperationUIHandler handler = new EditFishingOperationUIHandler(parentUI, this);
setContextValue(handler);
handler.beforeInitUI();
@@ -361,7 +362,7 @@
<!-- Commentaire -->
<row weighty='0.3'>
- <cell columns='6'>
+ <cell columns='6' fill='both'>
<JScrollPane id='commentPane'
onFocusGained='commentField.requestFocus()'>
<JTextArea id='commentField'
@@ -372,21 +373,18 @@
</Table>
</tab>
- <tab id='traitGearShootingTab'
- title='tutti.label.tab.fishingOperation.gearShooting'>
+ <tab id='traitGearShootingTab'>
<GearShootingTabUI id='gearShootingTabContent'
constructorParams='this'/>
</tab>
- <tab id='environmentTab'
- title='tutti.label.tab.fishingOperation.environment'>
+ <tab id='environmentTab'>
<EnvironmentTabUI id='environmentTabContent' constructorParams='this'/>
</tab>
- <tab id='traitHydrologyTabContent'
- title='tutti.label.tab.fishingOperation.hydrology'>
+ <tab id='traitHydrologyTabContent'>
<HydrologyTabUI id='hydrologyTabContent' constructorParams='this'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -31,7 +31,9 @@
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
import fr.ifremer.tutti.service.PersistenceService;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
+import fr.ifremer.tutti.ui.swing.MainUI;
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.environment.EnvironmentTabUI;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.environment.EnvironmentTabUIModel;
@@ -56,6 +58,7 @@
import java.beans.VetoableChangeListener;
import java.util.List;
import javax.swing.DefaultSingleSelectionModel;
+import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.SingleSelectionModel;
import javax.swing.event.ChangeEvent;
@@ -179,7 +182,7 @@
@Override
public void afterInitUI() {
-
+
ui.getFishingOperationValidPanel().remove(
ui.getFishingOperationResetRadio());
@@ -239,7 +242,7 @@
changeValidatorContext(model.getValidationContext(), ui.getValidator());
listenValidatorValid(ui.getValidator(), model);
- JTabbedPane tabPanel = ui.getFishingOperationTabPane();
+ final JTabbedPane tabPanel = ui.getFishingOperationTabPane();
tabPanel.setTabComponentAt(0, new CustomTab(model));
listModelIsModify(model);
@@ -247,44 +250,60 @@
GearShootingTabUIModel gearShootingModel =
ui.getGearShootingTabContent().getModel();
gearShootingModel.setAvailableCaracteristics(persistenceService.getAllFishingOperationGearCaracteristic());
-// tabPanel.setTabComponentAt(1, new CustomTab(gearShootingModel));
+ tabPanel.setTabComponentAt(1, new CustomTab(gearShootingModel));
//init environment
EnvironmentTabUIModel environmentModel =
ui.getEnvironmentTabContent().getModel();
environmentModel.setAvailableCaracteristics(persistenceService.getAllFishingOperationEnvironmentCaracteristic());
-// tabPanel.setTabComponentAt(2, new CustomTab(environmentModel));
+ tabPanel.setTabComponentAt(2, new CustomTab(environmentModel));
//init hydrology
HydrologyTabUIModel hydrologyModel = ui.getHydrologyTabContent().getModel();
hydrologyModel.setAvailableCaracteristics(persistenceService.getAllFishingOperationHydrologicCaracteristic());
-// tabPanel.setTabComponentAt(3, new CustomTab(hydrologyModel));
+ tabPanel.setTabComponentAt(3, new CustomTab(hydrologyModel));
tabPanel.setModel(new DefaultSingleSelectionModel() {
@Override
public void setSelectedIndex(int index) {
- EditFishingOperationUIModel model = getModel();
-
- if (TuttiUIContext.VALIDATION_CONTEXT_EDIT.equals(model.getValidationContext())
- || model.isEmpty() || model.isValid()) {
- if (model.isModify()) {
- save();
+ int currentIndex = tabPanel.getSelectedIndex();
+ if (currentIndex < 0) {
+ super.setSelectedIndex(index);
+
+ } else {
+ CustomTab currentTab = (CustomTab) tabPanel.getTabComponentAt(currentIndex);
+ AbstractTuttiBeanUIModel model = currentTab.getModel();
+
+ if (TuttiUIContext.VALIDATION_CONTEXT_EDIT.equals(getModel().getValidationContext())
+ || model.isValid()) {
+ if (!model.isCreate() && model.isModify()) {
+ save();
+ }
+ super.setSelectedIndex(index);
}
- super.setSelectedIndex(index);
}
}
});
+
+ MainUI main = ui.getContextValue(MainUI.class, MainUI.class.getName());
+ main.clearValidators();
+ main.registerValidator(ui.getValidator());
+
}
-
+
+
@Override
public void onCloseUI() {
if (log.isInfoEnabled()) {
log.info("closing: " + ui);
}
-
+
+ MainUI main = ui.getContextValue(MainUI.class, MainUI.class.getName());
+ main.clearValidators();
+
closeUI(ui.getGearShootingTabContent());
closeUI(ui.getEnvironmentTabContent());
closeUI(ui.getHydrologyTabContent());
@@ -310,7 +329,6 @@
EditFishingOperationUIModel model = getModel();
if (empty) {
-
bean = new FishingOperation();
}
@@ -423,8 +441,8 @@
getModel().setModify(false);
// persist current fishingOperation
- persistenceService.saveFishingOperation(toSave);
- //parentUi.getHandler().saveFishingOperation(toSave);
+// persistenceService.saveFishingOperation(toSave);
+ parentUi.getHandler().saveFishingOperation(toSave);
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx 2013-01-10 13:15:31 UTC (rev 164)
@@ -27,6 +27,7 @@
<import>
fr.ifremer.tutti.persistence.entities.data.FishingOperation
+ fr.ifremer.tutti.ui.swing.TuttiUI
fr.ifremer.tutti.ui.swing.TuttiUIContext
fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI
@@ -36,8 +37,9 @@
</import>
<script><![CDATA[
-public FishingOperationsUI(TuttiUIContext context) {
- FishingOperationsUIHandler handler = new FishingOperationsUIHandler(context, this);
+public FishingOperationsUI(TuttiUI parentUI) {
+ JAXXUtil.initContext(this, parentUI);
+ FishingOperationsUIHandler handler = new FishingOperationsUIHandler(parentUI, this);
setContextValue(handler);
handler.beforeInitUI();
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -30,7 +30,8 @@
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
-import fr.ifremer.tutti.ui.swing.TuttiUIContext;
+import fr.ifremer.tutti.ui.swing.MainUI;
+import fr.ifremer.tutti.ui.swing.TuttiUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.logging.Log;
@@ -60,9 +61,9 @@
private final PersistenceService persistenceService;
- public FishingOperationsUIHandler(TuttiUIContext context,
+ public FishingOperationsUIHandler(TuttiUI parentUI,
FishingOperationsUI ui) {
- super(context);
+ super(parentUI.getHandler().getContext());
this.ui = ui;
persistenceService = context.getService(PersistenceService.class);
}
@@ -156,6 +157,9 @@
// when quitting ui, let's de-select fishingOperation (will save any changes)
selectFishingOperation(null);
+
+ closeUI(ui.getFishingOperationTabContent());
+ closeUI(ui.getCatchesTabContent());
}
@Override
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -35,7 +35,6 @@
import fr.ifremer.tutti.ui.swing.util.editor.CaracteristicValueEditor;
import fr.ifremer.tutti.ui.swing.util.editor.CaracteristicValueRenderer;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
-import fr.ifremer.tutti.ui.swing.util.table.CaracteristicRow;
import java.util.Collection;
import java.util.List;
import jaxx.runtime.swing.editor.bean.BeanComboBox;
@@ -94,6 +93,7 @@
Object oldValue,
Object newValue) {
recomputeRowValidState(row);
+ super.onRowModified(rowIndex, row, propertyName, oldValue, newValue);
}
@Override
@@ -117,6 +117,7 @@
// clear modified flag on the monitor
rowMonitor.clearModified();
+ getModel().setModify(false);
}
}
}
@@ -209,6 +210,10 @@
keyCombo.removeItem(selectedItem);
selectFirstInCombo(keyCombo);
+
+ EnvironmentTabUIModel model = getModel();
+ model.setModify(true);
+ model.setValid(row.isValid());
}
/** Resets the table with the data from the database */
@@ -244,6 +249,7 @@
ui.getNewRowKey().setData(caracteristicList);
selectFirstInCombo(ui.getNewRowKey());
+ model.setModify(false);
}
public void removeCaracteristic() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -43,6 +43,8 @@
private static final long serialVersionUID = 1L;
+ public static final String TITLE = "tutti.label.tab.fishingOperation.environment";
+
public static final String PROPERTY_REMOVE_CARACTERISTIC_ENABLED = "removeCaracteristicEnabled";
protected List<Caracteristic> availableCaracteristics;
@@ -70,6 +72,11 @@
public EnvironmentTabUIModel() {
super(FishingOperation.class, fromBeanBinder, toBeanBinder);
}
+
+ @Override
+ public String getTitle() {
+ return TITLE;
+ }
public List<Caracteristic> getAvailableCaracteristics() {
return availableCaracteristics;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -29,18 +29,12 @@
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUI;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
-import fr.ifremer.tutti.ui.swing.content.operation.fishing.environment.EnvironmentRowModel;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.editor.CaracteristicValueEditor;
import fr.ifremer.tutti.ui.swing.util.editor.CaracteristicValueRenderer;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
-import fr.ifremer.tutti.ui.swing.util.table.CaracteristicRow;
import jaxx.runtime.swing.editor.bean.BeanComboBox;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -48,7 +42,6 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import java.util.Collection;
-import java.util.Collections;
import java.util.List;
/**
@@ -101,6 +94,7 @@
Object oldValue,
Object newValue) {
recomputeRowValidState(row);
+ super.onRowModified(rowIndex, row, propertyName, oldValue, newValue);
}
@Override
@@ -125,6 +119,7 @@
// clear modified flag on the monitor
rowMonitor.clearModified();
+ getModel().setModify(false);
}
}
}
@@ -219,6 +214,10 @@
keyCombo.removeItem(selectedItem);
selectFirstInCombo(keyCombo);
+
+ GearShootingTabUIModel model = getModel();
+ model.setModify(true);
+ model.setValid(row.isValid());
}
/** Resets the table with the data from the database */
@@ -253,6 +252,7 @@
ui.getNewRowKey().setData(caracteristicList);
selectFirstInCombo(ui.getNewRowKey());
+ model.setModify(false);
}
public void removeCaracteristic() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIModel.java 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIModel.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -49,6 +49,8 @@
private static final Log log = LogFactory.getLog(GearShootingTabUIModel.class);
+ public static final String TITLE = "tutti.label.tab.fishingOperation.gearShooting";
+
public static final String PROPERTY_REMOVE_CARACTERISTIC_ENABLED = "removeCaracteristicEnabled";
protected List<Caracteristic> availableCaracteristics;
@@ -77,6 +79,11 @@
super(FishingOperation.class, fromBeanBinder, toBeanBinder);
}
+ @Override
+ public String getTitle() {
+ return TITLE;
+ }
+
public List<Caracteristic> getAvailableCaracteristics() {
return availableCaracteristics;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -32,15 +32,12 @@
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUI;
-import fr.ifremer.tutti.ui.swing.content.operation.fishing.environment.EnvironmentRowModel;
-import fr.ifremer.tutti.ui.swing.content.operation.fishing.gearshooting.GearShootingRowModel;
import fr.ifremer.tutti.ui.swing.util.HydrologicCaracteristicUtil;
import fr.ifremer.tutti.ui.swing.util.HydrologicCaracteristicUtil.Type;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.editor.CaracteristicValueEditor;
import fr.ifremer.tutti.ui.swing.util.editor.CaracteristicValueRenderer;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
-import fr.ifremer.tutti.ui.swing.util.table.CaracteristicRow;
import jaxx.runtime.swing.editor.bean.BeanComboBox;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -113,6 +110,7 @@
Object oldValue,
Object newValue) {
recomputeRowValidState(row);
+ super.onRowModified(rowIndex, row, propertyName, oldValue, newValue);
}
@Override
@@ -137,6 +135,7 @@
// clear modified flag on the monitor
rowMonitor.clearModified();
+ getModel().setModify(false);
}
}
}
@@ -267,6 +266,10 @@
keyCombo.removeItem(selectedItem);
selectFirstInCombo(keyCombo);
+
+ HydrologyTabUIModel model = getModel();
+ model.setModify(true);
+ model.setValid(row.isValid());
}
/** Resets the table with the data from the database */
@@ -311,6 +314,7 @@
ui.getNewRowKey().setData(caracteristicList);
selectFirstInCombo(ui.getNewRowKey());
+ model.setModify(false);
}
public void removeCaracteristic() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -44,6 +44,8 @@
private static final long serialVersionUID = 1L;
+ public static final String TITLE = "tutti.label.tab.fishingOperation.hydrology";
+
public static final String PROPERTY_REMOVE_CARACTERISTIC_ENABLED = "removeCaracteristicEnabled";
public static final String PROPERTY_AVAILABLE_CARACTERISTICS = "availableCaracteristics";
@@ -73,6 +75,11 @@
public HydrologyTabUIModel() {
super(FishingOperation.class, fromBeanBinder, toBeanBinder);
}
+
+ @Override
+ public String getTitle() {
+ return TITLE;
+ }
public List<Caracteristic> getAvailableCaracteristics() {
return availableCaracteristics;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -59,12 +59,10 @@
this.model.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_MODIFY, new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
- log.info(">>>>>>>> model modified ? evt " + evt.getNewValue());
- log.info(">>>>>>>> model modified ? model " + CustomTab.this.model.isModify());
Boolean modified = (Boolean) evt.getNewValue();
String title = _(CustomTab.this.model.getTitle());
if (modified) {
- title += "*";
+ title = "<html><strong>" + title + "*</strong></html>";
}
CustomTab.this.title.setText(title);
}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/SwingValidatorMessageWidget.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/SwingValidatorMessageWidget.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/SwingValidatorMessageWidget.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -0,0 +1,109 @@
+
+package fr.ifremer.tutti.ui.swing.util;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import javax.swing.AbstractAction;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.JRootPane;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JToggleButton;
+import javax.swing.KeyStroke;
+import javax.swing.ListSelectionModel;
+import jaxx.runtime.SwingUtil;
+import jaxx.runtime.validator.swing.SwingValidator;
+import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel;
+import jaxx.runtime.validator.swing.SwingValidatorMessageTableRenderer;
+import jaxx.runtime.validator.swing.SwingValidatorUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Button which opens a popup containing a table with the errors found
+ * by registered validators.
+ *
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 2.5.10
+ */
+public class SwingValidatorMessageWidget extends JToggleButton {
+
+ private static final Log log = LogFactory.getLog(SwingValidatorMessageWidget.class);
+
+ protected SwingValidatorMessageTableModel errorTableModel = new SwingValidatorMessageTableModel();
+
+ protected JDialog popup = new JDialog();
+
+ protected JTable errorTable = new JTable();
+
+ public SwingValidatorMessageWidget() {
+ super(SwingUtil.createActionIcon("table-error"));
+
+ errorTable.setModel(errorTableModel);
+ errorTable.setRowSelectionAllowed(true);
+ errorTable.setAutoCreateRowSorter(true);
+ errorTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
+ errorTable.setCellSelectionEnabled(false);
+ errorTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ errorTable.setFillsViewportHeight(true);
+
+ SwingValidatorUtil.installUI(errorTable,
+ new SwingValidatorMessageTableRenderer());
+
+ JScrollPane scrollPanel = new JScrollPane(errorTable);
+ scrollPanel.setColumnHeaderView(errorTable.getTableHeader());
+ popup.add(scrollPanel);
+ popup.setSize(800, 300);
+
+ addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if(isSelected()) {
+ popup.setVisible(true);
+ } else {
+ popup.dispose();
+ }
+ }
+ });
+ popup.addWindowListener(new WindowAdapter() {
+
+ @Override
+ public void windowClosing(WindowEvent e) {
+ setSelected(false);
+ }
+
+ });
+
+ // add a auto-close action
+ JRootPane rootPane = popup.getRootPane();
+
+ KeyStroke shortcutClosePopup = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
+
+ rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
+ shortcutClosePopup, "close");
+ rootPane.getActionMap().put("close", new AbstractAction() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ popup.dispose();
+ setSelected(false);
+ }
+ });
+ }
+
+ public void registerValidator(SwingValidator validator) {
+ errorTableModel.registerValidator(validator);
+ }
+
+ public void clearValidators() {
+ errorTableModel.clearValidators();
+ errorTableModel.clear();
+ }
+
+}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CaracteristicValueEditor.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CaracteristicValueEditor.java 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CaracteristicValueEditor.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -46,6 +46,8 @@
import java.awt.Color;
import java.awt.Component;
import java.util.List;
+import javax.swing.event.CellEditorListener;
+import javax.swing.event.ChangeEvent;
/**
* Editor for the values of the caracteristics of the fishing operations.
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-01-10 09:10:19 UTC (rev 163)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-01-10 13:15:31 UTC (rev 164)
@@ -121,11 +121,13 @@
* @param newValue new value of the modified property
* @since 0.3
*/
- protected abstract void onRowModified(int rowIndex,
+ protected void onRowModified(int rowIndex,
R row,
String propertyName,
Object oldValue,
- Object newValue);
+ Object newValue) {
+ getModel().setModify(true);
+ }
/**
* Given the row monitor and his monitored row, try to save it if required.
@@ -617,6 +619,7 @@
// apply it to row
row.setValid(valid);
+ getModel().setValid(valid);
}
//------------------------------------------------------------------------//
1
0
r163 - in trunk: . tutti-persistence/src/main/xmi tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence tutti-persistence-adagio/src/main/resources tutti-persistence-adagio/src/test tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence
by tchemit@users.forge.codelutin.com 10 Jan '13
by tchemit@users.forge.codelutin.com 10 Jan '13
10 Jan '13
Author: tchemit
Date: 2013-01-10 10:10:19 +0100 (Thu, 10 Jan 2013)
New Revision: 163
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/163
Log:
refs #1807: [Persistence] Adagio r?\195?\169f?\195?\169rentiel
refs #1809: [Persistence] Adagio Donn?\195?\169es th?\195?\169matiques
Added:
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/AccidentalBatchTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BenthosBatchTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/FishingOperationTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/MacroWasteBatchTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/PlanktonBatchTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProtocolTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/SpeciesBatchTest.java
Removed:
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramDaoTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java
Modified:
trunk/pom.xml
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java
trunk/tutti-persistence-adagio/src/test/server.properties
trunk/tutti-persistence-adagio/src/test/startServer.sh
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-09 20:38:38 UTC (rev 162)
+++ trunk/pom.xml 2013-01-10 09:10:19 UTC (rev 163)
@@ -124,7 +124,7 @@
<h2Version>1.3.168</h2Version>
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
- <jaxxVersion>2.5.9</jaxxVersion>
+ <jaxxVersion>2.5.10-SNAPSHOT</jaxxVersion>
<swingXVersion>1.6.4</swingXVersion>
<xworkVersion>2.3.7</xworkVersion>
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-09 20:38:38 UTC (rev 162)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -26,6 +26,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+import fr.ifremer.adagio.core.dao.administration.programStrategy.ProgramDao;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
@@ -53,9 +54,11 @@
import org.hibernate.SessionFactory;
import org.hibernate.type.DateType;
import org.hibernate.type.IntegerType;
+import org.hibernate.type.StringType;
import org.hibernate.type.Type;
import org.springframework.transaction.annotation.Transactional;
+import javax.annotation.Resource;
import java.io.IOException;
import java.util.Date;
import java.util.Iterator;
@@ -81,6 +84,9 @@
*/
protected SessionFactory sessionFactory;
+ @Resource(name = "programDao")
+ protected ProgramDao programDao;
+
protected Properties enumerations;
public void setSessionFactory(SessionFactory sessionFactory) {
@@ -454,12 +460,48 @@
@Override
public List<Program> getAllProgram() {
- throw new UnsupportedOperationException();
+ Iterator<Object[]> list = queryList("allPrograms");
+
+ List<Program> result = Lists.newArrayList();
+ while (list.hasNext()) {
+ Object[] source = list.next();
+ Program target = new Program();
+ target.setId((String) source[0]);
+ target.setName((String) source[1]);
+ result.add(target);
+ }
+ return result;
}
@Override
public Program getProgram(String id) {
- throw new UnsupportedOperationException();
+ Object[] source = queryUnique(
+ "program",
+ "programCode", StringType.INSTANCE, id);
+
+ Program result = new Program();
+ result.setId((String) source[0]);
+ result.setName((String) source[1]);
+
+ // get program locations
+ Iterator<Object[]> list = queryList(
+ "allProgramLocations",
+ "programCode", StringType.INSTANCE, id);
+
+ List<Zone> zones = Lists.newArrayList();
+ while (list.hasNext()) {
+ Object[] zoneSource = list.next();
+ Zone target = new Zone();
+ target.setId(String.valueOf(zoneSource[0]));
+ target.setLabel((String) zoneSource[1]);
+ target.setName((String) zoneSource[2]);
+ zones.add(target);
+ }
+ if (!zones.isEmpty()) {
+ result.setZone(zones.get(0));
+ }
+
+ return result;
}
@Override
@@ -478,12 +520,50 @@
@Override
public List<Cruise> getAllCruise(String programId) {
- throw new UnsupportedOperationException();
+ Iterator<Object[]> list = queryList(
+ "allCruises",
+ "programCode", StringType.INSTANCE, programId);
+
+ List<Cruise> result = Lists.newArrayList();
+ while (list.hasNext()) {
+ Object[] source = list.next();
+ Cruise target = new Cruise();
+ target.setId((String) source[0]);
+ target.setName((String) source[1]);
+ target.setBeginDate((Date) source[2]);
+ result.add(target);
+ }
+ return result;
}
@Override
public Cruise getCruise(String id) {
- throw new UnsupportedOperationException();
+ Object[] source = queryUnique(
+ "cruise",
+ "cruiseId", StringType.INSTANCE, id);
+
+ Cruise result = new Cruise();
+ result.setId((String) source[0]);
+ result.setName((String) source[1]);
+
+ // get secondary gears
+ Iterator<Object[]> list = queryList(
+ "allCruiseSecondaryGears",
+ "cruiseId", StringType.INSTANCE, id);
+
+ List<Gear> gears = Lists.newArrayList();
+ while (list.hasNext()) {
+ Object[] zoneSource = list.next();
+ Gear target = new Gear();
+ target.setId((String) zoneSource[0]);
+ target.setLabel((String) zoneSource[1]);
+ target.setName((String) zoneSource[2]);
+ gears.add(target);
+ }
+ result.setGear(gears);
+
+
+ return result;
}
@Override
Modified: trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-09 20:38:38 UTC (rev 162)
+++ trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-10 09:10:19 UTC (rev 163)
@@ -31,6 +31,87 @@
<!--TODO Create fetch profile to avoid eager loading -->
<!--</fetch-profile>-->
+ <!-- Get all programs (to list with no detail) [DAT-01] -->
+ <query cacheable="true" name="allPrograms">
+ <![CDATA[
+ SELECT
+ p.code,
+ p.name
+ FROM ProgramImpl p
+ WHERE p.code LIKE 'CAM-%'
+ ]]>
+ </query>
+
+ <!-- Get all cruises for a given program (to list with no detail) [DAT-02] -->
+ <query cacheable="true" name="allCruises">
+ <![CDATA[
+ SELECT
+ c.id,
+ c.name,
+ c.departureDateTime
+ FROM ScientificCruiseImpl c
+ WHERE c.program.code = :programCode
+ ORDER BY c.departureDateTime desc
+ ]]>
+ <query-param name="programCode" type="java.lang.String"/>
+ </query>
+
+ <!-- Get a detail program [DAT-03] -->
+ <query cacheable="true" name="program">
+ <![CDATA[
+ SELECT
+ p.code,
+ p.name,
+ p.description
+ FROM ProgramImpl p
+ WHERE p.code = :programCode
+ ]]>
+ <query-param name="programCode" type="java.lang.String"/>
+ </query>
+
+ <!-- Get a program locations [DAT-03-1] -->
+ <query cacheable="true" name="allProgramLocations">
+ <![CDATA[
+ SELECT
+ l.id,
+ l.label,
+ l.name
+ FROM ProgramImpl p
+ LEFT OUTER JOIN p.locations l
+ WHERE p.code = :programCode
+ ]]>
+ <query-param name="programCode" type="java.lang.String"/>
+ </query>
+
+ <!-- Get a detail cruise [DAT-04] -->
+ <query cacheable="true" name="cruise">
+ <![CDATA[
+ select
+ sc.program.code as programCode,
+ year(sc.departureDateTime) as year,
+ -- partialSerie - pas stockée sous H2 ??
+ sc.name,
+ lh.locationHierarchyPk.parent.label as countryLabel,
+ lh.locationHierarchyPk.parent.name as countryName,
+ sc.departureDateTime,
+ sc.returnDateTime,
+ sc.vessel.code as vesselCode,
+ mp.lastname as managerLastname,
+ mp.firstname as managerFirstName,
+ coalesce(sc.comments, ft.comments) as comments
+from
+ ScientificCruiseImpl sc
+ left outer join sc.fishingTrips ft
+ left outer join sc.managerPerson mp,
+ LocationHierarchyImpl lh
+where 1=1
+ and sc.id = 100000 -- :scientificCruiseId
+ and lh.locationHierarchyPk.location.id = ft.departureLocation.id
+ and lh.locationHierarchyPk.parent.locationLevel.id = 21 -- locationLevel=Pays ISO 3
+ ]]>
+ <query-param name="programCode" type="java.lang.String"/>
+ </query>
+
<!-- Get all program zones [REF-01] -->
<query cacheable="true" name="allProgramZones">
<![CDATA[
Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/AccidentalBatchTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/AccidentalBatchTest.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/AccidentalBatchTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -0,0 +1,67 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $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.Program;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * To test operations around {@link Program}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+@Ignore
+public class AccidentalBatchTest {
+
+ @ClassRule
+ public static final DatabaseResource dbResource = new DatabaseResource();
+
+ @Test
+ public void getAllAccidentalBatch(/*String fishingOperationId*/) {
+
+ }
+
+ @Test
+ public void getAccidentalBatch(/*String id*/) {
+
+ }
+
+ @Test
+ public void createAccidentalBatch(/*AccidentalBatch bean*/) {
+
+ }
+
+ @Test
+ public void saveAccidentalBatch(/*AccidentalBatch bean*/) {
+
+ }
+
+ @Test
+ public void deleteAccidentalBatch(/*String id*/) {
+ }
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/AccidentalBatchTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java 2013-01-09 20:38:38 UTC (rev 162)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -1,112 +0,0 @@
-package fr.ifremer.tutti.persistence;
-
-/*
- * #%L
- * Tutti :: Persistence Adagio (impl)
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import fr.ifremer.tutti.persistence.config.TuttiPersistenceAdagioConfig;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hibernate.SessionFactory;
-import org.hibernate.classic.Session;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.springframework.context.ApplicationContext;
-
-//(a)RunWith(SpringJUnit4ClassRunner.class)
-// Skip bean definition for services, in the Spring context for DAO unit testing
-// This is need to increase test execution
-//@ContextConfiguration(locations = {"classpath:applicationContext-conf.xml",
-// "classpath:applicationContext-dataSource-local.xml",
-// "classpath:applicationContext-entities.xml"})
-//@TransactionConfiguration(transactionManager = "transactionManager")
-//@Transactional
-public abstract class BaseDaoTest {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(BaseDaoTest.class);
-
- // @Resource
- private SessionFactory sessionFactory;
-
- private Session session;
-
- @Rule
- public TestName name = new TestName();
-
- protected TuttiPersistenceAdagioConfig config;
-
- @BeforeClass
- public static void beforeClass() {
-
- TestUtil.checkDbExists();
- }
-
- @Before
- public void setUp() throws Exception {
-
- config = TestUtil.createConfig(getClass(), name.getMethodName());
-
- if (log.isDebugEnabled()) {
- log.debug("Use conf.properties at " + config.getDbConfigurationPath());
- }
-
- ApplicationContext context = TestUtil.createSpringContext();
-
- sessionFactory = (SessionFactory) context.getBean("sessionFactory");
- }
-
- @After
- public void tearDown() throws Exception {
-
- TestUtil.resetClassLoader();
-
- // close hibernate session if was used
- try {
- if (session != null) {
- session.close();
- }
- } finally {
-
- // close session factory
- sessionFactory.close();
- }
-
- }
-
- protected Session getSession() {
- if (session == null) {
- session = sessionFactory.openSession();
- }
- return session;
- }
-
- protected SessionFactory getSessionFactory() {
- return sessionFactory;
- }
-
-
-}
Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BenthosBatchTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BenthosBatchTest.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BenthosBatchTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -0,0 +1,67 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $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.Program;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * To test operations around {@link Program}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+@Ignore
+public class BenthosBatchTest {
+
+ @ClassRule
+ public static final DatabaseResource dbResource = new DatabaseResource();
+
+ @Test
+ public void getAllBenthosBatch(/*String fishingOperationId*/) {
+
+ }
+
+ @Test
+ public void getBenthosBatch(/*String id*/) {
+
+ }
+
+ @Test
+ public void createBenthosBatch(/*BenthosBatch bean*/) {
+
+ }
+
+ @Test
+ public void saveBenthosBatch(/*BenthosBatch bean*/) {
+
+ }
+
+ @Test
+ public void deleteBenthosBatch(/*String id*/) {
+ }
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BenthosBatchTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -0,0 +1,63 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $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.Program;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * To test operations around {@link Program}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+@Ignore
+public class CruiseTest {
+
+ @ClassRule
+ public static final DatabaseResource dbResource = new DatabaseResource();
+
+ @Test
+ public void getAllCruise(/*String programId*/) {
+
+ }
+
+ @Test
+ public void getCruise(/*String id*/) {
+
+ }
+
+ @Test
+ public void createCruise(/*Cruise bean*/) {
+
+ }
+
+ @Test
+ public void saveCruise(/*Cruise bean*/) {
+
+ }
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -0,0 +1,190 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $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.TuttiPersistenceAdagioConfig;
+import fr.ifremer.tutti.persistence.config.TuttiPersistenceAdagioConfigOption;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.Assume;
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.ArgumentsParserException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * To box the persistence service as a test resource.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class DatabaseResource implements TestRule {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(DatabaseResource.class);
+
+ public static long BUILD_TIMESTAMP = System.nanoTime();
+
+ private static ClassLoader oldClassLoader;
+
+ protected TuttiPersistenceAdagioConfig config;
+
+ protected TuttiPersistence driver;
+
+ public TuttiPersistenceAdagioConfig getConfig() {
+ return config;
+ }
+
+ public TuttiPersistence getDriver() {
+ return driver;
+ }
+
+ @Override
+ public Statement apply(final Statement base, final Description description) {
+
+ return new Statement() {
+ @Override
+ public void evaluate() throws Throwable {
+ before(description);
+ try {
+ base.evaluate();
+ } finally {
+ after(description);
+ }
+ }
+ };
+ }
+
+ protected void before(Description description) throws Throwable {
+ Class<?> testClass = description.getTestClass();
+
+ File db = new File("src/test/db");
+ if (!db.exists()) {
+
+ if (log.isWarnEnabled()) {
+ log.warn("Could not find db at " + db + ", test [" +
+ testClass + "] is skipped.");
+ }
+ Assume.assumeTrue(false);
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("Prepare test " + testClass);
+ }
+
+ config = createConfig(testClass, "");
+
+ if (log.isDebugEnabled()) {
+ log.debug("Use conf.properties at " + config.getDbConfigurationPath());
+ }
+ ApplicationContext context = new ClassPathXmlApplicationContext(
+ "applicationContext-conf.xml",
+ "applicationContext-dataSource-local.xml",
+ "applicationContext-entities.xml",
+ "applicationContext-service-tutti.xml");
+
+ driver = (TuttiPersistence) context.getBean("adagioPersistenceService");
+
+ driver.setEnumerations(config.getDbEnumerations());
+
+ driver.open();
+ }
+
+ protected void after(Description description) throws IOException {
+ Class<?> testClass = description.getTestClass();
+ if (log.isInfoEnabled()) {
+ log.info("After test " + testClass);
+ }
+ // push back old classLoader
+ if (oldClassLoader != null) {
+ Thread.currentThread().setContextClassLoader(oldClassLoader);
+ }
+
+ // close hibernate session if was used
+ if (driver != null) {
+ driver.close();
+ }
+ }
+
+
+ public static TuttiPersistenceAdagioConfig createConfig(Class<?> testClass,
+ String name) throws ArgumentsParserException, IOException {
+
+ File resourceDirectory = getTestSpecificDirectory(testClass, name);
+
+ RessourceClassLoader loader =
+ new RessourceClassLoader(testClass.getClassLoader());
+
+ oldClassLoader = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(loader);
+
+ ApplicationConfig applicationConfig =
+ new ApplicationConfig("tutti-test.properties");
+ applicationConfig.loadDefaultOptions(
+ TuttiPersistenceAdagioConfigOption.values());
+ applicationConfig.setDefaultOption("tutti.data.directory",
+ resourceDirectory.getAbsolutePath());
+ applicationConfig.parse();
+
+ TuttiPersistenceAdagioConfig result =
+ new TuttiPersistenceAdagioConfig(applicationConfig);
+
+ result.initConfig(loader);
+ return result;
+ }
+
+ public static File getTestSpecificDirectory(Class<?> testClass,
+ String name) throws IOException {
+ // Trying to look for the temporary folder to store data for the test
+ String tempDirPath = System.getProperty("java.io.tmpdir");
+ if (tempDirPath == null) {
+ // can this really occur ?
+ tempDirPath = "";
+ if (log.isWarnEnabled()) {
+ log.warn("'\"java.io.tmpdir\" not defined");
+ }
+ }
+ File tempDirFile = new File(tempDirPath);
+
+ // create the directory to store database data
+ String dataBasePath = testClass.getName()
+ + File.separator // a directory with the test class name
+ + name // a sub-directory with the method name
+ + '_'
+ + BUILD_TIMESTAMP; // and a timestamp
+ File databaseFile = new File(tempDirFile, dataBasePath);
+ FileUtils.forceMkdir(databaseFile);
+
+ return databaseFile;
+ }
+
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/FishingOperationTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/FishingOperationTest.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/FishingOperationTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -0,0 +1,63 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $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.FishingOperation;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * To test operations around {@link FishingOperation}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+@Ignore
+public class FishingOperationTest {
+
+ @ClassRule
+ public static final DatabaseResource dbResource = new DatabaseResource();
+
+ @Test
+ public void getAllFishingOperation(/*String cruiseId*/) {
+
+ }
+
+ @Test
+ public void getFishingOperation(/*String id*/) {
+
+ }
+
+ @Test
+ public void createFishingOperation(/*FishingOperation bean*/) {
+
+ }
+
+ @Test
+ public void saveFishingOperation(/*FishingOperation bean*/) {
+
+ }
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/FishingOperationTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/MacroWasteBatchTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/MacroWasteBatchTest.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/MacroWasteBatchTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -0,0 +1,67 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $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.Program;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * To test operations around {@link Program}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+@Ignore
+public class MacroWasteBatchTest {
+
+ @ClassRule
+ public static final DatabaseResource dbResource = new DatabaseResource();
+
+ @Test
+ public void getAllMacroWasteBatch(/*String fishingOperationId*/) {
+
+ }
+
+ @Test
+ public void getMacroWasteBatch(/*String id*/) {
+
+ }
+
+ @Test
+ public void createMacroWasteBatch(/*MacroWasteBatch bean*/) {
+
+ }
+
+ @Test
+ public void saveMacroWasteBatch(/*MacroWasteBatch bean*/) {
+
+ }
+
+ @Test
+ public void deleteMacroWasteBatch(/*String id*/) {
+ }
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/MacroWasteBatchTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/PlanktonBatchTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/PlanktonBatchTest.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/PlanktonBatchTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -0,0 +1,67 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $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.Program;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * To test operations around {@link Program}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+@Ignore
+public class PlanktonBatchTest {
+
+ @ClassRule
+ public static final DatabaseResource dbResource = new DatabaseResource();
+
+ @Test
+ public void getAllPlanktonBatch(/*String fishingOperationId*/) {
+
+ }
+
+ @Test
+ public void getPlanktonBatch(/*String id*/) {
+
+ }
+
+ @Test
+ public void createPlanktonBatch(/*PlanktonBatch bean*/) {
+
+ }
+
+ @Test
+ public void savePlanktonBatch(/*PlanktonBatch bean*/) {
+
+ }
+
+ @Test
+ public void deletePlanktonBatch(/*String id*/) {
+ }
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/PlanktonBatchTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramDaoTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramDaoTest.java 2013-01-09 20:38:38 UTC (rev 162)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramDaoTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -1,67 +0,0 @@
-package fr.ifremer.tutti.persistence;
-
-/*
- * #%L
- * Tutti :: Persistence Adagio (impl)
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import fr.ifremer.adagio.core.dao.administration.programStrategy.Program;
-import fr.ifremer.adagio.core.dao.administration.programStrategy.ProgramDao;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hibernate.Query;
-import org.hibernate.classic.Session;
-import org.junit.Assert;
-import org.junit.Test;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-
-public class ProgramDaoTest extends BaseDaoTest {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(ProgramDaoTest.class);
-
- @Resource(name = "programDao")
- private ProgramDao dao;
-
- @Test
- public void getAllProgramFromHibernate() {
- Session sess = getSession();
- Query query = sess.createQuery("from ProgramImpl");
- List actual = query.list();
- Assert.assertNotNull(actual);
-
- if (log.isInfoEnabled()) {
- log.info("Nb program: " + actual.size());
- }
- }
-
- public void getProgram() {
- String programCode = "OTB";
- Program actual = dao.load(programCode);
- Assert.assertNotNull(actual);
- Assert.assertEquals(programCode, actual.getCode());
- }
-
-}
Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -0,0 +1,75 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $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.Program;
+import org.junit.Assert;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.List;
+
+/**
+ * To test operations around {@link Program}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class ProgramTest {
+
+ @ClassRule
+ public static final DatabaseResource dbResource = new DatabaseResource();
+
+ @Test
+ public void getAllProgram() {
+ List<Program> result = dbResource.getDriver().getAllProgram();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(1, result.size());
+ }
+
+ @Test
+ public void getProgram(/*String id*/) {
+ String programCode = "CAM-CGFS";
+ Program actual = dbResource.getDriver().getProgram(programCode);
+ Assert.assertNotNull(actual);
+ Assert.assertNotNull(actual.getId());
+ Assert.assertNotNull(actual.getName());
+ Assert.assertNotNull(actual.getZone());
+ Assert.assertEquals(programCode, actual.getId());
+ }
+
+ @Test
+ @Ignore
+ public void createProgram(/*Program bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void saveProgram(/*Program bean*/) {
+
+ }
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProtocolTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProtocolTest.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProtocolTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -0,0 +1,63 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $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.protocol.TuttiProtocol;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * To test operations around {@link TuttiProtocol}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+@Ignore
+public class ProtocolTest {
+
+ @ClassRule
+ public static final DatabaseResource dbResource = new DatabaseResource();
+
+ @Test
+ public void getAllProtocol() {
+
+ }
+
+ @Test
+ public void getProtocol(/*String id*/) {
+
+ }
+
+ @Test
+ public void createProtocol(/*TuttiProtocol bean*/) {
+
+ }
+
+ @Test
+ public void saveProtocol(/*TuttiProtocol bean*/) {
+
+ }
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProtocolTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java 2013-01-09 20:38:38 UTC (rev 162)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.persistence;
-import fr.ifremer.tutti.persistence.config.TuttiPersistenceAdagioConfig;
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $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.Program;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Country;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
@@ -8,17 +32,11 @@
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 org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.AfterClass;
import org.junit.Assert;
-import org.junit.BeforeClass;
+import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
-import org.nuiton.util.ArgumentsParserException;
-import org.springframework.context.ApplicationContext;
-import java.io.IOException;
import java.util.List;
/**
@@ -29,61 +47,28 @@
*/
public class ReferentialTest {
- /** Logger. */
- private static final Log log = LogFactory.getLog(ReferentialTest.class);
+ @ClassRule
+ public static final DatabaseResource dbResource = new DatabaseResource();
- protected static TuttiPersistenceAdagioConfig config;
- protected static TuttiPersistence driver;
- @BeforeClass
- public static void beforeClass() throws IOException, ArgumentsParserException {
-
- TestUtil.checkDbExists();
-
- config = TestUtil.createConfig(ReferentialTest.class, "");
-
- if (log.isDebugEnabled()) {
- log.debug("Use conf.properties at " + config.getDbConfigurationPath());
- }
- ApplicationContext context = TestUtil.createSpringContext();
-
- driver = (TuttiPersistence) context.getBean("adagioPersistenceService");
-
- driver.setEnumerations(config.getDbEnumerations());
-
- driver.open();
- }
-
- @AfterClass
- public static void afterClass() throws Exception {
-
- // push back old classLoader
- TestUtil.resetClassLoader();
-
- // close hibernate session if was used
- if (driver != null) {
- driver.close();
- }
- }
-
@Test
public void getAllProgramZone() {
- List<Zone> result = driver.getAllProgramZone();
+ List<Zone> result = dbResource.getDriver().getAllProgramZone();
Assert.assertNotNull(result);
Assert.assertEquals(0, result.size());
}
@Test
public void getAllCountry() {
- List<Country> result = driver.getAllCountry();
+ List<Country> result = dbResource.getDriver().getAllCountry();
Assert.assertNotNull(result);
Assert.assertEquals(240, result.size());
}
@Test
public void getAllScientificVessel() {
- List<Vessel> result = driver.getAllScientificVessel();
+ List<Vessel> result = dbResource.getDriver().getAllScientificVessel();
Assert.assertNotNull(result);
Assert.assertEquals(1, result.size());
}
@@ -92,28 +77,28 @@
@Test
@Ignore
public void getAllFishingVessel() {
- List<Vessel> result = driver.getAllFishingVessel();
+ List<Vessel> result = dbResource.getDriver().getAllFishingVessel();
Assert.assertNotNull(result);
Assert.assertEquals(187, result.size());
}
@Test
public void getAllScientificGear() {
- List<Gear> result = driver.getAllScientificGear();
+ List<Gear> result = dbResource.getDriver().getAllScientificGear();
Assert.assertNotNull(result);
Assert.assertEquals(2, result.size());
}
@Test
public void getAllFishingGear() {
- List<Gear> result = driver.getAllFishingGear();
+ List<Gear> result = dbResource.getDriver().getAllFishingGear();
Assert.assertNotNull(result);
Assert.assertEquals(75, result.size());
}
@Test
public void getAllPerson() {
- List<Person> result = driver.getAllPerson();
+ List<Person> result = dbResource.getDriver().getAllPerson();
Assert.assertNotNull(result);
Assert.assertEquals(226, result.size());
}
@@ -121,21 +106,21 @@
@Test
public void getAllSpecies() {
- List<Species> result = driver.getAllSpecies();
+ List<Species> result = dbResource.getDriver().getAllSpecies();
Assert.assertNotNull(result);
Assert.assertEquals(156, result.size());
}
@Test
public void getAllBenthosSpecies() {
- List<Species> result = driver.getAllBenthosSpecies();
+ List<Species> result = dbResource.getDriver().getAllBenthosSpecies();
Assert.assertNotNull(result);
Assert.assertEquals(156, result.size());
}
@Test
public void getAllPlanktonSpecies() {
- List<Species> result = driver.getAllPlanktonSpecies();
+ List<Species> result = dbResource.getDriver().getAllPlanktonSpecies();
Assert.assertNotNull(result);
Assert.assertEquals(156, result.size());
}
@@ -158,35 +143,35 @@
@Test
public void getAllFishingOperationEnvironmentCaracteristic() {
- List<Caracteristic> result = driver.getAllFishingOperationEnvironmentCaracteristic();
+ List<Caracteristic> result = dbResource.getDriver().getAllFishingOperationEnvironmentCaracteristic();
Assert.assertNotNull(result);
Assert.assertEquals(40, result.size());
}
@Test
public void getAllFishingOperationGearCaracteristic() {
- List<Caracteristic> result = driver.getAllFishingOperationGearCaracteristic();
+ List<Caracteristic> result = dbResource.getDriver().getAllFishingOperationGearCaracteristic();
Assert.assertNotNull(result);
Assert.assertEquals(155, result.size());
}
@Test
public void getAllFishingOperationHydrologicCaracteristic() {
- List<Caracteristic> result = driver.getAllFishingOperationHydrologicCaracteristic();
+ List<Caracteristic> result = dbResource.getDriver().getAllFishingOperationHydrologicCaracteristic();
Assert.assertNotNull(result);
Assert.assertEquals(40, result.size());
}
@Test
public void getAllSpeciesLengthStepCaracteristic() {
- List<Caracteristic> result = driver.getAllSpeciesLengthStepCaracteristic();
+ List<Caracteristic> result = dbResource.getDriver().getAllSpeciesLengthStepCaracteristic();
Assert.assertNotNull(result);
Assert.assertEquals(0, result.size());
}
@Test
public void getSizeCategoryCaracteristic() {
- Caracteristic result = driver.getSizeCategoryCaracteristic();
+ Caracteristic result = dbResource.getDriver().getSizeCategoryCaracteristic();
Assert.assertNotNull(result);
Assert.assertTrue(result.isQualitativeType());
Assert.assertNotNull(result.getQualitativeValue());
@@ -195,7 +180,7 @@
@Test
public void getSexCaracteristic() {
- Caracteristic result = driver.getSexCaracteristic();
+ Caracteristic result = dbResource.getDriver().getSexCaracteristic();
Assert.assertNotNull(result);
Assert.assertTrue(result.isQualitativeType());
Assert.assertNotNull(result.getQualitativeValue());
@@ -204,7 +189,7 @@
@Test
public void getSortedUnsortedCaracteristic() {
- Caracteristic result = driver.getSortedUnsortedCaracteristic();
+ Caracteristic result = dbResource.getDriver().getSortedUnsortedCaracteristic();
Assert.assertNotNull(result);
Assert.assertTrue(result.isQualitativeType());
Assert.assertNotNull(result.getQualitativeValue());
@@ -213,7 +198,7 @@
@Test
public void getMaturityCaracteristic() {
- Caracteristic result = driver.getMaturityCaracteristic();
+ Caracteristic result = dbResource.getDriver().getMaturityCaracteristic();
Assert.assertNotNull(result);
Assert.assertTrue(result.isQualitativeType());
Assert.assertNotNull(result.getQualitativeValue());
@@ -222,7 +207,7 @@
@Test
public void getMacroWasteCategoryCaracteristic() {
- Caracteristic result = driver.getMacroWasteCategoryCaracteristic();
+ Caracteristic result = dbResource.getDriver().getMacroWasteCategoryCaracteristic();
Assert.assertNotNull(result);
Assert.assertTrue(result.isQualitativeType());
Assert.assertNotNull(result.getQualitativeValue());
@@ -231,7 +216,7 @@
@Test
public void getMacroWasteSizeCategoryCaracteristic() {
- Caracteristic result = driver.getMacroWasteSizeCategoryCaracteristic();
+ Caracteristic result = dbResource.getDriver().getMacroWasteSizeCategoryCaracteristic();
Assert.assertNotNull(result);
Assert.assertTrue(result.isQualitativeType());
Assert.assertNotNull(result.getQualitativeValue());
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/SpeciesBatchTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/SpeciesBatchTest.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/SpeciesBatchTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -0,0 +1,82 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $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.Program;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * To test operations around {@link SpeciesBatch}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+@Ignore
+public class SpeciesBatchTest {
+
+ @ClassRule
+ public static final DatabaseResource dbResource = new DatabaseResource();
+
+ @Test
+ public void getAllRootSpeciesBatch(/*String fishingOperationId*/) {
+
+ }
+
+ @Test
+ public void getAllSpeciesBatch(/*String fishingOperationId*/) {
+
+ }
+
+ @Test
+ public void getSpeciesBatch(/*String id*/) {
+
+ }
+
+ @Test
+ public void createSpeciesBatch(/*SpeciesBatch bean, String parentBatchId*/) {
+
+ }
+
+ @Test
+ public void saveSpeciesBatch(/*SpeciesBatch bean*/) {
+
+ }
+
+ @Test
+ public void deleteSpeciesBatch(/*String id*/) {
+ }
+
+ @Test
+ public void deleteSpeciesSubBatch(/*String id*/) {
+ }
+
+ @Test
+ public void getAllSpeciesBatchFrequency(/*String speciesBatchId*/) {
+
+ }
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/SpeciesBatchTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java 2013-01-09 20:38:38 UTC (rev 162)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -1,136 +0,0 @@
-package fr.ifremer.tutti.persistence;
-
-/*
- * #%L
- * Tutti :: Persistence Adagio (impl)
- * $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.TuttiPersistenceAdagioConfig;
-import fr.ifremer.tutti.persistence.config.TuttiPersistenceAdagioConfigOption;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Assume;
-import org.nuiton.util.ApplicationConfig;
-import org.nuiton.util.ArgumentsParserException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * TODO
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public final class TestUtil {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(TestUtil.class);
-
- public static long BUILD_TIMESTAMP = System.nanoTime();
-
- private static ClassLoader oldClassLoader;
-
- public static TuttiPersistenceAdagioConfig createConfig(Class<?> klass,
- String name) throws ArgumentsParserException, IOException {
-
- File resourceDirectory = TestUtil.getTestSpecificDirectory(klass, name);
-
- RessourceClassLoader loader =
- new RessourceClassLoader(klass.getClassLoader());
-
- oldClassLoader = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(loader);
-
- ApplicationConfig applicationConfig =
- new ApplicationConfig("tutti-test.properties");
- applicationConfig.loadDefaultOptions(
- TuttiPersistenceAdagioConfigOption.values());
- applicationConfig.setDefaultOption("tutti.data.directory",
- resourceDirectory.getAbsolutePath());
- applicationConfig.parse();
-
- TuttiPersistenceAdagioConfig config =
- new TuttiPersistenceAdagioConfig(applicationConfig);
-
- config.initConfig(loader);
- return config;
- }
-
- public static void resetClassLoader() {
- if (oldClassLoader != null) {
- Thread.currentThread().setContextClassLoader(oldClassLoader);
- }
- }
-
- public static void checkDbExists() {
- File db = new File("src/test/db");
- if (!db.exists()) {
-
- if (log.isWarnEnabled()) {
- log.warn("Could not find db at " + db + ", test is skipped.");
- }
- Assume.assumeTrue(false);
- }
- }
-
- public static File getTestSpecificDirectory(Class<?> klass,
- String name) throws IOException {
- // Trying to look for the temporary folder to store data for the test
- String tempDirPath = System.getProperty("java.io.tmpdir");
- if (tempDirPath == null) {
- // can this really occur ?
- tempDirPath = "";
- if (log.isWarnEnabled()) {
- log.warn("'\"java.io.tmpdir\" not defined");
- }
- }
- File tempDirFile = new File(tempDirPath);
-
- // create the directory to store database data
- String dataBasePath = klass.getName()
- + File.separator // a directory with the test class name
- + name // a sub-directory with the method name
- + '_'
- + BUILD_TIMESTAMP; // and a timestamp
- File databaseFile = new File(tempDirFile, dataBasePath);
- FileUtils.forceMkdir(databaseFile);
-
- return databaseFile;
- }
-
- public static ApplicationContext createSpringContext() {
- return new ClassPathXmlApplicationContext(
- "applicationContext-conf.xml",
- "applicationContext-dataSource-local.xml",
- "applicationContext-entities.xml",
- "applicationContext-service-tutti.xml");
- }
-
- private TestUtil() {
- }
-
-
-}
Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java 2013-01-09 20:38:38 UTC (rev 162)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java 2013-01-10 09:10:19 UTC (rev 163)
@@ -1,357 +0,0 @@
-package fr.ifremer.tutti.persistence;
-
-/*
- * #%L
- * Tutti :: Persistence Adagio (impl)
- * $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.TuttiPersistenceAdagioConfig;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TestName;
-import org.springframework.context.ApplicationContext;
-
-/**
- * To test the {@link TuttiPersistenceAdagioImpl} service.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-@Ignore
-public class TuttiPersistenceAdagioImplTest {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(TuttiPersistenceAdagioImplTest.class);
-
- @Rule
- public TestName name = new TestName();
-
- protected TuttiPersistenceAdagioConfig config;
-
- protected TuttiPersistence driver;
-
- @BeforeClass
- public static void beforeClass() {
-
- TestUtil.checkDbExists();
- }
-
- @Before
- public void setUp() throws Exception {
-
- config = TestUtil.createConfig(getClass(), name.getMethodName());
-
- if (log.isDebugEnabled()) {
- log.debug("Use conf.properties at " + config.getDbConfigurationPath());
- }
- ApplicationContext context = TestUtil.createSpringContext();
-
- driver = (TuttiPersistence) context.getBean("adagioPersistenceService");
-
- driver.setEnumerations(config.getDbEnumerations());
-
- driver.open();
- }
-
- @After
- public void tearDown() throws Exception {
-
- // push back old classLoader
- TestUtil.resetClassLoader();
-
- // close hibernate session if was used
- if (driver != null) {
- driver.close();
- }
- }
-
- //------------------------------------------------------------------------//
- //-- Referential methods --//
- //------------------------------------------------------------------------//
-
-
- @Test
- @Ignore
- public void getAllProgram() {
-
- }
-
- @Test
- @Ignore
- public void getProgram(/*String id*/) {
-
- }
-
- @Test
- @Ignore
- public void createProgram(/*Program bean*/) {
-
- }
-
- @Test
- @Ignore
- public void saveProgram(/*Program bean*/) {
-
- }
-
- @Test
- @Ignore
- public void getAllCruise(/*String programId*/) {
-
- }
-
- @Test
- @Ignore
- public void getCruise(/*String id*/) {
-
- }
-
- @Test
- @Ignore
- public void createCruise(/*Cruise bean*/) {
-
- }
-
- @Test
- @Ignore
- public void saveCruise(/*Cruise bean*/) {
-
- }
-
- @Test
- @Ignore
- public void getAllProtocol() {
-
- }
-
- @Test
- @Ignore
- public void getProtocol(/*String id*/) {
-
- }
-
- @Test
- @Ignore
- public void createProtocol(/*TuttiProtocol bean*/) {
-
- }
-
- @Test
- @Ignore
- public void saveProtocol(/*TuttiProtocol bean*/) {
-
- }
-
- @Test
- @Ignore
- public void getAllFishingOperation(/*String cruiseId*/) {
-
- }
-
- @Test
- @Ignore
- public void getFishingOperation(/*String id*/) {
-
- }
-
- @Test
- @Ignore
- public void createFishingOperation(/*FishingOperation bean*/) {
-
- }
-
- @Test
- @Ignore
- public void saveFishingOperation(/*FishingOperation bean*/) {
-
- }
-
- @Test
- @Ignore
- public void getAllRootSpeciesBatch(/*String fishingOperationId*/) {
-
- }
-
- @Test
- @Ignore
- public void getAllSpeciesBatch(/*String fishingOperationId*/) {
-
- }
-
- @Test
- @Ignore
- public void getSpeciesBatch(/*String id*/) {
-
- }
-
- @Test
- @Ignore
- public void createSpeciesBatch(/*SpeciesBatch bean, String parentBatchId*/) {
-
- }
-
- @Test
- @Ignore
- public void saveSpeciesBatch(/*SpeciesBatch bean*/) {
-
- }
-
- @Test
- @Ignore
- public void deleteSpeciesBatch(/*String id*/) {
- }
-
- @Test
- @Ignore
- public void deleteSpeciesSubBatch(/*String id*/) {
- }
-
- @Test
- @Ignore
- public void getAllSpeciesBatchFrequency(/*String speciesBatchId*/) {
-
- }
-
- @Test
- @Ignore
- public void getAllBenthosBatch(/*String fishingOperationId*/) {
-
- }
-
- @Test
- @Ignore
- public void getBenthosBatch(/*String id*/) {
-
- }
-
- @Test
- @Ignore
- public void createBenthosBatch(/*BenthosBatch bean*/) {
-
- }
-
- @Test
- @Ignore
- public void saveBenthosBatch(/*BenthosBatch bean*/) {
-
- }
-
- @Test
- @Ignore
- public void deleteBenthosBatch(/*String id*/) {
- }
-
- @Test
- @Ignore
- public void getAllPlanktonBatch(/*String fishingOperationId*/) {
-
- }
-
- @Test
- @Ignore
- public void getPlanktonBatch(/*String id*/) {
-
- }
-
- @Test
- @Ignore
- public void createPlanktonBatch(/*PlanktonBatch bean*/) {
-
- }
-
- @Test
- @Ignore
- public void savePlanktonBatch(/*PlanktonBatch bean*/) {
-
- }
-
- @Test
- @Ignore
- public void deletePlanktonBatch(/*String id*/) {
- }
-
- @Test
- @Ignore
- public void getAllMacroWasteBatch(/*String fishingOperationId*/) {
-
- }
-
- @Test
- @Ignore
- public void getMacroWasteBatch(/*String id*/) {
-
- }
-
- @Test
- @Ignore
- public void createMacroWasteBatch(/*MacroWasteBatch bean*/) {
-
- }
-
- @Test
- @Ignore
- public void saveMacroWasteBatch(/*MacroWasteBatch bean*/) {
-
- }
-
- @Test
- @Ignore
- public void deleteMacroWasteBatch(/*String id*/) {
- }
-
- @Test
- @Ignore
- public void getAllAccidentalBatch(/*String fishingOperationId*/) {
-
- }
-
- @Test
- @Ignore
- public void getAccidentalBatch(/*String id*/) {
-
- }
-
- @Test
- @Ignore
- public void createAccidentalBatch(/*AccidentalBatch bean*/) {
-
- }
-
- @Test
- @Ignore
- public void saveAccidentalBatch(/*AccidentalBatch bean*/) {
-
- }
-
- @Test
- @Ignore
- public void deleteAccidentalBatch(/*String id*/) {
- }
-
-}
Modified: trunk/tutti-persistence-adagio/src/test/server.properties
===================================================================
--- trunk/tutti-persistence-adagio/src/test/server.properties 2013-01-09 20:38:38 UTC (rev 162)
+++ trunk/tutti-persistence-adagio/src/test/server.properties 2013-01-10 09:10:19 UTC (rev 163)
@@ -1,2 +1,25 @@
+###
+# #%L
+# Tutti :: Persistence Adagio (impl)
+# $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%
+###
server.database.0=file:db/allegro
server.dbname.0=allegro
\ No newline at end of file
Property changes on: trunk/tutti-persistence-adagio/src/test/server.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/tutti-persistence-adagio/src/test/startServer.sh
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
1
0
r162 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/cruise java/fr/ifremer/tutti/ui/swing/util resources/fr/ifremer/tutti/ui/swing/content/operation resources/i18n
by tchemit@users.forge.codelutin.com 09 Jan '13
by tchemit@users.forge.codelutin.com 09 Jan '13
09 Jan '13
Author: tchemit
Date: 2013-01-09 21:38:38 +0100 (Wed, 09 Jan 2013)
New Revision: 162
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/162
Log:
refs #1911: [CAMPAGNE] - Gestion des campagnes (filtrage des navires)
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml
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/content/cruise/EditCruiseUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css 2013-01-09 18:34:01 UTC (rev 161)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css 2013-01-09 20:38:38 UTC (rev 162)
@@ -134,9 +134,41 @@
#vesselList {
property: vessel;
+}
+
+#vesselListPane {
border: {BorderFactory.createTitledBorder(_("tutti.label.list.vessel"))};
}
+#filterVesselLabel {
+ text: "tutti.label.filterVesselType";
+}
+
+
+#filterVesselAllButton {
+ text: "tutti.label.filterVesselType.all";
+ toolTipText: "tutti.label.filterVesselType.all.tip";
+ value: "all";
+ selected: {model.isVesselTypeAll()};
+ buttonGroup: "filterVesselType";
+}
+
+#filterVesselScientificButton {
+ text: "tutti.label.filterVesselType.scientific";
+ toolTipText: "tutti.label.filterVesselType.scientific.tip";
+ value: "scientific";
+ selected: {model.isVesselTypeScientific()};
+ buttonGroup: "filterVesselType";
+}
+
+#filterVesselFishingButton {
+ text: "tutti.label.filterVesselType.fishing";
+ toolTipText: "tutti.label.filterVesselType.fishing.tip";
+ value: "fishing";
+ selected: {model.isVesselTypeFishing()};
+ buttonGroup: "filterVesselType";
+}
+
#gearList {
property: gear;
border: {BorderFactory.createTitledBorder(_("tutti.label.list.gear"))};
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx 2013-01-09 18:34:01 UTC (rev 161)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx 2013-01-09 20:38:38 UTC (rev 162)
@@ -89,10 +89,11 @@
<field name='comment' component='commentField'/>
</BeanValidator>
+
<JSplitPane id='splitPane' constraints='BorderLayout.CENTER'>
<Table fill='both'>
- <!-- cruise program / year /program part / name -->
+ <!-- cruise program / year / program part / name -->
<row>
<cell anchor='west'>
<JLabel id='programLabel'/>
@@ -166,7 +167,18 @@
<row weighty='0.3'>
<cell columns='6'>
<JPanel layout='{new GridLayout(1, 0)}'>
- <BeanDoubleList id='vesselList' genericType='Vessel'/>
+ <JPanel id='vesselListPane' layout="{new BorderLayout()}">
+ <JPanel id='vesselFilterPane' constraints='BorderLayout.NORTH'>
+ <JLabel id='filterVesselLabel'/>
+ <JRadioButton id='filterVesselAllButton'
+ onActionPerformed='model.setVesselType(VesselTypeEnum.ALL)'/>
+ <JRadioButton id='filterVesselScientificButton'
+ onActionPerformed='model.setVesselType(VesselTypeEnum.SCIENTIFIC)'/>
+ <JRadioButton id='filterVesselFishingButton'
+ onActionPerformed='model.setVesselType(VesselTypeEnum.FISHING)'/>
+ </JPanel>
+ <BeanDoubleList id='vesselList' genericType='Vessel' constraints='BorderLayout.CENTER'/>
+ </JPanel>
<BeanDoubleList id='gearList' genericType='Gear'/>
</JPanel>
</cell>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-01-09 18:34:01 UTC (rev 161)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-01-09 20:38:38 UTC (rev 162)
@@ -126,13 +126,13 @@
ui.setContextValue(model);
}
- JAXXContextEntryDef<List<Vessel>> SCIENTIFIC_VESSELS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef();
+ JAXXContextEntryDef<List<Vessel>> SCIENTIFIC_VESSELS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef("scientificVessel");
- JAXXContextEntryDef<List<Vessel>> FISHING_VESSELS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef();
+ JAXXContextEntryDef<List<Vessel>> FISHING_VESSELS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef("fishingVessel");
- JAXXContextEntryDef<List<Gear>> SCIENTIFIC_GEARS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef();
+ JAXXContextEntryDef<List<Gear>> SCIENTIFIC_GEARS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef("scientificGear");
- JAXXContextEntryDef<List<Gear>> FISHING_GEARS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef();
+ JAXXContextEntryDef<List<Gear>> FISHING_GEARS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef("fishingGear");
protected List<Vessel> getVesselList(VesselTypeEnum vesselType) {
List<Vessel> result = Lists.newArrayList();
@@ -213,8 +213,6 @@
}
});
- model.setVesselType(VesselTypeEnum.ALL);
-
initBeanComboBox(ui.getSurveyComboBox(),
persistenceService.getAllProgram(),
model.getProgram());
@@ -244,6 +242,8 @@
listenValidatorValid(ui.getValidator(), model);
+ model.setVesselType(VesselTypeEnum.ALL);
+
// if new fishingOperation can already cancel his creation
model.setModify(model.isCreate());
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java 2013-01-09 18:34:01 UTC (rev 161)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java 2013-01-09 20:38:38 UTC (rev 162)
@@ -249,11 +249,30 @@
}
public void setVesselType(VesselTypeEnum vesselType) {
+ boolean oldAll = isVesselTypeAll();
+ boolean oldScientific = isVesselTypeScientific();
+ boolean oldFishing = isVesselTypeFishing();
Object oldValue = getVesselType();
this.vesselType = vesselType;
firePropertyChange(PROPERTY_VESSEL_TYPE, oldValue, vesselType);
+ firePropertyChange("vesselTypeAll", oldAll, isVesselTypeAll());
+ firePropertyChange("vesselTypeScientific", oldScientific, isVesselTypeScientific());
+ firePropertyChange("vesselTypeFishing", oldFishing, isVesselTypeFishing());
+
}
+ public boolean isVesselTypeAll() {
+ return VesselTypeEnum.ALL.equals(vesselType);
+ }
+
+ public boolean isVesselTypeScientific() {
+ return VesselTypeEnum.SCIENTIFIC.equals(vesselType);
+ }
+
+ public boolean isVesselTypeFishing() {
+ return VesselTypeEnum.FISHING.equals(vesselType);
+ }
+
public boolean isCanGenerateName() {
return program != null && year != null;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java 2013-01-09 18:34:01 UTC (rev 161)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java 2013-01-09 20:38:38 UTC (rev 162)
@@ -1,7 +1,28 @@
package fr.ifremer.tutti.ui.swing.content.cruise;
-import static org.nuiton.i18n.I18n._;
-import static org.nuiton.i18n.I18n.n_;
+/*
+ * #%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%
+ */
/**
* To select which vessel types we can see (All - Scientific, Fishing)
@@ -10,18 +31,7 @@
* @since 0.3
*/
public enum VesselTypeEnum {
-
- ALL(n_("tutti.label.vesselType.all")),
- SCIENTIFIC(n_("tutti.label.vesselType.scientific")),
- FISHING(n_("tutti.label.vesselType.fishing"));
-
- private final String i18nKey;
-
- private VesselTypeEnum(String i18nKey) {
- this.i18nKey = i18nKey;
- }
-
- public String getLabel() {
- return _(i18nKey);
- }
+ ALL,
+ SCIENTIFIC,
+ FISHING
}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java 2013-01-09 18:34:01 UTC (rev 161)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java 2013-01-09 20:38:38 UTC (rev 162)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.util;
+/*
+ * #%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.AbstractTuttiBeanUIModel;
import java.awt.Color;
import java.awt.Transparency;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-01-09 18:34:01 UTC (rev 161)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-01-09 20:38:38 UTC (rev 162)
@@ -17,10 +17,10 @@
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%
+ 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%
-->
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-09 18:34:01 UTC (rev 161)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-09 20:38:38 UTC (rev 162)
@@ -85,6 +85,13 @@
tutti.label.filterSpeciesBatchMode.mode.all=Tout voir
tutti.label.filterSpeciesBatchMode.mode.leaf=Voir les feuilles
tutti.label.filterSpeciesBatchMode.mode.root=Voir les parents
+tutti.label.filterVesselType=Filtre \:
+tutti.label.filterVesselType.all=Tout
+tutti.label.filterVesselType.all.tip=Tout les navires
+tutti.label.filterVesselType.fishing=Pro
+tutti.label.filterVesselType.fishing.tip=Uniquement les navires pro
+tutti.label.filterVesselType.scientific=Scientifique
+tutti.label.filterVesselType.scientific.tip=Uniquement les navires scientifiques
tutti.label.fishingOperation.date=Date
tutti.label.fishingOperation.distanceChalutee=Distance chalutée
tutti.label.fishingOperation.duree=Durée
@@ -138,7 +145,6 @@
tutti.label.tab.fishingOperation=Trait
tutti.label.tab.fishingOperation.environment=Environnement
tutti.label.tab.fishingOperation.gearShooting=Mise en oeuvre de l'engin
-tutti.label.tab.fishingOperation.general=Caractéristiques générales
tutti.label.tab.fishingOperation.hydrology=Paramètres hydrologiques
tutti.label.tab.macroDechet=Macro déchets
tutti.label.tab.observationIndividuel=Observations individuelles
@@ -148,9 +154,6 @@
tutti.label.tab.protocol.species=Espèces
tutti.label.tab.species=Espèces
tutti.label.traitReminder=Trait \: %s
-tutti.label.vesselType.all=
-tutti.label.vesselType.fishing=
-tutti.label.vesselType.scientific=
tutti.legend.catch.benthos=Benthos
tutti.legend.catch.macroWaste=Macro déchets
tutti.legend.catch.species=Espèces
1
0
09 Jan '13
Author: tchemit
Date: 2013-01-09 19:34:01 +0100 (Wed, 09 Jan 2013)
New Revision: 161
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/161
Log:
refs #1807: [Persistence] Adagio r?\195?\169f?\195?\169rentiel (ecriture des requetes + quelque modification sur le modele pour adapter)
refs #1911: [CAMPAGNE] - Gestion des campagnes (filtrage des navires) (debut du code)
Added:
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java
trunk/tutti-persistence-adagio/src/test/server.properties
trunk/tutti-persistence-adagio/src/test/startServer.sh
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java
Removed:
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/GearDaoTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/VesselDaoTest.java
Modified:
trunk/tutti-persistence-adagio/README.txt
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
trunk/tutti-persistence-adagio/src/main/resources/applicationContext-service-tutti.xml
trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml
trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java
trunk/tutti-persistence-adagio/src/test/resources/tutti-test.properties
trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java
trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -72,8 +72,45 @@
//-- Referential methods --//
//------------------------------------------------------------------------//
+ /**
+ * @return all available zones (used by a {@link Program}.
+ * @see Program#getZone()
+ * @see Program#setZone(Zone)
+ * @since 0.3
+ */
+ List<Zone> getAllProgramZone();
+
+ /**
+ * @return all countries (used by a {@link Cruise}).
+ * @see {@link Cruise#getCountry()}
+ * @see {@link Cruise#setCountry(Country)}
+ * @since 0.1
+ */
+ List<Country> getAllCountry();
+
+ /**
+ * @return all scientific vessels (used by a {@link Cruise}).
+ * @see Cruise#getVessel()
+ * @see Cruise#setVessel(List)
+ * @since 0.3
+ */
+ List<Vessel> getAllScientificVessel();
+
+ /**
+ * @return all commercial vessels (used by a {@link Cruise}).
+ * @see Cruise#getVessel()
+ * @see Cruise#setVessel(List)
+ * @since 0.3
+ */
+ List<Vessel> getAllFishingVessel();
+
List<Species> getAllSpecies();
+ List<Species> getAllBenthosSpecies();
+
+ List<Species> getAllPlanktonSpecies();
+
+
Species getSpecies(String speciesId);
List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId);
@@ -102,14 +139,10 @@
Caracteristic getMacroWasteSizeCategoryCaracteristic();
- List<Zone> getAllZone();
+ List<Gear> getAllScientificGear();
- List<Country> getAllCountry();
+ List<Gear> getAllFishingGear();
- List<Vessel> getAllVessel();
-
- List<Gear> getAllGear();
-
List<Person> getAllPerson();
//------------------------------------------------------------------------//
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Modified: trunk/tutti-persistence-adagio/README.txt
===================================================================
--- trunk/tutti-persistence-adagio/README.txt 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-adagio/README.txt 2013-01-09 18:34:01 UTC (rev 161)
@@ -0,0 +1,20 @@
+
+Pour se connecter à la base
+---------------------------
+
+java -jar ~/.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar --inlineRC URL=jdbc:hsqldb:file:src/test/db/allegro,USER=sa
+
+(cd src/test ; ./connectDb.sh)
+
+Pour lancer la base en mode serveur
+-----------------------------------
+
+(cd src/test ; ./startServer.sh)
+
+On peut ensuite accéder à la base via l'url jdbc:hsqldb://localhost/allegro
+
+
+Se connecter à une superbe ui swing de requétage
+------------------------------------------------
+
+java -classpath ~/.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar org.hsqldb.util.DatabaseManager
\ No newline at end of file
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -26,7 +26,6 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
-import fr.ifremer.adagio.core.dao.referential.gear.GearImpl;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
@@ -39,6 +38,7 @@
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.AbstractTuttiReferentialEntity;
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;
@@ -51,9 +51,14 @@
import org.apache.commons.logging.LogFactory;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
+import org.hibernate.type.DateType;
+import org.hibernate.type.IntegerType;
+import org.hibernate.type.Type;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
+import java.util.Date;
+import java.util.Iterator;
import java.util.List;
import java.util.Properties;
@@ -62,6 +67,7 @@
* @since 0.2
*/
//@TransactionConfiguration(transactionManager = "transactionManager")
+@Transactional(readOnly = true)
public class TuttiPersistenceAdagioImpl implements TuttiPersistence {
/** Logger. */
@@ -110,142 +116,341 @@
//-- Referential methods --//
//------------------------------------------------------------------------//
- @Transactional(readOnly = true)
@Override
- public List<Species> getAllSpecies() {
- return null;
+ public List<Zone> getAllProgramZone() {
+ Iterator<Object[]> list = queryList(
+ "allProgramZones",
+ "locationLevelId", IntegerType.INSTANCE, getEnumerationIntegerCode("LocationLevelId.PROGRAM"));
+
+ List<Zone> result = Lists.newArrayList();
+ while (list.hasNext()) {
+ Object[] source = list.next();
+ Zone target = new Zone();
+ target.setId((String) source[0]);
+ target.setName((String) source[1]);
+ target.setDescription((String) source[2]);
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
- public Species getSpecies(String speciesId) {
- return null;
+ public List<Country> getAllCountry() {
+ Iterator<Object[]> list = queryList(
+ "allCountries",
+ "locationLevelId", IntegerType.INSTANCE, getEnumerationIntegerCode("LocationLevelId.PAYS_ISO3"));
+
+ List<Country> result = Lists.newArrayList();
+ while (list.hasNext()) {
+ Object[] source = list.next();
+ Country target = new Country();
+ target.setId(String.valueOf(source[0]));
+ target.setName((String) source[1]);
+ target.setDescription((String) source[2]);
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
- public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) {
- return null;
+ public List<Vessel> getAllScientificVessel() {
+
+ Iterator<Object[]> list = queryList(
+ "allVessels",
+ "refDate", DateType.INSTANCE, new Date(),
+ "vesselTypeId", IntegerType.INSTANCE, getEnumerationIntegerCode("VesselTypeId.SCIENTIFIC_RESEARCH_VESSEL"));
+
+ List<Vessel> result = Lists.newArrayList();
+ while (list.hasNext()) {
+ Object[] source = list.next();
+ Vessel target = new Vessel();
+ target.setScientificVessel(true);
+ target.setId((String) source[0]);
+ target.setRegistrationCode((String) source[1]);
+ target.setInternalRegistrationCode((String) source[2]);
+ target.setName((String) source[3]);
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
- public List<FishingOperationLocation> getAllFishingOperationSubStrata(String locationId) {
- return null;
+ public List<Vessel> getAllFishingVessel() {
+ Iterator<Object[]> list = queryList(
+ "allVessels",
+ "refDate", DateType.INSTANCE, new Date(),
+ "vesselTypeId", IntegerType.INSTANCE, getEnumerationIntegerCode("VesselTypeId.FISHING_VESSEL"));
+
+ List<Vessel> result = Lists.newArrayList();
+ while (list.hasNext()) {
+ Object[] source = list.next();
+ Vessel target = new Vessel();
+ target.setId((String) source[0]);
+ target.setRegistrationCode((String) source[1]);
+ target.setInternalRegistrationCode((String) source[2]);
+ target.setName((String) source[3]);
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
- public List<FishingOperationLocation> getAllFishingOperationLocation(String locationId) {
- return null;
+ public List<Gear> getAllScientificGear() {
+
+ Iterator<Object[]> sources = queryList(
+ "allGears",
+ "gearClassificiationId", IntegerType.INSTANCE, getEnumerationIntegerCode("GearClassificationId.SCIENTIFIC_CRUISE"));
+ List<Gear> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ Gear target = new Gear();
+ target.setId(String.valueOf(source[0]));
+ target.setName(String.valueOf(source[1]));
+ target.setLabel(String.valueOf(source[2]));
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
- public List<Zone> getAllZone() {
- return null;
+ public List<Gear> getAllFishingGear() {
+ Iterator<Object[]> sources = queryList(
+ "allGears",
+ "gearClassificiationId", IntegerType.INSTANCE, getEnumerationIntegerCode("GearClassificationId.FAO"));
+ List<Gear> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ Gear target = new Gear();
+ target.setId(String.valueOf(source[0]));
+ target.setName(String.valueOf(source[1]));
+ target.setLabel(String.valueOf(source[2]));
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
- public List<Country> getAllCountry() {
- return null;
+ public List<Person> getAllPerson() {
+ Iterator<Object[]> list = queryList(
+ "allPersons");
+
+ List<Person> result = Lists.newArrayList();
+ while (list.hasNext()) {
+ Object[] source = list.next();
+ Person target = new Person();
+ target.setId(String.valueOf(source[0]));
+ target.setFirstName(String.valueOf(source[1]));
+ target.setLastName(String.valueOf(source[2]));
+ target.setDepartment(String.valueOf(source[3]));
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
- public List<Vessel> getAllVessel() {
- return null;
+ public List<Species> getAllSpecies() {
+ Iterator<Object[]> sources = queryList(
+ "allSpecies",
+ "taxonGroupCode", IntegerType.INSTANCE, getEnumerationIntegerCode("TaxonGroupTypeCode.METIER_SPECIES"));
+
+ List<Species> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ Species target = loadSpecies(source);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
- public List<Gear> getAllGear() {
- Query query = sessionFactory.getCurrentSession().getNamedQuery("getAllGears");
+ public Species getSpecies(String speciesId) {
+ Object[] source = queryUnique("species",
+ "taxonGroupCode", IntegerType.INSTANCE, Integer.valueOf(speciesId));
- List gears = query.list();
- List<Gear> result = Lists.newArrayList();
- for (Object o : gears) {
- GearImpl gearImpl = (GearImpl) o;
- Gear g = new Gear();
- g.setId(String.valueOf(gearImpl.getId()));
- g.setName(gearImpl.getName());
- g.setDescription(gearImpl.getLabel());
- setStatus(gearImpl.getStatus(), g);
- result.add(g);
+ Species target = loadSpecies(source);
+ return target;
+ }
+
+ @Override
+ public List<Species> getAllBenthosSpecies() {
+ Iterator<Object[]> sources = queryList(
+ "allBenthosSpecies",
+ "taxonGroupCode", IntegerType.INSTANCE, getEnumerationIntegerCode("TaxonGroupTypeCode.METIER_SPECIES"));
+
+ List<Species> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ Species target = loadSpecies(source);
+ result.add(target);
}
return result;
}
- @Transactional(readOnly = true)
@Override
- public List<Person> getAllPerson() {
- return null;
+ public List<Species> getAllPlanktonSpecies() {
+ Iterator<Object[]> sources = queryList(
+ "allPlanktonSpecies",
+ "taxonGroupCode", IntegerType.INSTANCE, getEnumerationIntegerCode("TaxonGroupTypeCode.METIER_SPECIES"));
+
+ List<Species> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ Species target = loadSpecies(source);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
- public List<Caracteristic> getAllFishingOperationEnvironmentCaracteristic() {
- return null;
+ public List<Caracteristic> getAllSpeciesLengthStepCaracteristic() {
+ Iterator<Object[]> sources = queryList(
+ "allLengthStepCaracteristics",
+ "matrixId", IntegerType.INSTANCE, getEnumerationIntegerCode("MatrixId.BATCH"));
+ List<Caracteristic> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ Caracteristic target = loadCaracteristic(source);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
public List<Caracteristic> getAllFishingOperationGearCaracteristic() {
- return null;
+ Iterator<Object[]> sources = queryList(
+ "allPmfmsByMatrixId",
+ "matrixId", IntegerType.INSTANCE, getEnumerationIntegerCode("MatrixId.GEAR"));
+ List<Caracteristic> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ Caracteristic target = loadCaracteristic(source);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
+ public List<Caracteristic> getAllFishingOperationEnvironmentCaracteristic() {
+ Iterator<Object[]> sources = queryList(
+ "allPmfmsByParameterGroudId",
+ "parameterGroupId", IntegerType.INSTANCE, getEnumerationIntegerCode("ParameterGroupId.ENVIRONEMENT_MEASUREMENT"));
+ List<Caracteristic> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ Caracteristic target = loadCaracteristic(source);
+ result.add(target);
+ }
+ return result;
+ }
+
+ @Override
public List<Caracteristic> getAllFishingOperationHydrologicCaracteristic() {
- return null;
+ Iterator<Object[]> sources = queryList(
+ "allPmfmsByParameterGroudId",
+ "parameterGroupId", IntegerType.INSTANCE, getEnumerationIntegerCode("ParameterGroupId.HYDROLOGIC_MEASUREMENT"));
+ List<Caracteristic> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ Caracteristic target = loadCaracteristic(source);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
- public List<Caracteristic> getAllSpeciesLengthStepCaracteristic() {
- return null;
+ public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) {
+ Iterator<Object[]> sources = queryList(
+ "allFishingOperationStratas",
+ "locationLevel", IntegerType.INSTANCE, getEnumerationIntegerCode("LocationLevelId.STRATA"));
+ List<FishingOperationLocation> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ FishingOperationLocation target = loadFishingOperationLocation(source);
+ result.add(target);
+ }
+ return result;
}
- @Transactional(readOnly = true)
@Override
+ public List<FishingOperationLocation> getAllFishingOperationSubStrata(String locationId) {
+ Iterator<Object[]> sources = queryList(
+ "allFishingOperationSubStratas",
+ "locationLevel", IntegerType.INSTANCE, getEnumerationIntegerCode("LocationLevelId.SUBSTRATA"));
+ List<FishingOperationLocation> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ FishingOperationLocation target = loadFishingOperationLocation(source);
+ result.add(target);
+ }
+ return result;
+ }
+
+ @Override
+ public List<FishingOperationLocation> getAllFishingOperationLocation(String locationId) {
+ Iterator<Object[]> sources = queryList(
+ "allFishingOperationLocalites",
+ "locationLevel", IntegerType.INSTANCE, getEnumerationIntegerCode("LocationLevelId.LOCALITE"));
+ List<FishingOperationLocation> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ FishingOperationLocation target = loadFishingOperationLocation(source);
+ result.add(target);
+ }
+ return result;
+ }
+
+ @Override
public Caracteristic getSizeCategoryCaracteristic() {
- return null;
+ Integer pmfmId = getEnumerationIntegerCode("PmfmId.SIZE_CATEGORY");
+ Caracteristic result = loadCaracteristic(pmfmId);
+ return result;
}
- @Transactional(readOnly = true)
@Override
public Caracteristic getSexCaracteristic() {
- return null;
+ Integer pmfmId = getEnumerationIntegerCode("PmfmId.SEX");
+ Caracteristic result = loadCaracteristic(pmfmId);
+ return result;
}
- @Transactional(readOnly = true)
@Override
public Caracteristic getSortedUnsortedCaracteristic() {
- return null;
+ Integer pmfmId = getEnumerationIntegerCode("PmfmId.SORTED_UNSORTED");
+ Caracteristic result = loadCaracteristic(pmfmId);
+ return result;
}
- @Transactional(readOnly = true)
@Override
public Caracteristic getMaturityCaracteristic() {
- return null;
+ Integer pmfmId = getEnumerationIntegerCode("PmfmId.MATURITY");
+ Caracteristic result = loadCaracteristic(pmfmId);
+ return result;
}
- @Transactional(readOnly = true)
@Override
public Caracteristic getMacroWasteCategoryCaracteristic() {
- return null;
+ Integer pmfmId = getEnumerationIntegerCode("PmfmId.MACRO_WASTE_CATEGORY");
+ Caracteristic result = loadCaracteristic(pmfmId);
+ return result;
}
- @Transactional(readOnly = true)
@Override
public Caracteristic getMacroWasteSizeCategoryCaracteristic() {
- return null;
+ Integer pmfmId = getEnumerationIntegerCode("PmfmId.MACRO_WASTE_SIZE_CATEGORY");
+ Caracteristic result = loadCaracteristic(pmfmId);
+ return result;
}
- //------------------------------------------------------------------------//
//-- Program methods --//
//------------------------------------------------------------------------//
+ //------------------------------------------------------------------------//
@Override
public List<Program> getAllProgram() {
@@ -517,4 +722,145 @@
newStatus.setName(status.getName());
entity.setStatus(newStatus);
}
+
+ protected String getEnumerationStringCode(String key) {
+ String result = enumerations.getProperty(key);
+ Preconditions.checkNotNull(
+ result,
+ "Could not find enumeration code for key [" + key + ']');
+ return result;
+ }
+
+ protected Integer getEnumerationIntegerCode(String key) {
+ String value = getEnumerationStringCode(key);
+ return Integer.valueOf(value);
+ }
+
+ protected Iterator<Object[]> queryList(String queryName, Object... params) {
+
+ Query query = sessionFactory.getCurrentSession().getNamedQuery(queryName);
+
+ if (params.length > 0) {
+
+ Preconditions.checkArgument(
+ params.length % 3 == 0,
+ "Params must be tuple (paramName, paramType, paramValue)");
+
+ int nbParams = params.length / 3;
+
+ for (int i = 0; i < nbParams; i++) {
+ String paramName = (String) params[3 * i];
+ Type paramType = (Type) params[3 * i + 1];
+ Object paramValue = params[3 * i + 2];
+ query.setParameter(paramName, paramValue, paramType);
+ if (log.isDebugEnabled()) {
+ log.debug("query [" + queryName + "] (param " + i
+ + " [" + paramName + '=' + paramValue + "])");
+ }
+ }
+ }
+ Iterator result = query.iterate();
+ return result;
+ }
+
+ protected Object[] queryUnique(String queryName, Object... params) {
+
+ Query query = sessionFactory.getCurrentSession().getNamedQuery(queryName);
+
+ if (params.length > 0) {
+
+ Preconditions.checkArgument(
+ params.length % 3 == 0,
+ "Params must be tuple (paramName, paramType, paramValue)");
+
+ int nbParams = params.length / 3;
+
+ for (int i = 0; i < nbParams; i++) {
+ String paramName = (String) params[3 * i];
+ Type paramType = (Type) params[3 * i + 1];
+ Object paramValue = params[3 * i + 2];
+ query.setParameter(paramName, paramValue, paramType);
+ if (log.isDebugEnabled()) {
+ log.debug("query [" + queryName + "] (param " + i
+ + " [" + paramName + '=' + paramValue + "])");
+ }
+ }
+ }
+ Object result = query.uniqueResult();
+ return (Object[]) result;
+ }
+
+ protected void loadCaracteristicQualitativeValues(Caracteristic caracteristic,
+ Integer pmfmId) {
+ Preconditions.checkNotNull(caracteristic, "Caracteristic can not be null");
+ Preconditions.checkNotNull(pmfmId, "pmfmId can not be null");
+ Preconditions.checkArgument(caracteristic.isQualitativeType(), "Caracteristic must be a qualitativeValue type");
+
+ Iterator<Object[]> sources = queryList(
+ "pmfmQualitativeValues",
+ "pmfmId", IntegerType.INSTANCE, pmfmId);
+
+ List<CaracteristicQualitativeValue> values = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ CaracteristicQualitativeValue target = new CaracteristicQualitativeValue();
+ target.setId(String.valueOf(source[0]));
+ target.setName(String.valueOf(source[1]));
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[2], target);
+ values.add(target);
+ }
+ caracteristic.setQualitativeValue(values);
+ }
+
+ protected Caracteristic loadCaracteristic(Integer pmfmId) {
+
+ Object[] source = queryUnique("pmfmById",
+ "pmfmId", IntegerType.INSTANCE, pmfmId);
+
+ Caracteristic target = loadCaracteristic(source);
+
+ if (target.isQualitativeType()) {
+
+ // load qualititative values
+ loadCaracteristicQualitativeValues(target, pmfmId);
+ }
+ return target;
+ }
+
+ protected Caracteristic loadCaracteristic(Object[] source) {
+
+ Caracteristic target = new Caracteristic();
+ target.setId(String.valueOf(source[0]));
+ target.setParameterName(String.valueOf(source[1]));
+ target.setMatrixName(String.valueOf(source[2]));
+ target.setFractionName(String.valueOf(source[3]));
+ target.setMethodName(String.valueOf(source[4]));
+ target.setNumberType(Boolean.valueOf(source[5].toString()));
+ target.setQualitativeType(Boolean.valueOf(source[6].toString()));
+
+ target.setUnit(String.valueOf(source[7]));
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[8], target);
+ return target;
+ }
+
+ protected FishingOperationLocation loadFishingOperationLocation(Object[] source) {
+ FishingOperationLocation target = new FishingOperationLocation();
+ target.setId(String.valueOf(source[0]));
+ target.setName(String.valueOf(source[1]));
+ target.setLabel(String.valueOf(source[2]));
+ target.setDescription(String.valueOf(source[3]));
+ target.setLocationLevel(Integer.valueOf(source[4].toString()));
+
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[5], target);
+ return target;
+ }
+
+ protected Species loadSpecies(Object[] source) {
+ Species target = new Species();
+ target.setId(String.valueOf(source[0]));
+ target.setCodeMemo(String.valueOf(source[1]));
+ target.setName(String.valueOf(source[2]));
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target);
+ return target;
+ }
}
Modified: trunk/tutti-persistence-adagio/src/main/resources/applicationContext-service-tutti.xml
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/applicationContext-service-tutti.xml 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-adagio/src/main/resources/applicationContext-service-tutti.xml 2013-01-09 18:34:01 UTC (rev 161)
@@ -24,7 +24,7 @@
-->
<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
@@ -36,17 +36,17 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!--<context:component-scan base-package="fr.ifremer.adagio.core.service" />-->
- <!-- Activates various annotations to be detected in bean classes: Spring's
- @Required and @Autowired, as well as JSR 250's @PostConstruct, @PreDestroy
- and @Resource (if available) and JPA's @PersistenceContext and @PersistenceUnit
+ <!-- Activates various annotations to be detected in bean classes: Spring's
+ @Required and @Autowired, as well as JSR 250's @PostConstruct, @PreDestroy
+ and @Resource (if available) and JPA's @PersistenceContext and @PersistenceUnit
(if available). -->
<!--<context:annotation-config />-->
- <!--Platform Transaction Manager declared as "transactionManager" will be
+ <!--Platform Transaction Manager declared as "transactionManager" will be
used. -->
- <!--"aspectj" mode enables load-time/compile-time weaving of transactional
- methods, which enables those methods to be intercepted even when called internally.
- (Unlike Spring generated proxies which will only be intercepted when called
+ <!--"aspectj" mode enables load-time/compile-time weaving of transactional
+ methods, which enables those methods to be intercepted even when called internally.
+ (Unlike Spring generated proxies which will only be intercepted when called
from outside) -->
<tx:annotation-driven transaction-manager="transactionManager" />
@@ -55,8 +55,410 @@
<property name="sessionFactory" ref="sessionFactory" />
</bean>
- <!--Enables the use of @AspectJ style of aspects' declarations. AspectJ
+ <!--Enables the use of @AspectJ style of aspects' declarations. AspectJ
run-time isn't necessarily involved -->
<!--<aop:aspectj-autoproxy />-->
+ <!--bean id="dataSource2"
+ class="org.apache.commons.dbcp.BasicDataSource"
+ destroy-method="close">
+ <property name="driverClassName" value="${dataSource.jdbc.driver}"/>
+ <property name="url" value="${dataSource.jdbc.url}"/>
+ <property name="username" value="${dataSource.jdbc.username}"/>
+ <property name="password" value="${dataSource.jdbc.password}"/>
+ </bean>
+
+ <bean id="sessionFactory2"
+ class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
+ <property name="dataSource" ref="dataSource2" />
+ <property name="hibernateProperties">
+ <props>
+ <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
+ <prop key="hibernate.show_sql">true</prop>
+ <prop key="hibernate.default_batch_fetch_size">40</prop>
+ <prop key="hibernate.max_fetch_depth">4</prop>
+ <prop key="hibernate.query.substitutions">true 1, false 0</prop>
+ <prop key="hibernate.cache.use_second_level_cache">true</prop>
+ <prop key="hibernate.cache.use_query_cache">true</prop>
+
+ <prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory</prop>
+ <prop key="hibernate.cache.query_cache_factory">org.hibernate.cache.StandardQueryCacheFactory</prop>
+ <prop key="net.sf.ehcache.configurationResourceName">ehcache.xml</prop>
+ <prop key="hibernate.format_sql">true</prop>
+ <prop key="hibernate.use_sql_comments">true</prop>
+ <prop key="hibernate.bytecode.provider">cglib</prop>
+ <prop key="hibernate.jdbc.use_streams_for_binary">true</prop>
+
+ <prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop>
+
+ </props>
+ </property-->
+ <!--property name="mappingResources">
+ <list>
+ <value>queries-override2.hbm.xml</value>
+ <value>file:///home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/Author.hbm.xml</value>
+ </list>
+ </property-->
+ <!--property name="mappingLocations">
+ <list>
+ <value>classpath:queries.hbm.xml</value>
+ <value>classpath:queries-override.hbm.xml</value>
+ <value>file:///home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/PersonSessionVessel.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/user/UserProfil.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/user/PersonSession.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/user/VesselManagePeriod.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/user/ManagedDataTransfer.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/user/ManagedDataType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/user/DepartmentPrivilegeTransfert.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/user/Person.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/user/ManagedData.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/user/ageReader/AgeReaderQualification.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/user/Department.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/Strategy.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/PmfmAppliedStrategy.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/ReferenceTaxonStrategy.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/AppliedStrategy.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/AppliedPeriod.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/Program2Person.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/Program.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/AcquisitionLevel.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/BatchModelAppliedStrategy.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/Program2Department.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/ProgramPrivilege.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/PmfmStrategy.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/technical/optimization/grouping/GroupingVesselHierarchy.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/technical/optimization/grouping/GroupingItemHierarchy.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/technical/optimization/location/LocationHierarchyException.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/technical/optimization/location/LocationHierarchy.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/DepthGradient.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/NearbySpecificArea.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/RegulationArea2RegulationLocation.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/RegulationArea.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/Corpus.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/CorpusType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/RightToProduce.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/MinimumSizeAllowed.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/Fishery.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/seller/SellerType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/seller/Seller.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/PrecisionType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingItem.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingSystem.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingItemType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingSide.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/ProcessingStatus.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/DistanceToCoastGradient.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/spatial/SpatialItem.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemLine.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemArea.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/spatial/SpatialItem2Location.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemPoint.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/SurveyQualification.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/VesselType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/ObjectType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/Status.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/ProcessingType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/LinkedItemType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/gear/GearClassification.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/gear/GearClassificationAssociation.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/gear/GearAssociation.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/gear/Gear.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/location/Location.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/location/LocationClassification.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/location/LocationLevel.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/location/LocationAssociation.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/samplingScheme/denormalized/DenormalizedSamplingStrata.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/buyer/Buyer.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/buyer/BuyerType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/grouping/GroupingClassification.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/grouping/GroupingItem.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/grouping/Grouping.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/grouping/GroupingLevel.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/PhotoType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/SaleType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroup.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroupHistoricalRecord.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/ReferenceDocument.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroupType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/Citation.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonInformation.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroupInformation.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonNameHistory.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/Author.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/ReferenceTaxon.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonInformationHistory.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonName.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonomicLevel.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/VirtualComponent.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselOwner.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/EducationGrade.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselFeatures.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselRegistrationPeriod.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselOwnerPeriod.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselEngineType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselMasterPeriod.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/Vessel.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselMaster.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/metier/Metier.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/order/OrderItem.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/order/OrderType.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/conversion/UnitConversion.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/conversion/WeightLengthConversion.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/conversion/RoundWeightConversion.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/qualification/QualificationRule.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/Matrix.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/Unit.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/ParameterGroup.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/Fraction.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/Method.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/Pmfm.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/Parameter.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/AggregationLevel.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/QualitativeValue.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/NumericalPrecision.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/QualityFlag.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/referential/AnalysisInstrument.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/batch/BatchExhaustiveInventory.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/batch/BatchModel.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/batch/Batch.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/batch/denormalized/DenormalizedBatch.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/batch/denormalized/DenormalisedBatchSortingValue.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/qualification/AppliedQualificationRule.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/qualification/QualifiedItem.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/takeOver/TakeOver.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/physicalGear/PhysicalGearSurvey.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/declaration/DeclaredDocumentReference.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/economy/EconomicalSurvey.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/activity/ActivityCalendar.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/activity/DailyActivityCalendar.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/sale/SaleOrigin.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/sale/Sale.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/fishingTrip/FishingTrip.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/fishingTrip/FishingTripOrigin.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/scientificCruise/ScientificCruise.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/fishingEffort/FishingEffortCalendar.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/landing/LandingOrigin.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/survey/landing/Landing.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/sale/ExpectedSale.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/fishingArea/FishingArea2RegulationLocation.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/fishingArea/FishingArea.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/operation/denormalized/DenormalizedOperation.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/operation/Operation.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/operation/OperationVesselAssociation.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/sample/Sample.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/transshipment/Transshipment.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/LandingMeasurement.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/VesselPhysicalMeasurement.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/QuantificationMeasurement.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/VesselUseMeasurement.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/file/MeasurementFile.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/VesselPositionMeasurement.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/SaleMeasurement.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/photo/Photo.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/TakeOverMeasurement.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/GearUseMeasurement.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/SortingMeasurement.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/SampleMeasurement.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/SurveyMeasurement.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/measure/GearPhysicalMeasurement.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/link/LinkedItem.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/produce/Produce.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/history/UpdatedItemHistory.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/history/InsertedItemHistory.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/history/ProcessingHistory.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/history/DeletedItemHistory.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/position/VesselPosition.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/physical/GearPhysicalFeatures.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/physical/VesselPhysicalFeaturesOrigin.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/physical/VesselPhysicalFeatures.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/physical/GearPhysicalFeaturesOrigin.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/use/VesselUseFeaturesOrigin.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/use/GearUseFeaturesOrigin.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/use/VesselUseFeatures.hbm.xml</value>
+ <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/use/GearUseFeatures.hbm.xml</value>
+ </list>
+ </property-->
+ <!--property name="mappingLocations">
+ <list>
+ <value>queries-override2.hbm.xml</value>
+ <value>file:///home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/Author.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/PersonSessionVessel.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/UserProfil.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/PersonSession.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/VesselManagePeriod.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/ManagedDataTransfer.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/ManagedDataType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/DepartmentPrivilegeTransfert.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/Person.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/ManagedData.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/ageReader/AgeReaderQualification.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/Department.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/Strategy.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/PmfmAppliedStrategy.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/ReferenceTaxonStrategy.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/AppliedStrategy.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/AppliedPeriod.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/Program2Person.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/Program.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/AcquisitionLevel.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/BatchModelAppliedStrategy.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/Program2Department.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/ProgramPrivilege.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/PmfmStrategy.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/technical/optimization/grouping/GroupingVesselHierarchy.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/technical/optimization/grouping/GroupingItemHierarchy.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/technical/optimization/location/LocationHierarchyException.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/technical/optimization/location/LocationHierarchy.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/DepthGradient.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/NearbySpecificArea.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/RegulationArea2RegulationLocation.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/RegulationArea.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/Corpus.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/CorpusType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/RightToProduce.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/MinimumSizeAllowed.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/Fishery.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/seller/SellerType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/seller/Seller.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/PrecisionType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingItem.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingSystem.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingItemType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingSide.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/ProcessingStatus.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/DistanceToCoastGradient.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/spatial/SpatialItem.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemLine.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemArea.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/spatial/SpatialItem2Location.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemPoint.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/SurveyQualification.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/VesselType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/ObjectType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/Status.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/ProcessingType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/LinkedItemType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/gear/GearClassification.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/gear/GearClassificationAssociation.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/gear/GearAssociation.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/gear/Gear.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/location/Location.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/location/LocationClassification.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/location/LocationLevel.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/location/LocationAssociation.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/samplingScheme/denormalized/DenormalizedSamplingStrata.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/buyer/Buyer.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/buyer/BuyerType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/grouping/GroupingClassification.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/grouping/GroupingItem.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/grouping/Grouping.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/grouping/GroupingLevel.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/PhotoType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/SaleType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroup.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroupHistoricalRecord.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/ReferenceDocument.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroupType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/Citation.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonInformation.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroupInformation.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonNameHistory.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/Author.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/ReferenceTaxon.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonInformationHistory.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonName.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonomicLevel.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/VirtualComponent.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselOwner.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/EducationGrade.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselFeatures.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselRegistrationPeriod.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselOwnerPeriod.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselEngineType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselMasterPeriod.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/Vessel.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselMaster.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/metier/Metier.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/order/OrderItem.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/order/OrderType.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/conversion/UnitConversion.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/conversion/WeightLengthConversion.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/conversion/RoundWeightConversion.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/qualification/QualificationRule.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/Matrix.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/Unit.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/ParameterGroup.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/Fraction.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/Method.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/Pmfm.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/Parameter.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/AggregationLevel.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/QualitativeValue.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/NumericalPrecision.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/QualityFlag.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/AnalysisInstrument.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/batch/BatchExhaustiveInventory.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/batch/BatchModel.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/batch/Batch.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/batch/denormalized/DenormalizedBatch.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/batch/denormalized/DenormalisedBatchSortingValue.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/qualification/AppliedQualificationRule.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/qualification/QualifiedItem.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/takeOver/TakeOver.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/physicalGear/PhysicalGearSurvey.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/declaration/DeclaredDocumentReference.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/economy/EconomicalSurvey.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/activity/ActivityCalendar.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/activity/DailyActivityCalendar.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/sale/SaleOrigin.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/sale/Sale.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/fishingTrip/FishingTrip.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/fishingTrip/FishingTripOrigin.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/scientificCruise/ScientificCruise.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/fishingEffort/FishingEffortCalendar.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/landing/LandingOrigin.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/landing/Landing.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/sale/ExpectedSale.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/fishingArea/FishingArea2RegulationLocation.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/fishingArea/FishingArea.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/operation/denormalized/DenormalizedOperation.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/operation/Operation.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/operation/OperationVesselAssociation.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/sample/Sample.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/transshipment/Transshipment.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/LandingMeasurement.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/VesselPhysicalMeasurement.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/QuantificationMeasurement.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/VesselUseMeasurement.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/file/MeasurementFile.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/VesselPositionMeasurement.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/SaleMeasurement.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/photo/Photo.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/TakeOverMeasurement.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/GearUseMeasurement.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/SortingMeasurement.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/SampleMeasurement.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/SurveyMeasurement.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/GearPhysicalMeasurement.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/link/LinkedItem.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/produce/Produce.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/history/UpdatedItemHistory.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/history/InsertedItemHistory.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/history/ProcessingHistory.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/history/DeletedItemHistory.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/position/VesselPosition.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/physical/GearPhysicalFeatures.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/physical/VesselPhysicalFeaturesOrigin.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/physical/VesselPhysicalFeatures.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/physical/GearPhysicalFeaturesOrigin.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/use/VesselUseFeaturesOrigin.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/use/GearUseFeaturesOrigin.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/use/VesselUseFeatures.hbm.xml</value>
+ <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/use/GearUseFeatures.hbm.xml</value>
+ </list>
+ </property-->
+ <!--</bean>-->
+
</beans>
\ No newline at end of file
Modified: trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-09 18:34:01 UTC (rev 161)
@@ -28,42 +28,386 @@
<hibernate-mapping>
<!--<fetch-profile name="tutti">-->
- <!--TODO Create fetch profile to avoid eager loading -->
+ <!--TODO Create fetch profile to avoid eager loading -->
<!--</fetch-profile>-->
- <!-- Exemple HQL : >
- <query cacheable="true"
- name="selectProgramFromUser">select distinct
- p.code,
- p.name,
- p.description
- from
- Program as p
- left outer join p.program2persons as users
- left outer join p.program2departments as dep
- left outer join dep.department.persons as depUsers
- where
- users.person.id=:userId
- or depUsers.id=:userId<query-param
- name="userId" type="java.lang.Integer"/>
- </query-->
+ <!-- Get all program zones [REF-01] -->
+ <query cacheable="true" name="allProgramZones">
+ <![CDATA[
+ SELECT
+ l.id,
+ l.label,
+ l.name,
+ l.status
+ FROM LocationImpl l
+ WHERE
+ l.locationLevel.id = :locationLevelId
+ AND l.status.code IN (1, 2)
+ ]]>
+ <query-param name="locationLevelId" type="java.lang.Integer"/>
+ </query>
- <query cacheable="true" name="getAllScientificVessels">
- FROM VesselImpl WHERE vesselType.id=8
+ <!-- Get all countries [REF-02] -->
+ <query cacheable="true" name="allCountries">
+ <![CDATA[
+ SELECT
+ l.id,
+ l.label,
+ l.name,
+ l.status
+ FROM LocationImpl l
+ WHERE
+ l.locationLevel.id = :locationLevelId
+ AND l.status.code IN (1, 2)
+ ]]>
+ <query-param name="locationLevelId" type="java.lang.Integer"/>
+ </query>
+ <!-- Get all vessel for a given vesselType [REF-03] et [REF-04]-->
+ <query cacheable="true" name="allVessels">
+ <![CDATA[
+ SELECT
+ v.code AS vesselCode,
+ vrp.registrationCode AS nationalRegistrationCode,
+ vrp.internationalRegistrationCode as internationalRegistrationCode,
+ vf.name AS vesselName,
+ v.status AS status
+ FROM
+ VesselImpl v
+ INNER JOIN v.vesselRegistrationPeriods AS vrp
+ LEFT OUTER JOIN v.vesselFeatures AS vf
+ WHERE v.vesselType.id = :vesselTypeId
+ AND v.status.code IN (1, 2)
+ AND vrp.vesselRegistrationPeriodPk.startDateTime =
+ (
+ SELECT MAX(vrp2.vesselRegistrationPeriodPk.startDateTime)
+ FROM VesselRegistrationPeriodImpl vrp2 WHERE
+ vrp2.vesselRegistrationPeriodPk.vessel.code = v.code
+ AND (vrp2.vesselRegistrationPeriodPk.startDateTime <= :refDate OR :refDate IS NULL)
+ GROUP BY vrp2.vesselRegistrationPeriodPk.vessel.code
+ )
+ AND vf.startDateTime =
+ (
+ SELECT MAX(vf2.startDateTime)
+ FROM VesselFeaturesImpl vf2 WHERE
+ vf2.vessel.code = v.code
+ AND (vf2.startDateTime <= :refDate OR :refDate IS NULL)
+ GROUP BY vf2.vessel.code
+ )]]>
+ <query-param name="vesselTypeId" type="java.lang.Integer"/>
+ <query-param name="refDate" type="java.util.Date"/>
</query>
- <query cacheable="true" name="getAllFishingVessels">
- FROM VesselImpl WHERE vesselType.id=1
+ <!-- Get all gears [REF-05] and [REF-06] -->
+ <query cacheable="true" name="allGears">
+ <![CDATA[
+ SELECT
+ g.id,
+ g.label,
+ g.name,
+ g.status AS status
+ FROM GearImpl g
+ WHERE
+ g.gearClassification.id= :gearClassificiationId
+ AND g.status.code IN (1, 2)
+ ]]>
+ <query-param name="gearClassificiationId" type="java.lang.Integer"/>
</query>
- <query cacheable="true" name="getAllGears">
- FROM GearImpl
+ <!-- Get all persons [REF-07] -->
+ <query cacheable="true" name="allPersons">
+ <![CDATA[
+ SELECT DISTINCT
+ p.id,
+ p.firstname,
+ p.lastname,
+ p.department,
+ p.status
+ FROM
+ PersonImpl p
+ WHERE p.status.code IN (1, 2)
+ ]]>
</query>
- <query cacheable="true" name="getPmfm">
- FROM GearImpl
+ <!-- TODO Fix it! Get all species [REF-08] -->
+ <query cacheable="true" name="allSpecies">
+ <![CDATA[
+ SELECT
+ t.id,
+ t.label,
+ t.name,
+ t.status
+ FROM TaxonGroupImpl t
+ WHERE t.taxonGroupType.code = :taxonGroupCode
+ AND t.isChildGroupExclusive = false
+ AND t.status.code IN (1, 2)
+ ]]>
+ <query-param name="taxonGroupCode" type="java.lang.Integer"/>
</query>
+ <!-- TODO Fix it! Get one species [REF-08-1] -->
+ <query cacheable="true" name="species">
+ <![CDATA[
+ SELECT
+ t.id,
+ t.label,
+ t.name,
+ t.status
+ FROM TaxonGroupImpl t
+ WHERE t.id = :speciesId
+ ]]>
+ <query-param name="speciesId" type="java.lang.Integer"/>
+ </query>
+ <!-- TODO Fix it! Get all length step catacteristics [REF-09] -->
+ <query cacheable="true" name="allLengthStepCaracteristics">
+ <![CDATA[
+ SELECT
+ p.id AS pmfmId,
+ p.parameter.name AS parameterName,
+ p.matrix.name AS matrixName,
+ p.fraction.name AS fractionName,
+ p.method.name AS methodName,
+ p.parameter.isAlphanumeric AS isAlphanumeric,
+ p.parameter.isQualitative AS isQualitative,
+ p.unit.symbol AS symbol,
+ p.status AS status
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.parameter.code LIKE 'LENGTH_%' AND p.matrix.id = :matrixId
+ ]]>
+ <query-param name="matrixId" type="java.lang.Integer"/>
+ </query>
+
+ <!-- Get all gear caracteristics [REF-10] (use allPmfmsByMatrixId) -->
+ <!--query cacheable="true" name="allGearFeaturesCaracteristics">
+ <![CDATA[
+ SELECT
+ p.id AS pmfmId,
+ p.parameter.name AS parameterName,
+ p.matrix.name AS matrixName,
+ p.fraction.name AS fractionName,
+ p.method.name AS methodName,
+ p.parameter.isAlphanumeric AS isAlphanumeric,
+ p.parameter.isQualitative AS isQualitative,
+ p.unit.symbol AS symbol,
+ p.status AS status
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.matrix.id= :matrixId
+ ]]>
+ <query-param name="matrixId" type="java.lang.Integer"/>
+ </query-->
+
+ <!-- Get all environment caracteristics [REF-11] (use allPmfmsByParameterGroudId) -->
+ <!--query cacheable="true" name="allEnvironmentCaracteristics">
+ <![CDATA[
+ SELECT
+ p.id AS pmfmId,
+ p.parameter.name AS parameterName,
+ p.matrix.name AS matrixName,
+ p.fraction.name AS fractionName,
+ p.method.name AS methodName,
+ p.parameter.isAlphanumeric AS isAlphanumeric,
+ p.parameter.isQualitative AS isQualitative,
+ p.unit.symbol AS symbol,
+ p.status AS status
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.parameter.parameterGroup.id= :parameterGroupId
+ ]]>
+ <query-param name="parameterGroupId" type="java.lang.Integer"/>
+ </query-->
+
+ <!-- TODO FIX IT! Get all hydrology caracteristics [REF-12] (use allPmfmsByParameterGroudId) -->
+ <!--query cacheable="true" name="allHydrologyCaracteristics">
+ <![CDATA[
+ SELECT
+ p.id AS pmfmId,
+ p.parameter.name AS parameterName,
+ p.matrix.name AS matrixName,
+ p.fraction.name AS fractionName,
+ p.method.name AS methodName,
+ p.parameter.isAlphanumeric AS isAlphanumeric,
+ p.parameter.isQualitative AS isQualitative,
+ p.unit.symbol AS symbol,
+ p.status AS status
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.parameter.parameterGroup.id= :parameterGroupId
+ ]]>
+ <query-param name="parameterGroupId" type="java.lang.Integer"/>
+ </query-->
+
+ <!-- Get all fishing operation strates [REF-13] -->
+ <query cacheable="true" name="allFishingOperationStratas">
+ <![CDATA[
+ SELECT
+ l.id as locationId,
+ l.label as locationLabel,
+ l.name as locationName,
+ l.locationLevel.id as locationLevelId,
+ l.status as status
+ FROM LocationImpl l
+ WHERE l.status.code IN (1, 2)
+ AND l.locationLevel.id = :locationLevelId
+ ]]>
+ <query-param name="locationLevel" type="java.lang.Integer"/>
+ </query>
+
+ <!-- Get all fishing operation substrates [REF-14] -->
+ <query cacheable="true" name="allFishingOperationSubStratas">
+ <![CDATA[
+ SELECT
+ l.id as locationId,
+ l.label as locationLabel,
+ l.name as locationName,
+ l.locationLevel.id as locationLevelId,
+ l.status as status
+ FROM LocationImpl l
+ WHERE l.status.code IN (1, 2)
+ AND l.locationLevel.id = :locationLevelId
+ ]]>
+ </query>
+
+ <!-- Get all fishing operation locaties [REF-15] -->
+ <query cacheable="true" name="allFishingOperationLocalites">
+ <![CDATA[
+ SELECT
+ l.id as locationId,
+ l.label as locationLabel,
+ l.name as locationName,
+ l.locationLevel.id as locationLevelId,
+ l.status as status
+ FROM LocationImpl l
+ WHERE l.status.code IN (1, 2)
+ AND l.locationLevel.id = :locationLevelId
+ ]]>
+ </query>
+
+ <!-- TODO Fix it! Get all Length - Weight conversions [REF-16] -->
+ <!--query cacheable="true" name="allLengthWeightConvertions">
+ <![CDATA[]]>
+ </query-->
+
+ <!-- TODO Fix it! Get all benthos species [REF-17] -->
+ <query cacheable="true" name="allBenthosSpecies">
+ <![CDATA[
+ SELECT
+ t.id,
+ t.label,
+ t.name,
+ t.status
+ FROM TaxonGroupImpl t
+ WHERE t.taxonGroupType.code = :taxonGroupCode
+ AND t.isChildGroupExclusive = false
+ AND t.status.code IN (1, 2)
+ ]]>
+ <query-param name="taxonGroupCode" type="java.lang.Integer"/>
+ </query>
+
+ <!-- TODO Fix it! Get all plankton species [REF-18] TODO -->
+ <query cacheable="true" name="allPlanktonSpecies">
+ <![CDATA[
+ SELECT
+ t.id,
+ t.label,
+ t.name,
+ t.status
+ FROM TaxonGroupImpl t
+ WHERE t.taxonGroupType.code = :taxonGroupCode
+ AND t.isChildGroupExclusive = false
+ AND t.status.code IN (1, 2)
+ ]]>
+ <query-param name="taxonGroupCode" type="java.lang.Integer"/>
+ </query>
+
+ <!-- Get all macroWaste categories [REF-19] (use pmfmById + pmfmQualitativeValues) -->
+ <!--query cacheable="true" name="allMacroWasteCategories">
+ <![CDATA[
+ ]]>
+ </query-->
+
+ <!-- Get all macroWaste size categories [REF-20] (use pmfmById + pmfmQualitativeValues) -->
+ <!--query cacheable="true" name="allMacroWasteSizeCategories">
+ <![CDATA[
+ ]]>
+ </query-->
+
+ <!-- Get a pmfm caracteristics by this id [REF-24] -->
+ <query cacheable="true" name="pmfmById">
+ <![CDATA[
+ SELECT
+ p.id AS pmfmId,
+ p.parameter.name AS parameterName,
+ p.matrix.name AS matrixName,
+ p.fraction.name AS fractionName,
+ p.method.name AS methodName,
+ p.parameter.isAlphanumeric AS isAlphanumeric,
+ p.parameter.isQualitative AS isQualitative,
+ p.unit.symbol AS symbol,
+ p.status AS status
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.id= :pmfmId
+ ]]>
+ <query-param name="pmfmId" type="java.lang.Integer"/>
+ </query>
+
+ <!-- Get a pmfm qualitative values from his id [REF-25] -->
+ <query cacheable="true" name="pmfmQualitativeValues">
+ <![CDATA[
+ SELECT
+ qv.id AS id,
+ case when (qv.name = qv.description) then qv.name else concat(qv.name, ' - ', qv.description) end AS name,
+ qv.status AS status
+ FROM
+ PmfmImpl p JOIN p.qualitativeValues qv
+ WHERE p.id= :pmfmId
+ AND qv.status.code IN (1, 2)
+ ]]>
+ <query-param name="pmfmId" type="java.lang.Integer"/>
+ </query>
+
+ <!-- Get all pmfms using a same matrix Id -->
+ <query cacheable="true" name="allPmfmsByMatrixId">
+ <![CDATA[
+ SELECT
+ p.id AS pmfmId,
+ p.parameter.name AS parameterName,
+ p.matrix.name AS matrixName,
+ p.fraction.name AS fractionName,
+ p.method.name AS methodName,
+ p.parameter.isAlphanumeric AS isAlphanumeric,
+ p.parameter.isQualitative AS isQualitative,
+ p.unit.symbol AS symbol,
+ p.status AS status
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.matrix.id= :matrixId
+ ]]>
+ <query-param name="matrixId" type="java.lang.Integer"/>
+ </query>
+
+ <!-- Get all pmfms using a same parameter group id -->
+ <query cacheable="true" name="allPmfmsByParameterGroudId">
+ <![CDATA[
+ SELECT
+ p.id AS pmfmId,
+ p.parameter.name AS parameterName,
+ p.matrix.name AS matrixName,
+ p.fraction.name AS fractionName,
+ p.method.name AS methodName,
+ p.parameter.isAlphanumeric AS isAlphanumeric,
+ p.parameter.isQualitative AS isQualitative,
+ p.unit.symbol AS symbol,
+ p.status AS status
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.parameter.parameterGroup.id= :parameterGroupId
+ ]]>
+ <query-param name="parameterGroupId" type="java.lang.Integer"/>
+ </query>
+
+
</hibernate-mapping>
Modified: trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties 2013-01-09 18:34:01 UTC (rev 161)
@@ -21,58 +21,59 @@
# <http://www.gnu.org/licenses/gpl-3.0.html>.
# #L%
###
-# v3 Version de test
+# Version de preprod
-AcquisitionLevelCode.ACTIVITY=ACTIVITY
+AcquisitionLevelCode.ACTIVITY=MONTHLY_ACTIVITY
AcquisitionLevelCode.ACTIVITY_CALENDAR=ACTIVITY_CALENDAR
-AcquisitionLevelCode.BATCH=LOT
+AcquisitionLevelCode.BATCH=BATCH
AcquisitionLevelCode.FISHING_EFFORT_CALENDAR=EFFORT_CALENDAR
-AcquisitionLevelCode.FISHING_OPERATION=OPER_PREL
+AcquisitionLevelCode.FISHING_OPERATION=OPERATION
AcquisitionLevelCode.FISHING_TRIP=FISHING_TRIP
-AcquisitionLevelCode.FISHING_TRIP_PHYSICAL_GEAR=OBSERVED_PHYSICAL_GEAR
+AcquisitionLevelCode.FISHING_TRIP_PHYSICAL_GEAR=OBSERVED_FISHING_TRIP_PHYSICAL_GEAR
AcquisitionLevelCode.LANDING=LANDING
-AcquisitionLevelCode.MONTHLY_EFFORT=EFFORT_MENS
+AcquisitionLevelCode.MONTHLY_EFFORT=MONTHLY_FISHING_EFFORT
AcquisitionLevelCode.OBSERVED_LANDING=OBSERVED_LANDING
AcquisitionLevelCode.OBSERVED_SALE=OBSERVED_SALE
-AcquisitionLevelCode.OBSERVED_TRIP_ON_BOARD=MAREE_OBSERV_MER
-AcquisitionLevelCode.OPERATION=OPER
+AcquisitionLevelCode.OBSERVED_TRIP_ON_BOARD=OBSERVED_FISHING_TRIP
+AcquisitionLevelCode.OPERATION=OPERATION_fake
AcquisitionLevelCode.OPERATION_GROUP=OPERATION_GROUP
-AcquisitionLevelCode.PHYSICAL_GEAR=PHYS_GEAR
+AcquisitionLevelCode.PHYSICAL_GEAR=PHYSICAL_GEAR_SURVEY
AcquisitionLevelCode.SALE=SALE
AcquisitionLevelCode.SALE_SURVEY=SALE_SURVEY
-AcquisitionLevelCode.SAMPLE=ECHANT
+AcquisitionLevelCode.SAMPLE=SAMPLE
AcquisitionLevelCode.SCIENTIFIC_CRUISE=SCIENTIFIC_CRUISE
AcquisitionLevelCode.VESSEL_PHYSICALFEATURES=VESSEL_PHYSICAL_FEATURES
-AcquisitionLevelCode.YEARLYEFFORT=EFFORT_ANN
+AcquisitionLevelCode.YEARLYEFFORT=YEARLY_FISHING_EFFORT
AcquisitionLevelCode.CONTROLS_REFERENTIAL=CONTROLS_REFERENTIAL
-ActivityCalendarNumericalPmfmIds.GREATER_VALUE_PMFM=82
-ActivityCalendarNumericalPmfmIds.LOWER_VALUE_PMFM=85
-AggregationLevelId.DAY=1
-AggregationLevelId.FISHING_TRIP=6
-AggregationLevelId.HOUR=7
-AggregationLevelId.MONTH=2
-AggregationLevelId.NONE=0
-AggregationLevelId.SEMESTER=4
-AggregationLevelId.TRIMESTER=3
-AggregationLevelId.YEAR=5
+ActivityCalendarNumericalPmfmIds.GREATER_VALUE_PMFM=241
+ActivityCalendarNumericalPmfmIds.LOWER_VALUE_PMFM=242
+AggregationLevelId.DAY=4
+AggregationLevelId.FISHING_TRIP=9
+AggregationLevelId.HOUR=3
+AggregationLevelId.MONTH=21
+AggregationLevelId.NONE=1
+AggregationLevelId.SEMESTER=7
+AggregationLevelId.TRIMESTER=6
+AggregationLevelId.YEAR=8
CriteriaType.DEFAULT=0
CriteriaType.EXISTS=3
CriteriaType.JOIN=1
CriteriaType.NOT_EXISTS=4
CriteriaType.SELECT=2
-DepartmentCode.OUTSIDE=EXT
+DepartmentCode.OUTSIDE=EXTERIEUR
+Filters.RESULTS_SIZE_WARNING_VALUE=10000
FractionId.ALL=1
FractionId.GEAR=2
-GearClassificationId.CNTS=3
-GearClassificationId.EU=2
+GearClassificationId.CNTS=5
+GearClassificationId.EU=4
GearClassificationId.FAO=1
GearClassificationId.SCIENTIFIC_CRUISE=5
-GearUseFeaturesOriginMapping.ACTIVITY_CALENDAR=<PROGRAM> N-1|<PROGRAM>,Enquêteur|<INVESTIGATOR>,Déclaratif|<DECLARATIVE>,Ventes|SIH_OBSMER
-GearUseFeaturesOriginMapping.EFFORT_CALENDAR=<PROGRAM> N-1|<PROGRAM>,Enquêteur|<INVESTIGATOR>,Déclaratif|<DECLARATIVE>,Ventes|SIH_OBSMER
+GearUseFeaturesOriginMapping.ACTIVITY_CALENDAR=Activit\u00E9 N-1|<PROGRAM>,Enqu\u00EAteur|<INVESTIGATOR>,Document d\u00E9claratif|<DECLARATIVE>,Ventes|OFIMER
+GearUseFeaturesOriginMapping.EFFORT_CALENDAR=Activit\u00E9 N-1|<PROGRAM>,Enqu\u00EAteur|<INVESTIGATOR>,Document d\u00E9claratif|<DECLARATIVE>,Ventes|OFIMER
isActive.ACTIVE=1
isActive.INACTIVE=0
isActive.NOT_EXISTS=2
-LocationClassificationId.REGULATION=4
+LocationClassificationId.REGULATION=3
LocationClassificationId.SECTOR=2
LocationClassificationId.TERRITORIAL=1
LocationLabel.FRANCE=FRA
@@ -88,49 +89,49 @@
LocationLevelId.SOUS_RECTANGLE_STATISTIQUE=114
ManageDataTypeId.ACTIVITY_CALENDAR=4
ManageDataTypeId.OBSERVED_FISHING_TRIP_ON_BOARD=5
-ManageDataTypeId.PHYSICAL_GEAR_SURVEY=6
-ManageDataTypeId.SALE=7
-ManageDataTypeId.SCIENTIFIC_CRUISE=8
-MatrixId.FISHING_METIER=10
-MatrixId.GEAR=2
-MatrixId.OPERATION=7
-MatrixId.VESSEL=8
+ManageDataTypeId.PHYSICAL_GEAR_SURVEY=7
+ManageDataTypeId.SALE=8
+ManageDataTypeId.SCIENTIFIC_CRUISE=9
+MatrixId.FISHING_METIER=6
+MatrixId.GEAR=3
+MatrixId.OPERATION=21
+MatrixId.VESSEL=5
MatrixId.SUPPORT_WITH_GEAR=17
MatrixId.SUPPORT_WITH_METIER=18
-MethodId.ALIVE_WEIGHT_EQUIVALENT=6
-MethodId.ESTIMATED=2
-MethodId.HEIGHT_WEIGHT=7
-MethodId.TOTAL_BATCH=17
+MethodId.ALIVE_WEIGHT_EQUIVALENT=5
+MethodId.ESTIMATED=45
+MethodId.HEIGHT_WEIGHT=47
+MethodId.TOTAL_BATCH=283
OrderTypeId.NORTH_SOUTH_LOCATION_RANK=1
-ParameterCode.ANOTHER_SURVEY=AUTRE_ENQ
-ParameterCode.BULK=VRAC/HORS VRAC
-ParameterCode.CALCULATED_WEIGHT=POIDS_CALCULE
+ParameterCode.ANOTHER_SURVEY=ACCEPT_OTHER_SURVEY
+ParameterCode.BULK=SORTED
+ParameterCode.CALCULATED_WEIGHT=WEIGHT_CALCULATED
ParameterCode.CONTRACT_CODE=CONTRACT_CODE
-ParameterCode.CREW_SIZE=NB_HOMME_BORD
-ParameterCode.DATA_RELIABILITY=FIAB_DATA
+ParameterCode.CREW_SIZE=CREW_SIZE
+ParameterCode.DATA_RELIABILITY=SURVEY_RELIABILITY
ParameterCode.DISCARD_TYPE=DISCARD_TYPE
-ParameterCode.ENGIN_TIME=NB_HEURES_MOTEUR
-ParameterCode.FISHING_DAY_COUNT=NB_JOURS_PECHE
-ParameterCode.GEAR_DEPTH=PROF
+ParameterCode.ENGIN_TIME=ENGIN_DURATION
+ParameterCode.FISHING_DAY_COUNT=FISHING_DURATION
+ParameterCode.GEAR_DEPTH=GEAR_DEPTH
ParameterCode.IS_SAMPLING=IS_SAMPLING
-ParameterCode.LANDING_REJECTION=DEB/REJ
-ParameterCode.PRESENTATION=PRES
-ParameterCode.PROCEEDING=DEROULEMENT
-ParameterCode.RECEPTION_QUALITY=QUALIT_ACC
-ParameterCode.SEA_DAY_COUNT=NB_JOURS_MER
-ParameterCode.SEA_STATE=ETAT_MER
-ParameterCode.SEX=SEXE
-ParameterCode.SIZE=TAILLE
-ParameterCode.STATUS=ETAT
-ParameterCode.SURVEY_QUALIFICATION=QUALIF_ENQ
-ParameterCode.VALIDATION_PROGRAM=VALIDPRO
-ParameterCode.VALIDATION_SUPERVISOR=VALIDSUP
-ParameterCode.WEIGHT=POIDS
-ParameterCode.SIZE_UNLI_CAT=CATEGORIE
+ParameterCode.LANDING_REJECTION=DISCARD_OR_LANDING
+ParameterCode.PRESENTATION=DRESSING
+ParameterCode.PROCEEDING=TRIP_PROGRESS
+ParameterCode.RECEPTION_QUALITY=WELCOME_QUALITY
+ParameterCode.SEA_DAY_COUNT=DURATION_AT_SEA
+ParameterCode.SEA_STATE=SEA_STATE
+ParameterCode.SEX=SEX
+ParameterCode.SIZE=LENGTH_TOTAL
+ParameterCode.STATUS=QUALITY
+ParameterCode.SURVEY_QUALIFICATION=SURVEY_QUALIFICATION
+ParameterCode.VALIDATION_PROGRAM=IS_VALIDATED_PRG
+ParameterCode.VALIDATION_SUPERVISOR=IS_VALIDATED
+ParameterCode.WEIGHT=WEIGHT
+ParameterCode.SIZE_UNLI_CAT=SIZE_UNLI_CAT
ParameterCode.SIZE_UE_CAT=SIZE_UE_CAT
ParameterCode.CASE=CASE
ParameterCode.SORTING_TYPE=SORTING_TYPE
-ParameterCode.PRESERVATION=ETAT
+ParameterCode.PRESERVATION=PRESERVATION
ParameterCode.DRESSING=DRESSING
ParameterCode.AGE=AGE
ParameterCode.LENGTH_TOTAL=LENGTH_TOTAL
@@ -167,60 +168,60 @@
ParameterCode.WARP_LENGTH=WARP_LENGTH
ParameterCode.CIRCUMFERENCE=CIRCUMFERENCE
ParameterCode.WIDTH=WIDTH
-ParameterGroupId.SURVEY_MEASUREMENT=6
-PmfmId.ALIVE_WEIGHT_CALCULATED=POIDS_CALCULE;6;1;6
-PmfmId.CALCULATED_WEIGHT_CHILDREN_SUM=POIDS_CALCULE;6;1;24
-PmfmId.WEIGHT_SIZE_CALCULATED=POIDS_CALCULE;6;1;7
-PmfmId.WEIGHT_SIZE_EXTRAPOLATE=POIDS_CALCULE;6;1;21
-PmfmId.WEIGHT_TOTAL_CALCULATED=POIDS_CALCULE;6;1;17
+ParameterGroupId.SURVEY_MEASUREMENT=21
+PmfmId.ALIVE_WEIGHT_CALCULATED=WEIGHT_CALCULATED;1;1;5
+PmfmId.CALCULATED_WEIGHT_CHILDREN_SUM=WEIGHT_CALCULATED;1;1;341
+PmfmId.WEIGHT_SIZE_CALCULATED=WEIGHT_CALCULATED;1;1;47
+PmfmId.WEIGHT_SIZE_EXTRAPOLATE=WEIGHT_CALCULATED;1;1;283
+PmfmId.WEIGHT_TOTAL_CALCULATED=WEIGHT_CALCULATED;1;1;22
PmfmId.MAX_DURATION_FOR_OPERATION_WITH_GEAR=DUREE_MAX_OPERATION;17;1;1
PmfmId.MAX_DISTANCE_FOR_OPERATION_WITH_GEAR=DISTANCE_MAX_OPERATION;17;1;1
PmfmId.MAX_DURATION_FOR_OPERATION_WITH_METIER=DUREE_MAX_OPERATION;18;1;1
PmfmId.MAX_DISTANCE_FOR_OPERATION_WITH_METIER=DISTANCE_MAX_OPERATION;18;1;1
-PmfmId.STORAGE_STATE=CLOSE_OBSVENTE_STOCK;19;11;1
-ProgramCode.ACTIVITY=SIH_STATPECHE
-ProgramCode.ACTIVITY_MERGE=SIH_STATPECHE_CONFLIT
-ProgramCode.DECLARATIVE_FLOW=SIPA
+PmfmId.STORAGE_STATE=CLOSE_OBSVENTE_STOCK;61;61;21
+ProgramCode.ACTIVITY=SIH-ACTIFLOT
+ProgramCode.ACTIVITY_MERGE=SIH-ACTIFLOT-CONFLIT
+ProgramCode.DECLARATIVE_FLOW=SIH-ACTIPRED
ProgramCode.PRE_RECOPESCA=SIH-preRECOPESCA
ProgramCode.RECOPESCA=SIH-RECOPESCA
-ProgramCode.SIH_OBSERVED_FISHING_TRIP_ON_BOARD=SIH_OBSMER
-ProgramCode.SIH_OBSMER=SIH_OBSMER
-ProgramCode.SIH_STATPECHE_CONFLIT=SIH_STATPECHE_CONFLIT
-ProgramCode.STAT_PECHE=SIH_STATPECHE
-SaleDateControlByProgram.MAX_DAYS_AFTER_FISHING_TRIP=SIH_OBSMER|3,SIH_OBSVENTE|3
-BatchControl.SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT=PRES,SIZE_UNLI_CAT,SEXE
-BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT=SIH_OBSMER|50,SIH_OBSVENTE|50
-BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN=SIH_OBSMER|5,SIH_OBSVENTE|5
-BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT=SIH_OBSMER|100,SIH_OBSVENTE|100
-BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX=SIH_OBSMER|5,SIH_OBSVENTE|5
-ProgramManagedDataTypeMapping.FISHING_TRIP=SIH_OBSMER|5
-ProgramManagedDataTypeMapping.SALE=SIH_OBSVENTE|7
-ProgramObjectTypeMapping.FISHING_TRIP=SIH_OBSMER|OBSERVED_FISHING_TRIP
-ProgramObjectTypeMapping.SALE=SIH_OBSVENTE|OBSERVED_SALE
+ProgramCode.SIH_OBSERVED_FISHING_TRIP_ON_BOARD=SIH-OBSMER
+ProgramCode.SIH_OBSMER=SIH-OBSMER
+ProgramCode.SIH_STATPECHE_CONFLIT=SIH-ACTIFLOT-CONFLIT
+ProgramCode.STAT_PECHE=SIH-ACTIFLOT
+SaleDateControlByProgram.MAX_DAYS_AFTER_FISHING_TRIP=SIH-OBSMER|3,SIH-OBSVENTE|3
+BatchControl.SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT=DRESSING,SIZE_UNLI_CAT,SEX
+BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT=SIH-OBSMER|50,SIH-OBSVENTE|50
+BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN=SIH-OBSMER|5,SIH-OBSVENTE|5
+BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT=SIH-OBSMER|100,SIH-OBSVENTE|100
+BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX=SIH-OBSMER|5,SIH-OBSVENTE|5
+ProgramManagedDataTypeMapping.FISHING_TRIP=SIH-OBSMER|5
+ProgramManagedDataTypeMapping.SALE=SIH-OBSVENTE|8
+ProgramObjectTypeMapping.FISHING_TRIP=SIH-OBSMER|OBSERVED_FISHING_TRIP
+ProgramObjectTypeMapping.SALE=SIH-OBSVENTE|OBSERVED_SALE
ProgramPrivilegeId.MANAGER=1
ProgramPrivilegeId.QUALIFICATOR=5
ProgramPrivilegeId.RECORDER=2
ProgramPrivilegeId.VALIDATOR=4
ProgramPrivilegeId.VIEWER=3
-QualitativeValueId.ABNORMAL=28
-QualitativeValueId.ANOTHER_SURVEY_NO=34
-QualitativeValueId.ANOTHER_SURVEY_YES=33
-QualitativeValueId.DIRECT_SURVEY=49
-QualitativeValueId.DISCARD_TYPE_ANIMALS=48
-QualitativeValueId.ESTIMATE_SURVEY=51
-QualitativeValueId.FRY_STATUS=31
-QualitativeValueId.INDIRECT_SURVEY=50
-QualitativeValueId.INTEGRAL_PRESENTATION=7
-QualitativeValueId.IS_SAMPLING=56
-QualitativeValueId.LANDING=3
-QualitativeValueId.NON_SEXED_SEX=55
-QualitativeValueId.VALIDATION_PROGRAM_DO_CORRECTION=2162
-QualitativeValueId.VALIDATION_SUPERVISOR_NO=2151
-QualitativeValueId.VALIDATION_SUPERVISOR_YES=2150
-QualitativeValueId.SORTING_TYPE_TPN=71
-QualitativeValueId.SORTING_TYPE_TCC=70
-QualitativeValueId.REJECTED=4
-QualitativeValueId.VRAC=1
+QualitativeValueId.ABNORMAL=328
+QualitativeValueId.ANOTHER_SURVEY_NO=847
+QualitativeValueId.ANOTHER_SURVEY_YES=846
+QualitativeValueId.DIRECT_SURVEY=965
+QualitativeValueId.DISCARD_TYPE_ANIMALS=407
+QualitativeValueId.ESTIMATE_SURVEY=967
+QualitativeValueId.FRY_STATUS=142
+QualitativeValueId.INDIRECT_SURVEY=966
+QualitativeValueId.INTEGRAL_PRESENTATION=139
+QualitativeValueId.IS_SAMPLING=415
+QualitativeValueId.LANDING=203
+QualitativeValueId.NON_SEXED_SEX=302
+QualitativeValueId.VALIDATION_PROGRAM_DO_CORRECTION=942
+QualitativeValueId.VALIDATION_SUPERVISOR_NO=418
+QualitativeValueId.VALIDATION_SUPERVISOR_YES=417
+QualitativeValueId.SORTING_TYPE_TPN=1746
+QualitativeValueId.SORTING_TYPE_TCC=1747
+QualitativeValueId.REJECTED=204
+QualitativeValueId.VRAC=311
QualityFlagCode.BAD=4
QualityFlagCode.CORRECTED=5
QualityFlagCode.DOUBTFUL=3
@@ -246,37 +247,37 @@
SaleTypeId.SUPERMARCHE=-4
SaleTypeId.TRANSFORMATEUR=3
SaleTypeId.VENTE_PARTICULIER=-1
-SamplingSchemeControl.MANDATORY_PROGRAM_LIST=SIH_OBSMER,SIH_OBSVENTE
+SamplingSchemeControl.MANDATORY_PROGRAM_LIST=SIH-OBSVENTE
SpatialItemTypeId.DEPTH_GRADIENT=1
SpatialItemTypeId.DISTANCE_TO_COAST_GRADIENT=3
-SpatialItemTypeId.GEAR=4
+SpatialItemTypeId.GEAR=5
SpatialItemTypeId.METIER=7
SpatialItemTypeId.NEARBY_SPECIFIC_AREA=2
-SpatialItemTypeId.TAXON_GROUP=5
+SpatialItemTypeId.TAXON_GROUP=4
StatusCode.DELETED=3
StatusCode.DISABLE=0
StatusCode.ENABLE=1
StatusCode.TEMPORARY=2
StorageStateValues.CLOSED=69
-SurveyQualificationId.DIRECT=1
-SurveyQualificationId.ESTIMATION=3
-SurveyQualificationId.INDIRECT=2
-SurveyQualificationId.PREDOCUMENTATION=4
+SurveyQualificationId.DIRECT=0
+SurveyQualificationId.ESTIMATION=0
+SurveyQualificationId.INDIRECT=0
+SurveyQualificationId.PREDOCUMENTATION=0
SurveyQualificationId.UNKNOWN=0
SynchronizationStatus.DELETED=DELETED
SynchronizationStatus.DIRTY=DIRTY
SynchronizationStatus.READY_TO_SYNCHRONIZE=READY_TO_SYNC
SynchronizationStatus.SYNCHRONIZED=SYNC
-TaxonGroupId.FISH=8
-TaxonGroupTypeCode.COMMERCIAL_SPECIES=1
-TaxonGroupTypeCode.METIER_SPECIES=2
-TaxonomicLevelCode.SPECIES=5
-TaxonomicLevelCode.VARIETY=6
+TaxonGroupId.FISH=1712
+TaxonGroupTypeCode.COMMERCIAL_SPECIES=2
+TaxonGroupTypeCode.METIER_SPECIES=3
+TaxonomicLevelCode.SPECIES=SPECIES
+TaxonomicLevelCode.VARIETY=SUBSPECIES
TranscribingSideId.IN=2
TranscribingSideId.IN_OUT=3
TranscribingSideId.OUT=1
TranscribingSystemId.FAO=4
-TranscribingSystemId.HARMONIE=1
+TranscribingSystemId.HARMONIE=5
TranscribingSystemId.OFIMER=3
TranscribingSystemId.SIPA=2
UnitId.DAY=17
@@ -290,8 +291,38 @@
VesselTypeId.FISHING_VESSEL=1
VesselTypeId.FISHING_VESSEL_GROUP=2
VesselTypeId.PLEASURE_BOAT=4
-VesselTypeId.SCIENTIFIC_RESEARCH_VESSEL=5
+VesselTypeId.SCIENTIFIC_RESEARCH_VESSEL=8
VesselTypeId.SHELLFISH_GATHERER=3
-ZoneCompetenceMapping.GROUND=Finistère|506;516,Méditerranée|408;391
-ZoneCompetenceMapping.SEA=Finistère|4018,Méditerranée|4022
-ZoneCompetenceMapping.DEFAULT_LOCATION_LEVEL=Finistère|113;114,Méditerranée|142
+ZoneCompetenceMapping.GROUND=Corse|394;391,Guadeloupe|430,Guyanne|423,La Réunion|433,Martinique|425,Mayotte|424;429,Méditerranée|408;410;420;415;419;415;419,Mer du nord manche atlantique|386;387;388;389;390;392;393;395;396;397;398;399;400;401;402;403;404;405;406;407;409;411;412;414;416;417;418;421;422;432;435;436,Saint Pierre et Miquelon|434
+ZoneCompetenceMapping.SEA=Corse|4022,Guadeloupe|4020,Guyanne|4020,La Réunion|4028,Martinique|4020,Mayotte|4028,Méditerranée|4022,Mer du nord manche atlantique|4018,Saint Pierre et Miquelon|4017
+ZoneCompetenceMapping.DEFAULT_LOCATION_LEVEL=Corse|142,Guadeloupe|158;159,Guyanne|154;156,La Réunion|151;152,Martinique|158;159,Mayotte|,Méditerranée|142,Mer du nord manche atlantique|113;114,Saint Pierre et Miquelon|101
+
+# Ajoute pour Tutti
+LocationLevelId.LOCALITE=22
+LocationLevelId.STRATA=23
+#TODO Creer la bonne valeur
+LocationLevelId.SUBSTRATA=-23
+#TODO Mettre la bonne valeur
+LocationLevelId.PROGRAM=111
+
+MatrixId.BATCH=1
+
+ParameterGroupId.ENVIRONEMENT_MEASUREMENT=3
+#TODO Mettre la bonne valeur
+ParameterGroupId.HYDROLOGIC_MEASUREMENT=3
+#TODO A creer
+ParameterGroupId.LENGTH=3
+
+PmfmId.SEX=196
+PmfmId.SIZE_CATEGORY=198
+PmfmId.SORTED_UNSORTED=200
+# TODO A confirmer
+PmfmId.MATURITY=1181
+#TODO A créér
+PmfmId.MACRO_WASTE_CATEGORY=1181
+#TODO A créér
+PmfmId.MACRO_WASTE_SIZE_CATEGORY=1181
+
+
+
+
Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -68,7 +68,7 @@
@Before
public void setUp() throws Exception {
- config = TestUtil.createConfig(getClass(), name);
+ config = TestUtil.createConfig(getClass(), name.getMethodName());
if (log.isDebugEnabled()) {
log.debug("Use conf.properties at " + config.getDbConfigurationPath());
Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/GearDaoTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/GearDaoTest.java 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/GearDaoTest.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -1,48 +0,0 @@
-package fr.ifremer.tutti.persistence;
-
-/*
- * #%L
- * Tutti :: Persistence Adagio (impl)
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hibernate.Query;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.List;
-
-public class GearDaoTest extends BaseDaoTest {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(GearDaoTest.class);
-
- @Test
- public void getAllGear() {
-
- Query query = getSession().getNamedQuery("getAllGears");
-
- List gears = query.list();
- Assert.assertNotNull(gears);
- }
-}
Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -0,0 +1,241 @@
+package fr.ifremer.tutti.persistence;
+
+import fr.ifremer.tutti.persistence.config.TuttiPersistenceAdagioConfig;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.Country;
+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 org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.nuiton.util.ArgumentsParserException;
+import org.springframework.context.ApplicationContext;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Test the referential service.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class ReferentialTest {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(ReferentialTest.class);
+
+ protected static TuttiPersistenceAdagioConfig config;
+
+ protected static TuttiPersistence driver;
+
+ @BeforeClass
+ public static void beforeClass() throws IOException, ArgumentsParserException {
+
+ TestUtil.checkDbExists();
+
+ config = TestUtil.createConfig(ReferentialTest.class, "");
+
+ if (log.isDebugEnabled()) {
+ log.debug("Use conf.properties at " + config.getDbConfigurationPath());
+ }
+ ApplicationContext context = TestUtil.createSpringContext();
+
+ driver = (TuttiPersistence) context.getBean("adagioPersistenceService");
+
+ driver.setEnumerations(config.getDbEnumerations());
+
+ driver.open();
+ }
+
+ @AfterClass
+ public static void afterClass() throws Exception {
+
+ // push back old classLoader
+ TestUtil.resetClassLoader();
+
+ // close hibernate session if was used
+ if (driver != null) {
+ driver.close();
+ }
+ }
+
+ @Test
+ public void getAllProgramZone() {
+ List<Zone> result = driver.getAllProgramZone();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(0, result.size());
+ }
+
+ @Test
+ public void getAllCountry() {
+ List<Country> result = driver.getAllCountry();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(240, result.size());
+ }
+
+ @Test
+ public void getAllScientificVessel() {
+ List<Vessel> result = driver.getAllScientificVessel();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(1, result.size());
+ }
+
+ //FIXME : requete trop longue (index manquant, trop de jointures?)
+ @Test
+ @Ignore
+ public void getAllFishingVessel() {
+ List<Vessel> result = driver.getAllFishingVessel();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(187, result.size());
+ }
+
+ @Test
+ public void getAllScientificGear() {
+ List<Gear> result = driver.getAllScientificGear();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(2, result.size());
+ }
+
+ @Test
+ public void getAllFishingGear() {
+ List<Gear> result = driver.getAllFishingGear();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(75, result.size());
+ }
+
+ @Test
+ public void getAllPerson() {
+ List<Person> result = driver.getAllPerson();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(226, result.size());
+ }
+
+
+ @Test
+ public void getAllSpecies() {
+ List<Species> result = driver.getAllSpecies();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(156, result.size());
+ }
+
+ @Test
+ public void getAllBenthosSpecies() {
+ List<Species> result = driver.getAllBenthosSpecies();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(156, result.size());
+ }
+
+ @Test
+ public void getAllPlanktonSpecies() {
+ List<Species> result = driver.getAllPlanktonSpecies();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(156, result.size());
+ }
+
+ @Test
+ public void getSpecies(/*String speciesId*/) {
+ }
+
+ @Test
+ public void getAllFishingOperationStrata(/*String zoneId*/) {
+ }
+
+ @Test
+ public void getAllFishingOperationSubStrata(/*String locationId*/) {
+ }
+
+ @Test
+ public void getAllFishingOperationLocation(/*String locationId*/) {
+ }
+
+ @Test
+ public void getAllFishingOperationEnvironmentCaracteristic() {
+ List<Caracteristic> result = driver.getAllFishingOperationEnvironmentCaracteristic();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(40, result.size());
+ }
+
+ @Test
+ public void getAllFishingOperationGearCaracteristic() {
+ List<Caracteristic> result = driver.getAllFishingOperationGearCaracteristic();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(155, result.size());
+ }
+
+ @Test
+ public void getAllFishingOperationHydrologicCaracteristic() {
+ List<Caracteristic> result = driver.getAllFishingOperationHydrologicCaracteristic();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(40, result.size());
+ }
+
+ @Test
+ public void getAllSpeciesLengthStepCaracteristic() {
+ List<Caracteristic> result = driver.getAllSpeciesLengthStepCaracteristic();
+ Assert.assertNotNull(result);
+ Assert.assertEquals(0, result.size());
+ }
+
+ @Test
+ public void getSizeCategoryCaracteristic() {
+ Caracteristic result = driver.getSizeCategoryCaracteristic();
+ Assert.assertNotNull(result);
+ Assert.assertTrue(result.isQualitativeType());
+ Assert.assertNotNull(result.getQualitativeValue());
+ Assert.assertEquals(6, result.sizeQualitativeValue());
+ }
+
+ @Test
+ public void getSexCaracteristic() {
+ Caracteristic result = driver.getSexCaracteristic();
+ Assert.assertNotNull(result);
+ Assert.assertTrue(result.isQualitativeType());
+ Assert.assertNotNull(result.getQualitativeValue());
+ Assert.assertEquals(4, result.sizeQualitativeValue());
+ }
+
+ @Test
+ public void getSortedUnsortedCaracteristic() {
+ Caracteristic result = driver.getSortedUnsortedCaracteristic();
+ Assert.assertNotNull(result);
+ Assert.assertTrue(result.isQualitativeType());
+ Assert.assertNotNull(result.getQualitativeValue());
+ Assert.assertEquals(2, result.sizeQualitativeValue());
+ }
+
+ @Test
+ public void getMaturityCaracteristic() {
+ Caracteristic result = driver.getMaturityCaracteristic();
+ Assert.assertNotNull(result);
+ Assert.assertTrue(result.isQualitativeType());
+ Assert.assertNotNull(result.getQualitativeValue());
+ Assert.assertEquals(10, result.sizeQualitativeValue());
+ }
+
+ @Test
+ public void getMacroWasteCategoryCaracteristic() {
+ Caracteristic result = driver.getMacroWasteCategoryCaracteristic();
+ Assert.assertNotNull(result);
+ Assert.assertTrue(result.isQualitativeType());
+ Assert.assertNotNull(result.getQualitativeValue());
+ Assert.assertEquals(10, result.sizeQualitativeValue());
+ }
+
+ @Test
+ public void getMacroWasteSizeCategoryCaracteristic() {
+ Caracteristic result = driver.getMacroWasteSizeCategoryCaracteristic();
+ Assert.assertNotNull(result);
+ Assert.assertTrue(result.isQualitativeType());
+ Assert.assertNotNull(result.getQualitativeValue());
+ Assert.assertEquals(10, result.sizeQualitativeValue());
+ }
+
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -30,7 +30,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Assume;
-import org.junit.rules.TestName;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ArgumentsParserException;
import org.springframework.context.ApplicationContext;
@@ -55,7 +54,7 @@
private static ClassLoader oldClassLoader;
public static TuttiPersistenceAdagioConfig createConfig(Class<?> klass,
- TestName name) throws ArgumentsParserException, IOException {
+ String name) throws ArgumentsParserException, IOException {
File resourceDirectory = TestUtil.getTestSpecificDirectory(klass, name);
@@ -73,7 +72,7 @@
resourceDirectory.getAbsolutePath());
applicationConfig.parse();
- TuttiPersistenceAdagioConfig config =
+ TuttiPersistenceAdagioConfig config =
new TuttiPersistenceAdagioConfig(applicationConfig);
config.initConfig(loader);
@@ -98,7 +97,7 @@
}
public static File getTestSpecificDirectory(Class<?> klass,
- TestName name) throws IOException {
+ String name) throws IOException {
// Trying to look for the temporary folder to store data for the test
String tempDirPath = System.getProperty("java.io.tmpdir");
if (tempDirPath == null) {
@@ -113,7 +112,7 @@
// create the directory to store database data
String dataBasePath = klass.getName()
+ File.separator // a directory with the test class name
- + name.getMethodName() // a sub-directory with the method name
+ + name // a sub-directory with the method name
+ '_'
+ BUILD_TIMESTAMP; // and a timestamp
File databaseFile = new File(tempDirFile, dataBasePath);
Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -25,26 +25,24 @@
*/
import fr.ifremer.tutti.persistence.config.TuttiPersistenceAdagioConfig;
-import fr.ifremer.tutti.persistence.entities.referential.Gear;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.After;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.springframework.context.ApplicationContext;
-import java.util.List;
-
/**
* To test the {@link TuttiPersistenceAdagioImpl} service.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 0.3
*/
+@Ignore
public class TuttiPersistenceAdagioImplTest {
/** Logger. */
@@ -67,7 +65,7 @@
@Before
public void setUp() throws Exception {
- config = TestUtil.createConfig(getClass(), name);
+ config = TestUtil.createConfig(getClass(), name.getMethodName());
if (log.isDebugEnabled()) {
log.debug("Use conf.properties at " + config.getDbConfigurationPath());
@@ -93,11 +91,267 @@
}
}
+ //------------------------------------------------------------------------//
+ //-- Referential methods --//
+ //------------------------------------------------------------------------//
+
+
@Test
- public void testGetAllGear() throws Exception {
+ @Ignore
+ public void getAllProgram() {
- List<Gear> allGear = driver.getAllGear();
- Assert.assertNotNull(allGear);
- Assert.assertFalse(allGear.isEmpty());
}
+
+ @Test
+ @Ignore
+ public void getProgram(/*String id*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void createProgram(/*Program bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void saveProgram(/*Program bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getAllCruise(/*String programId*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getCruise(/*String id*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void createCruise(/*Cruise bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void saveCruise(/*Cruise bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getAllProtocol() {
+
+ }
+
+ @Test
+ @Ignore
+ public void getProtocol(/*String id*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void createProtocol(/*TuttiProtocol bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void saveProtocol(/*TuttiProtocol bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getAllFishingOperation(/*String cruiseId*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getFishingOperation(/*String id*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void createFishingOperation(/*FishingOperation bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void saveFishingOperation(/*FishingOperation bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getAllRootSpeciesBatch(/*String fishingOperationId*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getAllSpeciesBatch(/*String fishingOperationId*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getSpeciesBatch(/*String id*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void createSpeciesBatch(/*SpeciesBatch bean, String parentBatchId*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void saveSpeciesBatch(/*SpeciesBatch bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void deleteSpeciesBatch(/*String id*/) {
+ }
+
+ @Test
+ @Ignore
+ public void deleteSpeciesSubBatch(/*String id*/) {
+ }
+
+ @Test
+ @Ignore
+ public void getAllSpeciesBatchFrequency(/*String speciesBatchId*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getAllBenthosBatch(/*String fishingOperationId*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getBenthosBatch(/*String id*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void createBenthosBatch(/*BenthosBatch bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void saveBenthosBatch(/*BenthosBatch bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void deleteBenthosBatch(/*String id*/) {
+ }
+
+ @Test
+ @Ignore
+ public void getAllPlanktonBatch(/*String fishingOperationId*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getPlanktonBatch(/*String id*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void createPlanktonBatch(/*PlanktonBatch bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void savePlanktonBatch(/*PlanktonBatch bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void deletePlanktonBatch(/*String id*/) {
+ }
+
+ @Test
+ @Ignore
+ public void getAllMacroWasteBatch(/*String fishingOperationId*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getMacroWasteBatch(/*String id*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void createMacroWasteBatch(/*MacroWasteBatch bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void saveMacroWasteBatch(/*MacroWasteBatch bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void deleteMacroWasteBatch(/*String id*/) {
+ }
+
+ @Test
+ @Ignore
+ public void getAllAccidentalBatch(/*String fishingOperationId*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void getAccidentalBatch(/*String id*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void createAccidentalBatch(/*AccidentalBatch bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void saveAccidentalBatch(/*AccidentalBatch bean*/) {
+
+ }
+
+ @Test
+ @Ignore
+ public void deleteAccidentalBatch(/*String id*/) {
+ }
+
}
Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/VesselDaoTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/VesselDaoTest.java 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/VesselDaoTest.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -1,54 +0,0 @@
-package fr.ifremer.tutti.persistence;
-
-/*
- * #%L
- * Tutti :: Persistence Adagio (impl)
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.hibernate.Query;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.util.List;
-
-public class VesselDaoTest extends BaseDaoTest {
-
- @Test
- public void getScientificVessel() {
-
- Query query = getSession().getNamedQuery("getAllScientificVessels");
-
- List vessels = query.list();
- Assert.assertNotNull(vessels);
- }
-
- @Ignore
- @Test
- public void getFishingVessel() {
-
- Query query = getSession().getNamedQuery("getAllFishingVessels");
-
- List vessels = query.list();
- Assert.assertNotNull(vessels);
- }
-}
Modified: trunk/tutti-persistence-adagio/src/test/resources/tutti-test.properties
===================================================================
--- trunk/tutti-persistence-adagio/src/test/resources/tutti-test.properties 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-adagio/src/test/resources/tutti-test.properties 2013-01-09 18:34:01 UTC (rev 161)
@@ -21,4 +21,5 @@
# <http://www.gnu.org/licenses/gpl-3.0.html>.
# #L%
###
-tutti.persistence.jdbc.url=jdbc:hsqldb:file:src/test/db/allegro
\ No newline at end of file
+tutti.persistence.jdbc.url=jdbc:hsqldb:file:src/test/db/allegro
+#tutti.persistence.jdbc.url=jdbc:hsqldb:hsql://localhost/allegro
\ No newline at end of file
Added: trunk/tutti-persistence-adagio/src/test/server.properties
===================================================================
--- trunk/tutti-persistence-adagio/src/test/server.properties (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/server.properties 2013-01-09 18:34:01 UTC (rev 161)
@@ -0,0 +1,2 @@
+server.database.0=file:db/allegro
+server.dbname.0=allegro
\ No newline at end of file
Property changes on: trunk/tutti-persistence-adagio/src/test/server.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence-adagio/src/test/startServer.sh
===================================================================
--- trunk/tutti-persistence-adagio/src/test/startServer.sh (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/startServer.sh 2013-01-09 18:34:01 UTC (rev 161)
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+java -classpath ~/.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar org.hsqldb.Server --database.0 file:db/allegro --dbname.0 allegro
\ No newline at end of file
Property changes on: trunk/tutti-persistence-adagio/src/test/startServer.sh
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java
===================================================================
--- trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -206,13 +206,25 @@
}
@Override
+ public List<Species> getAllBenthosSpecies() {
+ List<Species> result = getDataInNewList(Species.class);
+ return result;
+ }
+
+ @Override
+ public List<Species> getAllPlanktonSpecies() {
+ List<Species> result = getDataInNewList(Species.class);
+ return result;
+ }
+
+ @Override
public Species getSpecies(String id) {
Species result = getBean(Species.class, id);
return result;
}
@Override
- public List<Zone> getAllZone() {
+ public List<Zone> getAllProgramZone() {
List<Zone> result = getDataInNewList(Zone.class);
return result;
}
@@ -224,18 +236,40 @@
}
@Override
- public List<Vessel> getAllVessel() {
- List<Vessel> result = getDataInNewList(Vessel.class);
+ public List<Vessel> getAllScientificVessel() {
+ List<Vessel> result = Lists.newArrayList(Iterables.filter(getData(Vessel.class), new Predicate<Vessel>() {
+ @Override
+ public boolean apply(Vessel input) {
+ return input.isScientificVessel();
+ }
+ }));
return result;
}
@Override
- public List<Gear> getAllGear() {
+ public List<Vessel> getAllFishingVessel() {
+ List<Vessel> result = Lists.newArrayList(Iterables.filter(getData(Vessel.class), new Predicate<Vessel>() {
+ @Override
+ public boolean apply(Vessel input) {
+ return !input.isScientificVessel();
+ }
+ }));
+ return result;
+ }
+
+ @Override
+ public List<Gear> getAllScientificGear() {
List<Gear> result = getDataInNewList(Gear.class);
return result;
}
@Override
+ public List<Gear> getAllFishingGear() {
+ List<Gear> result = getDataInNewList(Gear.class);
+ return result;
+ }
+
+ @Override
public List<Person> getAllPerson() {
List<Person> result = getDataInNewList(Person.class);
return result;
Modified: trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java
===================================================================
--- trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -136,7 +136,7 @@
Program s = new Program();
s.setId("46de4ba5-3be6-4ab6-9f39-586b8e491fda");
s.setName("Serie 3");
- s.setZone(persistence.getAllZone().get(0));
+ s.setZone(persistence.getAllProgramZone().get(0));
persistence.createProgram(s);
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-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -173,19 +173,40 @@
//-- Referential methods --//
//------------------------------------------------------------------------//
+
@Override
+ public List<Vessel> getAllScientificVessel() {
+ return devDriver.getAllScientificVessel();
+ }
+
+ @Override
+ public List<Vessel> getAllFishingVessel() {
+ return devDriver.getAllFishingVessel();
+ }
+
+ @Override
public List<Species> getAllSpecies() {
return devDriver.getAllSpecies();
}
@Override
+ public List<Species> getAllBenthosSpecies() {
+ return devDriver.getAllBenthosSpecies();
+ }
+
+ @Override
+ public List<Species> getAllPlanktonSpecies() {
+ return devDriver.getAllPlanktonSpecies();
+ }
+
+ @Override
public Species getSpecies(String speciesId) {
return devDriver.getSpecies(speciesId);
}
@Override
- public List<Zone> getAllZone() {
- return devDriver.getAllZone();
+ public List<Zone> getAllProgramZone() {
+ return devDriver.getAllProgramZone();
}
@Override
@@ -194,13 +215,13 @@
}
@Override
- public List<Vessel> getAllVessel() {
- return devDriver.getAllVessel();
+ public List<Gear> getAllScientificGear() {
+ return devDriver.getAllScientificGear();
}
@Override
- public List<Gear> getAllGear() {
- return devDriver.getAllGear();
+ public List<Gear> getAllFishingGear() {
+ return devDriver.getAllFishingGear();
}
@Override
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -24,20 +24,27 @@
* #L%
*/
+import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Program;
+import fr.ifremer.tutti.persistence.entities.referential.Gear;
import fr.ifremer.tutti.persistence.entities.referential.Person;
+import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.TuttiScreen;
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
+import jaxx.runtime.JAXXUtil;
+import jaxx.runtime.context.JAXXContextEntryDef;
import jaxx.runtime.validator.swing.SwingValidatorMessageTableRenderer;
import jaxx.runtime.validator.swing.SwingValidatorUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.util.List;
/**
@@ -76,6 +83,22 @@
EditCruiseUIModel model = new EditCruiseUIModel();
+ // get vessels
+
+ List<Vessel> fishingVessels = persistenceService.getAllFishingVessel();
+ FISHING_VESSELS_CONTEXT_ENTRY.setContextValue(ui, fishingVessels);
+
+ List<Vessel> scientificVessels = persistenceService.getAllScientificVessel();
+ SCIENTIFIC_VESSELS_CONTEXT_ENTRY.setContextValue(ui, scientificVessels);
+
+ // get gears
+
+ List<Gear> scientificGears = persistenceService.getAllScientificGear();
+ SCIENTIFIC_GEARS_CONTEXT_ENTRY.setContextValue(ui, scientificGears);
+
+ List<Gear> fishingGears = persistenceService.getAllFishingGear();
+ FISHING_GEARS_CONTEXT_ENTRY.setContextValue(ui, fishingGears);
+
String cruiseId = context.getCruiseId();
if (cruiseId == null) {
@@ -103,6 +126,50 @@
ui.setContextValue(model);
}
+ JAXXContextEntryDef<List<Vessel>> SCIENTIFIC_VESSELS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef();
+
+ JAXXContextEntryDef<List<Vessel>> FISHING_VESSELS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef();
+
+ JAXXContextEntryDef<List<Gear>> SCIENTIFIC_GEARS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef();
+
+ JAXXContextEntryDef<List<Gear>> FISHING_GEARS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef();
+
+ protected List<Vessel> getVesselList(VesselTypeEnum vesselType) {
+ List<Vessel> result = Lists.newArrayList();
+ switch (vesselType) {
+
+ case ALL:
+ result.addAll(FISHING_VESSELS_CONTEXT_ENTRY.getContextValue(ui));
+ result.addAll(SCIENTIFIC_VESSELS_CONTEXT_ENTRY.getContextValue(ui));
+ break;
+ case SCIENTIFIC:
+ result.addAll(SCIENTIFIC_VESSELS_CONTEXT_ENTRY.getContextValue(ui));
+ break;
+ case FISHING:
+ result.addAll(FISHING_VESSELS_CONTEXT_ENTRY.getContextValue(ui));
+ break;
+ }
+ return result;
+ }
+
+ protected List<Gear> getGearList(VesselTypeEnum vesselType) {
+ List<Gear> result = Lists.newArrayList();
+ switch (vesselType) {
+
+ case ALL:
+ result.addAll(SCIENTIFIC_GEARS_CONTEXT_ENTRY.getContextValue(ui));
+ result.addAll(FISHING_GEARS_CONTEXT_ENTRY.getContextValue(ui));
+ break;
+ case SCIENTIFIC:
+ result.addAll(SCIENTIFIC_GEARS_CONTEXT_ENTRY.getContextValue(ui));
+ break;
+ case FISHING:
+ result.addAll(FISHING_GEARS_CONTEXT_ENTRY.getContextValue(ui));
+ break;
+ }
+ return result;
+ }
+
@Override
public void afterInitUI() {
@@ -112,6 +179,42 @@
EditCruiseUIModel model = getModel();
+ // Change vessel list and gear list when vessel type changes
+ model.addPropertyChangeListener(EditCruiseUIModel.PROPERTY_VESSEL_TYPE, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ EditCruiseUIModel source = (EditCruiseUIModel) evt.getSource();
+
+ List<Vessel> selectedVessel = source.getVessel();
+ List<Gear> selectedGear = source.getGear();
+
+ VesselTypeEnum vesselType = (VesselTypeEnum) evt.getNewValue();
+
+ List<Vessel> newVesselList = getVesselList(vesselType);
+ List<Gear> newGearList = getGearList(vesselType);
+
+ // compute new selected vessel list
+ List<Vessel> newSelectedVessel = Lists.newArrayList(selectedVessel);
+ newSelectedVessel.retainAll(newVesselList);
+
+ // compute new selected gear list
+ List<Gear> newSelectedGear = Lists.newArrayList(selectedGear);
+ newSelectedGear.retainAll(newGearList);
+
+ // reinit vessel list
+ ui.getVesselList().getModel().setUniverse(newVesselList);
+ ui.getVesselList().getModel().setSelected(newSelectedVessel);
+
+ // reinit gear list
+ ui.getGearList().getModel().setUniverse(newGearList);
+ ui.getGearList().getModel().setSelected(newSelectedGear);
+
+ }
+ });
+
+ model.setVesselType(VesselTypeEnum.ALL);
+
initBeanComboBox(ui.getSurveyComboBox(),
persistenceService.getAllProgram(),
model.getProgram());
@@ -121,11 +224,11 @@
model.getCountry());
initBeanList(ui.getVesselList(),
- persistenceService.getAllVessel(),
+ getVesselList(VesselTypeEnum.ALL),
model.getVessel());
initBeanList(ui.getGearList(),
- persistenceService.getAllGear(),
+ getGearList(VesselTypeEnum.ALL),
model.getGear());
initBeanList(ui.getHeadOfMissionList(),
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -75,6 +75,8 @@
public static final String PROPERTY_CAN_GENERATE_NAME = "canGenerateName";
+ public static final String PROPERTY_VESSEL_TYPE = "vesselType";
+
protected Program program;
protected Country country;
@@ -101,6 +103,8 @@
protected Date endDate;
+ protected VesselTypeEnum vesselType;
+
protected static Binder<EditCruiseUIModel, Cruise> toBeanBinder =
BinderFactory.newBinder(EditCruiseUIModel.class,
Cruise.class);
@@ -240,6 +244,16 @@
firePropertyChange(PROPERTY_HEAD_OF_SORT_ROOM, null, headOfSortRoom);
}
+ public VesselTypeEnum getVesselType() {
+ return vesselType;
+ }
+
+ public void setVesselType(VesselTypeEnum vesselType) {
+ Object oldValue = getVesselType();
+ this.vesselType = vesselType;
+ firePropertyChange(PROPERTY_VESSEL_TYPE, oldValue, vesselType);
+ }
+
public boolean isCanGenerateName() {
return program != null && year != null;
}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -0,0 +1,27 @@
+package fr.ifremer.tutti.ui.swing.content.cruise;
+
+import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * To select which vessel types we can see (All - Scientific, Fishing)
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public enum VesselTypeEnum {
+
+ ALL(n_("tutti.label.vesselType.all")),
+ SCIENTIFIC(n_("tutti.label.vesselType.scientific")),
+ FISHING(n_("tutti.label.vesselType.fishing"));
+
+ private final String i18nKey;
+
+ private VesselTypeEnum(String i18nKey) {
+ this.i18nKey = i18nKey;
+ }
+
+ public String getLabel() {
+ return _(i18nKey);
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java 2013-01-09 18:34:01 UTC (rev 161)
@@ -99,7 +99,7 @@
EditProgramUIModel model = getModel();
initBeanComboBox(ui.getZoneComboBox(),
- persistenceService.getAllZone(),
+ persistenceService.getAllProgramZone(),
model.getZone());
SwingValidatorUtil.installUI(ui.getErrorTable(),
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-08 22:32:00 UTC (rev 160)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-09 18:34:01 UTC (rev 161)
@@ -148,6 +148,9 @@
tutti.label.tab.protocol.species=Espèces
tutti.label.tab.species=Espèces
tutti.label.traitReminder=Trait \: %s
+tutti.label.vesselType.all=
+tutti.label.vesselType.fishing=
+tutti.label.vesselType.scientific=
tutti.legend.catch.benthos=Benthos
tutti.legend.catch.macroWaste=Macro déchets
tutti.legend.catch.species=Espèces
1
0
r160 - 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/util resources/fr/ifremer/tutti/ui/swing/content/operation resources/i18n
by kmorin@users.forge.codelutin.com 08 Jan '13
by kmorin@users.forge.codelutin.com 08 Jan '13
08 Jan '13
Author: kmorin
Date: 2013-01-08 23:32:00 +0100 (Tue, 08 Jan 2013)
New Revision: 160
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/160
Log:
refs #1908 [CONSOLIDATION] Mise en place des deux contextes de validation (pour les captures)
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiBeanUIModel.java
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/content/operation/EditFishingOperationUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml
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/AbstractTuttiBeanUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiBeanUIModel.java 2013-01-08 10:36:37 UTC (rev 159)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiBeanUIModel.java 2013-01-08 22:32:00 UTC (rev 160)
@@ -95,6 +95,10 @@
this.id = id;
firePropertyChange(PROPERTY_ID, oldValue, id);
}
+
+ public String getTitle() {
+ return "test title";
+ }
public boolean isModify() {
return modify;
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-01-08 10:36:37 UTC (rev 159)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java 2013-01-08 22:32:00 UTC (rev 160)
@@ -92,7 +92,7 @@
public abstract void afterInitUI();
public abstract void onCloseUI();
-
+
protected abstract M getModel();
protected final TuttiUIContext context;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-01-08 10:36:37 UTC (rev 159)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-01-08 22:32:00 UTC (rev 160)
@@ -115,8 +115,7 @@
layout='{new BorderLayout()}'>
<JTabbedPane id='fishingOperationTabPane' constraints='BorderLayout.CENTER'>
- <tab id='traitGeneralTab'
- title='tutti.label.tab.fishingOperation.general'>
+ <tab id='traitGeneralTab'>
<Table fill='both' id='generalForm'>
<!-- Numero station / Numéro trait / Date -->
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-08 10:36:37 UTC (rev 159)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-08 22:32:00 UTC (rev 160)
@@ -32,12 +32,14 @@
import fr.ifremer.tutti.persistence.entities.referential.Zone;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
+import fr.ifremer.tutti.ui.swing.TuttiUIContext;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.environment.EnvironmentTabUI;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.environment.EnvironmentTabUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.gearshooting.GearShootingTabUI;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.gearshooting.GearShootingTabUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology.HydrologyTabUI;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology.HydrologyTabUIModel;
+import fr.ifremer.tutti.ui.swing.util.CustomTab;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import jaxx.runtime.swing.editor.bean.BeanDoubleListModel;
import org.apache.commons.collections.CollectionUtils;
@@ -50,7 +52,16 @@
import java.awt.BorderLayout;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.beans.PropertyVetoException;
+import java.beans.VetoableChangeListener;
import java.util.List;
+import javax.swing.DefaultSingleSelectionModel;
+import javax.swing.JTabbedPane;
+import javax.swing.SingleSelectionModel;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import org.nuiton.validator.bean.simple.SimpleBeanValidatorEvent;
+import org.nuiton.validator.bean.simple.SimpleBeanValidatorListener;
/**
@@ -161,8 +172,6 @@
}
});
-// listModelIsModify(model);
-
ui.setContextValue(model);
fishingOperationMonitor.setBean(model);
@@ -181,25 +190,7 @@
initBeanList(ui.getSaisisseurList(),
persistenceService.getAllPerson(),
model.getSaisisseur());
- final BeanDoubleListModel<Person> saisisseurModel = ui.getSaisisseurList().getModel();
-// saisisseurModel.getSelectedModel().addListDataListener(new ListDataListener() {
-//
-// public void intervalAdded(ListDataEvent e) {
-// log.info(">>>>>>>>>> intervalAdded " + saisisseurModel.getSelected());
-// getModel().setSaisisseur(saisisseurModel.getSelected());
-// }
-//
-// public void intervalRemoved(ListDataEvent e) {
-// log.info(">>>>>>>>>> intervalRemoved " + saisisseurModel.getSelected());
-// getModel().setSaisisseur(saisisseurModel.getSelected());
-// }
-//
-// public void contentsChanged(ListDataEvent e) {
-// log.info(">>>>>>>>>> contentsChanged " + saisisseurModel.getSelected());
-// getModel().setSaisisseur(saisisseurModel.getSelected());
-// }
-// });
-
+
String programId = context.getProgramId();
Program program = persistenceService.getProgram(programId);
@@ -247,20 +238,44 @@
changeValidatorContext(model.getValidationContext(), ui.getValidator());
listenValidatorValid(ui.getValidator(), model);
-
+
+ JTabbedPane tabPanel = ui.getFishingOperationTabPane();
+ tabPanel.setTabComponentAt(0, new CustomTab(model));
+ listModelIsModify(model);
+
//init gear shooting
GearShootingTabUIModel gearShootingModel =
ui.getGearShootingTabContent().getModel();
gearShootingModel.setAvailableCaracteristics(persistenceService.getAllFishingOperationGearCaracteristic());
-
+// tabPanel.setTabComponentAt(1, new CustomTab(gearShootingModel));
+
//init environment
EnvironmentTabUIModel environmentModel =
ui.getEnvironmentTabContent().getModel();
environmentModel.setAvailableCaracteristics(persistenceService.getAllFishingOperationEnvironmentCaracteristic());
+// tabPanel.setTabComponentAt(2, new CustomTab(environmentModel));
//init hydrology
HydrologyTabUIModel hydrologyModel = ui.getHydrologyTabContent().getModel();
hydrologyModel.setAvailableCaracteristics(persistenceService.getAllFishingOperationHydrologicCaracteristic());
+// tabPanel.setTabComponentAt(3, new CustomTab(hydrologyModel));
+
+ tabPanel.setModel(new DefaultSingleSelectionModel() {
+
+ @Override
+ public void setSelectedIndex(int index) {
+ EditFishingOperationUIModel model = getModel();
+
+ if (TuttiUIContext.VALIDATION_CONTEXT_EDIT.equals(model.getValidationContext())
+ || model.isEmpty() || model.isValid()) {
+ if (model.isModify()) {
+ save();
+ }
+ super.setSelectedIndex(index);
+ }
+ }
+
+ });
}
@Override
@@ -287,40 +302,7 @@
public void selectFishingOperation(FishingOperation bean) {
if (fishingOperationMonitor.wasModified()) {
-
- // previous fishingOperation was modified, let's save it
- EditFishingOperationUIModel beanToSave = fishingOperationMonitor.getBean();
-
- if (beanToSave.isEmpty()) {
-
- // user must use save button
- if (log.isWarnEnabled()) {
- log.warn("Won't save new fishing operation, use explicit save button instead...");
- }
- } else {
- if (beanToSave.isUseSexagecimalFormat()) {
- beanToSave.convertGearShootingCoordinatesDMSToDD();
- }
-
- // save modified fishing operation
- FishingOperation toSave = beanToSave.toBean();
-
- showInformationMessage(
- "[ Trait - Caractéristiques générales ] " +
- "Sauvegarde des modifications de " + decorate(toSave) +
- ".");
-
- if (log.isInfoEnabled()) {
- log.info("FishingOperation " + toSave.getId() +
- " was modified, will save it.");
- }
-
- fishingOperationMonitor.clearModified();
-
- // persist current fishingOperation
- persistenceService.saveFishingOperation(toSave);
- //parentUi.getHandler().saveFishingOperation(toSave);
- }
+ save();
}
boolean empty = bean == null;
@@ -365,8 +347,8 @@
List<Person> saisisseur = model.getSaisisseur();
if (log.isInfoEnabled()) {
log.info("Selected saisisseurs: " + (saisisseur == null ? 0 : saisisseur.size()));
+ log.info(saisisseur);
}
- ui.getSaisisseurList().getModel().setSelected(saisisseur);
// update model empty property
model.setEmpty(empty);
@@ -383,6 +365,7 @@
HydrologyTabUI hydrologyTab = ui.getHydrologyTabContent();
hydrologyTab.getHandler().reset(bean);
+ model.setModify(false);
fishingOperationMonitor.clearModified();
}
@@ -409,31 +392,41 @@
}
public void save() {
- EditFishingOperationUIModel model = getModel();
+ // previous fishingOperation was modified, let's save it
+ EditFishingOperationUIModel beanToSave = fishingOperationMonitor.getBean();
- // get fishingOperation to save
- if (model.isUseSexagecimalFormat()) {
- model.convertGearShootingCoordinatesDMSToDD();
- }
- FishingOperation toSave = model.toBean();
+ if (beanToSave.isEmpty()) {
- if (log.isInfoEnabled()) {
- log.info("Save edition for fishingOperation: " + toSave.getId());
- }
+ // user must use save button
+ if (log.isWarnEnabled()) {
+ log.warn("Won't save new fishing operation, use explicit save button instead...");
+ }
+ } else {
+ if (beanToSave.isUseSexagecimalFormat()) {
+ beanToSave.convertGearShootingCoordinatesDMSToDD();
+ }
- // keep selected tab (to resotre it after save)
- int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ // save modified fishing operation
+ FishingOperation toSave = beanToSave.toBean();
- // clean auto-save monitor to avoid re-entrant code
- fishingOperationMonitor.clearModified();
+ showInformationMessage(
+ "[ Trait - Caractéristiques générales ] " +
+ "Sauvegarde des modifications de " + decorate(toSave) +
+ ".");
- // persist current fishingOperation
- parentUi.getHandler().saveFishingOperation(toSave);
+ if (log.isInfoEnabled()) {
+ log.info("FishingOperation " + toSave.getId() +
+ " was modified, will save it.");
+ }
- // reselect current tab
- ui.getFishingOperationTabPane().setSelectedIndex(selectedIndex);
+ fishingOperationMonitor.clearModified();
+ getModel().setModify(false);
-// getModel().setModify(false);
+ // persist current fishingOperation
+ persistenceService.saveFishingOperation(toSave);
+ //parentUi.getHandler().saveFishingOperation(toSave);
+ }
+
}
public void importCasino() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-01-08 10:36:37 UTC (rev 159)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-01-08 22:32:00 UTC (rev 160)
@@ -31,12 +31,11 @@
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.spatial.SexagecimalPosition;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
+import java.util.Date;
+import java.util.List;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
-import java.util.Date;
-import java.util.List;
-
/**
* Model for UI {@link EditFishingOperationUI}.
*
@@ -46,6 +45,8 @@
public class EditFishingOperationUIModel extends AbstractTuttiBeanUIModel<FishingOperation, EditFishingOperationUIModel> {
private static final long serialVersionUID = 1L;
+
+ public static final String TITLE = "tutti.label.tab.fishingOperation.general";
public static final String PROPERTY_PERSISTED = "persisted";
@@ -192,7 +193,11 @@
gearShootingEndLatitudeAsSexagecimal = SexagecimalPosition.valueOf(gearShootingEndLatitude);
gearShootingEndLongitudeAsSexagecimal = SexagecimalPosition.valueOf(gearShootingEndLongitude);
}
-
+
+ public String getTitle() {
+ return TITLE;
+ }
+
public FishingOperation getFishingOperation() {
return fishingOperation;
}
@@ -570,8 +575,9 @@
}
public void setSaisisseur(List<Person> saisisseur) {
+ Object oldValue = getSaisisseur();
this.saisisseur = saisisseur;
- firePropertyChange(PROPERTY_SAISISSEUR, null, saisisseur);
+ firePropertyChange(PROPERTY_SAISISSEUR, oldValue, saisisseur);
}
public String getValidationContext() {
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java 2013-01-08 22:32:00 UTC (rev 160)
@@ -0,0 +1,51 @@
+
+package fr.ifremer.tutti.ui.swing.util;
+
+import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
+import java.awt.Color;
+import java.awt.Transparency;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import static org.nuiton.i18n.I18n._;
+/**
+ *
+ * @author kmorin <kmorin(a)codelutin.com>
+ */
+public class CustomTab extends JPanel {
+
+ private Log log = LogFactory.getLog(CustomTab.class);
+
+ protected AbstractTuttiBeanUIModel model;
+
+ protected JLabel title = new JLabel();
+
+ public AbstractTuttiBeanUIModel getModel() {
+ return model;
+ }
+
+ public CustomTab(AbstractTuttiBeanUIModel model) {
+ this.model = model;
+ title.setText(_(model.getTitle()));
+ setBackground(new Color(0, 0, 0, 0));
+ this.model.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_MODIFY, new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ log.info(">>>>>>>> model modified ? evt " + evt.getNewValue());
+ log.info(">>>>>>>> model modified ? model " + CustomTab.this.model.isModify());
+ Boolean modified = (Boolean) evt.getNewValue();
+ String title = _(CustomTab.this.model.getTitle());
+ if (modified) {
+ title += "*";
+ }
+ CustomTab.this.title.setText(title);
+ }
+ });
+ add(title);
+ }
+
+}
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-01-08 10:36:37 UTC (rev 159)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-01-08 22:32:00 UTC (rev 160)
@@ -17,11 +17,11 @@
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%
- -->
+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%
+-->
<!DOCTYPE validators PUBLIC
@@ -34,27 +34,27 @@
<field name="gearShootingStartLatitude">
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:90.0|max:90.0</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="doubleParams">min:90.0|max:90.0</param>
+ <param name="expression">
<![CDATA[
useSexagecimalFormat || ( -doubles.min <= gearShootingStartLatitude && gearShootingStartLatitude <= doubles.max )
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.latitude.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <field name="gearShootingStartLatitudeDegree">
+ <field name="gearShootingStartLatitudeDegree">
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:90|max:90</param>
+ <param name="expression">
<![CDATA[
- useSexagecimalFormat && (
+ !useSexagecimalFormat || (
( -ints.min < getGearShootingStartLatitudeDegree() && getGearShootingStartLatitudeDegree() < ints.max )
|| (
( getGearShootingStartLatitudeDegree() == ints.max || getGearShootingStartLatitudeDegree() == -ints.min )
@@ -62,71 +62,71 @@
)
)
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.latitude.degree.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <field name="gearShootingStartLatitudeMinute">
+ <field name="gearShootingStartLatitudeMinute">
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
<![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLatitudeMinute() && getGearShootingStartLatitudeMinute() < ints.max
+ !useSexagecimalFormat || ( ints.min <= getGearShootingStartLatitudeMinute() && getGearShootingStartLatitudeMinute() < ints.max )
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.latitude.minute.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <field name="gearShootingStartLatitudeSecond">
+ <field name="gearShootingStartLatitudeSecond">
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
<![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLatitudeSecond() && getGearShootingStartLatitudeSecond() < ints.max
+ !useSexagecimalFormat || ( ints.min <= getGearShootingStartLatitudeSecond() && getGearShootingStartLatitudeSecond() < ints.max )
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.latitude.second.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <!--gear shooting start longitude validation -->
+ <!--gear shooting start longitude validation -->
- <field name="gearShootingStartLongitude">
+ <field name="gearShootingStartLongitude">
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:180.0|max:180.0</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="doubleParams">min:180.0|max:180.0</param>
+ <param name="expression">
<![CDATA[
useSexagecimalFormat || ( -doubles.min <= gearShootingStartLongitude && gearShootingStartLongitude <= doubles.max )
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.longitude.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <field name="gearShootingStartLongitudeDegree">
+ <field name="gearShootingStartLongitudeDegree">
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:180|max:180</param>
+ <param name="expression">
<![CDATA[
- useSexagecimalFormat && (
+ !useSexagecimalFormat || (
(-ints.min < getGearShootingStartLongitudeDegree() && getGearShootingStartLongitudeDegree() < ints.max)
|| (
( getGearShootingStartLongitudeDegree() == ints.max || getGearShootingStartLongitudeDegree() == -ints.min )
@@ -134,72 +134,72 @@
)
)
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.longitude.degree.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <field name="gearShootingStartLongitudeMinute">
+ <field name="gearShootingStartLongitudeMinute">
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
<![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLongitudeMinute() && getGearShootingStartLongitudeMinute() < ints.max
+ !useSexagecimalFormat || ( ints.min <= getGearShootingStartLongitudeMinute() && getGearShootingStartLongitudeMinute() < ints.max )
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.longitude.minute.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <field name="gearShootingStartLongitudeSecond">
+ <field name="gearShootingStartLongitudeSecond">
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
<![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLongitudeSecond() && getGearShootingStartLongitudeSecond() < ints.max
+ !useSexagecimalFormat || ( ints.min <= getGearShootingStartLongitudeSecond() && getGearShootingStartLongitudeSecond() < ints.max )
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.longitude.second.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <!--gear shooting end latitude validation -->
+ <!--gear shooting end latitude validation -->
- <field name="gearShootingEndLatitude">
+ <field name="gearShootingEndLatitude">
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:90.0|max:90.0</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="doubleParams">min:90.0|max:90.0</param>
+ <param name="expression">
<![CDATA[
useSexagecimalFormat || ( -doubles.min <= gearShootingEndLatitude && gearShootingEndLatitude <= doubles.max )
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.latitude.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <field name="gearShootingEndLatitudeDegree">
+ <field name="gearShootingEndLatitudeDegree">
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:90|max:90</param>
+ <param name="expression">
<![CDATA[
- useSexagecimalFormat && (
+ !useSexagecimalFormat || (
(-ints.min < getGearShootingEndLatitudeDegree() && getGearShootingEndLatitudeDegree() < ints.max)
|| (
( getGearShootingEndLatitudeDegree() == ints.max || getGearShootingEndLatitudeDegree() == -ints.min )
@@ -207,71 +207,71 @@
)
)
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.latitude.degree.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <field name="gearShootingEndLatitudeMinute">
+ <field name="gearShootingEndLatitudeMinute">
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
<![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLatitudeMinute() && getGearShootingEndLatitudeMinute() < ints.max
+ !useSexagecimalFormat || ( ints.min <= getGearShootingEndLatitudeMinute() && getGearShootingEndLatitudeMinute() < ints.max )
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.latitude.minute.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <field name="gearShootingEndLatitudeSecond">
+ <field name="gearShootingEndLatitudeSecond">
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
<![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLatitudeSecond() && getGearShootingEndLatitudeSecond() < ints.max
+ !useSexagecimalFormat || ( ints.min <= getGearShootingEndLatitudeSecond() && getGearShootingEndLatitudeSecond() < ints.max )
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.latitude.second.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <!--gear shooting end longitude validation -->
+ <!--gear shooting end longitude validation -->
- <field name="gearShootingEndLongitude">
+ <field name="gearShootingEndLongitude">
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:180.0|max:180.0</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="doubleParams">min:180.0|max:180.0</param>
+ <param name="expression">
<![CDATA[
useSexagecimalFormat || ( -doubles.min <= gearShootingEndLongitude && gearShootingEndLongitude <= doubles.max )
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.longitude.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <field name="gearShootingEndLongitudeDegree">
+ <field name="gearShootingEndLongitudeDegree">
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:180|max:180</param>
+ <param name="expression">
<![CDATA[
- useSexagecimalFormat && (
+ !useSexagecimalFormat || (
(-ints.min < getGearShootingEndLongitudeDegree() && getGearShootingEndLongitudeDegree() < ints.max)
|| (
( getGearShootingEndLongitudeDegree() == ints.max || getGearShootingEndLongitudeDegree() == -ints.min )
@@ -279,44 +279,44 @@
)
)
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.longitude.degree.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <field name="gearShootingEndLongitudeMinute">
+ <field name="gearShootingEndLongitudeMinute">
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
<![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLongitudeMinute() && getGearShootingEndLongitudeMinute() < ints.max
+ !useSexagecimalFormat || ( ints.min <= getGearShootingEndLongitudeMinute() && getGearShootingEndLongitudeMinute() < ints.max )
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.longitude.minute.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
- <field name="gearShootingEndLongitudeSecond">
+ <field name="gearShootingEndLongitudeSecond">
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
<![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLongitudeSecond() && getGearShootingEndLongitudeSecond() < ints.max
+ !useSexagecimalFormat || ( ints.min <= getGearShootingEndLongitudeSecond() && getGearShootingEndLongitudeSecond() < ints.max )
]]>
- </param>
+ </param>
- <message></message>
+ <message>tutti.validator.warning.longitude.second.outOfBounds</message>
- </field-validator>
+ </field-validator>
- </field>
+ </field>
</validators>
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-01-08 10:36:37 UTC (rev 159)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-01-08 22:32:00 UTC (rev 160)
@@ -58,28 +58,28 @@
<!--gear shooting start latitude validation -->
<field name="gearShootingStartLatitude">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="doubleParams">min:90.0|max:90.0</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
useSexagecimalFormat || ( -doubles.min <= gearShootingStartLatitude && gearShootingStartLatitude <= doubles.max )
]]>
</param>
+
+ <message>tutti.validator.warning.latitude.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<field name="gearShootingStartLatitudeDegree">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:90|max:90</param>
<param name="expression">
- <![CDATA[
- useSexagecimalFormat && (
+ <![CDATA[
+ !useSexagecimalFormat || (
( -ints.min < getGearShootingStartLatitudeDegree() && getGearShootingStartLatitudeDegree() < ints.max )
|| (
( getGearShootingStartLatitudeDegree() == ints.max || getGearShootingStartLatitudeDegree() == -ints.min )
@@ -88,70 +88,70 @@
)
]]>
</param>
+
+ <message>tutti.validator.warning.latitude.degree.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<field name="gearShootingStartLatitudeMinute">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLatitudeMinute() && getGearShootingStartLatitudeMinute() < ints.max
+ <![CDATA[
+ !useSexagecimalFormat || ( ints.min <= getGearShootingStartLatitudeMinute() && getGearShootingStartLatitudeMinute() < ints.max )
]]>
</param>
+
+ <message>tutti.validator.warning.latitude.minute.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<field name="gearShootingStartLatitudeSecond">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLatitudeSecond() && getGearShootingStartLatitudeSecond() < ints.max
+ <![CDATA[
+ !useSexagecimalFormat || ( ints.min <= getGearShootingStartLatitudeSecond() && getGearShootingStartLatitudeSecond() < ints.max )
]]>
</param>
+
+ <message>tutti.validator.warning.latitude.second.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<!--gear shooting start longitude validation -->
<field name="gearShootingStartLongitude">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="doubleParams">min:180.0|max:180.0</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
useSexagecimalFormat || ( -doubles.min <= gearShootingStartLongitude && gearShootingStartLongitude <= doubles.max )
]]>
</param>
+
+ <message>tutti.validator.warning.longitude.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<field name="gearShootingStartLongitudeDegree">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:180|max:180</param>
<param name="expression">
- <![CDATA[
- useSexagecimalFormat && (
+ <![CDATA[
+ !useSexagecimalFormat || (
(-ints.min < getGearShootingStartLongitudeDegree() && getGearShootingStartLongitudeDegree() < ints.max)
|| (
( getGearShootingStartLongitudeDegree() == ints.max || getGearShootingStartLongitudeDegree() == -ints.min )
@@ -160,71 +160,71 @@
)
]]>
</param>
+
+ <message>tutti.validator.warning.longitude.degree.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<field name="gearShootingStartLongitudeMinute">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLongitudeMinute() && getGearShootingStartLongitudeMinute() < ints.max
+ <![CDATA[
+ !useSexagecimalFormat || ( ints.min <= getGearShootingStartLongitudeMinute() && getGearShootingStartLongitudeMinute() < ints.max )
]]>
</param>
+
+ <message>tutti.validator.warning.longitude.minute.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<field name="gearShootingStartLongitudeSecond">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLongitudeSecond() && getGearShootingStartLongitudeSecond() < ints.max
+ <![CDATA[
+ !useSexagecimalFormat || ( ints.min <= getGearShootingStartLongitudeSecond() && getGearShootingStartLongitudeSecond() < ints.max )
]]>
</param>
+
+ <message>tutti.validator.warning.longitude.second.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<!--gear shooting end latitude validation -->
-
+
<field name="gearShootingEndLatitude">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="doubleParams">min:90.0|max:90.0</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
useSexagecimalFormat || ( -doubles.min <= gearShootingEndLatitude && gearShootingEndLatitude <= doubles.max )
]]>
</param>
+
+ <message>tutti.validator.warning.latitude.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
-
+
+
<field name="gearShootingEndLatitudeDegree">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:90|max:90</param>
<param name="expression">
- <![CDATA[
- useSexagecimalFormat && (
+ <![CDATA[
+ !useSexagecimalFormat || (
(-ints.min < getGearShootingEndLatitudeDegree() && getGearShootingEndLatitudeDegree() < ints.max)
|| (
( getGearShootingEndLatitudeDegree() == ints.max || getGearShootingEndLatitudeDegree() == -ints.min )
@@ -233,70 +233,70 @@
)
]]>
</param>
+
+ <message>tutti.validator.warning.latitude.degree.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<field name="gearShootingEndLatitudeMinute">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLatitudeMinute() && getGearShootingEndLatitudeMinute() < ints.max
+ <![CDATA[
+ !useSexagecimalFormat || ( ints.min <= getGearShootingEndLatitudeMinute() && getGearShootingEndLatitudeMinute() < ints.max )
]]>
</param>
+
+ <message>tutti.validator.warning.latitude.minute.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<field name="gearShootingEndLatitudeSecond">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLatitudeSecond() && getGearShootingEndLatitudeSecond() < ints.max
+ <![CDATA[
+ !useSexagecimalFormat || ( ints.min <= getGearShootingEndLatitudeSecond() && getGearShootingEndLatitudeSecond() < ints.max )
]]>
</param>
+
+ <message>tutti.validator.warning.latitude.second.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<!--gear shooting end longitude validation -->
-
+
<field name="gearShootingEndLongitude">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="doubleParams">min:180.0|max:180.0</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
useSexagecimalFormat || ( -doubles.min <= gearShootingEndLongitude && gearShootingEndLongitude <= doubles.max )
]]>
</param>
+
+ <message>tutti.validator.warning.longitude.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<field name="gearShootingEndLongitudeDegree">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:180|max:180</param>
<param name="expression">
- <![CDATA[
- useSexagecimalFormat && (
+ <![CDATA[
+ !useSexagecimalFormat || (
(-ints.min < getGearShootingEndLongitudeDegree() && getGearShootingEndLongitudeDegree() < ints.max)
|| (
( getGearShootingEndLongitudeDegree() == ints.max || getGearShootingEndLongitudeDegree() == -ints.min )
@@ -305,44 +305,43 @@
)
]]>
</param>
+
+ <message>tutti.validator.warning.longitude.degree.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<field name="gearShootingEndLongitudeMinute">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLongitudeMinute() && getGearShootingEndLongitudeMinute() < ints.max
+ <![CDATA[
+ !useSexagecimalFormat || ( ints.min <= getGearShootingEndLongitudeMinute() && getGearShootingEndLongitudeMinute() < ints.max )
]]>
</param>
+
+ <message>tutti.validator.warning.longitude.minute.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
+
<field name="gearShootingEndLongitudeSecond">
-
+
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLongitudeSecond() && getGearShootingEndLongitudeSecond() < ints.max
+ <![CDATA[
+ !useSexagecimalFormat || ( ints.min <= getGearShootingEndLongitudeSecond() && getGearShootingEndLongitudeSecond() < ints.max )
]]>
</param>
+
+ <message>tutti.validator.warning.longitude.second.outOfBounds</message>
- <message></message>
-
</field-validator>
-
+
</field>
-
</validators>
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-08 10:36:37 UTC (rev 159)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-08 22:32:00 UTC (rev 160)
@@ -188,14 +188,14 @@
tutti.table.benthos.batch.header.speciesByGenusCode=Espèce
tutti.table.benthos.batch.header.toConfirm=A Confirmer
tutti.table.benthos.batch.header.weight=Poids
-tutti.table.fishing.environment.header.key=Clé
+tutti.table.fishing.environment.header.key=Paramètre
tutti.table.fishing.environment.header.value=Valeur
-tutti.table.fishing.gearShooting.header.key=Clé
+tutti.table.fishing.gearShooting.header.key=Paramètre
tutti.table.fishing.gearShooting.header.value=Valeur
tutti.table.fishing.hydrology.header.averageValue=Moyenne
tutti.table.fishing.hydrology.header.gearShootingEndValue=Fin de traîne
tutti.table.fishing.hydrology.header.gearShootingStartValue=Début de traîne
-tutti.table.fishing.hydrology.header.key=Clé
+tutti.table.fishing.hydrology.header.key=Paramètre
tutti.table.macrowaste.batch.header.comment=Commentaire
tutti.table.macrowaste.batch.header.file=Pièces jointes
tutti.table.macrowaste.batch.header.macroWasteCategory=Catégorie
@@ -286,4 +286,12 @@
tutti.validator.error.splitSpeciesBatch.sampleWeight.required=Pas de poids ventilé
tutti.validator.error.splitSpeciesBatch.sampleWeight.sampleBatchGreaterThanBatchWeight=La somme des poids ventilés doit être inférieur ou égale à celle du poids du lot
tutti.validator.error.splitSpeciesBatch.selectedCategory.required=La catégorie est obligatoire
+tutti.validator.warning.latitude.degree.outOfBounds=Le degré de la latitude doit être compris entre -90 et 90
+tutti.validator.warning.latitude.minute.outOfBounds=La minute de la latitude doit être comprise entre 0 et 60
+tutti.validator.warning.latitude.outOfBounds=La Latitude doit être comprise entre -90.0 et 90.0
+tutti.validator.warning.latitude.second.outOfBounds=La seconde de la latitude doit être comprise entre 0 et 60
+tutti.validator.warning.longitude.degree.outOfBounds=Le degré de la latitude doit être compris entre -180 et 180
+tutti.validator.warning.longitude.minute.outOfBounds=La minute de la latitude doit être comprise entre 0 et 60
+tutti.validator.warning.longitude.outOfBounds=La Latitude doit être comprise entre -180.0 et 180.0
+tutti.validator.warning.longitude.second.outOfBounds=La seconde de la longitude doit être comprise entre 0 et 60
tutti.validator.warning.splitSpeciesBatch.sampleBatch=Ce lot est-il vraiment un échantillon du lot parent ?
1
0
r159 - in trunk: tutti-persistence/src/license tutti-persistence-adagio tutti-persistence-adagio/src/license tutti-persistence-adagio/src/test/resources tutti-persistence-dev/src/license tutti-service/src/license tutti-ui-swing/src/license tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation
by tchemit@users.forge.codelutin.com 08 Jan '13
by tchemit@users.forge.codelutin.com 08 Jan '13
08 Jan '13
Author: tchemit
Date: 2013-01-08 11:36:37 +0100 (Tue, 08 Jan 2013)
New Revision: 159
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/159
Log:
fix third parties, missing header, imports
Modified:
trunk/tutti-persistence-adagio/pom.xml
trunk/tutti-persistence-adagio/src/license/THIRD-PARTY.properties
trunk/tutti-persistence-adagio/src/test/resources/log4j.properties
trunk/tutti-persistence-dev/src/license/THIRD-PARTY.properties
trunk/tutti-persistence/src/license/THIRD-PARTY.properties
trunk/tutti-service/src/license/THIRD-PARTY.properties
trunk/tutti-ui-swing/src/license/THIRD-PARTY.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
Modified: trunk/tutti-persistence/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/tutti-persistence/src/license/THIRD-PARTY.properties 2013-01-08 10:12:05 UTC (rev 158)
+++ trunk/tutti-persistence/src/license/THIRD-PARTY.properties 2013-01-08 10:36:37 UTC (rev 159)
@@ -1,18 +1,21 @@
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
#-------------------------------------------------------------------------------
# Already used licenses in project :
+# - Apache License
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
# - Indiana University Extreme! Lab Software License, vesion 1.1.1
-# - Lesser General Public License (LGPL)
# - Lesser General Public License (LGPL) v 3.0
# - Lesser General Public License (LPGL)
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
+# - Public Domain
# - The Apache Software License, Version 2.0
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Thu Nov 22 17:23:30 CET 2012
+#Tue Jan 08 11:33:52 CET 2013
+commons-codec--commons-codec--1.2=The Apache Software License, Version 2.0
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+regexp--regexp--1.3=The Apache Software License, Version 2.0
Modified: trunk/tutti-persistence-adagio/pom.xml
===================================================================
--- trunk/tutti-persistence-adagio/pom.xml 2013-01-08 10:12:05 UTC (rev 158)
+++ trunk/tutti-persistence-adagio/pom.xml 2013-01-08 10:36:37 UTC (rev 159)
@@ -1,4 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti :: Persistence Adagio (impl)
+ %%
+ Copyright (C) 2012 - 2013 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
Modified: trunk/tutti-persistence-adagio/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/tutti-persistence-adagio/src/license/THIRD-PARTY.properties 2013-01-08 10:12:05 UTC (rev 158)
+++ trunk/tutti-persistence-adagio/src/license/THIRD-PARTY.properties 2013-01-08 10:36:37 UTC (rev 159)
@@ -1,6 +1,7 @@
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
#-------------------------------------------------------------------------------
# Already used licenses in project :
+# - Apache License
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
# - Common Public License Version 1.0
@@ -15,15 +16,17 @@
# - MPL 1.1
# - New BSD License
# - Public Domain
+# - TODO - Define me
# - The Apache Software License, Version 2.0
# - license.txt
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Fri Dec 14 23:47:18 CET 2012
+#Tue Jan 08 11:31:29 CET 2013
antlr--antlr--2.7.6=BSD License
+commons-codec--commons-codec--1.2=The Apache Software License, Version 2.0
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
dom4j--dom4j--1.6.1=BSD License
-fr.ifremer.adagio--adagio-core--3.3.1-SNAPSHOT=TODO
javax.transaction--jta--1.1=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+regexp--regexp--1.3=The Apache Software License, Version 2.0
Modified: trunk/tutti-persistence-adagio/src/test/resources/log4j.properties
===================================================================
--- trunk/tutti-persistence-adagio/src/test/resources/log4j.properties 2013-01-08 10:12:05 UTC (rev 158)
+++ trunk/tutti-persistence-adagio/src/test/resources/log4j.properties 2013-01-08 10:36:37 UTC (rev 159)
@@ -1,6 +1,6 @@
###
# #%L
-# Tutti :: Persistence Dev (impl)
+# Tutti :: Persistence Adagio (impl)
# $Id$
# $HeadURL$
# %%
@@ -39,3 +39,4 @@
log4j.logger.fr.ifremer.adagio.core=DEBUG
log4j.logger.fr.ifremer.tutti=DEBUG
+log4j.logger.org.nuiton=INFO
Modified: trunk/tutti-persistence-dev/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/tutti-persistence-dev/src/license/THIRD-PARTY.properties 2013-01-08 10:12:05 UTC (rev 158)
+++ trunk/tutti-persistence-dev/src/license/THIRD-PARTY.properties 2013-01-08 10:36:37 UTC (rev 159)
@@ -1,21 +1,24 @@
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
#-------------------------------------------------------------------------------
# Already used licenses in project :
+# - Apache License
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
# - Common Public License Version 1.0
# - General Public License (GPL)
# - Indiana University Extreme! Lab Software License, vesion 1.1.1
-# - Lesser General Public License (LGPL)
# - Lesser General Public License (LGPL) v 3.0
# - Lesser General Public License (LPGL)
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
# - New BSD License
+# - Public Domain
# - The Apache Software License, Version 2.0
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Thu Nov 22 17:23:30 CET 2012
+#Tue Jan 08 11:33:57 CET 2013
+commons-codec--commons-codec--1.2=The Apache Software License, Version 2.0
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+regexp--regexp--1.3=The Apache Software License, Version 2.0
Modified: trunk/tutti-service/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/tutti-service/src/license/THIRD-PARTY.properties 2013-01-08 10:12:05 UTC (rev 158)
+++ trunk/tutti-service/src/license/THIRD-PARTY.properties 2013-01-08 10:36:37 UTC (rev 159)
@@ -1,19 +1,30 @@
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
#-------------------------------------------------------------------------------
# Already used licenses in project :
+# - Apache License
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Eclipse Public License - v 1.0
# - General Public License (GPL)
+# - HSQLDB License
# - Indiana University Extreme! Lab Software License, vesion 1.1.1
-# - Lesser General Public License (LGPL)
# - Lesser General Public License (LGPL) v 3.0
# - Lesser General Public License (LPGL)
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
+# - MPL 1.1
+# - Public Domain
+# - TODO - Define me
# - The Apache Software License, Version 2.0
+# - license.txt
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Thu Nov 22 17:23:31 CET 2012
+#Tue Jan 08 11:35:10 CET 2013
+antlr--antlr--2.7.6=BSD License
+commons-codec--commons-codec--1.2=The Apache Software License, Version 2.0
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
+javax.transaction--jta--1.1=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+regexp--regexp--1.3=The Apache Software License, Version 2.0
Modified: trunk/tutti-ui-swing/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/tutti-ui-swing/src/license/THIRD-PARTY.properties 2013-01-08 10:12:05 UTC (rev 158)
+++ trunk/tutti-ui-swing/src/license/THIRD-PARTY.properties 2013-01-08 10:36:37 UTC (rev 159)
@@ -31,6 +31,5 @@
commons-codec--commons-codec--1.2=The Apache Software License, Version 2.0
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
dom4j--dom4j--1.6.1=BSD License
-fr.ifremer.adagio--adagio-core--3.3.1-SNAPSHOT=Lesser General Public License (LGPL) v 3.0
javax.transaction--jta--1.1=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
regexp--regexp--1.3=The Apache Software License, Version 2.0
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-08 10:12:05 UTC (rev 158)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-08 10:36:37 UTC (rev 159)
@@ -40,7 +40,6 @@
import fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology.HydrologyTabUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import jaxx.runtime.swing.editor.bean.BeanDoubleListModel;
-import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
1
0
r158 - in trunk/tutti-ui-swing: . src/main/java/fr/ifremer/tutti/ui/swing src/main/java/fr/ifremer/tutti/ui/swing/content/operation src/main/resources/fr/ifremer/tutti/ui/swing/content/operation src/main/resources/icons src/test/java/fr/ifremer/tutti/ui/swing
by tchemit@users.forge.codelutin.com 08 Jan '13
by tchemit@users.forge.codelutin.com 08 Jan '13
08 Jan '13
Author: tchemit
Date: 2013-01-08 11:12:05 +0100 (Tue, 08 Jan 2013)
New Revision: 158
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/158
Log:
refs #1908: [CONSOLIDATION] Mise en place des deux contextes de validation (pour les captures)
- les deux scopes fonctionnent bien
- ajout d'un test pour v?\195?\169rifier que les validateurs sont bien d?\195?\169tect?\195?\169s et valides (attention ?\195?\160 bien modifier le test lors de l'ajout ou suppression de validateurs)
Added:
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml
trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/BeanValidatorDetectorTest.java
Removed:
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-warning-validation.xml
Modified:
trunk/tutti-ui-swing/pom.xml
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/content/operation/EditFishingOperationUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-warning-validation.xml
trunk/tutti-ui-swing/src/main/resources/icons/action-validate.png
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-01-08 09:28:42 UTC (rev 157)
+++ trunk/tutti-ui-swing/pom.xml 2013-01-08 10:12:05 UTC (rev 158)
@@ -282,6 +282,13 @@
<artifactId>nuiton-validator</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-validator</artifactId>
+ <scope>test</scope>
+ <classifier>tests</classifier>
+ </dependency>
+
<!-- librairie Jaxx -->
<dependency>
<groupId>org.nuiton.jaxx</groupId>
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-01-08 09:28:42 UTC (rev 157)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java 2013-01-08 10:12:05 UTC (rev 158)
@@ -40,6 +40,7 @@
import jaxx.runtime.swing.editor.bean.BeanComboBox;
import jaxx.runtime.swing.editor.bean.BeanDoubleList;
import jaxx.runtime.swing.renderer.DecoratorListCellRenderer;
+import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -407,4 +408,11 @@
protected void closeUI(TuttiUI ui) {
ui.getHandler().onCloseUI();
}
+
+ protected <B> void changeValidatorContext(String newContext,
+ SwingValidator<B> validator) {
+ B bean = validator.getBean();
+ validator.setContext(newContext);
+ validator.setBean(bean);
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-01-08 09:28:42 UTC (rev 157)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-01-08 10:12:05 UTC (rev 158)
@@ -75,8 +75,7 @@
<SwingValidatorMessageTableModel id='errorTableModel'/>
- <BeanValidator id='validator'
- bean='model'
+ <BeanValidator id='validator' context='validate' bean='model'
errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
<field name='stationNumber' component='stationNumberField'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-08 09:28:42 UTC (rev 157)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-08 10:12:05 UTC (rev 158)
@@ -40,6 +40,7 @@
import fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology.HydrologyTabUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import jaxx.runtime.swing.editor.bean.BeanDoubleListModel;
+import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
@@ -245,11 +246,9 @@
model.setEmpty(true);
- //FIXME-tchemit Use this when jaxx-validator will works again :(
- //ui.getValidator().setContext(getModel().getValidationContext());
+ changeValidatorContext(model.getValidationContext(), ui.getValidator());
+ listenValidatorValid(ui.getValidator(), model);
- listenValidatorValid(ui.getValidator(), getModel());
-
//init gear shooting
GearShootingTabUIModel gearShootingModel =
ui.getGearShootingTabContent().getModel();
Copied: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml (from rev 157, trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-error-validation.xml)
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml (rev 0)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml 2013-01-08 10:12:05 UTC (rev 158)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti :: UI
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+<!DOCTYPE validators PUBLIC
+ "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="stationNumber">
+
+ <field-validator type="required" short-circuit="true">
+ <message>
+ tutti.validator.error.fishingOperation.stationNumber.required
+ </message>
+ </field-validator>
+
+ </field>
+
+ <field name="fishingOperationNumber">
+
+ <field-validator type="required" short-circuit="true">
+ <message>
+ tutti.validator.error.fishingOperation.fishingOperationNumber.required
+ </message>
+ </field-validator>
+
+ </field>
+
+ <field name="date">
+
+ <field-validator type="required" short-circuit="true">
+ <message>tutti.validator.error.fishingOperation.date.required</message>
+ </field-validator>
+
+ </field>
+</validators>
Copied: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml (from rev 157, trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-warning-validation.xml)
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml (rev 0)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-01-08 10:12:05 UTC (rev 158)
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+
+<!DOCTYPE validators PUBLIC
+ "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
+
+<validators>
+
+ <!--gear shooting start latitude validation -->
+
+ <field name="gearShootingStartLatitude">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="doubleParams">min:90.0|max:90.0</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat || ( -doubles.min <= gearShootingStartLatitude && gearShootingStartLatitude <= doubles.max )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartLatitudeDegree">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:90|max:90</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && (
+ ( -ints.min < getGearShootingStartLatitudeDegree() && getGearShootingStartLatitudeDegree() < ints.max )
+ || (
+ ( getGearShootingStartLatitudeDegree() == ints.max || getGearShootingStartLatitudeDegree() == -ints.min )
+ && getGearShootingStartLatitudeMinute() == 0 && getGearShootingStartLatitudeSecond() == 0
+ )
+ )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartLatitudeMinute">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingStartLatitudeMinute() && getGearShootingStartLatitudeMinute() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartLatitudeSecond">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingStartLatitudeSecond() && getGearShootingStartLatitudeSecond() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <!--gear shooting start longitude validation -->
+
+ <field name="gearShootingStartLongitude">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="doubleParams">min:180.0|max:180.0</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat || ( -doubles.min <= gearShootingStartLongitude && gearShootingStartLongitude <= doubles.max )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartLongitudeDegree">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:180|max:180</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && (
+ (-ints.min < getGearShootingStartLongitudeDegree() && getGearShootingStartLongitudeDegree() < ints.max)
+ || (
+ ( getGearShootingStartLongitudeDegree() == ints.max || getGearShootingStartLongitudeDegree() == -ints.min )
+ && getGearShootingStartLongitudeMinute() == 0 && getGearShootingStartLongitudeSecond() == 0
+ )
+ )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartLongitudeMinute">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingStartLongitudeMinute() && getGearShootingStartLongitudeMinute() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartLongitudeSecond">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingStartLongitudeSecond() && getGearShootingStartLongitudeSecond() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <!--gear shooting end latitude validation -->
+
+ <field name="gearShootingEndLatitude">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="doubleParams">min:90.0|max:90.0</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat || ( -doubles.min <= gearShootingEndLatitude && gearShootingEndLatitude <= doubles.max )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+
+ <field name="gearShootingEndLatitudeDegree">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:90|max:90</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && (
+ (-ints.min < getGearShootingEndLatitudeDegree() && getGearShootingEndLatitudeDegree() < ints.max)
+ || (
+ ( getGearShootingEndLatitudeDegree() == ints.max || getGearShootingEndLatitudeDegree() == -ints.min )
+ && getGearShootingEndLatitudeMinute() == 0 && getGearShootingEndLatitudeSecond() == 0
+ )
+ )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingEndLatitudeMinute">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingEndLatitudeMinute() && getGearShootingEndLatitudeMinute() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingEndLatitudeSecond">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingEndLatitudeSecond() && getGearShootingEndLatitudeSecond() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <!--gear shooting end longitude validation -->
+
+ <field name="gearShootingEndLongitude">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="doubleParams">min:180.0|max:180.0</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat || ( -doubles.min <= gearShootingEndLongitude && gearShootingEndLongitude <= doubles.max )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingEndLongitudeDegree">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:180|max:180</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && (
+ (-ints.min < getGearShootingEndLongitudeDegree() && getGearShootingEndLongitudeDegree() < ints.max)
+ || (
+ ( getGearShootingEndLongitudeDegree() == ints.max || getGearShootingEndLongitudeDegree() == -ints.min )
+ && getGearShootingEndLongitudeMinute() == 0 && getGearShootingEndLongitudeSecond() == 0
+ )
+ )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingEndLongitudeMinute">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingEndLongitudeMinute() && getGearShootingEndLongitudeMinute() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingEndLongitudeSecond">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingEndLongitudeSecond() && getGearShootingEndLongitudeSecond() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+</validators>
Deleted: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-error-validation.xml 2013-01-08 09:28:42 UTC (rev 157)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-error-validation.xml 2013-01-08 10:12:05 UTC (rev 158)
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%L
- Tutti :: UI
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2012 Ifremer
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with this program. If not, see
- <http://www.gnu.org/licenses/gpl-3.0.html>.
- #L%
- -->
-<!DOCTYPE validators PUBLIC
- "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
-<validators>
-
- <field name="stationNumber">
-
- <field-validator type="required" short-circuit="true">
- <message>
- tutti.validator.error.fishingOperation.stationNumber.required
- </message>
- </field-validator>
-
- </field>
-
- <field name="fishingOperationNumber">
-
- <field-validator type="required" short-circuit="true">
- <message>
- tutti.validator.error.fishingOperation.fishingOperationNumber.required
- </message>
- </field-validator>
-
- </field>
-
- <field name="date">
-
- <field-validator type="required" short-circuit="true">
- <message>tutti.validator.error.fishingOperation.date.required</message>
- </field-validator>
-
- </field>
-</validators>
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-01-08 09:28:42 UTC (rev 157)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-01-08 10:12:05 UTC (rev 158)
@@ -54,4 +54,295 @@
</field-validator>
</field>
+
+ <!--gear shooting start latitude validation -->
+
+ <field name="gearShootingStartLatitude">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="doubleParams">min:90.0|max:90.0</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat || ( -doubles.min <= gearShootingStartLatitude && gearShootingStartLatitude <= doubles.max )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartLatitudeDegree">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:90|max:90</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && (
+ ( -ints.min < getGearShootingStartLatitudeDegree() && getGearShootingStartLatitudeDegree() < ints.max )
+ || (
+ ( getGearShootingStartLatitudeDegree() == ints.max || getGearShootingStartLatitudeDegree() == -ints.min )
+ && getGearShootingStartLatitudeMinute() == 0 && getGearShootingStartLatitudeSecond() == 0
+ )
+ )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartLatitudeMinute">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingStartLatitudeMinute() && getGearShootingStartLatitudeMinute() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartLatitudeSecond">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingStartLatitudeSecond() && getGearShootingStartLatitudeSecond() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <!--gear shooting start longitude validation -->
+
+ <field name="gearShootingStartLongitude">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="doubleParams">min:180.0|max:180.0</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat || ( -doubles.min <= gearShootingStartLongitude && gearShootingStartLongitude <= doubles.max )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartLongitudeDegree">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:180|max:180</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && (
+ (-ints.min < getGearShootingStartLongitudeDegree() && getGearShootingStartLongitudeDegree() < ints.max)
+ || (
+ ( getGearShootingStartLongitudeDegree() == ints.max || getGearShootingStartLongitudeDegree() == -ints.min )
+ && getGearShootingStartLongitudeMinute() == 0 && getGearShootingStartLongitudeSecond() == 0
+ )
+ )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartLongitudeMinute">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingStartLongitudeMinute() && getGearShootingStartLongitudeMinute() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartLongitudeSecond">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingStartLongitudeSecond() && getGearShootingStartLongitudeSecond() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <!--gear shooting end latitude validation -->
+
+ <field name="gearShootingEndLatitude">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="doubleParams">min:90.0|max:90.0</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat || ( -doubles.min <= gearShootingEndLatitude && gearShootingEndLatitude <= doubles.max )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+
+ <field name="gearShootingEndLatitudeDegree">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:90|max:90</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && (
+ (-ints.min < getGearShootingEndLatitudeDegree() && getGearShootingEndLatitudeDegree() < ints.max)
+ || (
+ ( getGearShootingEndLatitudeDegree() == ints.max || getGearShootingEndLatitudeDegree() == -ints.min )
+ && getGearShootingEndLatitudeMinute() == 0 && getGearShootingEndLatitudeSecond() == 0
+ )
+ )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingEndLatitudeMinute">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingEndLatitudeMinute() && getGearShootingEndLatitudeMinute() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingEndLatitudeSecond">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingEndLatitudeSecond() && getGearShootingEndLatitudeSecond() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <!--gear shooting end longitude validation -->
+
+ <field name="gearShootingEndLongitude">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="doubleParams">min:180.0|max:180.0</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat || ( -doubles.min <= gearShootingEndLongitude && gearShootingEndLongitude <= doubles.max )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingEndLongitudeDegree">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:180|max:180</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && (
+ (-ints.min < getGearShootingEndLongitudeDegree() && getGearShootingEndLongitudeDegree() < ints.max)
+ || (
+ ( getGearShootingEndLongitudeDegree() == ints.max || getGearShootingEndLongitudeDegree() == -ints.min )
+ && getGearShootingEndLongitudeMinute() == 0 && getGearShootingEndLongitudeSecond() == 0
+ )
+ )
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingEndLongitudeMinute">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingEndLongitudeMinute() && getGearShootingEndLongitudeMinute() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingEndLongitudeSecond">
+
+ <field-validator type="fieldexpressionwithparams">
+ <param name="intParams">min:0|max:60</param>
+ <param name="expression">
+ <![CDATA[
+ useSexagecimalFormat && ints.min <= getGearShootingEndLongitudeSecond() && getGearShootingEndLongitudeSecond() < ints.max
+ ]]>
+ </param>
+
+ <message></message>
+
+ </field-validator>
+
+ </field>
+
+
</validators>
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-warning-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-warning-validation.xml 2013-01-08 09:28:42 UTC (rev 157)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-warning-validation.xml 2013-01-08 10:12:05 UTC (rev 158)
@@ -3,7 +3,7 @@
#%L
Tutti :: UI
$Id$
- $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/reso… $
+ $HeadURL$
%%
Copyright (C) 2012 - 2013 Ifremer
%%
@@ -29,294 +29,17 @@
"http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
<validators>
-
- <!--gear shooting start latitude validation -->
- <field name="gearShootingStartLatitude">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:90.0|max:90.0</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat || ( -doubles.min <= gearShootingStartLatitude && gearShootingStartLatitude <= doubles.max )
- ]]>
- </param>
-
- <message></message>
- </field-validator>
-
- </field>
-
- <field name="gearShootingStartLatitudeDegree">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && (
- ( -ints.min < getGearShootingStartLatitudeDegree() && getGearShootingStartLatitudeDegree() < ints.max )
- || (
- ( getGearShootingStartLatitudeDegree() == ints.max || getGearShootingStartLatitudeDegree() == -ints.min )
- && getGearShootingStartLatitudeMinute() == 0 && getGearShootingStartLatitudeSecond() == 0
- )
- )
- ]]>
- </param>
-
- <message></message>
+ <field name="comment">
- </field-validator>
-
- </field>
-
- <field name="gearShootingStartLatitudeMinute">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLatitudeMinute() && getGearShootingStartLatitudeMinute() < ints.max
- ]]>
- </param>
-
- <message></message>
+ <field-validator type="required">
- </field-validator>
-
- </field>
-
- <field name="gearShootingStartLatitudeSecond">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLatitudeSecond() && getGearShootingStartLatitudeSecond() < ints.max
- ]]>
- </param>
-
- <message></message>
+ <!-- No comment (just to test...) -->
+ <message></message>
- </field-validator>
-
- </field>
-
- <!--gear shooting start longitude validation -->
+ </field-validator>
- <field name="gearShootingStartLongitude">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:180.0|max:180.0</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat || ( -doubles.min <= gearShootingStartLongitude && gearShootingStartLongitude <= doubles.max )
- ]]>
- </param>
-
- <message></message>
+ </field>
- </field-validator>
-
- </field>
-
- <field name="gearShootingStartLongitudeDegree">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && (
- (-ints.min < getGearShootingStartLongitudeDegree() && getGearShootingStartLongitudeDegree() < ints.max)
- || (
- ( getGearShootingStartLongitudeDegree() == ints.max || getGearShootingStartLongitudeDegree() == -ints.min )
- && getGearShootingStartLongitudeMinute() == 0 && getGearShootingStartLongitudeSecond() == 0
- )
- )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingStartLongitudeMinute">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLongitudeMinute() && getGearShootingStartLongitudeMinute() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingStartLongitudeSecond">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLongitudeSecond() && getGearShootingStartLongitudeSecond() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <!--gear shooting end latitude validation -->
-
- <field name="gearShootingEndLatitude">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:90.0|max:90.0</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat || ( -doubles.min <= gearShootingEndLatitude && gearShootingEndLatitude <= doubles.max )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
-
- <field name="gearShootingEndLatitudeDegree">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && (
- (-ints.min < getGearShootingEndLatitudeDegree() && getGearShootingEndLatitudeDegree() < ints.max)
- || (
- ( getGearShootingEndLatitudeDegree() == ints.max || getGearShootingEndLatitudeDegree() == -ints.min )
- && getGearShootingEndLatitudeMinute() == 0 && getGearShootingEndLatitudeSecond() == 0
- )
- )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingEndLatitudeMinute">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLatitudeMinute() && getGearShootingEndLatitudeMinute() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingEndLatitudeSecond">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLatitudeSecond() && getGearShootingEndLatitudeSecond() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <!--gear shooting end longitude validation -->
-
- <field name="gearShootingEndLongitude">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:180.0|max:180.0</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat || ( -doubles.min <= gearShootingEndLongitude && gearShootingEndLongitude <= doubles.max )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingEndLongitudeDegree">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && (
- (-ints.min < getGearShootingEndLongitudeDegree() && getGearShootingEndLongitudeDegree() < ints.max)
- || (
- ( getGearShootingEndLongitudeDegree() == ints.max || getGearShootingEndLongitudeDegree() == -ints.min )
- && getGearShootingEndLongitudeMinute() == 0 && getGearShootingEndLongitudeSecond() == 0
- )
- )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingEndLongitudeMinute">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLongitudeMinute() && getGearShootingEndLongitudeMinute() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingEndLongitudeSecond">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLongitudeSecond() && getGearShootingEndLongitudeSecond() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
</validators>
Property changes on: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-warning-validation.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Deleted: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-warning-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-warning-validation.xml 2013-01-08 09:28:42 UTC (rev 157)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-warning-validation.xml 2013-01-08 10:12:05 UTC (rev 158)
@@ -1,322 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-
-<!DOCTYPE validators PUBLIC
- "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
-
-<validators>
-
- <!--gear shooting start latitude validation -->
-
- <field name="gearShootingStartLatitude">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:90.0|max:90.0</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat || ( -doubles.min <= gearShootingStartLatitude && gearShootingStartLatitude <= doubles.max )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingStartLatitudeDegree">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && (
- ( -ints.min < getGearShootingStartLatitudeDegree() && getGearShootingStartLatitudeDegree() < ints.max )
- || (
- ( getGearShootingStartLatitudeDegree() == ints.max || getGearShootingStartLatitudeDegree() == -ints.min )
- && getGearShootingStartLatitudeMinute() == 0 && getGearShootingStartLatitudeSecond() == 0
- )
- )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingStartLatitudeMinute">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLatitudeMinute() && getGearShootingStartLatitudeMinute() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingStartLatitudeSecond">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLatitudeSecond() && getGearShootingStartLatitudeSecond() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <!--gear shooting start longitude validation -->
-
- <field name="gearShootingStartLongitude">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:180.0|max:180.0</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat || ( -doubles.min <= gearShootingStartLongitude && gearShootingStartLongitude <= doubles.max )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingStartLongitudeDegree">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && (
- (-ints.min < getGearShootingStartLongitudeDegree() && getGearShootingStartLongitudeDegree() < ints.max)
- || (
- ( getGearShootingStartLongitudeDegree() == ints.max || getGearShootingStartLongitudeDegree() == -ints.min )
- && getGearShootingStartLongitudeMinute() == 0 && getGearShootingStartLongitudeSecond() == 0
- )
- )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingStartLongitudeMinute">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLongitudeMinute() && getGearShootingStartLongitudeMinute() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingStartLongitudeSecond">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingStartLongitudeSecond() && getGearShootingStartLongitudeSecond() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <!--gear shooting end latitude validation -->
-
- <field name="gearShootingEndLatitude">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:90.0|max:90.0</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat || ( -doubles.min <= gearShootingEndLatitude && gearShootingEndLatitude <= doubles.max )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
-
- <field name="gearShootingEndLatitudeDegree">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && (
- (-ints.min < getGearShootingEndLatitudeDegree() && getGearShootingEndLatitudeDegree() < ints.max)
- || (
- ( getGearShootingEndLatitudeDegree() == ints.max || getGearShootingEndLatitudeDegree() == -ints.min )
- && getGearShootingEndLatitudeMinute() == 0 && getGearShootingEndLatitudeSecond() == 0
- )
- )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingEndLatitudeMinute">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLatitudeMinute() && getGearShootingEndLatitudeMinute() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingEndLatitudeSecond">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLatitudeSecond() && getGearShootingEndLatitudeSecond() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <!--gear shooting end longitude validation -->
-
- <field name="gearShootingEndLongitude">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:180.0|max:180.0</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat || ( -doubles.min <= gearShootingEndLongitude && gearShootingEndLongitude <= doubles.max )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingEndLongitudeDegree">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && (
- (-ints.min < getGearShootingEndLongitudeDegree() && getGearShootingEndLongitudeDegree() < ints.max)
- || (
- ( getGearShootingEndLongitudeDegree() == ints.max || getGearShootingEndLongitudeDegree() == -ints.min )
- && getGearShootingEndLongitudeMinute() == 0 && getGearShootingEndLongitudeSecond() == 0
- )
- )
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingEndLongitudeMinute">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLongitudeMinute() && getGearShootingEndLongitudeMinute() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
- <field name="gearShootingEndLongitudeSecond">
-
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- useSexagecimalFormat && ints.min <= getGearShootingEndLongitudeSecond() && getGearShootingEndLongitudeSecond() < ints.max
- ]]>
- </param>
-
- <message></message>
-
- </field-validator>
-
- </field>
-
-</validators>
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-validate.png
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/BeanValidatorDetectorTest.java
===================================================================
--- trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/BeanValidatorDetectorTest.java (rev 0)
+++ trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/BeanValidatorDetectorTest.java 2013-01-08 10:12:05 UTC (rev 158)
@@ -0,0 +1,139 @@
+/*
+ * #%L
+ * ObServe :: Validation
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit
+ * %%
+ * 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%
+ */
+package fr.ifremer.tutti.ui.swing;
+
+import fr.ifremer.tutti.ui.swing.content.cruise.EditCruiseUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.CreateSpeciesBatchUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.SplitSpeciesBatchUIModel;
+import fr.ifremer.tutti.ui.swing.content.program.EditProgramUIModel;
+import fr.ifremer.tutti.ui.swing.content.protocol.EditProtocolUIModel;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.nuiton.validator.AbstractValidatorDetectorTest;
+import org.nuiton.validator.NuitonValidator;
+import org.nuiton.validator.xwork2.XWork2NuitonValidatorProvider;
+
+import java.io.File;
+import java.util.SortedSet;
+import java.util.regex.Pattern;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest {
+
+ private static final String EDIT_CONTEXT_NAME = "edit";
+
+ private static final String VALIDATE_CONTEXT_NAME = "validate";
+
+ SortedSet<NuitonValidator<?>> validators;
+
+ public BeanValidatorDetectorTest() {
+ super(XWork2NuitonValidatorProvider.PROVIDER_NAME);
+ }
+
+ static Class<?>[] ALL_TYPES;
+
+ @BeforeClass
+ public static void setUpClass() throws Exception {
+ ALL_TYPES = new Class[]{
+ EditCruiseUIModel.class,
+ EditProgramUIModel.class,
+ EditProtocolUIModel.class,
+ EditFishingOperationUIModel.class,
+ EditCatchesUIModel.class,
+ SpeciesBatchUIModel.class,
+ CreateSpeciesBatchUIModel.class,
+ SplitSpeciesBatchUIModel.class,
+ SpeciesFrequencyUIModel.class
+
+ };
+ }
+
+ @Override
+ protected File getRootDirectory(File basedir) {
+ return new File(basedir,
+ "src" + File.separator + "main" + File.separator + "resources");
+ }
+
+ @Test
+ public void detectAll() {
+
+ SortedSet<NuitonValidator<?>> validators = detectValidators(ALL_TYPES);
+ assertFalse(validators.isEmpty());
+ assertEquals(8, validators.size());
+ }
+
+ @Test
+ public void detectWithNoContext() {
+
+ String contextName = "";
+
+ validators = detectValidators(Pattern.compile(contextName), ALL_TYPES);
+
+ assertValidatorSetWithSameContextName(validators, null,
+ CreateSpeciesBatchUIModel.class,
+ EditCruiseUIModel.class,
+ EditProgramUIModel.class,
+ EditProtocolUIModel.class,
+ SpeciesFrequencyUIModel.class,
+ SplitSpeciesBatchUIModel.class
+ );
+ }
+
+ @Test
+ public void detectWithEditContext() {
+
+ String contextName = EDIT_CONTEXT_NAME;
+
+ validators = detectValidators(Pattern.compile(contextName), ALL_TYPES);
+
+ assertValidatorSetWithSameContextName(validators,
+ contextName,
+ EditFishingOperationUIModel.class
+ );
+ }
+
+ @Test
+ public void detectWithValidateContext() {
+ String contextName = VALIDATE_CONTEXT_NAME;
+
+ validators = detectValidators(Pattern.compile(contextName), ALL_TYPES);
+
+ assertValidatorSetWithSameContextName(validators,
+ contextName,
+ EditFishingOperationUIModel.class
+ );
+
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/BeanValidatorDetectorTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0