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
- 4130 discussions
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
r157 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing java/fr/ifremer/tutti/ui/swing/content/home java/fr/ifremer/tutti/ui/swing/content/operation resources/fr/ifremer/tutti/ui/swing/content/operation resources/i18n resources/icons
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 10:28:42 +0100 (Tue, 08 Jan 2013)
New Revision: 157
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/157
Log:
refs #1908: [CONSOLIDATION] Mise en place des deux contextes de validation (pour les captures)
Added:
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-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/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-warning-validation.xml
trunk/tutti-ui-swing/src/main/resources/icons/action-validate.png
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/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/TuttiUIContext.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/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/i18n/tutti-ui-swing_fr_FR.properties
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-07 22:58:44 UTC (rev 156)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css 2013-01-08 09:28:42 UTC (rev 157)
@@ -77,6 +77,14 @@
/*actionIcon: "catches";*/
}
+#menuActionValidateCatches {
+ text: "tutti.action.validateCatches";
+ toolTipText: "tutti.action.validateCatches.tip";
+ mnemonic: V;
+ enabled: {model.getScreen() != TuttiScreen.EDIT_FISHING_OPERATION && model.isCruiseContextFilled()};
+ actionIcon: validate;
+}
+
#menuSynchronisations {
text: "tutti.menu.synchronisations";
toolTipText: "tutti.menu.synchronisations.tip";
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-07 22:58:44 UTC (rev 156)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.jaxx 2013-01-08 09:28:42 UTC (rev 157)
@@ -68,6 +68,8 @@
onActionPerformed="getHandler().showSelectCampaign()"/>
<JMenuItem id='menuActionFillCatches'
onActionPerformed="getHandler().showFillCatches()"/>
+ <JMenuItem id='menuActionValidateCatches'
+ onActionPerformed="getHandler().showFillCatches()"/>
</JMenu>
<JMenu id='menuSynchronisations'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2013-01-07 22:58:44 UTC (rev 156)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2013-01-08 09:28:42 UTC (rev 157)
@@ -113,16 +113,18 @@
TuttiScreen screen;
- if (context.isCruiseContextFilled()) {
+// if (context.isCruiseContextFilled()) {
+//
+// // direct fill catches screen
+// screen = TuttiScreen.EDIT_FISHING_OPERATION;
+// } else {
+//
+// // go to select cruise screen
+// screen = TuttiScreen.SELECT_CRUISE;
+// }
- // direct fill catches screen
- screen = TuttiScreen.EDIT_FISHING_OPERATION;
- } else {
+ screen = TuttiScreen.SELECT_CRUISE;
- // go to select cruise screen
- screen = TuttiScreen.SELECT_CRUISE;
- }
-
context.setScreen(screen);
}
@@ -185,9 +187,15 @@
}
public void showFillCatches() {
+ context.setValidationContext(TuttiUIContext.VALIDATION_CONTEXT_EDIT);
context.setScreen(TuttiScreen.EDIT_FISHING_OPERATION);
}
+ public void showValidateCatches() {
+ context.setValidationContext(TuttiUIContext.VALIDATION_CONTEXT_VALIDATE);
+ context.setScreen(TuttiScreen.EDIT_FISHING_OPERATION);
+ }
+
public void showImportScreen() {
}
@@ -338,7 +346,17 @@
case EDIT_FISHING_OPERATION:
- screenTitle = _("tutti.title.edit.operations", getSelectedCruiseTitle());
+ String validationContext = context.getValidationContext();
+
+ if (TuttiUIContext.VALIDATION_CONTEXT_EDIT.equals(validationContext)) {
+
+ // edit catches
+ screenTitle = _("tutti.title.edit.operations", getSelectedCruiseTitle());
+ } else {
+
+ // validate catches
+ screenTitle = _("tutti.title.validate.operations", getSelectedCruiseTitle());
+ }
screenUI = new FishingOperationsUI(context);
break;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-01-07 22:58:44 UTC (rev 156)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-01-08 09:28:42 UTC (rev 157)
@@ -55,6 +55,10 @@
*/
public class TuttiUIContext extends AbstractBean implements Closeable, UIMessageNotifier {
+ public static final String VALIDATION_CONTEXT_EDIT = "edit";
+
+ public static final String VALIDATION_CONTEXT_VALIDATE = "validate";
+
/** Logger. */
private static final Log log = LogFactory.getLog(TuttiUIContext.class);
@@ -64,17 +68,19 @@
public static final String PROPERTY_PROTOCOL_ID = "protocolId";
- public static final Set<String> ID_TO_SAVE_PROPERTIES = Sets.newHashSet(
- PROPERTY_PROGRAM_ID,
- PROPERTY_CRUISE_ID,
- PROPERTY_PROTOCOL_ID);
-
public static final String PROPERTY_SCREEN = "screen";
public static final String PROPERTY_CRUISE_CONTEXT_FILLED = "cruiseContextFilled";
public static final String PROPERTY_PROTOCOL_FILLED = "protocolFilled";
+ public static final String PROPERTY_VALIDATION_CONTEXT = "validationContext";
+
+ public static final Set<String> ID_TO_SAVE_PROPERTIES = Sets.newHashSet(
+ PROPERTY_PROGRAM_ID,
+ PROPERTY_CRUISE_ID,
+ PROPERTY_PROTOCOL_ID);
+
/**
* Application context (only one for all the application).
*
@@ -145,6 +151,13 @@
*/
protected final Set<UIMessageNotifier> messageNotifiers;
+ /**
+ * Validation context (used by fishingOperation screens).
+ *
+ * @since 0.3
+ */
+ private String validationContext;
+
public static TuttiUIContext newContext(TuttiConfig config) {
Preconditions.checkNotNull(config);
Preconditions.checkState(applicationContext == null,
@@ -240,6 +253,16 @@
oldValue, isProtocolFilled());
}
+ public void setValidationContext(String validationContext) {
+ Object oldValue = getValidationContext();
+ this.validationContext = validationContext;
+ firePropertyChange(PROPERTY_VALIDATION_CONTEXT, oldValue, validationContext);
+ }
+
+ public String getValidationContext() {
+ return validationContext;
+ }
+
public void setScreen(TuttiScreen screen) {
Object oldValue = getScreen();
this.screen = screen;
@@ -362,6 +385,7 @@
programId = null;
cruiseId = null;
protocolId = null;
+ validationContext = null;
setScreen(null);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css 2013-01-07 22:58:44 UTC (rev 156)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css 2013-01-08 09:28:42 UTC (rev 157)
@@ -96,7 +96,12 @@
text: "tutti.action.new";
}
-#showFishingOperationsButton {
- text: "tutti.action.catches";
+#fillFishingOperationsButton {
+ text: "tutti.action.fillCatches";
enabled: {uiContext.isCruiseContextFilled()};
}
+
+#validateFishingOperationsButton {
+ text: "tutti.action.validateCatches";
+ enabled: {uiContext.isCruiseContextFilled()};
+}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.jaxx 2013-01-07 22:58:44 UTC (rev 156)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.jaxx 2013-01-08 09:28:42 UTC (rev 157)
@@ -112,8 +112,12 @@
</row>
<row>
<cell columns='3'>
- <JButton id='showFishingOperationsButton'
- onActionPerformed='handler.showFishingOperations()'/>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <JButton id='fillFishingOperationsButton'
+ onActionPerformed='handler.showFillCatches()'/>
+ <JButton id='validateFishingOperationsButton'
+ onActionPerformed='handler.showValidateCatches()'/>
+ </JPanel>
</cell>
</row>
</Table>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java 2013-01-07 22:58:44 UTC (rev 156)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java 2013-01-08 09:28:42 UTC (rev 157)
@@ -231,8 +231,13 @@
}
}
- public void showFishingOperations() {
+ public void showFillCatches() {
+ context.setValidationContext(TuttiUIContext.VALIDATION_CONTEXT_EDIT);
+ context.setScreen(TuttiScreen.EDIT_FISHING_OPERATION);
+ }
+ public void showValidateCatches() {
+ context.setValidationContext(TuttiUIContext.VALIDATION_CONTEXT_VALIDATE);
context.setScreen(TuttiScreen.EDIT_FISHING_OPERATION);
}
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-07 22:58:44 UTC (rev 156)
+++ 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)
@@ -48,11 +48,9 @@
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.BorderLayout;
-import java.awt.CardLayout;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
-import jaxx.runtime.swing.CardLayout2Ext;
/**
@@ -111,6 +109,8 @@
public void beforeInitUI() {
EditFishingOperationUIModel model = new EditFishingOperationUIModel();
+ model.setValidationContext(getContext().getValidationContext());
+
model.addPropertyChangeListener(EditFishingOperationUIModel.PROPERTY_EMPTY, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
@@ -146,13 +146,13 @@
onSelectedSubStrata(source, newStrata);
}
});
-
+
model.addPropertyChangeListener(EditFishingOperationUIModel.PROPERTY_USE_SEXAGECIMAL_FORMAT, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
boolean useSexagecimalFormat = (Boolean) evt.getNewValue();
log.info("property PROPERTY_USE_SEXAGECIMAL_FORMAT changed " + useSexagecimalFormat);
-
+
if (useSexagecimalFormat) {
getModel().convertGearShootingCoordinatesDDToDMS();
} else {
@@ -164,7 +164,7 @@
// listModelIsModify(model);
ui.setContextValue(model);
-
+
fishingOperationMonitor.setBean(model);
}
@@ -245,6 +245,9 @@
model.setEmpty(true);
+ //FIXME-tchemit Use this when jaxx-validator will works again :(
+ //ui.getValidator().setContext(getModel().getValidationContext());
+
listenValidatorValid(ui.getValidator(), getModel());
//init gear shooting
@@ -282,9 +285,9 @@
//------------------------------------------------------------------------//
//-- Public methods --//
//------------------------------------------------------------------------//
-
+
public void selectFishingOperation(FishingOperation bean) {
-
+
if (fishingOperationMonitor.wasModified()) {
// previous fishingOperation was modified, let's save it
@@ -300,7 +303,7 @@
if (beanToSave.isUseSexagecimalFormat()) {
beanToSave.convertGearShootingCoordinatesDMSToDD();
}
-
+
// save modified fishing operation
FishingOperation toSave = beanToSave.toBean();
@@ -409,7 +412,7 @@
public void save() {
EditFishingOperationUIModel model = getModel();
-
+
// get fishingOperation to save
if (model.isUseSexagecimalFormat()) {
model.convertGearShootingCoordinatesDMSToDD();
@@ -442,19 +445,19 @@
public void setUseSexagecimalFormat(boolean useSexagecimalFormat) {
getModel().setUseSexagecimalFormat(useSexagecimalFormat);
}
-
+
public void setGearShootingStartLatitude(String text) {
getModel().setGearShootingStartLatitude(Float.valueOf(text));
}
-
+
public void setGearShootingStartLatitudeDegree(String text) {
getModel().setGearShootingStartLatitude(Float.valueOf(text));
}
-
+
public void setGearShootingStartLatitudeMinute(String text) {
getModel().setGearShootingStartLatitude(Float.valueOf(text));
}
-
+
public void setGearShootingStartLatitudeSecond(String text) {
getModel().setGearShootingStartLatitude(Float.valueOf(text));
}
@@ -470,11 +473,11 @@
public void setGearShootingEndLongitude(String text) {
getModel().setGearShootingEndLongitude(Float.valueOf(text));
}
-
+
//------------------------------------------------------------------------//
//-- Protected methods --//
//------------------------------------------------------------------------//
-
+
protected void onSelectedStrata(EditFishingOperationUIModel model,
FishingOperationLocation newStrata) {
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-07 22:58:44 UTC (rev 156)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-01-08 09:28:42 UTC (rev 157)
@@ -24,16 +24,13 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Person;
+import fr.ifremer.tutti.persistence.spatial.SexagecimalPosition;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
-import fr.ifremer.tutti.persistence.spatial.SexagecimalPosition;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -65,39 +62,39 @@
public static final String PROPERTY_SUB_STRATA = "subStrata";
public static final String PROPERTY_USE_SEXAGECIMAL_FORMAT = "useSexagecimalFormat";
-
+
public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE = "gearShootingStartLatitude";
-
+
public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DEGREE = "gearShootingStartLatitudeDegree";
-
+
public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_MINUTE = "gearShootingStartLatitudeMinute";
-
+
public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_SECOND = "gearShootingStartLatitudeSecond";
-
+
public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE = "gearShootingStartLongitude";
-
+
public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DEGREE = "gearShootingStartLongitudeDegree";
-
+
public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_MINUTE = "gearShootingStartLongitudeMinute";
-
+
public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_SECOND = "gearShootingStartLongitudeSecond";
public static final String PROPERTY_GEAR_SHOOTING_START_DATE = "gearShootingStartDate";
public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE = "gearShootingEndLatitude";
-
+
public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DEGREE = "gearShootingEndLatitudeDegree";
-
+
public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_MINUTE = "gearShootingEndLatitudeMinute";
-
+
public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_SECOND = "gearShootingEndLatitudeSecond";
public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE = "gearShootingEndLongitude";
-
+
public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DEGREE = "gearShootingEndLongitudeDegree";
-
+
public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_MINUTE = "gearShootingEndLongitudeMinute";
-
+
public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_SECOND = "gearShootingEndLongitudeSecond";
public static final String PROPERTY_GEAR_SHOOTING_END_DATE = "gearShootingEndDate";
@@ -116,6 +113,8 @@
public static final String PROPERTY_SAISISSEUR = "saisisseur";
+ public static final String PROPERTY_VALIDATION_CONTEXT = "validationContext";
+
/**
* Flag when there is no fishing operation selected.
*
@@ -177,6 +176,8 @@
protected FishingOperation fishingOperation;
+ protected String validationContext;
+
protected static Binder<EditFishingOperationUIModel, FishingOperation> toBeanBinder =
BinderFactory.newBinder(EditFishingOperationUIModel.class,
FishingOperation.class);
@@ -282,7 +283,7 @@
this.useSexagecimalFormat = useSexagecimalFormat;
firePropertyChange(PROPERTY_USE_SEXAGECIMAL_FORMAT, oldValue, useSexagecimalFormat);
}
-
+
public Float getGearShootingStartLatitude() {
return gearShootingStartLatitude;
}
@@ -292,7 +293,7 @@
this.gearShootingStartLatitude = gearShootingStartLatitude;
firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE, oldValue, gearShootingStartLatitude);
}
-
+
public Integer getGearShootingStartLatitudeDegree() {
Integer result = gearShootingStartLatitudeAsSexagecimal.getDegre();
if (gearShootingStartLatitudeAsSexagecimal.isSign()) {
@@ -300,7 +301,7 @@
}
return result;
}
-
+
public void setGearShootingStartLatitudeDegree(Integer degree) {
Object oldValue = getGearShootingStartLatitudeDegree();
boolean sign = degree != null && degree < 0;
@@ -311,22 +312,22 @@
gearShootingStartLatitudeAsSexagecimal.setDegre(degree);
firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DEGREE, oldValue, degree);
}
-
+
public Integer getGearShootingStartLatitudeMinute() {
return gearShootingStartLatitudeAsSexagecimal.getMinute();
}
-
+
public void setGearShootingStartLatitudeMinute(Integer minute) {
Object oldValue = getGearShootingStartLatitudeMinute();
gearShootingStartLatitudeAsSexagecimal.setMinute(minute);
firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_MINUTE, oldValue, minute);
-
+
}
-
+
public Integer getGearShootingStartLatitudeSecond() {
return gearShootingStartLatitudeAsSexagecimal.getSeconde();
}
-
+
public void setGearShootingStartLatitudeSecond(Integer second) {
Object oldValue = getGearShootingStartLatitudeSecond();
gearShootingStartLatitudeAsSexagecimal.setSeconde(second);
@@ -343,7 +344,7 @@
firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE, oldValue, gearShootingStartLongitude);
}
-
+
public Integer getGearShootingStartLongitudeDegree() {
Integer result = gearShootingStartLongitudeAsSexagecimal.getDegre();
if (gearShootingStartLongitudeAsSexagecimal.isSign()) {
@@ -351,7 +352,7 @@
}
return result;
}
-
+
public void setGearShootingStartLongitudeDegree(Integer degree) {
Object oldValue = getGearShootingStartLongitudeDegree();
boolean sign = degree != null && degree < 0;
@@ -362,28 +363,28 @@
gearShootingStartLongitudeAsSexagecimal.setDegre(degree);
firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DEGREE, oldValue, degree);
}
-
+
public Integer getGearShootingStartLongitudeMinute() {
return gearShootingStartLongitudeAsSexagecimal.getMinute();
}
-
+
public void setGearShootingStartLongitudeMinute(Integer minute) {
Object oldValue = getGearShootingStartLongitudeMinute();
gearShootingStartLongitudeAsSexagecimal.setMinute(minute);
firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_MINUTE, oldValue, minute);
-
+
}
-
+
public Integer getGearShootingStartLongitudeSecond() {
return gearShootingStartLongitudeAsSexagecimal.getSeconde();
}
-
+
public void setGearShootingStartLongitudeSecond(Integer second) {
Object oldValue = getGearShootingStartLongitudeSecond();
gearShootingStartLongitudeAsSexagecimal.setSeconde(second);
firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_SECOND, oldValue, second);
}
-
+
public Date getGearShootingStartDate() {
return gearShootingStartDate;
}
@@ -403,7 +404,7 @@
this.gearShootingEndLatitude = gearShootingEndLatitude;
firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE, oldValue, gearShootingEndLatitude);
}
-
+
public Integer getGearShootingEndLatitudeDegree() {
Integer result = gearShootingEndLatitudeAsSexagecimal.getDegre();
if (gearShootingEndLatitudeAsSexagecimal.isSign()) {
@@ -411,7 +412,7 @@
}
return result;
}
-
+
public void setGearShootingEndLatitudeDegree(Integer degree) {
Object oldValue = getGearShootingEndLatitudeDegree();
boolean sign = degree != null && degree < 0;
@@ -422,22 +423,22 @@
gearShootingEndLatitudeAsSexagecimal.setDegre(degree);
firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DEGREE, oldValue, degree);
}
-
+
public Integer getGearShootingEndLatitudeMinute() {
return gearShootingEndLatitudeAsSexagecimal.getMinute();
}
-
+
public void setGearShootingEndLatitudeMinute(Integer minute) {
Object oldValue = getGearShootingEndLatitudeMinute();
gearShootingEndLatitudeAsSexagecimal.setMinute(minute);
firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_MINUTE, oldValue, minute);
-
+
}
-
+
public Integer getGearShootingEndLatitudeSecond() {
return gearShootingEndLatitudeAsSexagecimal.getSeconde();
}
-
+
public void setGearShootingEndLatitudeSecond(Integer second) {
Object oldValue = getGearShootingEndLatitudeSecond();
gearShootingEndLatitudeAsSexagecimal.setSeconde(second);
@@ -461,7 +462,7 @@
}
return result;
}
-
+
public void setGearShootingEndLongitudeDegree(Integer degree) {
Object oldValue = getGearShootingEndLongitudeDegree();
boolean sign = degree != null && degree < 0;
@@ -472,28 +473,28 @@
gearShootingEndLongitudeAsSexagecimal.setDegre(degree);
firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DEGREE, oldValue, degree);
}
-
+
public Integer getGearShootingEndLongitudeMinute() {
return gearShootingEndLongitudeAsSexagecimal.getMinute();
}
-
+
public void setGearShootingEndLongitudeMinute(Integer minute) {
Object oldValue = getGearShootingEndLongitudeMinute();
gearShootingEndLongitudeAsSexagecimal.setMinute(minute);
firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_MINUTE, oldValue, minute);
-
+
}
-
+
public Integer getGearShootingEndLongitudeSecond() {
return gearShootingEndLongitudeAsSexagecimal.getSeconde();
}
-
+
public void setGearShootingEndLongitudeSecond(Integer second) {
Object oldValue = getGearShootingEndLongitudeSecond();
gearShootingEndLongitudeAsSexagecimal.setSeconde(second);
firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_SECOND, oldValue, second);
}
-
+
public Date getGearShootingEndDate() {
return gearShootingEndDate;
}
@@ -573,15 +574,25 @@
firePropertyChange(PROPERTY_SAISISSEUR, null, saisisseur);
}
+ public String getValidationContext() {
+ return validationContext;
+ }
+
+ public void setValidationContext(String validationContext) {
+ Object oldValue = getValidationContext();
+ this.validationContext = validationContext;
+ firePropertyChange(PROPERTY_VALIDATION_CONTEXT, oldValue, validationContext);
+ }
+
@Override
protected FishingOperation newEntity() {
return fishingOperation;
}
-
+
public void convertGearShootingCoordinatesDDToDMS() {
SexagecimalPosition position;
Integer degree;
-
+
position = SexagecimalPosition.valueOf(gearShootingStartLatitude);
degree = position.getDegre();
if (degree != null) {
@@ -590,7 +601,7 @@
setGearShootingStartLatitudeDegree(degree);
setGearShootingStartLatitudeMinute(position.getMinute());
setGearShootingStartLatitudeSecond(position.getSeconde());
-
+
position = SexagecimalPosition.valueOf(gearShootingStartLongitude);
degree = position.getDegre();
if (degree != null) {
@@ -599,19 +610,19 @@
setGearShootingStartLongitudeDegree(degree);
setGearShootingStartLongitudeMinute(position.getMinute());
setGearShootingStartLongitudeSecond(position.getSeconde());
-
+
position = SexagecimalPosition.valueOf(gearShootingEndLatitude);
degree = position.getDegre();
if (degree != null) {
degree *= position.isSign() ? -1 : 1;
}
if (position.getDegre() != null) {
-
+
}
setGearShootingEndLatitudeDegree(degree);
setGearShootingEndLatitudeMinute(position.getMinute());
setGearShootingEndLatitudeSecond(position.getSeconde());
-
+
position = SexagecimalPosition.valueOf(gearShootingEndLongitude);
degree = position.getDegre();
if (degree != null) {
@@ -621,19 +632,19 @@
setGearShootingEndLongitudeMinute(position.getMinute());
setGearShootingEndLongitudeSecond(position.getSeconde());
}
-
+
public void convertGearShootingCoordinatesDMSToDD() {
Float decimalValue = gearShootingStartLatitudeAsSexagecimal.toDecimal();
setGearShootingStartLatitude(decimalValue);
-
+
decimalValue = gearShootingStartLongitudeAsSexagecimal.toDecimal();
setGearShootingStartLongitude(decimalValue);
-
+
decimalValue = gearShootingEndLatitudeAsSexagecimal.toDecimal();
setGearShootingEndLatitude(decimalValue);
-
+
decimalValue = gearShootingEndLongitudeAsSexagecimal.toDecimal();
setGearShootingEndLongitude(decimalValue);
}
-
+
}
\ No newline at end of file
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-07 22:58:44 UTC (rev 156)
+++ 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)
@@ -1,53 +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>
Copied: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-error-validation.xml (from rev 155, 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 (rev 0)
+++ 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)
@@ -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-validate-error-validation.xml (from rev 155, 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-validate-error-validation.xml (rev 0)
+++ 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)
@@ -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>
Added: 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 (rev 0)
+++ 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)
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti :: UI
+ $Id$
+ $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/reso… $
+ %%
+ 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/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-warning-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
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-07 22:58:44 UTC (rev 156)
+++ 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)
@@ -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>
Copied: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-warning-validation.xml (from rev 156, 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 (rev 0)
+++ 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)
@@ -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>
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-07 22:58:44 UTC (rev 156)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-08 09:28:42 UTC (rev 157)
@@ -4,7 +4,6 @@
tutti.action.about.tip=À Propos
tutti.action.cancel=Annuler
tutti.action.casino-import=Import Casino
-tutti.action.catches=Captures
tutti.action.close=Fermer
tutti.action.configuration=Configuration
tutti.action.configuration.tip=Configurer Tutti
@@ -12,7 +11,7 @@
tutti.action.edit=Editer
tutti.action.exit=Quitter
tutti.action.exit.tip=Quitter l'application
-tutti.action.fillCatches=Captures
+tutti.action.fillCatches=Saisir les captures
tutti.action.fillCatches.tip=Saisir des captures
tutti.action.generate=Générer
tutti.action.generateCampaignName=Générer le nom
@@ -33,6 +32,8 @@
tutti.action.site=Site
tutti.action.site.tip=Accéder au site du projet Tutti
tutti.action.splitSpeciesBatch=Catégoriser un lot
+tutti.action.validateCatches=Valider les captures
+tutti.action.validateCatches.tip=Valider les captures
tutti.application.config=Configuration de l'application Tutti
tutti.application.name=Tutti
tutti.config.category.applications=Application
@@ -187,7 +188,6 @@
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.caracteristic.header.key=
tutti.table.fishing.environment.header.key=Clé
tutti.table.fishing.environment.header.value=Valeur
tutti.table.fishing.gearShooting.header.key=Clé
@@ -255,6 +255,7 @@
tutti.title.selectedProgram=Série de campagne %s
tutti.title.selectedProtocol=Protocol %s
tutti.title.splitBatch=Catégoriser un lot
+tutti.title.validate.operations=Validation des opérations de pêches (%s)
tutti.to.be.done=< A FAIRE >
tutti.tooltip.attachment.none=Pas de pièce-jointes
tutti.tooltip.comment.none=Pas de commentaire
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-validate.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-validate.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
1
0
07 Jan '13
Author: tchemit
Date: 2013-01-07 23:58:44 +0100 (Mon, 07 Jan 2013)
New Revision: 156
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/156
Log:
refs #1807: [Persistence] Adagio r?\195?\169f?\195?\169rentiel (mise en place technique)
Added:
trunk/tutti-persistence-adagio/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider
trunk/tutti-persistence-adagio/src/main/resources/tutti-db-conf.properties
trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties
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/src/main/java/fr/ifremer/tutti/persistence/RessourceClassLoader.java
Removed:
trunk/tutti-persistence-adagio/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.TuttiPersistence
trunk/tutti-persistence-adagio/src/test/resources/conf.properties
trunk/tutti-persistence-dev/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.TuttiPersistence
Modified:
trunk/pom.xml
trunk/tutti-persistence-adagio/pom.xml
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfig.java
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfigOption.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/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/GearDaoTest.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/VesselDaoTest.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-service/pom.xml
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceContext.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java
trunk/tutti-ui-swing/pom.xml
trunk/tutti-ui-swing/src/license/THIRD-PARTY.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java
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/log4j.properties
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/pom.xml 2013-01-07 22:58:44 UTC (rev 156)
@@ -38,7 +38,7 @@
<modules>
<module>tutti-persistence</module>
<module>tutti-persistence-dev</module>
- <!--module>tutti-persistence-adagio</module-->
+ <module>tutti-persistence-adagio</module>
<module>tutti-service</module>
<module>tutti-ui-swing</module>
</modules>
@@ -77,6 +77,17 @@
</roles>
<timezone>Europe/Paris</timezone>
</developer>
+ <developer>
+ <id>morin</id>
+ <name>Kevin Morin</name>
+ <email>morin at codelutin dot com</email>
+ <organization>CodeLutin</organization>
+ <organizationUrl>http://www.codelutin.com</organizationUrl>
+ <roles>
+ <role>developer</role>
+ </roles>
+ <timezone>Europe/Paris</timezone>
+ </developer>
</developers>
<scm>
@@ -105,7 +116,7 @@
<!-- libraries version -->
- <nuitonUtilsVersion>2.6.5</nuitonUtilsVersion>
+ <nuitonUtilsVersion>2.7-SNAPSHOT</nuitonUtilsVersion>
<nuitonI18nVersion>2.5</nuitonI18nVersion>
<eugenePluginVersion>2.6</eugenePluginVersion>
@@ -122,7 +133,7 @@
<adagioVersion>3.3.1-SNAPSHOT</adagioVersion>
<msaccessImporterVersion>1.4.1</msaccessImporterVersion>
-
+
<i18n.bundles>fr_FR</i18n.bundles>
<i18n.silent>true</i18n.silent>
@@ -204,13 +215,13 @@
<groupId>org.nuiton.jaxx</groupId>
<artifactId>jaxx-validator</artifactId>
<version>${jaxxVersion}</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.nuiton.jaxx</groupId>
<artifactId>jaxx-widgets</artifactId>
<version>${jaxxVersion}</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.nuiton.jaxx</groupId>
@@ -370,11 +381,9 @@
<scope>test</scope>
</dependency>
- <!-- Runtime -->
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
- <scope>runtime</scope>
<version>${jdbc.hsqldb.version}</version>
</dependency>
@@ -405,6 +414,16 @@
<artifactId>doxia-module-jrst</artifactId>
<version>${jrstPluginVersion}</version>
</dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>${jdbc.hsqldb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>${hibernateVersion}</version>
+ </dependency>
</dependencies>
</plugin>
@@ -482,13 +501,13 @@
<profiles>
<profile>
- <id>license-profile</id>
- <activation>
- <property>
- <name>performRelease</name>
- <value>true</value>
- </property>
- </activation>
+ <id>license-profile</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
<build>
<defaultGoal>generate-resources</defaultGoal>
@@ -504,8 +523,12 @@
</goals>
<phase>generate-resources</phase>
<configuration>
- <roots><root>${project.basedir}</root></roots>
- <includes><include>pom.xml</include></includes>
+ <roots>
+ <root>${project.basedir}</root>
+ </roots>
+ <includes>
+ <include>pom.xml</include>
+ </includes>
<addSvnKeyWords>false</addSvnKeyWords>
<verbose>false</verbose>
</configuration>
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/RessourceClassLoader.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/RessourceClassLoader.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/RessourceClassLoader.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -0,0 +1,183 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence API
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Lists;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Enumeration;
+import java.util.List;
+
+/**
+ * A class loader that search first in a given directory before in parent
+ * class loader.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class RessourceClassLoader extends ClassLoader {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(RessourceClassLoader.class);
+
+ public static final URL[] EMPTY_URL_ARRAY = new URL[0];
+
+ protected URLClassLoader loader;
+
+ protected Predicate<String> searchInDirectoriesPredicate;
+
+ protected final List<File> directories;
+
+ public RessourceClassLoader(ClassLoader parent) {
+ super(parent);
+
+ // by default try in directories if there is some
+ this.searchInDirectoriesPredicate = new Predicate<String>() {
+ @Override
+ public boolean apply(String input) {
+ return !directories.isEmpty();
+ }
+ };
+ directories = Lists.newArrayList();
+ loader = URLClassLoader.newInstance(EMPTY_URL_ARRAY);
+ }
+
+ public void addDirectory(File... directories) throws IOException {
+ for (File directory : directories) {
+ if (!this.directories.contains(directory)) {
+ this.directories.add(directory);
+ }
+ }
+ loader = null;
+ }
+
+ public void removeDirectory(File... directories) {
+ for (File directory : directories) {
+ this.directories.remove(directory);
+ }
+ loader = null;
+ }
+
+ public Predicate<String> getSearchInDirectoriesPredicate() {
+ return searchInDirectoriesPredicate;
+ }
+
+ public void addSearchInDirectoriesPredicate(Predicate<String> predicate) {
+ Preconditions.checkNotNull(predicate,
+ "search predicate can not be null");
+ this.searchInDirectoriesPredicate = Predicates.and(searchInDirectoriesPredicate, predicate);
+ }
+ public void setSearchInDirectoriesPredicate(Predicate<String> searchInDirectoriesPredicate) {
+ Preconditions.checkNotNull(searchInDirectoriesPredicate,
+ "search predicate can not be null");
+ this.searchInDirectoriesPredicate = searchInDirectoriesPredicate;
+ }
+
+ @Override
+ public URL findResource(String name) {
+ URL result = null;
+ if (searchInDirectoriesPredicate.apply(name)) {
+ if (log.isInfoEnabled()) {
+ log.info("findResource [" + name + "] in [" + directories + ']');
+ }
+ result = getLoader().findResource(name);
+ }
+ if (result == null) {
+ result = super.findResource(name);
+ }
+ return result;
+ }
+
+ @Override
+ public Enumeration<URL> findResources(String name) throws IOException {
+ Enumeration<URL> result = null;
+ if (searchInDirectoriesPredicate.apply(name)) {
+ if (log.isInfoEnabled()) {
+ log.info("findResources [" + name + "] in [" + directories + ']');
+ }
+ result = getLoader().findResources(name);
+ }
+ if (result == null || !result.hasMoreElements()) {
+ result = super.findResources(name);
+ }
+ return result;
+ }
+
+ @Override
+ public URL getResource(String name) {
+ URL result = null;
+ if (searchInDirectoriesPredicate.apply(name)) {
+ if (log.isInfoEnabled()) {
+ log.info("getResource [" + name + "] in [" +
+ directories + ']');
+ }
+ result = getLoader().getResource(name);
+ }
+ if (result == null) {
+ result = super.getResource(name);
+ }
+ return result;
+ }
+
+ @Override
+ public Enumeration<URL> getResources(String name) throws IOException {
+ Enumeration<URL> result = null;
+ if (searchInDirectoriesPredicate.apply(name)) {
+ if (log.isInfoEnabled()) {
+ log.info("getResources [" + name + "] in [" + directories + ']');
+ }
+ result = getLoader().getResources(name);
+ }
+ if (result == null || !result.hasMoreElements()) {
+ result = super.getResources(name);
+ }
+ return result;
+ }
+
+ protected URLClassLoader getLoader() {
+ if (loader == null) {
+ try {
+ URL[] urls = FileUtils.toURLs(
+ directories.toArray(new File[directories.size()]));
+ loader = URLClassLoader.newInstance(urls);
+ } catch (IOException e) {
+ throw new RuntimeException(
+ "Could not convert directories " + directories
+ + " to url.", e);
+ }
+ }
+ return loader;
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/RessourceClassLoader.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -42,11 +42,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.nuiton.util.ApplicationConfig;
import java.io.Closeable;
import java.io.IOException;
import java.util.List;
+import java.util.Properties;
/**
* Contract for a persistence driver used by Tutti.
@@ -62,10 +62,12 @@
String getImplementationName();
- void open(ApplicationConfig config) throws IOException;
+ void open() throws IOException;
void close() throws IOException;
+ void setEnumerations(Properties dbEnumerations);
+
//------------------------------------------------------------------------//
//-- Referential methods --//
//------------------------------------------------------------------------//
@@ -237,5 +239,4 @@
AccidentalBatch saveAccidentalBatch(AccidentalBatch bean);
void deleteAccidentalBatch(String id);
-
}
Modified: trunk/tutti-persistence-adagio/pom.xml
===================================================================
--- trunk/tutti-persistence-adagio/pom.xml 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/pom.xml 2013-01-07 22:58:44 UTC (rev 156)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
@@ -40,17 +40,19 @@
<artifactId>guava</artifactId>
</dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
+
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency-->
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
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-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -24,7 +24,9 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.config.TuttiPersistenceAdagioConfig;
+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;
@@ -35,168 +37,234 @@
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
+import fr.ifremer.tutti.persistence.entities.referential.AbstractTuttiReferentialEntity;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Country;
import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.Species;
+import fr.ifremer.tutti.persistence.entities.referential.Status;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
-import org.apache.commons.io.FileUtils;
-import org.nuiton.util.ApplicationConfig;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.Query;
+import org.hibernate.SessionFactory;
+import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.util.List;
+import java.util.Properties;
/**
* @author tchemit <chemit(a)codelutin.com>
* @since 0.2
*/
+//@TransactionConfiguration(transactionManager = "transactionManager")
public class TuttiPersistenceAdagioImpl implements TuttiPersistence {
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(TuttiPersistenceAdagioImpl.class);
+
/**
- * Persistence config.
+ * Session factory.
*
- * @since 0.2
+ * @since 0.3
*/
- protected TuttiPersistenceAdagioConfig config;
+ protected SessionFactory sessionFactory;
+ protected Properties enumerations;
+
+ public void setSessionFactory(SessionFactory sessionFactory) {
+ this.sessionFactory = sessionFactory;
+ }
+
+ public void setEnumerations(Properties enumerations) {
+ this.enumerations = enumerations;
+ }
+
@Override
public String getImplementationName() {
return "Persistence Adagio implementation";
}
@Override
- public void open(ApplicationConfig config) throws IOException {
- this.config = new TuttiPersistenceAdagioConfig(config);
- try {
- FileUtils.forceMkdir(this.config.getDbDirectory());
- } catch (IOException e) {
- throw new RuntimeException("Could not create directory", e);
- }
+ public void open() throws IOException {
+ Preconditions.checkNotNull(sessionFactory, " No sessionFactory property setted");
+ Preconditions.checkNotNull(enumerations, " No enumerations property setted");
}
@Override
public void close() throws IOException {
+
+ if (log.isInfoEnabled()) {
+ log.info("Close persistence driver " + getImplementationName());
+ }
+
+ sessionFactory.close();
}
//------------------------------------------------------------------------//
//-- Referential methods --//
//------------------------------------------------------------------------//
+ @Transactional(readOnly = true)
@Override
public List<Species> getAllSpecies() {
return null;
}
+ @Transactional(readOnly = true)
@Override
+ public Species getSpecies(String speciesId) {
+ return null;
+ }
+
+ @Transactional(readOnly = true)
+ @Override
public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) {
return null;
}
+ @Transactional(readOnly = true)
@Override
public List<FishingOperationLocation> getAllFishingOperationSubStrata(String locationId) {
return null;
}
+ @Transactional(readOnly = true)
@Override
public List<FishingOperationLocation> getAllFishingOperationLocation(String locationId) {
return null;
}
+ @Transactional(readOnly = true)
@Override
public List<Zone> getAllZone() {
return null;
}
+ @Transactional(readOnly = true)
@Override
public List<Country> getAllCountry() {
return null;
}
+ @Transactional(readOnly = true)
@Override
public List<Vessel> getAllVessel() {
return null;
}
+ @Transactional(readOnly = true)
@Override
public List<Gear> getAllGear() {
- return null;
+ Query query = sessionFactory.getCurrentSession().getNamedQuery("getAllGears");
+
+ 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);
+ }
+ return result;
}
+ @Transactional(readOnly = true)
@Override
public List<Person> getAllPerson() {
return null;
}
+ @Transactional(readOnly = true)
@Override
public List<Caracteristic> getAllFishingOperationEnvironmentCaracteristic() {
return null;
}
+ @Transactional(readOnly = true)
@Override
public List<Caracteristic> getAllFishingOperationGearCaracteristic() {
return null;
}
+ @Transactional(readOnly = true)
@Override
public List<Caracteristic> getAllFishingOperationHydrologicCaracteristic() {
return null;
}
+ @Transactional(readOnly = true)
@Override
- public List<Caracteristic> getAllSpeciesFrequencyCaracteristic() {
+ public List<Caracteristic> getAllSpeciesLengthStepCaracteristic() {
return null;
}
+ @Transactional(readOnly = true)
@Override
public Caracteristic getSizeCategoryCaracteristic() {
return null;
}
+ @Transactional(readOnly = true)
@Override
public Caracteristic getSexCaracteristic() {
return null;
}
+ @Transactional(readOnly = true)
@Override
public Caracteristic getSortedUnsortedCaracteristic() {
return null;
}
+ @Transactional(readOnly = true)
@Override
public Caracteristic getMaturityCaracteristic() {
return null;
}
+ @Transactional(readOnly = true)
@Override
public Caracteristic getMacroWasteCategoryCaracteristic() {
return null;
}
+ @Transactional(readOnly = true)
+ @Override
+ public Caracteristic getMacroWasteSizeCategoryCaracteristic() {
+ return null;
+ }
+
//------------------------------------------------------------------------//
//-- Program methods --//
//------------------------------------------------------------------------//
@Override
public List<Program> getAllProgram() {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public Program getProgram(String id) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public Program createProgram(Program bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public Program saveProgram(Program bean) {
- return null;
+ throw new UnsupportedOperationException();
}
//------------------------------------------------------------------------//
@@ -205,22 +273,22 @@
@Override
public List<Cruise> getAllCruise(String programId) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public Cruise getCruise(String id) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public Cruise createCruise(Cruise bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public Cruise saveCruise(Cruise bean) {
- return null;
+ throw new UnsupportedOperationException();
}
//------------------------------------------------------------------------//
@@ -229,22 +297,22 @@
@Override
public List<TuttiProtocol> getAllProtocol() {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public TuttiProtocol getProtocol(String id) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public TuttiProtocol createProtocol(TuttiProtocol bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public TuttiProtocol saveProtocol(TuttiProtocol bean) {
- return null;
+ throw new UnsupportedOperationException();
}
//------------------------------------------------------------------------//
@@ -253,60 +321,74 @@
@Override
public List<FishingOperation> getAllFishingOperation(String cruiseId) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public FishingOperation getFishingOperation(String id) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public FishingOperation createFishingOperation(FishingOperation bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public FishingOperation saveFishingOperation(FishingOperation bean) {
- return null;
+ throw new UnsupportedOperationException();
}
//------------------------------------------------------------------------//
//-- Species Batch methods --//
//------------------------------------------------------------------------//
+
@Override
+ public List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
public List<SpeciesBatch> getAllSpeciesBatch(String fishingOperationId) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public SpeciesBatch getSpeciesBatch(String id) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
- public SpeciesBatch createSpeciesBatch(SpeciesBatch bean) {
- return null;
+ public SpeciesBatch createSpeciesBatch(SpeciesBatch bean,
+ String parentBatchId) {
+ throw new UnsupportedOperationException();
}
@Override
public SpeciesBatch saveSpeciesBatch(SpeciesBatch bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public void deleteSpeciesBatch(String id) {
+ throw new UnsupportedOperationException();
}
@Override
+ public void deleteSpeciesSubBatch(String id) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
public List<SpeciesBatchFrequency> getAllSpeciesBatchFrequency(String speciesBatchId) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
- public List<SpeciesBatchFrequency> saveSpeciesBatchFrequency(String speciesBatchId, List<SpeciesBatchFrequency> frequencies) {
- return null;
+ public List<SpeciesBatchFrequency> saveSpeciesBatchFrequency(String speciesBatchId,
+ List<SpeciesBatchFrequency> frequencies) {
+ throw new UnsupportedOperationException();
}
//------------------------------------------------------------------------//
@@ -315,26 +397,27 @@
@Override
public List<BenthosBatch> getAllBenthosBatch(String fishingOperationId) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public BenthosBatch getBenthosBatch(String id) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public BenthosBatch createBenthosBatch(BenthosBatch bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public BenthosBatch saveBenthosBatch(BenthosBatch bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public void deleteBenthosBatch(String id) {
+ throw new UnsupportedOperationException();
}
//------------------------------------------------------------------------//
@@ -343,26 +426,27 @@
@Override
public List<PlanktonBatch> getAllPlanktonBatch(String fishingOperationId) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public PlanktonBatch getPlanktonBatch(String id) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public PlanktonBatch createPlanktonBatch(PlanktonBatch bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public PlanktonBatch savePlanktonBatch(PlanktonBatch bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public void deletePlanktonBatch(String id) {
+ throw new UnsupportedOperationException();
}
//------------------------------------------------------------------------//
@@ -371,26 +455,27 @@
@Override
public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public MacroWasteBatch getMacroWasteBatch(String id) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public void deleteMacroWasteBatch(String id) {
+ throw new UnsupportedOperationException();
}
//------------------------------------------------------------------------//
@@ -399,25 +484,37 @@
@Override
public List<AccidentalBatch> getAllAccidentalBatch(String fishingOperationId) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public AccidentalBatch getAccidentalBatch(String id) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public AccidentalBatch createAccidentalBatch(AccidentalBatch bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public AccidentalBatch saveAccidentalBatch(AccidentalBatch bean) {
- return null;
+ throw new UnsupportedOperationException();
}
@Override
public void deleteAccidentalBatch(String id) {
+ throw new UnsupportedOperationException();
}
+
+ //------------------------------------------------------------------------//
+ //-- Internal methods --//
+ //------------------------------------------------------------------------//
+
+ protected <E extends AbstractTuttiReferentialEntity> void setStatus(fr.ifremer.adagio.core.dao.referential.Status status, E entity) {
+ Status newStatus = new Status();
+ newStatus.setId(status.getCode());
+ newStatus.setName(status.getName());
+ entity.setStatus(newStatus);
+ }
}
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfig.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfig.java 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfig.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -24,9 +24,24 @@
* #L%
*/
+import com.google.common.base.Charsets;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Sets;
+import com.google.common.io.Files;
+import fr.ifremer.tutti.persistence.RessourceClassLoader;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.util.ApplicationConfig;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import java.util.Set;
/**
* Configuration for the persistence driver.
@@ -36,31 +51,194 @@
*/
public class TuttiPersistenceAdagioConfig {
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(TuttiPersistenceAdagioConfig.class);
+
protected final ApplicationConfig config;
public TuttiPersistenceAdagioConfig(ApplicationConfig config) {
this.config = config;
- config.loadDefaultOptions(TuttiPersistenceAdagioConfigOption.values());
}
+ public void initConfig(RessourceClassLoader resourceLoader) throws IOException {
+ try {
+ FileUtils.forceMkdir(getDbDirectory());
+ } catch (Exception e) {
+ throw new RuntimeException("Could not create directory", e);
+ }
+
+ // add a predicate to search the configuration file from his directory instead of the class-path
+ resourceLoader.addSearchInDirectoriesPredicate(new Predicate<String>() {
+
+ Set<String> matchingNames = Sets.newHashSet(
+ getDbConfigurationPath().getName(),
+ getDbEnumerationPath().getName());
+
+ @Override
+ public boolean apply(String input) {
+ return matchingNames.contains(input);
+ }
+ });
+
+ // get configuration file path
+ File configurationPath = getDbConfigurationPath();
+
+ // add his directory in path to search
+ resourceLoader.addDirectory(configurationPath.getParentFile());
+
+ // generate configuration file if required
+ generateDbConfiguration(configurationPath);
+
+ // get enumeration file path
+ File enumerationPath = getDbEnumerationPath();
+
+ // add his directory in path to search
+ resourceLoader.addDirectory(enumerationPath.getParentFile());
+
+ generateDbEnumerationConfiguration(enumerationPath);
+ }
+
+ public File getDbConfigurationPath() {
+ return config.getOptionAsFile(TuttiPersistenceAdagioConfigOption.DB_CONFIGURATION_PATH.getKey());
+ }
+
public File getDbDirectory() {
- return config.getOptionAsFile(TuttiPersistenceAdagioConfigOption.DB_PATH.getKey());
+ return config.getOptionAsFile(TuttiPersistenceAdagioConfigOption.DB_DIRECTORY.getKey());
}
public File getDbName() {
return config.getOptionAsFile(TuttiPersistenceAdagioConfigOption.DB_NAME.getKey());
}
- public File getDbConfigurationPath() {
- return config.getOptionAsFile(TuttiPersistenceAdagioConfigOption.DB_CONFIGURATION_PATH.getKey());
+ public File getDbEnumerationPath() {
+ return config.getOptionAsFile(TuttiPersistenceAdagioConfigOption.DB_ENUMERATION_PATH.getKey());
}
- public File getDbMappingPath() {
- return config.getOptionAsFile(TuttiPersistenceAdagioConfigOption.BB_MAPPING_PATH.getKey());
+ public String getJdbcUrl() {
+ return config.getOption(TuttiPersistenceAdagioConfigOption.JDBC_URL.getKey());
}
+ public Class getJdbcDriver() {
+ return config.getOptionAsClass(TuttiPersistenceAdagioConfigOption.JDBC_DRIVER.getKey());
+ }
+
+ public String getJdbcUsername() {
+ return config.getOption(TuttiPersistenceAdagioConfigOption.JDBC_USERNAME.getKey());
+ }
+
+ public String getJdbcPassword() {
+ return config.getOption(TuttiPersistenceAdagioConfigOption.JDBC_PASSWORD.getKey());
+ }
+
+ public Class getHibernateDialect() {
+ return config.getOptionAsClass(TuttiPersistenceAdagioConfigOption.HIBERNATE_DIALECT.getKey());
+ }
+
+ public boolean isHibernateShowSql() {
+ Boolean result = config.getOptionAsBoolean(TuttiPersistenceAdagioConfigOption.HIBERNATE_SHOW_SQL.getKey());
+ return result != null && result;
+ }
+
+ public boolean isHibernateUseSqlComment() {
+ Boolean result = config.getOptionAsBoolean(TuttiPersistenceAdagioConfigOption.HIBERNATE_USE_SQL_COMMENT.getKey());
+ return result != null && result;
+ }
+
+ public boolean isHibernateFormatSql() {
+ Boolean result = config.getOptionAsBoolean(TuttiPersistenceAdagioConfigOption.HIBERNATE_FORMAT_SQL.getKey());
+ return result != null && result;
+ }
+
public ApplicationConfig getConfig() {
return config;
}
+ public void generateDbConfiguration(File destination) throws IOException {
+
+ if (!destination.exists()) {
+
+ // load db configuration template (tutti-db.properties)
+
+ if (log.isInfoEnabled()) {
+ log.info("Generate " + destination + " from classpath.");
+ }
+ Properties result = new Properties();
+ InputStream in = getClass().getResourceAsStream("/tutti-db-conf.properties");
+ try {
+ result.load(in);
+ in.close();
+ } finally {
+ IOUtils.closeQuietly(in);
+ }
+
+ // replace some values from ApplicationConfig
+
+ result.put("dataSource.jdbc.driver", getJdbcDriver().getName());
+ result.put("dataSource.jdbc.username", getJdbcUsername());
+ result.put("dataSource.jdbc.password", getJdbcPassword());
+ result.put("dataSource.jdbc.url", getJdbcUrl());
+ result.put("hibernate.dialect", getHibernateDialect().getName());
+ result.put("hibernate.show_sql", isHibernateShowSql() + "");
+ result.put("hibernate.format_sql", isHibernateFormatSql() + "");
+ result.put("hibernate.use_sql_comments", isHibernateUseSqlComment() + "");
+
+ // write result file at destination
+
+ BufferedWriter writer = Files.newWriter(destination, Charsets.UTF_8);
+ try {
+ result.store(writer, "Generated by " + getClass().getName());
+ writer.close();
+ } finally {
+ IOUtils.closeQuietly(writer);
+ }
+ }
+ }
+
+ public void generateDbEnumerationConfiguration(File destination) throws IOException {
+
+ if (!destination.exists()) {
+
+ // load enumeration mapping from classpath (enumerations.properties)
+
+ if (log.isInfoEnabled()) {
+ log.info("Generate " + destination + " from classpath.");
+ }
+
+ Properties result = new Properties();
+ InputStream in = getClass().getResourceAsStream("/tutti-db-enumerations.properties");
+ try {
+ result.load(in);
+ in.close();
+ } finally {
+ IOUtils.closeQuietly(in);
+ }
+
+ // replace some values from ApplicationConfig
+
+
+ // write result file at destination
+
+ BufferedWriter writer =
+ Files.newWriter(destination, Charsets.UTF_8);
+ try {
+ result.store(writer, "Generated by " + getClass().getName());
+ writer.close();
+ } finally {
+ IOUtils.closeQuietly(writer);
+ }
+ }
+ }
+
+ public Properties getDbEnumerations() throws IOException {
+ Properties result = new Properties();
+ BufferedReader in = Files.newReader(getDbEnumerationPath(), Charsets.UTF_8);
+ try {
+ result.load(in);
+ in.close();
+ } finally {
+ IOUtils.closeQuietly(in);
+ }
+ return result;
+ }
}
\ No newline at end of file
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfigOption.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfigOption.java 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfigOption.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -24,6 +24,8 @@
* #L%
*/
+import org.hibernate.dialect.HSQLDialect;
+import org.hsqldb.jdbcDriver;
import org.nuiton.util.ApplicationConfig;
import java.io.File;
@@ -36,32 +38,92 @@
*/
public enum TuttiPersistenceAdagioConfigOption implements ApplicationConfig.OptionDef {
- DB_PATH("tutti.persistence.dbPath",
+ DB_CONFIGURATION_PATH(
+ "tutti.persistence.db.configurationPath",
+ "Chemin du fichier de configuration d'Adagio",
+ "${tutti.data.directory}/conf.properties",
+ File.class,
+ true,
+ true),
+
+ DB_DIRECTORY(
+ "tutti.persistence.db.directory",
"Répertoire où est la base de données",
"${tutti.data.directory}/db",
File.class,
true,
true),
- DB_NAME("tutti.persistence.dbName",
+ DB_NAME(
+ "tutti.persistence.db.name",
"Nom du fichier de la base de données",
- "tutti",
+ "allegro",
String.class,
true,
true),
+ DB_ENUMERATION_PATH(
+ "tutti.persistence.db.enumerationPath",
+ "Chemin du fichier de correspondance des énumérations",
+ "${tutti.data.directory}/enumerations.properties",
+ File.class,
+ true,
+ true),
+ JDBC_USERNAME(
+ "tutti.persistence.jdbc.username",
+ "Login de l'utilisateur pour se connecter à la base de données",
+ "sa",
+ String.class,
+ true,
+ true),
+ JDBC_PASSWORD(
+ "tutti.persistence.jdbc.password",
+ "Mot de passe de l'utilisateur pour se connecter à la base de données",
+ "",
+ String.class,
+ true,
+ true),
+ JDBC_URL(
+ "tutti.persistence.jdbc.url",
+ "URL de connexion à la base de données",
+ "jdbc:hsqldb:file:${tutti.persistence.db.directory}/${tutti.persistence.db.name}",
+ String.class,
+ true,
+ true),
+ JDBC_DRIVER(
+ "tutti.persistence.jdbc.driver",
+ "Le pilote JDBC utilisé pour communiquer avec la base de données",
+ jdbcDriver.class.getName(),
+ Class.class,
+ true,
+ true),
+ HIBERNATE_DIALECT(
+ "tutti.persistence.hibernate.dialect",
+ "Le dialect hibernate utilisée pour communiquer avec la base de données",
+ HSQLDialect.class.getName(),
+ Class.class,
+ true,
+ true),
+ HIBERNATE_SHOW_SQL(
+ "tutti.persistence.hibernate.showSql",
+ "Option pour afficher ou non les requète sql dans les logs",
+ Boolean.FALSE.toString(),
+ boolean.class,
+ true,
+ true),
+ HIBERNATE_USE_SQL_COMMENT(
+ "tutti.persistence.hibernate.useSqlComment",
+ "Option pour ajouter les commentaires dans les requètes sql générées",
+ Boolean.FALSE.toString(),
+ boolean.class,
+ true,
+ true),
+ HIBERNATE_FORMAT_SQL(
+ "tutti.persistence.hibernate.formatSql",
+ "Option pour ajouter les commentaires dans les requètes sql générées",
+ Boolean.FALSE.toString(),
+ boolean.class,
+ true,
+ true);
- DB_CONFIGURATION_PATH("tutti.persistence.dbConfigurationµPath",
- "Chemin du fichier de configuration de la base",
- "${tutti.data.directory}/dbConfiguration.properties",
- File.class,
- true,
- true),
- BB_MAPPING_PATH("tutti.persistence.dbMappingPath",
- "Chemin du fichier de mapping des constantes de la base",
- "${tutti.data.directory}/dbMapping.properties",
- File.class,
- true,
- true);
-
/** Configuration key. */
private final String key;
Deleted: trunk/tutti-persistence-adagio/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.TuttiPersistence
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.TuttiPersistence 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.TuttiPersistence 2013-01-07 22:58:44 UTC (rev 156)
@@ -1 +0,0 @@
-fr.ifremer.tutti.persistence.TuttiPersistenceAdagioImpl
\ No newline at end of file
Added: trunk/tutti-persistence-adagio/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider (rev 0)
+++ trunk/tutti-persistence-adagio/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider 2013-01-07 22:58:44 UTC (rev 156)
@@ -0,0 +1 @@
+fr.ifremer.tutti.persistence.config.TuttiPersistenceAdagioProvider
\ No newline at end of file
Property changes on: trunk/tutti-persistence-adagio/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/src/main/resources/applicationContext-service-tutti.xml 2013-01-07 22:58:44 UTC (rev 156)
@@ -35,12 +35,12 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
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" />
+ <!--<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
(if available). -->
- <context:annotation-config />
+ <!--<context:annotation-config />-->
<!--Platform Transaction Manager declared as "transactionManager" will be
used. -->
@@ -50,8 +50,13 @@
from outside) -->
<tx:annotation-driven transaction-manager="transactionManager" />
+ <bean id="adagioPersistenceService" destroy-method="close"
+ class="fr.ifremer.tutti.persistence.TuttiPersistenceAdagioImpl">
+ <property name="sessionFactory" ref="sessionFactory" />
+ </bean>
+
<!--Enables the use of @AspectJ style of aspects' declarations. AspectJ
run-time isn't necessarily involved -->
- <aop:aspectj-autoproxy />
+ <!--<aop:aspectj-autoproxy />-->
</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-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-07 22:58:44 UTC (rev 156)
@@ -26,6 +26,11 @@
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
+
+ <!--<fetch-profile name="tutti">-->
+ <!--TODO Create fetch profile to avoid eager loading -->
+ <!--</fetch-profile>-->
+
<!-- Exemple HQL : >
<query cacheable="true"
name="selectProgramFromUser">select distinct
Added: trunk/tutti-persistence-adagio/src/main/resources/tutti-db-conf.properties
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/tutti-db-conf.properties (rev 0)
+++ trunk/tutti-persistence-adagio/src/main/resources/tutti-db-conf.properties 2013-01-07 22:58:44 UTC (rev 156)
@@ -0,0 +1,46 @@
+###
+# #%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%
+###
+# dataSource : jndi ou local
+dataSource.type=local
+
+# Si 'dataSource.type=jndi' :
+# - pour tomcat : jdbc/adagio-ds
+# - pour jboss : java:jdbc/adagio-ds
+#dataSource.jndi-name=jdbc/adagio-ds
+
+# Si 'dataSource.type=local' :
+dataSource.jdbc.driver=${tutti.persistence.jdbc.driver}
+dataSource.jdbc.username=${tutti.persistence.jdbc.username}
+dataSource.jdbc.password=${tutti.persistence.jdbc.password}
+dataSource.jdbc.url=${tutti.persistence.jdbc.url}
+#dataSource.jdbc.url=jdbc:hsqldb:hsql://localhost/toto
+
+# Hibernate configuration :
+hibernate.dialect=${tutti.persistence.hibernate.dialect}
+hibernate.show_sql=${tutti.persistence.hibernate.showSql}
+hibernate.format_sql=${tutti.persistence.hibernate.formatSql}
+hibernate.use_sql_comments=${tutti.persistence.hibernate.useSqlComment}
+hibernate.generate_statistics=false
+hibernate.query.substitutions=true 1, false 0
+hibernate.hbm2ddl.auto=none
\ No newline at end of file
Property changes on: trunk/tutti-persistence-adagio/src/main/resources/tutti-db-conf.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties (rev 0)
+++ trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties 2013-01-07 22:58:44 UTC (rev 156)
@@ -0,0 +1,297 @@
+###
+# #%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%
+###
+# v3 Version de test
+
+AcquisitionLevelCode.ACTIVITY=ACTIVITY
+AcquisitionLevelCode.ACTIVITY_CALENDAR=ACTIVITY_CALENDAR
+AcquisitionLevelCode.BATCH=LOT
+AcquisitionLevelCode.FISHING_EFFORT_CALENDAR=EFFORT_CALENDAR
+AcquisitionLevelCode.FISHING_OPERATION=OPER_PREL
+AcquisitionLevelCode.FISHING_TRIP=FISHING_TRIP
+AcquisitionLevelCode.FISHING_TRIP_PHYSICAL_GEAR=OBSERVED_PHYSICAL_GEAR
+AcquisitionLevelCode.LANDING=LANDING
+AcquisitionLevelCode.MONTHLY_EFFORT=EFFORT_MENS
+AcquisitionLevelCode.OBSERVED_LANDING=OBSERVED_LANDING
+AcquisitionLevelCode.OBSERVED_SALE=OBSERVED_SALE
+AcquisitionLevelCode.OBSERVED_TRIP_ON_BOARD=MAREE_OBSERV_MER
+AcquisitionLevelCode.OPERATION=OPER
+AcquisitionLevelCode.OPERATION_GROUP=OPERATION_GROUP
+AcquisitionLevelCode.PHYSICAL_GEAR=PHYS_GEAR
+AcquisitionLevelCode.SALE=SALE
+AcquisitionLevelCode.SALE_SURVEY=SALE_SURVEY
+AcquisitionLevelCode.SAMPLE=ECHANT
+AcquisitionLevelCode.SCIENTIFIC_CRUISE=SCIENTIFIC_CRUISE
+AcquisitionLevelCode.VESSEL_PHYSICALFEATURES=VESSEL_PHYSICAL_FEATURES
+AcquisitionLevelCode.YEARLYEFFORT=EFFORT_ANN
+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
+CriteriaType.DEFAULT=0
+CriteriaType.EXISTS=3
+CriteriaType.JOIN=1
+CriteriaType.NOT_EXISTS=4
+CriteriaType.SELECT=2
+DepartmentCode.OUTSIDE=EXT
+FractionId.ALL=1
+FractionId.GEAR=2
+GearClassificationId.CNTS=3
+GearClassificationId.EU=2
+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
+isActive.ACTIVE=1
+isActive.INACTIVE=0
+isActive.NOT_EXISTS=2
+LocationClassificationId.REGULATION=4
+LocationClassificationId.SECTOR=2
+LocationClassificationId.TERRITORIAL=1
+LocationLabel.FRANCE=FRA
+LocationLabel.MEDITERRANEAN_AND_BLACK_SEA=37
+LocationLevelId.CRIEE=7
+LocationLevelId.DEPARTEMENT=32
+LocationLevelId.FAO_ZONE=101
+LocationLevelId.PAYS_ISO3=21
+LocationLevelId.PORT=6
+LocationLevelId.QUARTIER=13
+LocationLevelId.RECTANGLE_STATISTIQUE=113
+LocationLevelId.REGION=31
+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
+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
+OrderTypeId.NORTH_SOUTH_LOCATION_RANK=1
+ParameterCode.ANOTHER_SURVEY=AUTRE_ENQ
+ParameterCode.BULK=VRAC/HORS VRAC
+ParameterCode.CALCULATED_WEIGHT=POIDS_CALCULE
+ParameterCode.CONTRACT_CODE=CONTRACT_CODE
+ParameterCode.CREW_SIZE=NB_HOMME_BORD
+ParameterCode.DATA_RELIABILITY=FIAB_DATA
+ParameterCode.DISCARD_TYPE=DISCARD_TYPE
+ParameterCode.ENGIN_TIME=NB_HEURES_MOTEUR
+ParameterCode.FISHING_DAY_COUNT=NB_JOURS_PECHE
+ParameterCode.GEAR_DEPTH=PROF
+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.SIZE_UE_CAT=SIZE_UE_CAT
+ParameterCode.CASE=CASE
+ParameterCode.SORTING_TYPE=SORTING_TYPE
+ParameterCode.PRESERVATION=ETAT
+ParameterCode.DRESSING=DRESSING
+ParameterCode.AGE=AGE
+ParameterCode.LENGTH_TOTAL=LENGTH_TOTAL
+ParameterCode.LONG_CARAPACE=LONG_CARAPACE
+ParameterCode.LENGTH_PREANAL=LENGTH_PREANAL
+ParameterCode.LENGTH=LENGTH
+ParameterCode.LENGTH_CARAPACE=LENGTH_CARAPACE
+ParameterCode.LENGTH_FORK=LENGTH_FORK
+ParameterCode.LENGTH_LM_FORK=LENGTH_LM_FORK
+ParameterCode.LENGTH_MANTLE=LENGTH_MANTLE
+ParameterCode.LENGTH_PELVIC=LENGTH_PELVIC
+ParameterCode.LENGTH_PRE_SUPRA_CAUDAL=LENGTH_PRE_SUPRA_CAUDAL
+ParameterCode.LENGTH_STANDARD=LENGTH_STANDARD
+ParameterCode.BEAM_LENGTH=BEAM_LENGTH
+ParameterCode.BEAM_TOTAL_LENGTH=BEAM_TOTAL_LENGTH
+ParameterCode.GEAR_TOTAL_LENGTH=GEAR_TOTAL_LENGTH
+ParameterCode.HEADLINE_LENGTH=HEADLINE_LENGTH
+ParameterCode.LBP=LBP
+ParameterCode.LG_ENGINS_PERDUS=LG_ENGINS_PERDUS
+ParameterCode.LG_RELEVEE=LG_RELEVEE
+ParameterCode.LOA=LOA
+ParameterCode.LONG=LONG
+ParameterCode.LONGLINE_LENGTH=LONGLINE_LENGTH
+ParameterCode.LONG_FORK=LONG_FORK
+ParameterCode.LONG_MANTLE=LONG_MANTLE
+ParameterCode.NET_LENGTH=NET_LENGTH
+ParameterCode.SEGMENT_LENGTH=SEGMENT_LENGTH
+ParameterCode.SEINE_LENGTH=SEINE_LENGTH
+ParameterCode.STD_CURVE_LENGTH=STD_CURVE_LENGTH
+ParameterCode.STD_STRAIGTH_LENGTH=STD_STRAIGTH_LENGTH
+ParameterCode.SWEEP_LENGTH=SWEEP_LENGTH
+ParameterCode.TOTAL_LENGTH_HAULED=TOTAL_LENGTH_HAULED
+ParameterCode.TOTAL_LENGTH_SOAKED=TOTAL_LENGTH_SOAKED
+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
+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
+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
+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
+QualityFlagCode.BAD=4
+QualityFlagCode.CORRECTED=5
+QualityFlagCode.DOUBTFUL=3
+QualityFlagCode.GOOD=1
+QualityFlagCode.INCOMPLETE=8
+QualityFlagCode.MISSING=9
+QualityFlagCode.NOTQUALIFIED=0
+QualityFlagCode.OUT_OF_STAT=2
+QualityFlagConfiguration.COLOR_MAPPING=GOOD|0,128,0;DOUBTFUL|255,128,0;BAD|255,0,0;CORRECTED|0,128,255
+QualityFlagConfiguration.INVALID_FLAG_LIST=2,4,8,9
+SaleTypeId.COOPERATIVE=-5
+SaleTypeId.CRIEE=1
+SaleTypeId.HORS_CONTROLE=9
+SaleTypeId.MARCHE_EXTERIEUR=5
+SaleTypeId.MARCHE_INTERIEUR=4
+SaleTypeId.MAREYEUR=2
+SaleTypeId.POISSONNIER=-6
+SaleTypeId.PRODUCTEUR=6
+SaleTypeId.RESTAURATION_COLLECTIVE=-3
+SaleTypeId.RESTAURATION_PRIVEE=-2
+SaleTypeId.RETRAIT_OP=7
+SaleTypeId.RETRAIT_SANITAIRE=8
+SaleTypeId.SUPERMARCHE=-4
+SaleTypeId.TRANSFORMATEUR=3
+SaleTypeId.VENTE_PARTICULIER=-1
+SamplingSchemeControl.MANDATORY_PROGRAM_LIST=SIH_OBSMER,SIH_OBSVENTE
+SpatialItemTypeId.DEPTH_GRADIENT=1
+SpatialItemTypeId.DISTANCE_TO_COAST_GRADIENT=3
+SpatialItemTypeId.GEAR=4
+SpatialItemTypeId.METIER=7
+SpatialItemTypeId.NEARBY_SPECIFIC_AREA=2
+SpatialItemTypeId.TAXON_GROUP=5
+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.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
+TranscribingSideId.IN=2
+TranscribingSideId.IN_OUT=3
+TranscribingSideId.OUT=1
+TranscribingSystemId.FAO=4
+TranscribingSystemId.HARMONIE=1
+TranscribingSystemId.OFIMER=3
+TranscribingSystemId.SIPA=2
+UnitId.DAY=17
+UnitId.DECIMAL_HOURS=9
+UnitId.MILLIMETER=6
+UnitId.NONE=1
+UserProfilId.OBSERVER=2
+UserProfilId.PROJECT_MEMBER=3
+UserProfilId.REFERENTIAL_ADMINISTRATOR=1
+UserProfilId.USER=4
+VesselTypeId.FISHING_VESSEL=1
+VesselTypeId.FISHING_VESSEL_GROUP=2
+VesselTypeId.PLEASURE_BOAT=4
+VesselTypeId.SCIENTIFIC_RESEARCH_VESSEL=5
+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
Property changes on: trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties
___________________________________________________________________
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/BaseDaoTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -24,45 +24,89 @@
* #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.junit.Assume;
+import org.hibernate.classic.Session;
+import org.junit.After;
+import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.context.transaction.TransactionConfiguration;
-import org.springframework.transaction.annotation.Transactional;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.springframework.context.ApplicationContext;
-import javax.annotation.Resource;
-import java.io.File;
-
-(a)RunWith(SpringJUnit4ClassRunner.class)
+//(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
+//@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
- protected SessionFactory sessionFactory;
+ // @Resource
+ private SessionFactory sessionFactory;
+ private Session session;
+
+ @Rule
+ public TestName name = new TestName();
+
+ protected TuttiPersistenceAdagioConfig config;
+
@BeforeClass
public static void beforeClass() {
- File db = new File("src/test/db");
- if (!db.exists()) {
- if (log.isWarnEnabled()) {
- log.warn("Could not find db at " + db + ", test is skipped.");
+ TestUtil.checkDbExists();
+ }
+
+ @Before
+ public void setUp() throws Exception {
+
+ config = TestUtil.createConfig(getClass(), name);
+
+ 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();
}
- Assume.assumeTrue(false);
+ } finally {
+
+ // close session factory
+ sessionFactory.close();
}
+
}
+
+ protected Session getSession() {
+ if (session == null) {
+ session = sessionFactory.openSession();
+ }
+ return session;
+ }
+
+ protected SessionFactory getSessionFactory() {
+ return sessionFactory;
+ }
+
+
}
Modified: 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-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/GearDaoTest.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -24,52 +24,25 @@
* #L%
*/
-import fr.ifremer.adagio.core.dao.Search;
-import fr.ifremer.adagio.core.dao.SearchParameter;
-import fr.ifremer.adagio.core.dao.referential.gear.Gear;
-import fr.ifremer.adagio.core.dao.referential.gear.GearDao;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Query;
-import org.hibernate.classic.Session;
-import org.junit.After;
import org.junit.Assert;
-import org.junit.Before;
import org.junit.Test;
-import javax.annotation.Resource;
-import java.util.Collection;
import java.util.List;
-import java.util.Set;
-
public class GearDaoTest extends BaseDaoTest {
/** Logger. */
private static final Log log = LogFactory.getLog(GearDaoTest.class);
- protected Session session;
-
- @Before
- public void setUp() throws Exception {
-
- session = sessionFactory.openSession();
- }
-
- @After
- public void tearDown() throws Exception {
- if (session != null) {
- session.close();
- }
- }
-
@Test
public void getAllGear() {
- Query query = session.getNamedQuery("getAllGears");
+ Query query = getSession().getNamedQuery("getAllGears");
List gears = query.list();
Assert.assertNotNull(gears);
}
-
}
Modified: 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-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramDaoTest.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -47,7 +47,7 @@
@Test
public void getAllProgramFromHibernate() {
- Session sess = sessionFactory.openSession();
+ Session sess = getSession();
Query query = sess.createQuery("from ProgramImpl");
List actual = query.list();
Assert.assertNotNull(actual);
Added: 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 (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -0,0 +1,137 @@
+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.TestName;
+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,
+ TestName 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,
+ TestName 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.getMethodName() // 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() {
+ }
+
+
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.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/TuttiPersistenceAdagioImplTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java (rev 0)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -0,0 +1,103 @@
+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.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.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
+ */
+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);
+
+ 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();
+ }
+ }
+
+ @Test
+ public void testGetAllGear() throws Exception {
+
+ List<Gear> allGear = driver.getAllGear();
+ Assert.assertNotNull(allGear);
+ Assert.assertFalse(allGear.isEmpty());
+ }
+}
Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.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/VesselDaoTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/VesselDaoTest.java 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/VesselDaoTest.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -24,13 +24,8 @@
* #L%
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hibernate.Query;
-import org.hibernate.classic.Session;
-import org.junit.After;
import org.junit.Assert;
-import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -38,28 +33,10 @@
public class VesselDaoTest extends BaseDaoTest {
- /** Logger. */
- private static final Log log = LogFactory.getLog(VesselDaoTest.class);
-
- protected Session session;
-
- @Before
- public void setUp() throws Exception {
-
- session = sessionFactory.openSession();
- }
-
- @After
- public void tearDown() throws Exception {
- if (session != null) {
- session.close();
- }
- }
-
@Test
public void getScientificVessel() {
- Query query = session.getNamedQuery("getAllScientificVessels");
+ Query query = getSession().getNamedQuery("getAllScientificVessels");
List vessels = query.list();
Assert.assertNotNull(vessels);
@@ -69,7 +46,7 @@
@Test
public void getFishingVessel() {
- Query query = session.getNamedQuery("getAllFishingVessels");
+ Query query = getSession().getNamedQuery("getAllFishingVessels");
List vessels = query.list();
Assert.assertNotNull(vessels);
Deleted: trunk/tutti-persistence-adagio/src/test/resources/conf.properties
===================================================================
--- trunk/tutti-persistence-adagio/src/test/resources/conf.properties 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/src/test/resources/conf.properties 2013-01-07 22:58:44 UTC (rev 156)
@@ -1,49 +0,0 @@
-###
-# #%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%
-###
-
-# dataSource : jndi ou local
-dataSource.type=local
-
-# Si 'dataSource.type=jndi' :
-# - pour tomcat : jdbc/adagio-ds
-# - pour jboss : java:jdbc/adagio-ds
-#dataSource.jndi-name=jdbc/adagio-ds
-
-# Si 'dataSource.type=local' :
-dataSource.jdbc.driver=org.hsqldb.jdbcDriver
-dataSource.jdbc.username=sa
-dataSource.jdbc.password=
-dataSource.jdbc.url=jdbc:hsqldb:file:src/test/db/allegro
-#dataSource.jdbc.url=jdbc:hsqldb:file:${tutti.persistence.dbPath}/${tutti.persistence.dbName}
-#dataSource.jdbc.url=jdbc:hsqldb:hsql://localhost/toto
-
-# Hibernate configuration :
-hibernate.dialect=org.hibernate.dialect.HSQLDialect
-#hibernate.show_sql=true
-hibernate.format_sql=false
-hibernate.use_sql_comments=true
-hibernate.generate_statistics=false
-hibernate.query.substitutions=true 1, false 0
-hibernate.hbm2ddl.auto=none
-
Modified: trunk/tutti-persistence-adagio/src/test/resources/tutti-test.properties
===================================================================
--- trunk/tutti-persistence-adagio/src/test/resources/tutti-test.properties 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-adagio/src/test/resources/tutti-test.properties 2013-01-07 22:58:44 UTC (rev 156)
@@ -21,4 +21,4 @@
# <http://www.gnu.org/licenses/gpl-3.0.html>.
# #L%
###
-tutti.data.directory=${testDirectory}
+tutti.persistence.jdbc.url=jdbc:hsqldb:file:src/test/db/allegro
\ No newline at end of file
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-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -60,7 +60,6 @@
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -72,6 +71,7 @@
import java.io.ObjectOutputStream;
import java.util.List;
import java.util.Map;
+import java.util.Properties;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.UUID;
@@ -128,7 +128,7 @@
*
* @since 0.1
*/
- protected TuttiPersistenceDevConfig config;
+ protected final TuttiPersistenceDevConfig config;
/**
* Cache of data.
@@ -144,6 +144,10 @@
*/
protected final Map<Class<? extends IdAware>, Binder<? extends IdAware, ? extends IdAware>> binderCache = Maps.newHashMap();
+ public TuttiPersistenceDevImpl(TuttiPersistenceDevConfig config) {
+ this.config = config;
+ }
+
//------------------------------------------------------------------------//
//-- Technical methods --//
//------------------------------------------------------------------------//
@@ -154,9 +158,10 @@
}
@Override
- public void open(ApplicationConfig config) throws IOException {
+ public void open() throws IOException {
- this.config = new TuttiPersistenceDevConfig(config);
+ Preconditions.checkNotNull(config, " No config property setted");
+
try {
FileUtils.forceMkdir(this.config.getStorageDirectory());
} catch (IOException e) {
@@ -176,6 +181,9 @@
@Override
public void close() throws IOException {
+ if (log.isInfoEnabled()) {
+ log.info("Close persistence driver " + getImplementationName());
+ }
binderCache.clear();
for (Class<? extends IdAware> entityType : cache.keySet()) {
@@ -183,6 +191,10 @@
}
}
+ @Override
+ public void setEnumerations(Properties dbEnumerations) {
+ }
+
//------------------------------------------------------------------------//
//-- Referential methods --//
//------------------------------------------------------------------------//
Deleted: trunk/tutti-persistence-dev/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.TuttiPersistence
===================================================================
--- trunk/tutti-persistence-dev/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.TuttiPersistence 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-dev/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.TuttiPersistence 2013-01-07 22:58:44 UTC (rev 156)
@@ -1 +0,0 @@
-fr.ifremer.tutti.persistence.TuttiPersistenceDevImpl
\ No newline at end of file
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-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -78,7 +78,7 @@
applicationConfig.setDefaultOption("tutti.data.directory",
testBasedir.getAbsolutePath());
config = new TuttiPersistenceDevConfig(applicationConfig);
- persistence = new TuttiPersistenceDevImpl();
+ persistence = new TuttiPersistenceDevImpl(config);
}
@After
@@ -94,7 +94,7 @@
File storageDirectory = config.getStorageDirectory();
Assert.assertNotNull(storageDirectory);
Assert.assertFalse(storageDirectory.exists());
- persistence.open(config.getConfig());
+ persistence.open();
Assert.assertTrue(storageDirectory.exists());
TuttiPersistenceDevFixtures fixtures = new TuttiPersistenceDevFixtures();
@@ -109,7 +109,7 @@
Assert.assertNotNull(storageDirectory);
Assert.assertFalse(storageDirectory.exists());
- persistence.open(config.getConfig());
+ persistence.open();
TuttiPersistenceDevFixtures fixtures = new TuttiPersistenceDevFixtures();
Assert.assertEquals(fixtures.getData(Country.class).size(),
@@ -128,7 +128,7 @@
Assert.assertNotNull(storageDirectory);
Assert.assertFalse(storageDirectory.exists());
- persistence.open(config.getConfig());
+ persistence.open();
Assert.assertTrue(storageDirectory.exists());
int size = persistence.getAllProgram().size();
@@ -143,7 +143,7 @@
persistence.close();
Assert.assertTrue(storageDirectory.exists());
- persistence.open(config.getConfig());
+ persistence.open();
Assert.assertEquals(size + 1, persistence.getAllProgram().size());
}
@@ -151,7 +151,7 @@
@Test
public void persistList() throws Exception {
- persistence.open(config.getConfig());
+ persistence.open();
SpeciesBatch batch = persistence.createSpeciesBatch(new SpeciesBatch(), null);
String batchId = batch.getId();
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-service/pom.xml 2013-01-07 22:58:44 UTC (rev 156)
@@ -48,8 +48,20 @@
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tutti-persistence-dev</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tutti-persistence-adagio</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ <dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-utils</artifactId>
</dependency>
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-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -24,8 +24,10 @@
* #L%
*/
-import com.google.common.base.Preconditions;
import fr.ifremer.tutti.persistence.TuttiPersistence;
+import fr.ifremer.tutti.persistence.TuttiPersistenceDevImpl;
+import fr.ifremer.tutti.persistence.config.TuttiPersistenceAdagioConfig;
+import fr.ifremer.tutti.persistence.config.TuttiPersistenceDevConfig;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
@@ -47,11 +49,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.ApplicationConfig;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.io.IOException;
-import java.util.Iterator;
import java.util.List;
-import java.util.ServiceLoader;
+import java.util.Properties;
/**
* Persistence service.
@@ -64,6 +67,8 @@
/** Logger. */
private static final Log log = LogFactory.getLog(PersistenceService.class);
+ protected TuttiPersistence devDriver;
+
protected TuttiPersistence driver;
@Override
@@ -71,7 +76,7 @@
super.setServiceContext(context);
try {
- open(context.getConfig().getApplicationConfig());
+ open();
} catch (IOException e) {
throw new TuttiServiceTechnicalException(
"Could init persistence storage", e);
@@ -84,170 +89,188 @@
@Override
public String getImplementationName() {
- checkDriverExists();
- return driver.getImplementationName();
+ return "Tutti Persistence Service";
}
@Override
- public void open(ApplicationConfig config) throws IOException {
+ public void open() throws IOException {
- ServiceLoader<TuttiPersistence> loader =
- ServiceLoader.load(TuttiPersistence.class);
+ if (log.isInfoEnabled()) {
+ log.info("Open persistence driver " + getImplementationName());
+ }
- Iterator<TuttiPersistence> iterator = loader.iterator();
+ ApplicationConfig config = context.getConfig().getApplicationConfig();
- if (!iterator.hasNext()) {
+ TuttiPersistenceDevConfig devDriverConfig = new TuttiPersistenceDevConfig(config);
- // no driver found
- throw new TuttiServiceTechnicalException("No persistence driver found");
+ devDriver = new TuttiPersistenceDevImpl(devDriverConfig);
+
+ if (log.isInfoEnabled()) {
+ log.info("Will open persistence driver " + devDriver.getImplementationName());
}
- driver = iterator.next();
+ devDriver.open();
- if (iterator.hasNext()) {
+ TuttiPersistenceAdagioConfig driverConfig = new TuttiPersistenceAdagioConfig(config);
- // yet another driver found, not possible
- throw new TuttiServiceTechnicalException("No persistence driver found");
+ if (!driverConfig.getDbDirectory().exists()) {
+ if (log.isWarnEnabled()) {
+
+ log.warn("--------------------------------------------------------------------");
+ log.warn("");
+ log.warn("Could not find database directory at " + driverConfig.getDbDirectory());
+ log.warn("Will still use dev dataStorage in " + devDriverConfig.getStorageDirectory());
+ log.warn("");
+ log.warn("--------------------------------------------------------------------");
+ }
+
+ driver = devDriver;
+ } else {
+ driverConfig.initConfig(context.getResourceLoader());
+
+ // can now instanciate Spring context
+
+ ApplicationContext springContext = new ClassPathXmlApplicationContext(
+ "applicationContext-conf.xml",
+ "applicationContext-dataSource-local.xml",
+ "applicationContext-entities.xml",
+ "applicationContext-service-tutti.xml"
+ );
+
+ driver = (TuttiPersistence) springContext.getBean("adagioPersistenceService");
+
+ if (log.isInfoEnabled()) {
+ log.info("Will open persistence driver " + driver.getImplementationName());
+ }
+
+ Properties enumerations = driverConfig.getDbEnumerations();
+ driver.setEnumerations(enumerations);
+ driver.open();
}
- if (log.isInfoEnabled()) {
- log.info("Using persistence driver " + getImplementationName());
- }
- driver.open(config);
+
}
@Override
public void close() throws IOException {
- checkDriverExists();
if (log.isInfoEnabled()) {
- log.info("Will close persistence driver " + getImplementationName());
+ log.info("Will close persistence Service " + getImplementationName());
}
- driver.close();
+ try {
+ driver.close();
+ } finally {
+
+ devDriver.close();
+ }
}
+ @Override
+ public void setEnumerations(Properties dbEnumerations) {
+ }
+
//------------------------------------------------------------------------//
//-- Referential methods --//
//------------------------------------------------------------------------//
@Override
public List<Species> getAllSpecies() {
- checkDriverExists();
- return driver.getAllSpecies();
+ return devDriver.getAllSpecies();
}
@Override
public Species getSpecies(String speciesId) {
- checkDriverExists();
- return driver.getSpecies(speciesId);
+ return devDriver.getSpecies(speciesId);
}
@Override
public List<Zone> getAllZone() {
- checkDriverExists();
- return driver.getAllZone();
+ return devDriver.getAllZone();
}
@Override
public List<Country> getAllCountry() {
- checkDriverExists();
- return driver.getAllCountry();
+ return devDriver.getAllCountry();
}
@Override
public List<Vessel> getAllVessel() {
- checkDriverExists();
- return driver.getAllVessel();
+ return devDriver.getAllVessel();
}
@Override
public List<Gear> getAllGear() {
- checkDriverExists();
- return driver.getAllGear();
+ return devDriver.getAllGear();
}
@Override
public List<Person> getAllPerson() {
- checkDriverExists();
- return driver.getAllPerson();
+ return devDriver.getAllPerson();
}
@Override
public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) {
- checkDriverExists();
- return driver.getAllFishingOperationStrata(zoneId);
+ return devDriver.getAllFishingOperationStrata(zoneId);
}
@Override
public List<FishingOperationLocation> getAllFishingOperationSubStrata(String locationId) {
- checkDriverExists();
- return driver.getAllFishingOperationSubStrata(locationId);
+ return devDriver.getAllFishingOperationSubStrata(locationId);
}
@Override
public List<FishingOperationLocation> getAllFishingOperationLocation(String locationId) {
- checkDriverExists();
- return driver.getAllFishingOperationLocation(locationId);
+ return devDriver.getAllFishingOperationLocation(locationId);
}
@Override
public List<Caracteristic> getAllFishingOperationEnvironmentCaracteristic() {
- checkDriverExists();
- return driver.getAllFishingOperationEnvironmentCaracteristic();
+ return devDriver.getAllFishingOperationEnvironmentCaracteristic();
}
@Override
public List<Caracteristic> getAllFishingOperationGearCaracteristic() {
- checkDriverExists();
- return driver.getAllFishingOperationGearCaracteristic();
+ return devDriver.getAllFishingOperationGearCaracteristic();
}
@Override
public List<Caracteristic> getAllFishingOperationHydrologicCaracteristic() {
- checkDriverExists();
- return driver.getAllFishingOperationHydrologicCaracteristic();
+ return devDriver.getAllFishingOperationHydrologicCaracteristic();
}
@Override
public List<Caracteristic> getAllSpeciesLengthStepCaracteristic() {
- checkDriverExists();
- return driver.getAllSpeciesLengthStepCaracteristic();
+ return devDriver.getAllSpeciesLengthStepCaracteristic();
}
@Override
public Caracteristic getSizeCategoryCaracteristic() {
- checkDriverExists();
- return driver.getSizeCategoryCaracteristic();
+ return devDriver.getSizeCategoryCaracteristic();
}
@Override
public Caracteristic getSexCaracteristic() {
- checkDriverExists();
- return driver.getSexCaracteristic();
+ return devDriver.getSexCaracteristic();
}
@Override
public Caracteristic getSortedUnsortedCaracteristic() {
- checkDriverExists();
- return driver.getSortedUnsortedCaracteristic();
+ return devDriver.getSortedUnsortedCaracteristic();
}
@Override
public Caracteristic getMaturityCaracteristic() {
- checkDriverExists();
- return driver.getMaturityCaracteristic();
+ return devDriver.getMaturityCaracteristic();
}
@Override
public Caracteristic getMacroWasteCategoryCaracteristic() {
- checkDriverExists();
- return driver.getMacroWasteCategoryCaracteristic();
+ return devDriver.getMacroWasteCategoryCaracteristic();
}
@Override
public Caracteristic getMacroWasteSizeCategoryCaracteristic() {
- checkDriverExists();
- return driver.getMacroWasteSizeCategoryCaracteristic();
+ return devDriver.getMacroWasteSizeCategoryCaracteristic();
}
//------------------------------------------------------------------------//
@@ -256,26 +279,22 @@
@Override
public List<Program> getAllProgram() {
- checkDriverExists();
- return driver.getAllProgram();
+ return devDriver.getAllProgram();
}
@Override
public Program getProgram(String id) {
- checkDriverExists();
- return driver.getProgram(id);
+ return devDriver.getProgram(id);
}
@Override
public Program createProgram(Program bean) {
- checkDriverExists();
- return driver.createProgram(bean);
+ return devDriver.createProgram(bean);
}
@Override
public Program saveProgram(Program bean) {
- checkDriverExists();
- return driver.saveProgram(bean);
+ return devDriver.saveProgram(bean);
}
//------------------------------------------------------------------------//
@@ -284,26 +303,22 @@
@Override
public List<Cruise> getAllCruise(String programId) {
- checkDriverExists();
- return driver.getAllCruise(programId);
+ return devDriver.getAllCruise(programId);
}
@Override
public Cruise getCruise(String id) {
- checkDriverExists();
- return driver.getCruise(id);
+ return devDriver.getCruise(id);
}
@Override
public Cruise createCruise(Cruise bean) {
- checkDriverExists();
- return driver.createCruise(bean);
+ return devDriver.createCruise(bean);
}
@Override
public Cruise saveCruise(Cruise bean) {
- checkDriverExists();
- return driver.saveCruise(bean);
+ return devDriver.saveCruise(bean);
}
//------------------------------------------------------------------------//
@@ -312,26 +327,22 @@
@Override
public List<TuttiProtocol> getAllProtocol() {
- checkDriverExists();
- return driver.getAllProtocol();
+ return devDriver.getAllProtocol();
}
@Override
public TuttiProtocol getProtocol(String id) {
- checkDriverExists();
- return driver.getProtocol(id);
+ return devDriver.getProtocol(id);
}
@Override
public TuttiProtocol createProtocol(TuttiProtocol bean) {
- checkDriverExists();
- return driver.createProtocol(bean);
+ return devDriver.createProtocol(bean);
}
@Override
public TuttiProtocol saveProtocol(TuttiProtocol bean) {
- checkDriverExists();
- return driver.saveProtocol(bean);
+ return devDriver.saveProtocol(bean);
}
@@ -341,26 +352,22 @@
@Override
public List<FishingOperation> getAllFishingOperation(String cruiseId) {
- checkDriverExists();
- return driver.getAllFishingOperation(cruiseId);
+ return devDriver.getAllFishingOperation(cruiseId);
}
@Override
public FishingOperation getFishingOperation(String id) {
- checkDriverExists();
- return driver.getFishingOperation(id);
+ return devDriver.getFishingOperation(id);
}
@Override
public FishingOperation createFishingOperation(FishingOperation bean) {
- checkDriverExists();
- return driver.createFishingOperation(bean);
+ return devDriver.createFishingOperation(bean);
}
@Override
public FishingOperation saveFishingOperation(FishingOperation bean) {
- checkDriverExists();
- return driver.saveFishingOperation(bean);
+ return devDriver.saveFishingOperation(bean);
}
//------------------------------------------------------------------------//
@@ -370,58 +377,49 @@
@Override
public List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId) {
- checkDriverExists();
- return driver.getAllRootSpeciesBatch(fishingOperationId);
+ return devDriver.getAllRootSpeciesBatch(fishingOperationId);
}
@Override
public List<SpeciesBatch> getAllSpeciesBatch(String fishingOperationId) {
- checkDriverExists();
- return driver.getAllSpeciesBatch(fishingOperationId);
+ return devDriver.getAllSpeciesBatch(fishingOperationId);
}
@Override
public SpeciesBatch getSpeciesBatch(String id) {
- checkDriverExists();
- return driver.getSpeciesBatch(id);
+ return devDriver.getSpeciesBatch(id);
}
@Override
public SpeciesBatch createSpeciesBatch(SpeciesBatch bean,
String parentBatchId) {
- checkDriverExists();
- return driver.createSpeciesBatch(bean, parentBatchId);
+ return devDriver.createSpeciesBatch(bean, parentBatchId);
}
@Override
public SpeciesBatch saveSpeciesBatch(SpeciesBatch bean) {
- checkDriverExists();
- return driver.saveSpeciesBatch(bean);
+ return devDriver.saveSpeciesBatch(bean);
}
@Override
public void deleteSpeciesBatch(String id) {
- checkDriverExists();
- driver.deleteSpeciesBatch(id);
+ devDriver.deleteSpeciesBatch(id);
}
@Override
public void deleteSpeciesSubBatch(String id) {
- checkDriverExists();
- driver.deleteSpeciesSubBatch(id);
+ devDriver.deleteSpeciesSubBatch(id);
}
@Override
public List<SpeciesBatchFrequency> getAllSpeciesBatchFrequency(String speciesBatchId) {
- checkDriverExists();
- return driver.getAllSpeciesBatchFrequency(speciesBatchId);
+ return devDriver.getAllSpeciesBatchFrequency(speciesBatchId);
}
@Override
public List<SpeciesBatchFrequency> saveSpeciesBatchFrequency(String speciesBatchId,
List<SpeciesBatchFrequency> frequencies) {
- checkDriverExists();
- return driver.saveSpeciesBatchFrequency(speciesBatchId, frequencies);
+ return devDriver.saveSpeciesBatchFrequency(speciesBatchId, frequencies);
}
//------------------------------------------------------------------------//
@@ -430,32 +428,27 @@
@Override
public List<BenthosBatch> getAllBenthosBatch(String fishingOperationId) {
- checkDriverExists();
- return driver.getAllBenthosBatch(fishingOperationId);
+ return devDriver.getAllBenthosBatch(fishingOperationId);
}
@Override
public BenthosBatch getBenthosBatch(String id) {
- checkDriverExists();
- return driver.getBenthosBatch(id);
+ return devDriver.getBenthosBatch(id);
}
@Override
public BenthosBatch createBenthosBatch(BenthosBatch bean) {
- checkDriverExists();
- return driver.createBenthosBatch(bean);
+ return devDriver.createBenthosBatch(bean);
}
@Override
public BenthosBatch saveBenthosBatch(BenthosBatch bean) {
- checkDriverExists();
- return driver.saveBenthosBatch(bean);
+ return devDriver.saveBenthosBatch(bean);
}
@Override
public void deleteBenthosBatch(String id) {
- checkDriverExists();
- driver.deleteBenthosBatch(id);
+ devDriver.deleteBenthosBatch(id);
}
//------------------------------------------------------------------------//
@@ -464,32 +457,27 @@
@Override
public List<PlanktonBatch> getAllPlanktonBatch(String fishingOperationId) {
- checkDriverExists();
- return driver.getAllPlanktonBatch(fishingOperationId);
+ return devDriver.getAllPlanktonBatch(fishingOperationId);
}
@Override
public PlanktonBatch getPlanktonBatch(String id) {
- checkDriverExists();
- return driver.getPlanktonBatch(id);
+ return devDriver.getPlanktonBatch(id);
}
@Override
public PlanktonBatch createPlanktonBatch(PlanktonBatch bean) {
- checkDriverExists();
- return driver.createPlanktonBatch(bean);
+ return devDriver.createPlanktonBatch(bean);
}
@Override
public PlanktonBatch savePlanktonBatch(PlanktonBatch bean) {
- checkDriverExists();
- return driver.savePlanktonBatch(bean);
+ return devDriver.savePlanktonBatch(bean);
}
@Override
public void deletePlanktonBatch(String id) {
- checkDriverExists();
- driver.deletePlanktonBatch(id);
+ devDriver.deletePlanktonBatch(id);
}
//------------------------------------------------------------------------//
@@ -498,32 +486,27 @@
@Override
public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) {
- checkDriverExists();
- return driver.getAllMacroWasteBatch(fishingOperationId);
+ return devDriver.getAllMacroWasteBatch(fishingOperationId);
}
@Override
public MacroWasteBatch getMacroWasteBatch(String id) {
- checkDriverExists();
- return driver.getMacroWasteBatch(id);
+ return devDriver.getMacroWasteBatch(id);
}
@Override
public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) {
- checkDriverExists();
- return driver.createMacroWasteBatch(bean);
+ return devDriver.createMacroWasteBatch(bean);
}
@Override
public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) {
- checkDriverExists();
- return driver.saveMacroWasteBatch(bean);
+ return devDriver.saveMacroWasteBatch(bean);
}
@Override
public void deleteMacroWasteBatch(String id) {
- checkDriverExists();
- driver.deleteMacroWasteBatch(id);
+ devDriver.deleteMacroWasteBatch(id);
}
//------------------------------------------------------------------------//
@@ -532,41 +515,31 @@
@Override
public List<AccidentalBatch> getAllAccidentalBatch(String fishingOperationId) {
- checkDriverExists();
- return driver.getAllAccidentalBatch(fishingOperationId);
+ return devDriver.getAllAccidentalBatch(fishingOperationId);
}
@Override
public AccidentalBatch getAccidentalBatch(String id) {
- checkDriverExists();
- return driver.getAccidentalBatch(id);
+ return devDriver.getAccidentalBatch(id);
}
@Override
public AccidentalBatch createAccidentalBatch(AccidentalBatch bean) {
- checkDriverExists();
- return driver.createAccidentalBatch(bean);
+ return devDriver.createAccidentalBatch(bean);
}
@Override
public AccidentalBatch saveAccidentalBatch(AccidentalBatch bean) {
- checkDriverExists();
- return driver.saveAccidentalBatch(bean);
+ return devDriver.saveAccidentalBatch(bean);
}
@Override
public void deleteAccidentalBatch(String id) {
- checkDriverExists();
- driver.deleteAccidentalBatch(id);
+ devDriver.deleteAccidentalBatch(id);
}
//------------------------------------------------------------------------//
//-- Internal methods --//
//------------------------------------------------------------------------//
- protected void checkDriverExists() {
- Preconditions.checkNotNull(
- driver,
- "Driver not initialized, please use the open method before all.");
- }
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceContext.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceContext.java 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceContext.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -28,6 +28,7 @@
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
+import fr.ifremer.tutti.persistence.RessourceClassLoader;
import fr.ifremer.tutti.service.config.TuttiServiceConfig;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
@@ -54,9 +55,13 @@
protected final TuttiServiceConfig config;
+ protected final RessourceClassLoader resourceLoader;
+
protected final LoadingCache<Class<? extends TuttiService>, TuttiService> services;
- public TuttiServiceContext(TuttiServiceConfig config) {
+ public TuttiServiceContext(RessourceClassLoader resourceLoader,
+ TuttiServiceConfig config) {
+ this.resourceLoader = resourceLoader;
this.config = config;
this.services = CacheBuilder.newBuilder().build(new CacheLoader<Class<? extends TuttiService>, TuttiService>() {
@Override
@@ -78,6 +83,10 @@
return config;
}
+ public RessourceClassLoader getResourceLoader() {
+ return resourceLoader;
+ }
+
public <S extends TuttiService> S getService(Class<S> serviceType) {
try {
S s = (S) services.get(serviceType);
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -53,7 +53,7 @@
this.applicationConfig = applicationConfig;
- applicationConfig.loadDefaultOptions(TuttiServiceConfigOption.values());
+// applicationConfig.loadDefaultOptions(TuttiServiceConfigOption.values());
}
public ApplicationConfig getApplicationConfig() {
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-ui-swing/pom.xml 2013-01-07 22:58:44 UTC (rev 156)
@@ -218,6 +218,14 @@
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tutti-persistence-adagio</artifactId>
+ <version>${project.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+
<!--dependency>
<groupId>com.jidesoft</groupId>
<artifactId>jide-oss</artifactId>
Modified: trunk/tutti-ui-swing/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/tutti-ui-swing/src/license/THIRD-PARTY.properties 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-ui-swing/src/license/THIRD-PARTY.properties 2013-01-07 22:58:44 UTC (rev 156)
@@ -1,18 +1,36 @@
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
#-------------------------------------------------------------------------------
# Already used licenses in project :
+# - Apache License
# - BSD License
+# - BSD-3 Clause License
+# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Development and Distribution License (CDDL) v1.0
+# - Common Public License Version 1.0
+# - Eclipse Public License - v 1.0
# - GNU General Public License - Version 2 with the class path exception
+# - GNU LESSER GENERAL PUBLIC LICENSE
+# - GNU Lesser General Public License
# - General Public License (GPL)
+# - HSQLDB License
# - LGPL 2.1
# - Lesser General Public License (LGPL)
# - Lesser General Public License (LGPL) v 3.0
# - MIT License
# - MPL 1.1
+# - New BSD License
+# - Public Domain
# - The Apache Software License, Version 2.0
+# - license.txt
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Thu Nov 22 16:54:03 CET 2012
+#Mon Jan 07 22:45:28 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=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/RunTutti.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -55,6 +55,9 @@
// Create application context
final TuttiUIContext context = TuttiUIContext.newContext(config);
+ // use our special classLoader (which will read some files from resources from a configuration directory)
+ Thread.currentThread().setContextClassLoader(context.getResourceLoader());
+
// Use shutdownHook to close context on System.exit
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -26,6 +26,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;
+import fr.ifremer.tutti.persistence.RessourceClassLoader;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Program;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
@@ -89,6 +90,13 @@
protected final TuttiConfig config;
/**
+ * ClassLoader ressource.
+ *
+ * @since 0.3
+ */
+ protected final RessourceClassLoader resourceLoader;
+
+ /**
* Service context used by any service.
*
* @since 0.1
@@ -147,7 +155,8 @@
protected TuttiUIContext(TuttiConfig config) {
this.config = config;
- this.serviceContext = new TuttiServiceContext(config.getServiceConfig());
+ this.resourceLoader = new RessourceClassLoader(Thread.currentThread().getContextClassLoader());
+ this.serviceContext = new TuttiServiceContext(resourceLoader, config.getServiceConfig());
this.swingSession = new SwingSession(getConfig().getUIConfigFile(), false);
UIMessageNotifier logMessageNotifier = new UIMessageNotifier() {
@@ -389,4 +398,8 @@
messageNotifier.showInformationMessage(message);
}
}
+
+ public RessourceClassLoader getResourceLoader() {
+ return resourceLoader;
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java 2013-01-07 22:58:44 UTC (rev 156)
@@ -32,6 +32,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.ApplicationConfigHelper;
import org.nuiton.util.ArgumentsParserException;
import org.nuiton.util.Version;
@@ -69,14 +70,15 @@
public TuttiConfig(String file, String... args) {
applicationConfig = new ApplicationConfig();
+
+ // load all config default options
+ ApplicationConfigHelper.loadAllDefaultOption(applicationConfig,
+ null,
+ null,
+ null,
+ true);
applicationConfig.setConfigFileName(file);
- log.info(this + " is initializing...");
-
- applicationConfig.loadDefaultOptions(TuttiConfigOption.values());
-
- serviceConfig = new TuttiServiceConfig(applicationConfig);
-
try {
applicationConfig.parse(args);
@@ -85,6 +87,11 @@
"Could not parse configuration", e);
}
+ log.info(this + " is initializing...");
+
+ serviceConfig = new TuttiServiceConfig(applicationConfig);
+
+
try {
serviceConfig.prepareDirectories();
} catch (IOException e) {
Modified: 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-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-warning-validation.xml 2013-01-07 22:58:44 UTC (rev 156)
@@ -1,5 +1,29 @@
<?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">
Modified: trunk/tutti-ui-swing/src/main/resources/log4j.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/log4j.properties 2013-01-07 16:42:45 UTC (rev 155)
+++ trunk/tutti-ui-swing/src/main/resources/log4j.properties 2013-01-07 22:58:44 UTC (rev 156)
@@ -38,3 +38,4 @@
# tutti levels
log4j.logger.fr.ifremer=INFO
+log4j.logger.org.nuiton.util=INFO
1
0
r155 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation
by kmorin@users.forge.codelutin.com 07 Jan '13
by kmorin@users.forge.codelutin.com 07 Jan '13
07 Jan '13
Author: kmorin
Date: 2013-01-07 17:42:45 +0100 (Mon, 07 Jan 2013)
New Revision: 155
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/155
Log:
refs #1899 [Ecran Trait] Cr?\195?\169er un ?\195?\169diteur de position spatiale
add popup on the DMS editors
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-01-07 16:38:05 UTC (rev 154)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-01-07 16:42:45 UTC (rev 155)
@@ -154,16 +154,12 @@
}
.degree {
- autoPopup: false;
- showPopupButton: false;
showReset: false;
useFloat: false;
useSign: true;
}
.minute {
- autoPopup: false;
- showPopupButton: false;
showReset: false;
useFloat: false;
useSign: false;
@@ -171,8 +167,6 @@
}
.second {
- autoPopup: false;
- showPopupButton: false;
showReset: false;
useFloat: false;
useSign: false;
1
0
r154 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/operation resources resources/fr/ifremer/tutti/ui/swing/content/operation resources/i18n
by kmorin@users.forge.codelutin.com 07 Jan '13
by kmorin@users.forge.codelutin.com 07 Jan '13
07 Jan '13
Author: kmorin
Date: 2013-01-07 17:38:05 +0100 (Mon, 07 Jan 2013)
New Revision: 154
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/154
Log:
refs #1899 [Ecran Trait] Cr?\195?\169er un ?\195?\169diteur de position spatiale
validation
Added:
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-warning-validation.xml
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
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-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
trunk/tutti-ui-swing/src/main/resources/validators.xml
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-01-04 17:38:11 UTC (rev 153)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-01-07 16:38:05 UTC (rev 154)
@@ -149,13 +149,16 @@
buttonGroup: "gearShootingCoordinates";
}
+CardLayout2Ext {
+ selected: {model.isUseSexagecimalFormat() ? "DMS" : "DD"};
+}
+
.degree {
autoPopup: false;
showPopupButton: false;
showReset: false;
useFloat: false;
useSign: true;
- numberPattern: {"-?" + INT_3_DIGITS_PATTERN};
}
.minute {
@@ -176,9 +179,14 @@
numberPattern: {INT_2_DIGITS_PATTERN};
}
+#gearShootingStartLongitudePanel {
+ layout:{gearShootingStartLongitudeLayout};
+}
+
#gearShootingStartLongitudeDMSDegreeField {
property: gearShootingStartLongitudeDegree;
model: {model.getGearShootingStartLongitudeDegree()};
+ numberPattern: {"-?" + INT_3_DIGITS_PATTERN};
}
#gearShootingStartLongitudeDMSMinuteField {
@@ -199,9 +207,14 @@
useSign: true;
}
+#gearShootingStartLatitudePanel {
+ layout:{gearShootingStartLatitudeLayout};
+}
+
#gearShootingStartLatitudeDMSDegreeField {
property: gearShootingStartLatitudeDegree;
model: {model.getGearShootingStartLatitudeDegree()};
+ numberPattern: {"-?" + INT_2_DIGITS_PATTERN};
}
#gearShootingStartLatitudeDMSMinuteField {
@@ -232,9 +245,14 @@
date: {model.getGearShootingStartDate()};
}
+#gearShootingEndLongitudePanel {
+ layout:{gearShootingEndLongitudeLayout};
+}
+
#gearShootingEndLongitudeDMSDegreeField {
property: gearShootingEndLongitudeDegree;
model: {model.getGearShootingEndLongitudeDegree()};
+ numberPattern: {"-?" + INT_3_DIGITS_PATTERN};
}
#gearShootingEndLongitudeDMSMinuteField {
@@ -255,9 +273,14 @@
useSign: true;
}
+#gearShootingEndLatitudePanel {
+ layout:{gearShootingEndLatitudeLayout};
+}
+
#gearShootingEndLatitudeDMSDegreeField {
property: gearShootingEndLatitudeDegree;
model: {model.getGearShootingEndLatitudeDegree()};
+ numberPattern: {"-?" + INT_2_DIGITS_PATTERN};
}
#gearShootingEndLatitudeDMSMinuteField {
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-04 17:38:11 UTC (rev 153)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-01-07 16:38:05 UTC (rev 154)
@@ -39,6 +39,7 @@
jaxx.runtime.swing.editor.bean.BeanDoubleList
jaxx.runtime.swing.editor.NumberEditor
jaxx.runtime.swing.editor.TimeEditor
+ jaxx.runtime.swing.CardLayout2Ext
jaxx.runtime.validator.swing.SwingValidatorUtil
jaxx.runtime.validator.swing.SwingValidatorMessageTableModel
@@ -47,7 +48,6 @@
org.jdesktop.swingx.JXTable
java.awt.Dimension
- java.awt.CardLayout
javax.swing.DefaultListModel
javax.swing.ListSelectionModel
@@ -75,7 +75,9 @@
<SwingValidatorMessageTableModel id='errorTableModel'/>
- <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
+ <BeanValidator id='validator'
+ bean='model'
+ errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
<field name='stationNumber' component='stationNumberField'/>
<field name='fishingOperationNumber'
@@ -83,8 +85,33 @@
<field name='date' component='dateField'/>
<field name='comment' component='commentField'/>
<field name='saisisseur' component='saisisseurList'/>
+ <field name='gearShootingStartLatitude' component='gearShootingStartLatitudeDDField'/>
+ <field name='gearShootingStartLatitudeDegree' component='gearShootingStartLatitudeDMSDegreeField'/>
+ <field name='gearShootingStartLatitudeMinute' component='gearShootingStartLatitudeDMSMinuteField'/>
+ <field name='gearShootingStartLatitudeSecond' component='gearShootingStartLatitudeDMSSecondField'/>
+ <field name='gearShootingStartLongitude' component='gearShootingStartLongitudeDDField'/>
+ <field name='gearShootingStartLongitudeDegree' component='gearShootingStartLongitudeDMSDegreeField'/>
+ <field name='gearShootingStartLongitudeMinute' component='gearShootingStartLongitudeDMSMinuteField'/>
+ <field name='gearShootingStartLongitudeSecond' component='gearShootingStartLongitudeDMSSecondField'/>
+ <field name='gearShootingEndLatitude' component='gearShootingEndLatitudeDDField'/>
+ <field name='gearShootingEndLatitudeDegree' component='gearShootingEndLatitudeDMSDegreeField'/>
+ <field name='gearShootingEndLatitudeMinute' component='gearShootingEndLatitudeDMSMinuteField'/>
+ <field name='gearShootingEndLatitudeSecond' component='gearShootingEndLatitudeDMSSecondField'/>
+ <field name='gearShootingEndLongitude' component='gearShootingEndLongitudeDDField'/>
+ <field name='gearShootingEndLongitudeDegree' component='gearShootingEndLongitudeDMSDegreeField'/>
+ <field name='gearShootingEndLongitudeMinute' component='gearShootingEndLongitudeDMSMinuteField'/>
+ <field name='gearShootingEndLongitudeSecond' component='gearShootingEndLongitudeDMSSecondField'/>
</BeanValidator>
+ <CardLayout2Ext id='gearShootingStartLongitudeLayout'
+ constructorParams='this, "gearShootingStartLongitudePanel"'/>
+ <CardLayout2Ext id='gearShootingStartLatitudeLayout'
+ constructorParams='this, "gearShootingStartLatitudePanel"'/>
+ <CardLayout2Ext id='gearShootingEndLongitudeLayout'
+ constructorParams='this, "gearShootingEndLongitudePanel"'/>
+ <CardLayout2Ext id='gearShootingEndLatitudeLayout'
+ constructorParams='this, "gearShootingEndLatitudePanel"'/>
+
<JPanel id='fishingOperationPane' constraints='BorderLayout.CENTER'
layout='{new BorderLayout()}'>
@@ -152,12 +179,14 @@
constraints='BorderLayout.CENTER'>
<row>
<cell>
- <JLabel/>
+ <JPanel layout="{new GridLayout(1,0)}">
+ <JRadioButton id='gearShootingCoordinatesDDRadio'
+ onActionPerformed='handler.setUseSexagecimalFormat(false)'/>
+ <JRadioButton id='gearShootingCoordinatesDMSRadio'
+ onActionPerformed='handler.setUseSexagecimalFormat(true)'/>
+ </JPanel>
</cell>
<cell>
- <JLabel/>
- </cell>
- <cell>
<JLabel id='gearLatitudeLabel'/>
</cell>
<cell>
@@ -175,12 +204,8 @@
<cell>
<JLabel id='gearShootingStartLabel'/>
</cell>
- <cell>
- <JRadioButton id='gearShootingCoordinatesDDRadio'
- onActionPerformed='handler.setUseSexagecimalFormat(false)'/>
- </cell>
<cell weightx='1'>
- <JPanel id='gearShootingStartLatitudePanel' layout="{new CardLayout()}">
+ <JPanel id='gearShootingStartLatitudePanel'>
<NumberEditor id='gearShootingStartLatitudeDDField' constraints='"DD"'
constructorParams='this'/>
<JPanel layout="{new GridLayout(1,0)}" constraints='"DMS"'>
@@ -197,7 +222,7 @@
</JPanel>
</cell>
<cell weightx='1'>
- <JPanel id='gearShootingStartLongitudePanel' layout="{new CardLayout()}">
+ <JPanel id='gearShootingStartLongitudePanel'>
<NumberEditor id='gearShootingStartLongitudeDDField' constraints='"DD"'
constructorParams='this'/>
<JPanel layout="{new GridLayout(1,0)}" constraints='"DMS"'>
@@ -225,12 +250,8 @@
<cell>
<JLabel id='gearShootingEndLabel'/>
</cell>
- <cell>
- <JRadioButton id='gearShootingCoordinatesDMSRadio'
- onActionPerformed='handler.setUseSexagecimalFormat(true)'/>
- </cell>
<cell weightx='1'>
- <JPanel id='gearShootingEndLatitudePanel' layout="{new CardLayout()}">
+ <JPanel id='gearShootingEndLatitudePanel'>
<NumberEditor id='gearShootingEndLatitudeDDField' constraints='"DD"'
constructorParams='this'/>
<JPanel layout="{new GridLayout(1,0)}" constraints='"DMS"'>
@@ -246,7 +267,7 @@
</JPanel>
</cell>
<cell weightx='1'>
- <JPanel id='gearShootingEndLongitudePanel' layout="{new CardLayout()}">
+ <JPanel id='gearShootingEndLongitudePanel'>
<NumberEditor id='gearShootingEndLongitudeDDField' constraints='"DD"'
constructorParams='this'/>
<JPanel layout="{new GridLayout(1,0)}" constraints='"DMS"'>
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-04 17:38:11 UTC (rev 153)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-07 16:38:05 UTC (rev 154)
@@ -52,6 +52,7 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
+import jaxx.runtime.swing.CardLayout2Ext;
/**
@@ -152,26 +153,11 @@
boolean useSexagecimalFormat = (Boolean) evt.getNewValue();
log.info("property PROPERTY_USE_SEXAGECIMAL_FORMAT changed " + useSexagecimalFormat);
- List<JPanel> panels = Lists.newArrayList(
- ui.getGearShootingStartLatitudePanel(),
- ui.getGearShootingStartLongitudePanel(),
- ui.getGearShootingEndLatitudePanel(),
- ui.getGearShootingEndLongitudePanel()
- );
-
- String fieldToShow;
if (useSexagecimalFormat) {
- fieldToShow = "DMS";
getModel().convertGearShootingCoordinatesDDToDMS();
} else {
- fieldToShow = "DD";
getModel().convertGearShootingCoordinatesDMSToDD();
}
-
- for (JPanel panel : panels) {
- CardLayout cardLayout = (CardLayout) panel.getLayout();
- cardLayout.show(panel, fieldToShow);
- }
}
});
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-04 17:38:11 UTC (rev 153)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-01-07 16:38:05 UTC (rev 154)
@@ -490,7 +490,7 @@
public void setGearShootingEndLongitudeSecond(Integer second) {
Object oldValue = getGearShootingEndLongitudeSecond();
- gearShootingStartLongitudeAsSexagecimal.setSeconde(second);
+ gearShootingEndLongitudeAsSexagecimal.setSeconde(second);
firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_SECOND, oldValue, second);
}
Modified: 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-04 17:38:11 UTC (rev 153)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-error-validation.xml 2013-01-07 16:38:05 UTC (rev 154)
@@ -34,7 +34,15 @@
</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">
Copied: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-warning-validation.xml (from rev 153, 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 (rev 0)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-warning-validation.xml 2013-01-07 16:38:05 UTC (rev 154)
@@ -0,0 +1,298 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!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>
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-04 17:38:11 UTC (rev 153)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-07 16:38:05 UTC (rev 154)
@@ -273,6 +273,7 @@
tutti.validator.error.cruise.vessel.required=Au moins un bateau doit être sélectionné
tutti.validator.error.cruise.year.required=L'année est obligatoire
tutti.validator.error.fishingOperation.date.required=La date du fishingOperation est obligatoire
+tutti.validator.error.fishingOperation.fishingOperationNumber.required=Le numéro de trait est obligatoire
tutti.validator.error.fishingOperation.stationNumber.required=Le numéro de station est obligatoire
tutti.validator.error.program.name.required=Le nom de la série est obligatoire
tutti.validator.error.program.zone.required=La zone de la série est obligatoire
Modified: trunk/tutti-ui-swing/src/main/resources/validators.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/validators.xml 2013-01-04 17:38:11 UTC (rev 153)
+++ trunk/tutti-ui-swing/src/main/resources/validators.xml 2013-01-07 16:38:05 UTC (rev 154)
@@ -43,5 +43,6 @@
<validator name="email" class="com.opensymphony.xwork2.validator.validators.EmailValidator"/>
<validator name="collectionUniqueKey" class="org.nuiton.validator.xwork2.field.CollectionUniqueKeyValidator"/>
+ <validator name="fieldexpressionwithparams" class="org.nuiton.validator.xwork2.field.FieldExpressionWithParamsValidator"/>
</validators>
1
0
r153 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing java/fr/ifremer/tutti/ui/swing/content/operation java/fr/ifremer/tutti/ui/swing/content/protocol resources/i18n
by kmorin@users.forge.codelutin.com 04 Jan '13
by kmorin@users.forge.codelutin.com 04 Jan '13
04 Jan '13
Author: kmorin
Date: 2013-01-04 18:38:11 +0100 (Fri, 04 Jan 2013)
New Revision: 153
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/153
Log:
refs #1899 [Ecran Trait] Cr?\195?\169er un ?\195?\169diteur de position spatiale
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUI.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
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/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUI.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUI.java 2013-01-04 09:13:06 UTC (rev 152)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUI.java 2013-01-04 17:38:11 UTC (rev 153)
@@ -46,6 +46,13 @@
public static final String INT_1_DIGITS_PATTERN = "\\d{0,1}";
/**
+ * Pattern to use for short numeric values in editors with max 2 digits.
+ *
+ * @since 0.1
+ */
+ public static final String INT_2_DIGITS_PATTERN = "\\d{0,2}";
+
+ /**
* Pattern to use for short numeric values in editors with max 3 digits.
*
* @since 0.1
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-01-04 09:13:06 UTC (rev 152)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-01-04 17:38:11 UTC (rev 153)
@@ -137,14 +137,91 @@
text: "tutti.label.fishingOperation.gearShootingEnd";
}
-#gearShootingStartLongitudeField {
- text: {getStringValue(model.getGearShootingStartLongitude())};
+#gearShootingCoordinatesDMSRadio {
+ text: "tutti.label.fishingOperation.gearShootingCoordinatesDMS";
+ selected: {model.isUseSexagecimalFormat()};
+ buttonGroup: "gearShootingCoordinates";
}
-#gearShootingStartLatitudeField {
- text: {getStringValue(model.getGearShootingStartLatitude())};
+#gearShootingCoordinatesDDRadio {
+ text: "tutti.label.fishingOperation.gearShootingCoordinatesDD";
+ selected: {!model.isUseSexagecimalFormat()};
+ buttonGroup: "gearShootingCoordinates";
}
+.degree {
+ autoPopup: false;
+ showPopupButton: false;
+ showReset: false;
+ useFloat: false;
+ useSign: true;
+ numberPattern: {"-?" + INT_3_DIGITS_PATTERN};
+}
+
+.minute {
+ autoPopup: false;
+ showPopupButton: false;
+ showReset: false;
+ useFloat: false;
+ useSign: false;
+ numberPattern: {INT_2_DIGITS_PATTERN};
+}
+
+.second {
+ autoPopup: false;
+ showPopupButton: false;
+ showReset: false;
+ useFloat: false;
+ useSign: false;
+ numberPattern: {INT_2_DIGITS_PATTERN};
+}
+
+#gearShootingStartLongitudeDMSDegreeField {
+ property: gearShootingStartLongitudeDegree;
+ model: {model.getGearShootingStartLongitudeDegree()};
+}
+
+#gearShootingStartLongitudeDMSMinuteField {
+ property: gearShootingStartLongitudeMinute;
+ model: {model.getGearShootingStartLongitudeMinute()};
+}
+
+#gearShootingStartLongitudeDMSSecondField {
+ property: gearShootingStartLongitudeSecond;
+ model: {model.getGearShootingStartLongitudeSecond()};
+}
+
+#gearShootingStartLongitudeDDField {
+ property: gearShootingStartLongitude;
+ model: {model.getGearShootingStartLongitude()};
+ showReset: false;
+ useFloat: true;
+ useSign: true;
+}
+
+#gearShootingStartLatitudeDMSDegreeField {
+ property: gearShootingStartLatitudeDegree;
+ model: {model.getGearShootingStartLatitudeDegree()};
+}
+
+#gearShootingStartLatitudeDMSMinuteField {
+ property: gearShootingStartLatitudeMinute;
+ model: {model.getGearShootingStartLatitudeMinute()};
+}
+
+#gearShootingStartLatitudeDMSSecondField {
+ property: gearShootingStartLatitudeSecond;
+ model: {model.getGearShootingStartLatitudeSecond()};
+}
+
+#gearShootingStartLatitudeDDField {
+ property: gearShootingStartLatitude;
+ model: {model.getGearShootingStartLatitude()};
+ showReset: false;
+ useFloat: true;
+ useSign: true;
+}
+
#gearShootingStartDateField {
date: {model.getGearShootingStartDate()};
formats: {"dd/MM/yyyy"};
@@ -155,14 +232,52 @@
date: {model.getGearShootingStartDate()};
}
-#gearShootingEndLongitudeField {
- text: {getStringValue(model.getGearShootingEndLongitude())};
+#gearShootingEndLongitudeDMSDegreeField {
+ property: gearShootingEndLongitudeDegree;
+ model: {model.getGearShootingEndLongitudeDegree()};
}
-#gearShootingEndLatitudeField {
- text: {getStringValue(model.getGearShootingEndLatitude())};
+#gearShootingEndLongitudeDMSMinuteField {
+ property: gearShootingEndLongitudeMinute;
+ model: {model.getGearShootingEndLongitudeMinute()};
}
+#gearShootingEndLongitudeDMSSecondField {
+ property: gearShootingEndLongitudeSecond;
+ model: {model.getGearShootingEndLongitudeSecond()};
+}
+
+#gearShootingEndLongitudeDDField {
+ property: gearShootingEndLongitude;
+ model: {model.getGearShootingEndLongitude()};
+ showReset: false;
+ useFloat: true;
+ useSign: true;
+}
+
+#gearShootingEndLatitudeDMSDegreeField {
+ property: gearShootingEndLatitudeDegree;
+ model: {model.getGearShootingEndLatitudeDegree()};
+}
+
+#gearShootingEndLatitudeDMSMinuteField {
+ property: gearShootingEndLatitudeMinute;
+ model: {model.getGearShootingEndLatitudeMinute()};
+}
+
+#gearShootingEndLatitudeDMSSecondField {
+ property: gearShootingEndLatitudeSecond;
+ model: {model.getGearShootingEndLatitudeSecond()};
+}
+
+#gearShootingEndLatitudeDDField {
+ property: gearShootingEndLatitude;
+ model: {model.getGearShootingEndLatitude()};
+ showReset: false;
+ useFloat: true;
+ useSign: true;
+}
+
#gearShootingEndDateField {
date: {model.getGearShootingEndDate()};
formats: {"dd/MM/yyyy"};
@@ -195,6 +310,7 @@
selected: {model.getFishingOperationValid() == Boolean.FALSE};
buttonGroup: "fishingOperationValid";
}
+
#fishingOperationResetRadio {
selected: {model.getFishingOperationValid() == null};
buttonGroup: "fishingOperationValid";
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-04 09:13:06 UTC (rev 152)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-01-04 17:38:11 UTC (rev 153)
@@ -47,6 +47,7 @@
org.jdesktop.swingx.JXTable
java.awt.Dimension
+ java.awt.CardLayout
javax.swing.DefaultListModel
javax.swing.ListSelectionModel
@@ -154,6 +155,9 @@
<JLabel/>
</cell>
<cell>
+ <JLabel/>
+ </cell>
+ <cell>
<JLabel id='gearLatitudeLabel'/>
</cell>
<cell>
@@ -172,13 +176,42 @@
<JLabel id='gearShootingStartLabel'/>
</cell>
<cell>
- <JTextField id='gearShootingStartLatitudeLabel'
- onKeyReleased='handler.setGearShootingStartLatitude(((JTextField)event.getSource()).getText())'/>
+ <JRadioButton id='gearShootingCoordinatesDDRadio'
+ onActionPerformed='handler.setUseSexagecimalFormat(false)'/>
</cell>
- <cell>
- <JTextField id='gearShootingStartLongitudeField'
- onKeyReleased='handler.setGearShootingStartLongitude(((JTextField)event.getSource()).getText())'/>
+ <cell weightx='1'>
+ <JPanel id='gearShootingStartLatitudePanel' layout="{new CardLayout()}">
+ <NumberEditor id='gearShootingStartLatitudeDDField' constraints='"DD"'
+ constructorParams='this'/>
+ <JPanel layout="{new GridLayout(1,0)}" constraints='"DMS"'>
+ <NumberEditor id='gearShootingStartLatitudeDMSDegreeField'
+ constructorParams='this' styleClass='degree'/>
+
+ <NumberEditor id='gearShootingStartLatitudeDMSMinuteField'
+ constructorParams='this' styleClass='minute'/>
+
+ <NumberEditor id='gearShootingStartLatitudeDMSSecondField'
+ constructorParams='this' styleClass='second'/>
+ </JPanel>
+<!-- -->
+ </JPanel>
</cell>
+ <cell weightx='1'>
+ <JPanel id='gearShootingStartLongitudePanel' layout="{new CardLayout()}">
+ <NumberEditor id='gearShootingStartLongitudeDDField' constraints='"DD"'
+ constructorParams='this'/>
+ <JPanel layout="{new GridLayout(1,0)}" constraints='"DMS"'>
+ <NumberEditor id='gearShootingStartLongitudeDMSDegreeField'
+ constructorParams='this' styleClass='degree'/>
+
+ <NumberEditor id='gearShootingStartLongitudeDMSMinuteField'
+ constructorParams='this' styleClass='minute'/>
+
+ <NumberEditor id='gearShootingStartLongitudeDMSSecondField'
+ constructorParams='this' styleClass='second'/>
+ </JPanel>
+ </JPanel>
+ </cell>
<cell>
<JXDatePicker id='gearShootingStartDateField'
onActionPerformed='handler.setDate(event, "gearShootingStartDate")'/>
@@ -193,13 +226,41 @@
<JLabel id='gearShootingEndLabel'/>
</cell>
<cell>
- <JTextField id='gearShootingEndLatitudeLabel'
- onKeyReleased='handler.setGearShootingEndLatitude(((JTextField)event.getSource()).getText())'/>
+ <JRadioButton id='gearShootingCoordinatesDMSRadio'
+ onActionPerformed='handler.setUseSexagecimalFormat(true)'/>
</cell>
- <cell>
- <JTextField id='gearShootingEndLongitudeField'
- onKeyReleased='handler.setGearShootingEndLongitude(((JTextField)event.getSource()).getText())'/>
+ <cell weightx='1'>
+ <JPanel id='gearShootingEndLatitudePanel' layout="{new CardLayout()}">
+ <NumberEditor id='gearShootingEndLatitudeDDField' constraints='"DD"'
+ constructorParams='this'/>
+ <JPanel layout="{new GridLayout(1,0)}" constraints='"DMS"'>
+ <NumberEditor id='gearShootingEndLatitudeDMSDegreeField'
+ constructorParams='this' styleClass='degree'/>
+
+ <NumberEditor id='gearShootingEndLatitudeDMSMinuteField'
+ constructorParams='this' styleClass='minute'/>
+
+ <NumberEditor id='gearShootingEndLatitudeDMSSecondField'
+ constructorParams='this' styleClass='second'/>
+ </JPanel>
+ </JPanel>
</cell>
+ <cell weightx='1'>
+ <JPanel id='gearShootingEndLongitudePanel' layout="{new CardLayout()}">
+ <NumberEditor id='gearShootingEndLongitudeDDField' constraints='"DD"'
+ constructorParams='this'/>
+ <JPanel layout="{new GridLayout(1,0)}" constraints='"DMS"'>
+ <NumberEditor id='gearShootingEndLongitudeDMSDegreeField'
+ constructorParams='this' styleClass='degree'/>
+
+ <NumberEditor id='gearShootingEndLongitudeDMSMinuteField'
+ constructorParams='this' styleClass='minute'/>
+
+ <NumberEditor id='gearShootingEndLongitudeDMSSecondField'
+ constructorParams='this' styleClass='second'/>
+ </JPanel>
+ </JPanel>
+ </cell>
<cell>
<JXDatePicker id='gearShootingEndDateField'
onActionPerformed='handler.setDate(event, "gearShootingEndDate")'/>
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-04 09:13:06 UTC (rev 152)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-04 17:38:11 UTC (rev 153)
@@ -48,6 +48,7 @@
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.BorderLayout;
+import java.awt.CardLayout;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
@@ -144,11 +145,40 @@
onSelectedSubStrata(source, newStrata);
}
});
+
+ model.addPropertyChangeListener(EditFishingOperationUIModel.PROPERTY_USE_SEXAGECIMAL_FORMAT, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ boolean useSexagecimalFormat = (Boolean) evt.getNewValue();
+ log.info("property PROPERTY_USE_SEXAGECIMAL_FORMAT changed " + useSexagecimalFormat);
+
+ List<JPanel> panels = Lists.newArrayList(
+ ui.getGearShootingStartLatitudePanel(),
+ ui.getGearShootingStartLongitudePanel(),
+ ui.getGearShootingEndLatitudePanel(),
+ ui.getGearShootingEndLongitudePanel()
+ );
+
+ String fieldToShow;
+ if (useSexagecimalFormat) {
+ fieldToShow = "DMS";
+ getModel().convertGearShootingCoordinatesDDToDMS();
+ } else {
+ fieldToShow = "DD";
+ getModel().convertGearShootingCoordinatesDMSToDD();
+ }
+
+ for (JPanel panel : panels) {
+ CardLayout cardLayout = (CardLayout) panel.getLayout();
+ cardLayout.show(panel, fieldToShow);
+ }
+ }
+ });
// listModelIsModify(model);
ui.setContextValue(model);
-
+
fishingOperationMonitor.setBean(model);
}
@@ -263,6 +293,10 @@
return ui.getModel();
}
+ //------------------------------------------------------------------------//
+ //-- Public methods --//
+ //------------------------------------------------------------------------//
+
public void selectFishingOperation(FishingOperation bean) {
if (fishingOperationMonitor.wasModified()) {
@@ -277,7 +311,10 @@
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();
@@ -321,6 +358,7 @@
model.setStrata(null);
model.setSubStrata(null);
model.setLocation(null);
+ model.convertGearShootingCoordinatesDDToDMS();
if (strata != null) {
ui.getStrataComboBox().setSelectedItem(strata);
@@ -384,11 +422,14 @@
}
public void save() {
-
+ EditFishingOperationUIModel model = getModel();
+
// get fishingOperation to save
+ if (model.isUseSexagecimalFormat()) {
+ model.convertGearShootingCoordinatesDMSToDD();
+ }
+ FishingOperation toSave = model.toBean();
- FishingOperation toSave = getModel().toBean();
-
if (log.isInfoEnabled()) {
log.info("Save edition for fishingOperation: " + toSave.getId());
}
@@ -412,9 +453,25 @@
//TODO
}
+ public void setUseSexagecimalFormat(boolean useSexagecimalFormat) {
+ getModel().setUseSexagecimalFormat(useSexagecimalFormat);
+ }
+
public void setGearShootingStartLatitude(String text) {
getModel().setGearShootingStartLatitude(Float.valueOf(text));
}
+
+ public void setGearShootingStartLatitudeDegree(String text) {
+ getModel().setGearShootingStartLatitude(Float.valueOf(text));
+ }
+
+ public void setGearShootingStartLatitudeMinute(String text) {
+ getModel().setGearShootingStartLatitude(Float.valueOf(text));
+ }
+
+ public void setGearShootingStartLatitudeSecond(String text) {
+ getModel().setGearShootingStartLatitude(Float.valueOf(text));
+ }
public void setGearShootingStartLongitude(String text) {
getModel().setGearShootingStartLongitude(Float.valueOf(text));
@@ -427,7 +484,11 @@
public void setGearShootingEndLongitude(String text) {
getModel().setGearShootingEndLongitude(Float.valueOf(text));
}
-
+
+ //------------------------------------------------------------------------//
+ //-- Protected methods --//
+ //------------------------------------------------------------------------//
+
protected void onSelectedStrata(EditFishingOperationUIModel model,
FishingOperationLocation newStrata) {
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-04 09:13:06 UTC (rev 152)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-01-04 17:38:11 UTC (rev 153)
@@ -31,7 +31,9 @@
import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
-import fr.ird.type.SexagecimalPosition;
+import fr.ifremer.tutti.persistence.spatial.SexagecimalPosition;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -62,15 +64,41 @@
public static final String PROPERTY_SUB_STRATA = "subStrata";
+ public static final String PROPERTY_USE_SEXAGECIMAL_FORMAT = "useSexagecimalFormat";
+
public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE = "gearShootingStartLatitude";
-
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DEGREE = "gearShootingStartLatitudeDegree";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_MINUTE = "gearShootingStartLatitudeMinute";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_SECOND = "gearShootingStartLatitudeSecond";
+
public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE = "gearShootingStartLongitude";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DEGREE = "gearShootingStartLongitudeDegree";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_MINUTE = "gearShootingStartLongitudeMinute";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_SECOND = "gearShootingStartLongitudeSecond";
public static final String PROPERTY_GEAR_SHOOTING_START_DATE = "gearShootingStartDate";
public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE = "gearShootingEndLatitude";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DEGREE = "gearShootingEndLatitudeDegree";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_MINUTE = "gearShootingEndLatitudeMinute";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_SECOND = "gearShootingEndLatitudeSecond";
public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE = "gearShootingEndLongitude";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DEGREE = "gearShootingEndLongitudeDegree";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_MINUTE = "gearShootingEndLongitudeMinute";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_SECOND = "gearShootingEndLongitudeSecond";
public static final String PROPERTY_GEAR_SHOOTING_END_DATE = "gearShootingEndDate";
@@ -115,7 +143,7 @@
protected SexagecimalPosition gearShootingEndLongitudeAsSexagecimal;
- protected boolean useSexagecimalFormat;
+ protected boolean useSexagecimalFormat = false;
protected Float gearShootingStartLatitude;
@@ -158,6 +186,10 @@
public EditFishingOperationUIModel() {
super(FishingOperation.class, fromBeanBinder, toBeanBinder);
+ gearShootingStartLatitudeAsSexagecimal = SexagecimalPosition.valueOf(gearShootingStartLatitude);
+ gearShootingStartLongitudeAsSexagecimal = SexagecimalPosition.valueOf(gearShootingStartLongitude);
+ gearShootingEndLatitudeAsSexagecimal = SexagecimalPosition.valueOf(gearShootingEndLatitude);
+ gearShootingEndLongitudeAsSexagecimal = SexagecimalPosition.valueOf(gearShootingEndLongitude);
}
public FishingOperation getFishingOperation() {
@@ -241,6 +273,16 @@
firePropertyChange(PROPERTY_SUB_STRATA, oldValue, subStrata);
}
+ public boolean isUseSexagecimalFormat() {
+ return useSexagecimalFormat;
+ }
+
+ public void setUseSexagecimalFormat(boolean useSexagecimalFormat) {
+ Object oldValue = isUseSexagecimalFormat();
+ this.useSexagecimalFormat = useSexagecimalFormat;
+ firePropertyChange(PROPERTY_USE_SEXAGECIMAL_FORMAT, oldValue, useSexagecimalFormat);
+ }
+
public Float getGearShootingStartLatitude() {
return gearShootingStartLatitude;
}
@@ -250,6 +292,46 @@
this.gearShootingStartLatitude = gearShootingStartLatitude;
firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE, oldValue, gearShootingStartLatitude);
}
+
+ public Integer getGearShootingStartLatitudeDegree() {
+ Integer result = gearShootingStartLatitudeAsSexagecimal.getDegre();
+ if (gearShootingStartLatitudeAsSexagecimal.isSign()) {
+ result *= -1;
+ }
+ return result;
+ }
+
+ public void setGearShootingStartLatitudeDegree(Integer degree) {
+ Object oldValue = getGearShootingStartLatitudeDegree();
+ boolean sign = degree != null && degree < 0;
+ if (degree != null) {
+ degree = Math.abs(degree);
+ }
+ gearShootingStartLatitudeAsSexagecimal.setSign(sign);
+ gearShootingStartLatitudeAsSexagecimal.setDegre(degree);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DEGREE, oldValue, degree);
+ }
+
+ public Integer getGearShootingStartLatitudeMinute() {
+ return gearShootingStartLatitudeAsSexagecimal.getMinute();
+ }
+
+ public void setGearShootingStartLatitudeMinute(Integer minute) {
+ Object oldValue = getGearShootingStartLatitudeMinute();
+ gearShootingStartLatitudeAsSexagecimal.setMinute(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_MINUTE, oldValue, minute);
+
+ }
+
+ public Integer getGearShootingStartLatitudeSecond() {
+ return gearShootingStartLatitudeAsSexagecimal.getSeconde();
+ }
+
+ public void setGearShootingStartLatitudeSecond(Integer second) {
+ Object oldValue = getGearShootingStartLatitudeSecond();
+ gearShootingStartLatitudeAsSexagecimal.setSeconde(second);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_SECOND, oldValue, second);
+ }
public Float getGearShootingStartLongitude() {
return gearShootingStartLongitude;
@@ -261,6 +343,47 @@
firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE, oldValue, gearShootingStartLongitude);
}
+
+ public Integer getGearShootingStartLongitudeDegree() {
+ Integer result = gearShootingStartLongitudeAsSexagecimal.getDegre();
+ if (gearShootingStartLongitudeAsSexagecimal.isSign()) {
+ result *= -1;
+ }
+ return result;
+ }
+
+ public void setGearShootingStartLongitudeDegree(Integer degree) {
+ Object oldValue = getGearShootingStartLongitudeDegree();
+ boolean sign = degree != null && degree < 0;
+ if (degree != null) {
+ degree = Math.abs(degree);
+ }
+ gearShootingStartLongitudeAsSexagecimal.setSign(sign);
+ gearShootingStartLongitudeAsSexagecimal.setDegre(degree);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DEGREE, oldValue, degree);
+ }
+
+ public Integer getGearShootingStartLongitudeMinute() {
+ return gearShootingStartLongitudeAsSexagecimal.getMinute();
+ }
+
+ public void setGearShootingStartLongitudeMinute(Integer minute) {
+ Object oldValue = getGearShootingStartLongitudeMinute();
+ gearShootingStartLongitudeAsSexagecimal.setMinute(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_MINUTE, oldValue, minute);
+
+ }
+
+ public Integer getGearShootingStartLongitudeSecond() {
+ return gearShootingStartLongitudeAsSexagecimal.getSeconde();
+ }
+
+ public void setGearShootingStartLongitudeSecond(Integer second) {
+ Object oldValue = getGearShootingStartLongitudeSecond();
+ gearShootingStartLongitudeAsSexagecimal.setSeconde(second);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_SECOND, oldValue, second);
+ }
+
public Date getGearShootingStartDate() {
return gearShootingStartDate;
}
@@ -280,6 +403,46 @@
this.gearShootingEndLatitude = gearShootingEndLatitude;
firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE, oldValue, gearShootingEndLatitude);
}
+
+ public Integer getGearShootingEndLatitudeDegree() {
+ Integer result = gearShootingEndLatitudeAsSexagecimal.getDegre();
+ if (gearShootingEndLatitudeAsSexagecimal.isSign()) {
+ result *= -1;
+ }
+ return result;
+ }
+
+ public void setGearShootingEndLatitudeDegree(Integer degree) {
+ Object oldValue = getGearShootingEndLatitudeDegree();
+ boolean sign = degree != null && degree < 0;
+ if (degree != null) {
+ degree = Math.abs(degree);
+ }
+ gearShootingEndLatitudeAsSexagecimal.setSign(sign);
+ gearShootingEndLatitudeAsSexagecimal.setDegre(degree);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DEGREE, oldValue, degree);
+ }
+
+ public Integer getGearShootingEndLatitudeMinute() {
+ return gearShootingEndLatitudeAsSexagecimal.getMinute();
+ }
+
+ public void setGearShootingEndLatitudeMinute(Integer minute) {
+ Object oldValue = getGearShootingEndLatitudeMinute();
+ gearShootingEndLatitudeAsSexagecimal.setMinute(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_MINUTE, oldValue, minute);
+
+ }
+
+ public Integer getGearShootingEndLatitudeSecond() {
+ return gearShootingEndLatitudeAsSexagecimal.getSeconde();
+ }
+
+ public void setGearShootingEndLatitudeSecond(Integer second) {
+ Object oldValue = getGearShootingEndLatitudeSecond();
+ gearShootingEndLatitudeAsSexagecimal.setSeconde(second);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_SECOND, oldValue, second);
+ }
public Float getGearShootingEndLongitude() {
return gearShootingEndLongitude;
@@ -291,6 +454,46 @@
firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE, oldValue, gearShootingEndLongitude);
}
+ public Integer getGearShootingEndLongitudeDegree() {
+ Integer result = gearShootingEndLongitudeAsSexagecimal.getDegre();
+ if (gearShootingEndLongitudeAsSexagecimal.isSign()) {
+ result *= -1;
+ }
+ return result;
+ }
+
+ public void setGearShootingEndLongitudeDegree(Integer degree) {
+ Object oldValue = getGearShootingEndLongitudeDegree();
+ boolean sign = degree != null && degree < 0;
+ if (degree != null) {
+ degree = Math.abs(degree);
+ }
+ gearShootingEndLongitudeAsSexagecimal.setSign(sign);
+ gearShootingEndLongitudeAsSexagecimal.setDegre(degree);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DEGREE, oldValue, degree);
+ }
+
+ public Integer getGearShootingEndLongitudeMinute() {
+ return gearShootingEndLongitudeAsSexagecimal.getMinute();
+ }
+
+ public void setGearShootingEndLongitudeMinute(Integer minute) {
+ Object oldValue = getGearShootingEndLongitudeMinute();
+ gearShootingEndLongitudeAsSexagecimal.setMinute(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_MINUTE, oldValue, minute);
+
+ }
+
+ public Integer getGearShootingEndLongitudeSecond() {
+ return gearShootingEndLongitudeAsSexagecimal.getSeconde();
+ }
+
+ public void setGearShootingEndLongitudeSecond(Integer second) {
+ Object oldValue = getGearShootingEndLongitudeSecond();
+ gearShootingStartLongitudeAsSexagecimal.setSeconde(second);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_SECOND, oldValue, second);
+ }
+
public Date getGearShootingEndDate() {
return gearShootingEndDate;
}
@@ -374,4 +577,63 @@
protected FishingOperation newEntity() {
return fishingOperation;
}
+
+ public void convertGearShootingCoordinatesDDToDMS() {
+ SexagecimalPosition position;
+ Integer degree;
+
+ position = SexagecimalPosition.valueOf(gearShootingStartLatitude);
+ degree = position.getDegre();
+ if (degree != null) {
+ degree *= position.isSign() ? -1 : 1;
+ }
+ setGearShootingStartLatitudeDegree(degree);
+ setGearShootingStartLatitudeMinute(position.getMinute());
+ setGearShootingStartLatitudeSecond(position.getSeconde());
+
+ position = SexagecimalPosition.valueOf(gearShootingStartLongitude);
+ degree = position.getDegre();
+ if (degree != null) {
+ degree *= position.isSign() ? -1 : 1;
+ }
+ setGearShootingStartLongitudeDegree(degree);
+ setGearShootingStartLongitudeMinute(position.getMinute());
+ setGearShootingStartLongitudeSecond(position.getSeconde());
+
+ position = SexagecimalPosition.valueOf(gearShootingEndLatitude);
+ degree = position.getDegre();
+ if (degree != null) {
+ degree *= position.isSign() ? -1 : 1;
+ }
+ if (position.getDegre() != null) {
+
+ }
+ setGearShootingEndLatitudeDegree(degree);
+ setGearShootingEndLatitudeMinute(position.getMinute());
+ setGearShootingEndLatitudeSecond(position.getSeconde());
+
+ position = SexagecimalPosition.valueOf(gearShootingEndLongitude);
+ degree = position.getDegre();
+ if (degree != null) {
+ degree *= position.isSign() ? -1 : 1;
+ }
+ setGearShootingEndLongitudeDegree(degree);
+ setGearShootingEndLongitudeMinute(position.getMinute());
+ setGearShootingEndLongitudeSecond(position.getSeconde());
+ }
+
+ public void convertGearShootingCoordinatesDMSToDD() {
+ Float decimalValue = gearShootingStartLatitudeAsSexagecimal.toDecimal();
+ setGearShootingStartLatitude(decimalValue);
+
+ decimalValue = gearShootingStartLongitudeAsSexagecimal.toDecimal();
+ setGearShootingStartLongitude(decimalValue);
+
+ decimalValue = gearShootingEndLatitudeAsSexagecimal.toDecimal();
+ setGearShootingEndLatitude(decimalValue);
+
+ decimalValue = gearShootingEndLongitudeAsSexagecimal.toDecimal();
+ setGearShootingEndLongitude(decimalValue);
+ }
+
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java 2013-01-04 09:13:06 UTC (rev 152)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java 2013-01-04 17:38:11 UTC (rev 153)
@@ -53,8 +53,6 @@
public static final String PROPERTY_HYDROLOGY_PMFM_ID = "hydrologyPmfmId";
- public static final String PROPERTY_SPECIES = "species";
-
public static final String PROPERTY_SAMPLE_CATEGORY_ORDER = "sampleCategoryOrder";
public static final String PROPERTY_REMOVE_SPECIES_ENABLED = "removeSpeciesEnabled";
@@ -69,8 +67,6 @@
protected List<String> hydrologyPmfmId;
- protected List<SpeciesProtocol> species;
-
protected List<SampleCategoryEnum> sampleCategoryOrder = Lists.newArrayList(
SampleCategoryEnum.sortedUnsorted,
SampleCategoryEnum.size,
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-04 09:13:06 UTC (rev 152)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-04 17:38:11 UTC (rev 153)
@@ -94,6 +94,8 @@
tutti.label.fishingOperation.gearDate=Date
tutti.label.fishingOperation.gearLatitude=Latitude
tutti.label.fishingOperation.gearLongitude=Longitude
+tutti.label.fishingOperation.gearShootingCoordinatesDD=DD
+tutti.label.fishingOperation.gearShootingCoordinatesDMS=DMS
tutti.label.fishingOperation.gearShootingEnd=Fin de traine
tutti.label.fishingOperation.gearShootingStart=Début de traine
tutti.label.fishingOperation.gearTime=Heure
1
0
r152 - in trunk: . tutti-persistence tutti-persistence-dev tutti-service tutti-ui-swing
by tchemit@users.forge.codelutin.com 04 Jan '13
by tchemit@users.forge.codelutin.com 04 Jan '13
04 Jan '13
Author: tchemit
Date: 2013-01-04 10:13:06 +0100 (Fri, 04 Jan 2013)
New Revision: 152
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/152
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pom.xml
trunk/tutti-persistence-dev/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-04 09:12:58 UTC (rev 151)
+++ trunk/pom.xml 2013-01-04 09:13:06 UTC (rev 152)
@@ -33,7 +33,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2.5</version>
+ <version>0.3-SNAPSHOT</version>
<modules>
<module>tutti-persistence</module>
@@ -80,12 +80,12 @@
</developers>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.2.5</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.2.5
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.2.5
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</developerConnection>
</scm>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2013-01-04 09:12:58 UTC (rev 151)
+++ trunk/tutti-persistence/pom.xml 2013-01-04 09:13:06 UTC (rev 152)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2.5</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-persistence-dev/pom.xml
===================================================================
--- trunk/tutti-persistence-dev/pom.xml 2013-01-04 09:12:58 UTC (rev 151)
+++ trunk/tutti-persistence-dev/pom.xml 2013-01-04 09:13:06 UTC (rev 152)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2.5</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2013-01-04 09:12:58 UTC (rev 151)
+++ trunk/tutti-service/pom.xml 2013-01-04 09:13:06 UTC (rev 152)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2.5</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-01-04 09:12:58 UTC (rev 151)
+++ trunk/tutti-ui-swing/pom.xml 2013-01-04 09:13:06 UTC (rev 152)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2.5</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0