T3-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
March 2018
- 1 participants
- 153 discussions
[Git][ultreiaio/ird-t3][feature/116] Refactor avdth input modules + add missing license header (See #116)
by Tony CHEMIT 04 Mar '18
by Tony CHEMIT 04 Mar '18
04 Mar '18
Tony CHEMIT pushed to branch feature/116 at ultreiaio / ird-t3
Commits:
8e373b7d by Tony CHEMIT at 2018-03-04T09:08:45Z
Refactor avdth input modules + add missing license header (See #116)
- - - - -
25 changed files:
- t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/AnalyzeInputSourceAction.ftl
- t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/AnalyzeInputSourceAction_en.ftl
- t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/ImportInputSourceAction.ftl
- t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/ImportInputSourceAction_en.ftl
- t3-actions/src/test/java/fr/ird/t3/io/input/fake/v0/T3InputProviderFake0.java
- t3-domain/src/main/java/fr/ird/t3/entities/data/TripType.java
- t3-domain/src/main/java/fr/ird/t3/io/input/T3InputProvider.java
- + t3-domain/src/main/java/fr/ird/t3/io/input/access/T3AvdthDataEntityVisitor.java
- t3-domain/src/main/java/fr/ird/t3/io/input/access/T3DataEntityVisitor.java
- t3-domain/src/main/java/fr/ird/t3/services/migration/T3MigrationCallbackV2_3.java
- t3-input-avdthv33/pom.xml
- t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3AccessEntityMetaProviderAvdth33.java
- t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3DataEntityVisitorAvdth33.java
- t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3InputAvdth33.java
- t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3InputProviderAvdth33.java
- t3-input-avdthv35/pom.xml
- t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3AccessEntityMetaProviderAvdth35.java
- t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3DataEntityVisitorAvdth35.java
- t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3InputAvdth35.java
- t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3InputProviderAvdth35.java
- t3-input-avdthv36/pom.xml
- t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3AccessEntityMetaProviderAvdth36.java
- t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3DataEntityVisitorAvdth36.java
- t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3InputAvdth36.java
- t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3InputProviderAvdth36.java
Changes:
=====================================
t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/AnalyzeInputSourceAction.ftl
=====================================
--- a/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/AnalyzeInputSourceAction.ftl
+++ b/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/AnalyzeInputSourceAction.ftl
@@ -20,7 +20,7 @@
-->
<#include "/ftl/header.ftl"/>
-Pilote d'acquisition de données : ${configuration.inputProvider.libelle}
+Pilote d'acquisition de données : ${configuration.inputProvider.label}
Source de données : ${configuration.inputFile.name}
Utilisation des plans de cuves : ${configuration.useWells?string}
Type de marées : ${configuration.tripType.label}
=====================================
t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/AnalyzeInputSourceAction_en.ftl
=====================================
--- a/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/AnalyzeInputSourceAction_en.ftl
+++ b/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/AnalyzeInputSourceAction_en.ftl
@@ -20,7 +20,7 @@
-->
<#include "/ftl/header_en.ftl"/>
-Input Pilot: ${configuration.inputProvider.libelle}
+Input Pilot: ${configuration.inputProvider.label}
Input file: ${configuration.inputFile.name}
Use wells: ${configuration.useWells?string}
Trip type: ${configuration.tripType.label}
=====================================
t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/ImportInputSourceAction.ftl
=====================================
--- a/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/ImportInputSourceAction.ftl
+++ b/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/ImportInputSourceAction.ftl
@@ -20,7 +20,7 @@
-->
<#include "/ftl/header.ftl"/>
-Pilote d'acquisition de données : ${configuration.inputProvider.libelle}
+Pilote d'acquisition de données : ${configuration.inputProvider.label}
Source de données : ${configuration.inputFile.name}
Utilisation des plans de cuves : ${configuration.useWells?string}
Type de marées : ${configuration.tripType.label}
=====================================
t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/ImportInputSourceAction_en.ftl
=====================================
--- a/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/ImportInputSourceAction_en.ftl
+++ b/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/io/input/ImportInputSourceAction_en.ftl
@@ -20,7 +20,7 @@
-->
<#include "/ftl/header_en.ftl"/>
-Input Pilot: ${configuration.inputProvider.libelle}
+Input Pilot: ${configuration.inputProvider.label}
Input file: ${configuration.inputFile.name}
Use wells: ${configuration.useWells?string}
Trip type: ${configuration.tripType.label}
=====================================
t3-actions/src/test/java/fr/ird/t3/io/input/fake/v0/T3InputProviderFake0.java
=====================================
--- a/t3-actions/src/test/java/fr/ird/t3/io/input/fake/v0/T3InputProviderFake0.java
+++ b/t3-actions/src/test/java/fr/ird/t3/io/input/fake/v0/T3InputProviderFake0.java
@@ -63,7 +63,7 @@ public class T3InputProviderFake0 implements T3InputProvider {
}
@Override
- public String getLibelle() {
+ public String getLabel() {
return getName() + " - v." + getVersion() + " (" + getInputType() + ")";
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/data/TripType.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/data/TripType.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/data/TripType.java
@@ -1,5 +1,26 @@
package fr.ird.t3.entities.data;
+/*-
+ * #%L
+ * T3 :: Domain
+ * %%
+ * Copyright (C) 2010 - 2018 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ird.t3.t3.domain.I18nEnumHelper;
import static org.nuiton.i18n.I18n.t;
=====================================
t3-domain/src/main/java/fr/ird/t3/io/input/T3InputProvider.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/io/input/T3InputProvider.java
+++ b/t3-domain/src/main/java/fr/ird/t3/io/input/T3InputProvider.java
@@ -71,7 +71,7 @@ public interface T3InputProvider extends Serializable {
*
* @return the description of the provider
*/
- String getLibelle();
+ String getLabel();
/**
* To instanciate a new {@link T3Input} for a given {@code inputFile} to
=====================================
t3-domain/src/main/java/fr/ird/t3/io/input/access/T3AvdthDataEntityVisitor.java
=====================================
--- /dev/null
+++ b/t3-domain/src/main/java/fr/ird/t3/io/input/access/T3AvdthDataEntityVisitor.java
@@ -0,0 +1,202 @@
+package fr.ird.t3.io.input.access;
+
+/*-
+ * #%L
+ * T3 :: Domain
+ * %%
+ * Copyright (C) 2010 - 2018 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import fr.ird.t3.entities.ReferenceEntityMap;
+import fr.ird.t3.entities.T3EntityEnum;
+import fr.ird.t3.entities.data.Activity;
+import fr.ird.t3.entities.data.ElementaryCatch;
+import fr.ird.t3.entities.data.ElementaryLanding;
+import fr.ird.t3.entities.data.Sample;
+import fr.ird.t3.entities.data.SampleSet;
+import fr.ird.t3.entities.data.Trip;
+import fr.ird.t3.entities.data.Well;
+import fr.ird.t3.entities.data.WellPlan;
+import fr.ird.t3.entities.reference.WeightCategoryLanding;
+import fr.ird.t3.entities.reference.WeightCategoryLogBook;
+import fr.ird.t3.io.input.MissingForeignKeyInT3;
+import fr.ird.type.CoordinateHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.TopiaEntity;
+
+import java.io.Serializable;
+
+/**
+ * Created by tchemit on 04/03/2018.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ */
+public abstract class T3AvdthDataEntityVisitor extends T3DataEntityVisitor {
+
+ private static final Log log = LogFactory.getLog(T3AvdthDataEntityVisitor.class);
+
+
+ private final ReverseAssociationGetter<Trip, WellPlan, Activity> wellPlanReverse;
+ private final ReverseAssociationGetter<Trip, Sample, Well> sampleReverse;
+ private final ReverseAssociationGetter<Trip, SampleSet, Activity> sampleSetReverse;
+
+ protected T3AvdthDataEntityVisitor(T3AccessDataSource dataSource, ReferenceEntityMap referentiel) {
+ super(dataSource, referentiel);
+ wellPlanReverse = newReverseAssociationGetter(
+ Trip.class,
+ WellPlan.class,
+ Activity.class,
+ Trip.PROPERTY_ACTIVITY,
+ WellPlan.PROPERTY_ACTIVITY);
+ sampleReverse = newReverseAssociationGetter(
+ Trip.class,
+ Sample.class,
+ Well.class,
+ Trip.PROPERTY_WELL,
+ Sample.PROPERTY_WELL);
+ sampleSetReverse = newReverseAssociationGetter(
+ Trip.class,
+ SampleSet.class,
+ Activity.class,
+ Trip.PROPERTY_ACTIVITY,
+ SampleSet.PROPERTY_ACTIVITY);
+ }
+
+
+ @Override
+ public void onEnd(T3AccessEntity entity, T3AccessEntityMeta meta) {
+ super.onEnd(entity, meta);
+ if (!deepVisit) {
+ return;
+ }
+ endActivity(entity, meta);
+ }
+
+ @Override
+ public void onVisitReverseAssociation(String propertyName, T3AccessEntity entity, T3AccessEntityMeta meta) {
+ if (!deepVisit) {
+ return;
+ }
+ if (SampleSet.PROPERTY_ACTIVITY.equals(propertyName) && entity instanceof SampleSet) {
+ // special case, must obtain the activity from the trip
+ sampleSetReverse.attachReverseAssociation(entity);
+ return;
+ }
+ if (WellPlan.PROPERTY_ACTIVITY.equals(propertyName) && entity instanceof WellPlan) {
+ // special case, must obtain the activity from the trip
+ wellPlanReverse.attachReverseAssociation(entity);
+ return;
+ }
+ if (Sample.PROPERTY_WELL.equals(propertyName) && entity instanceof Sample) {
+ // special case, must obtain the well from the trip
+ sampleReverse.attachReverseAssociation(entity);
+ return;
+ }
+ super.onVisitReverseAssociation(propertyName, entity, meta);
+ }
+
+ @Override
+ public void onVisitComposition(String propertyName, Class<?> type, T3AccessEntity entity, T3AccessEntityMeta meta) {
+ if (onVisitElementaryLanding(propertyName, entity)) {
+ return;
+ }
+ if (onVisitElementaryCatch(propertyName, entity)) {
+ return;
+ }
+ super.onVisitComposition(propertyName, type, entity, meta);
+ }
+
+ private void endActivity(T3AccessEntity entity, T3AccessEntityMeta meta) {
+ T3EntityEnum type = meta.getType();
+ if (type == T3EntityEnum.Activity) {
+ Activity a = (Activity) entity;
+ Integer quadrant = a.getQuadrant();
+ Float latitude = CoordinateHelper.getSignedLatitude(quadrant, a.getLatitude());
+ Float longitude = CoordinateHelper.getSignedLongitude(quadrant, a.getLongitude());
+ a.setLatitude(latitude);
+ a.setLongitude(longitude);
+ log.debug(String.format("Will use for activity %s coordinates <%s,%s>", entity, a.getLongitude(), a.getLatitude()));
+ }
+ }
+
+ protected boolean onVisitElementaryLanding(String propertyName, T3AccessEntity entity) {
+ if (!(ElementaryLanding.PROPERTY_WEIGHT_CATEGORY_LANDING.equals(propertyName) && entity instanceof ElementaryLanding)) {
+ return false;
+ }
+ Serializable codeEspece = getProperty("C_ESP", row);
+ Serializable codeCate = getProperty("C_CAT_C", row);
+
+ // must found the species
+ T3AccessEntityMeta specieMeta = dataSource.getMeta(T3EntityEnum.Species);
+ TopiaEntity specie = getReferenceEntity(specieMeta, codeEspece);
+ T3AccessEntityMeta categoryMeta = dataSource.getMeta(T3EntityEnum.WeightCategoryLanding);
+
+ // special case : need to find a reference with two primary keys...
+ TopiaEntity ref = getReferenceEntity(
+ categoryMeta,
+ new String[]{WeightCategoryLanding.PROPERTY_CODE, WeightCategoryLanding.PROPERTY_SPECIES},
+ codeCate, specie);
+ if (ref == null) {
+ log.warn(String.format("Can't find WeightCategoryLanding for speciesCode / categoryCode: %s/%s", codeEspece, codeCate));
+ getMissingForeignKeys().add(new MissingForeignKeyInT3(
+ T3EntityEnum.ElementaryLanding,
+ T3EntityEnum.WeightCategoryLanding,
+ getPKey(T3EntityEnum.ElementaryLanding),
+ new Object[]{codeEspece, codeCate}));
+ } else {
+ log.debug(String.format("Detected landing catch weight category : %s", ref));
+ entity.setProperty(ElementaryLanding.PROPERTY_WEIGHT_CATEGORY_LANDING, ref);
+ }
+ return true;
+ }
+
+ protected boolean onVisitElementaryCatch(String propertyName, T3AccessEntity entity) {
+ if (!(ElementaryCatch.PROPERTY_WEIGHT_CATEGORY_LOG_BOOK.equals(propertyName) && entity instanceof ElementaryCatch)) {
+ return false;
+ }
+
+ // special case : need to find a reference with two primary keys...
+ Serializable codeEspece = getProperty("C_ESP", row);
+ Serializable codeCate = getProperty("C_CAT_T", row);
+
+ // must found the species
+ T3AccessEntityMeta specieMeta = dataSource.getMeta(T3EntityEnum.Species);
+ TopiaEntity specie = getReferenceEntity(specieMeta, codeEspece);
+ T3AccessEntityMeta categoryMeta = dataSource.getMeta(T3EntityEnum.WeightCategoryLogBook);
+
+ // special case : need to find a reference with two primary keys...
+ TopiaEntity ref = getReferenceEntity(
+ categoryMeta,
+ new String[]{WeightCategoryLogBook.PROPERTY_CODE, WeightCategoryLogBook.PROPERTY_SPECIES},
+ codeCate, specie);
+
+ if (ref == null) {
+ log.warn(String.format("Can't find weightCategoryLogBook for speciesCode / categoryCode: %s/%s", codeEspece, codeCate));
+ getMissingForeignKeys().add(new MissingForeignKeyInT3(
+ T3EntityEnum.ElementaryCatch,
+ T3EntityEnum.WeightCategoryLogBook,
+ getPKey(T3EntityEnum.ElementaryCatch),
+ new Object[]{codeCate, codeEspece}));
+ } else {
+ log.debug(String.format("Detected logBook catch weight category : %s", ref));
+ entity.setProperty(propertyName, ref);
+ }
+ return true;
+ }
+
+}
=====================================
t3-domain/src/main/java/fr/ird/t3/io/input/access/T3DataEntityVisitor.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/io/input/access/T3DataEntityVisitor.java
+++ b/t3-domain/src/main/java/fr/ird/t3/io/input/access/T3DataEntityVisitor.java
@@ -8,41 +8,42 @@
* it under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package fr.ird.t3.io.input.access;
-import com.google.common.collect.Lists;
import fr.ird.msaccess.importer.AbstractAccessEntityMeta;
import fr.ird.t3.entities.ReferenceEntityMap;
import fr.ird.t3.entities.T3EntityEnum;
import fr.ird.t3.entities.T3EntityMap;
import fr.ird.t3.entities.reference.T3ReferenceEntity;
import fr.ird.t3.io.input.MissingForeignKey;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.TopiaEntity;
+import org.nuiton.topia.persistence.util.EntityOperator;
+
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Stack;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.persistence.TopiaEntity;
-import org.nuiton.topia.persistence.util.EntityOperator;
/**
* To visit and fill properly an data entity.
* <p/>
* If visitor has the flag {@link #deepVisit} is set to {@code false}, then
- * only the pkey will be filled, otherwise all fields, compositions or
+ * only the pKey will be filled, otherwise all fields, compositions or
* associations are filled.
*
* @author Tony Chemit - dev(a)tchemit.fr
@@ -50,7 +51,6 @@ import org.nuiton.topia.persistence.util.EntityOperator;
*/
public class T3DataEntityVisitor extends AbstractT3EntityVisitor {
- /** Logger. */
private static final Log log = LogFactory.getLog(T3DataEntityVisitor.class);
/** la pile des objets en cours de construction. */
@@ -60,14 +60,14 @@ public class T3DataEntityVisitor extends AbstractT3EntityVisitor {
private final Stack<Map<String, Object>> rows;
/** Universe of touched references while visiting a data. */
- protected T3EntityMap entitiesTouched;
+ private T3EntityMap entitiesTouched;
private List<MissingForeignKey> missingForeignKeys;
protected T3DataEntityVisitor(T3AccessDataSource dataSource, ReferenceEntityMap referentiel) {
super(dataSource, referentiel);
- rows = new Stack<Map<String, Object>>();
- stack = new Stack<T3AccessEntity>();
+ rows = new Stack<>();
+ stack = new Stack<>();
}
public T3EntityMap getEntitiesTouched() {
@@ -84,20 +84,15 @@ public class T3DataEntityVisitor extends AbstractT3EntityVisitor {
@Override
public void onStart(T3AccessEntity entity, T3AccessEntityMeta meta) {
-
super.onStart(entity, meta);
-
stack.push(entity);
rows.push(row);
-
getEntitiesTouched().addEntity(entity);
}
@Override
public void onEnd(T3AccessEntity entity, T3AccessEntityMeta meta) {
-
super.onEnd(entity, meta);
-
stack.pop();
rows.pop();
if (!rows.isEmpty()) {
@@ -105,60 +100,40 @@ public class T3DataEntityVisitor extends AbstractT3EntityVisitor {
}
}
- @SuppressWarnings({"RawUseOfParameterizedType", "unchecked"})
+ @SuppressWarnings("unchecked")
@Override
- protected TopiaEntity getReferenceEntity(T3AccessEntityMeta compoMeta,
- Serializable newValue) {
-
- T3ReferenceEntity e = (T3ReferenceEntity)
- super.getReferenceEntity(compoMeta, newValue);
-
+ protected TopiaEntity getReferenceEntity(T3AccessEntityMeta compoMeta, Serializable newValue) {
+ T3ReferenceEntity e = (T3ReferenceEntity) super.getReferenceEntity(compoMeta, newValue);
if (e == null) {
-
// reference entity not found
// add the entity in touched refs (to be able to know it is
// missing...)
try {
- T3ReferenceEntity e2 =
- (T3ReferenceEntity) compoMeta.getType().getImplementation().getConstructor().newInstance();
+ T3ReferenceEntity e2 = (T3ReferenceEntity) compoMeta.getType().getImplementation().getConstructor().newInstance();
EntityOperator operator = T3EntityEnum.getOperator(compoMeta.getType().getContract());
operator.set("code", e2, newValue);
getEntitiesTouched().addUniqueEntity(e2);
} catch (Exception eee) {
- if (log.isErrorEnabled()) {
- log.error("Could not create dummy reference entity", eee);
- }
+ log.error("Could not create dummy reference entity", eee);
}
-
// still returns null entity
return null;
}
-
boolean added = getEntitiesTouched().addUniqueEntity(e);
-
if (added && log.isDebugEnabled()) {
- log.debug("Touched reference " + e.getTopiaId() + " : " +
- e.getCode());
+ log.debug(String.format("Touched reference %s : %d", e.getTopiaId(), e.getCode()));
}
return e;
}
@Override
- public void onVisitSimpleProperty(String propertyName,
- Class<?> type,
- T3AccessEntity entity,
- T3AccessEntityMeta meta) {
-
+ public void onVisitSimpleProperty(String propertyName, Class<?> type, T3AccessEntity entity, T3AccessEntityMeta meta) {
// just set the property into the entity
-
Serializable newValue = getProperty(propertyName, meta, row);
-
if (newValue != null) {
if (log.isDebugEnabled()) {
String colName = meta.getPropertyColumnName(propertyName);
- log.debug("get property [" + propertyName + "] (type:" +
- type.getName() + ") (dbcol:" + colName + ") = " +
- newValue);
+ log.debug(String.format("get property [%s] (type:%s) (dbcol:%s) = %s", propertyName, type.getName(), colName, newValue));
}
entity.setProperty(propertyName, newValue);
}
@@ -166,145 +141,91 @@ public class T3DataEntityVisitor extends AbstractT3EntityVisitor {
@Override
- public void onVisitComposition(String propertyName,
- Class<?> type,
- T3AccessEntity entity,
- T3AccessEntityMeta meta) {
-
+ public void onVisitComposition(String propertyName, Class<?> type, T3AccessEntity entity, T3AccessEntityMeta meta) {
if (!deepVisit) {
return;
}
-
// find the reference entity to add as composition
-
Serializable newValue = getProperty(propertyName, meta, row);
-
if (newValue == null) {
-
return;
}
- AbstractAccessEntityMeta.PropertyMapping mapping =
- meta.getPropertyMapping(propertyName);
+ AbstractAccessEntityMeta.PropertyMapping mapping = meta.getPropertyMapping(propertyName);
Class<?> compositionType = mapping.getType();
T3AccessEntityMeta compoMeta;
- T3AccessEntityMeta[] compoMetas =
- dataSource.getMetaForType(compositionType);
+ T3AccessEntityMeta[] compoMetas = dataSource.getMetaForType(compositionType);
if (compoMetas.length == 0) {
throw new IllegalStateException(
- "Skip composition [" + meta.getType() + " - " +
- propertyName + ":" + type + "], meta of type [" +
- compositionType + "] not found...");
+ String.format("Skip composition [%s - %s:%s], meta of type [%s] not found...", meta.getType(), propertyName, type, compositionType));
}
if (compoMetas.length > 1) {
- // on n'autorise pas d'avoir plusieurs méta à traiter
- // il s'agit d'une reférence sur un référentiel
+ // on n'autorise pas d'avoir plusieurs méta à traiter il s'agit d'une reférence sur un référentiel
throw new IllegalStateException(
- "Found more than one meta for referentiel type [" +
- compositionType + "] : " + Arrays.toString(compoMetas));
+ String.format("Found more than one meta for referentiel type [%s] : %s", compositionType, Arrays.toString(compoMetas)));
}
compoMeta = compoMetas[0];
-
TopiaEntity compoEntity = getReferenceEntity(compoMeta, newValue);
-
if (compoEntity == null) {
// could not find the correct composition entity
- if (log.isDebugEnabled()) {
- log.debug("Could not find referentiel entity for composition [" +
- propertyName + ":" + compoMeta.getType() + ":" + newValue +
- "] to " + entity);
- }
+ log.debug(String.format("Could not find referentiel entity for composition [%s:%s:%s] to %s", propertyName, compoMeta.getType(), newValue, entity));
return;
}
-
- if (log.isDebugEnabled()) {
- log.debug("Will add composition [" +
- propertyName + ":" + compoEntity + "] to " + entity);
- }
-
+ log.debug(String.format("Will add composition [%s:%s] to %s", propertyName, compoEntity, entity));
// then affect it to this entity for the given property
entity.setProperty(propertyName, compoEntity);
}
+ @SuppressWarnings("unchecked")
@Override
- public void onVisitReverseAssociation(String propertyName,
- T3AccessEntity entity,
- T3AccessEntityMeta meta) {
-
+ public void onVisitReverseAssociation(String propertyName, T3AccessEntity entity, T3AccessEntityMeta meta) {
if (!deepVisit) {
return;
}
-
// on recherche dans la pile des objets en cours de construction
- // l'objet maitre de l'association y est forcement puisque la création
- // de l'entité en cours en dépend.
- T3AccessEntityMeta.AssociationMapping reverse =
- meta.getReverseAssociationMapping(propertyName);
-
- Class<? extends TopiaEntity> type =
- (Class<? extends TopiaEntity>) reverse.getType();
+ // l'objet maitre de l'association y est forcement puisque la création de l'entité en cours en dépend.
+ T3AccessEntityMeta.AssociationMapping reverse = meta.getReverseAssociationMapping(propertyName);
+ Class<? extends TopiaEntity> type = (Class<? extends TopiaEntity>) reverse.getType();
TopiaEntity parent = getEntityFromStack(type);
-
if (parent == null) {
// ce cas ne devrait jamais arrivé
throw new IllegalStateException(
- "Could not find reverse association [" + propertyName
- + ":" + type + "] for one of his child " + entity);
- }
- if (log.isDebugEnabled()) {
- log.debug("Will add reverse composition [" + propertyName + ":" +
- parent + "] to " + entity);
+ String.format("Could not find reverse association [%s:%s] for one of his child %s", propertyName, type, entity));
}
+ log.debug(String.format("Will add reverse composition [%s:%s] to %s", propertyName, parent, entity));
entity.setProperty(propertyName, parent);
}
@Override
- public void onVisitAssociation(String propertyName,
- Class<?> type,
- T3AccessEntity entity,
- T3AccessEntityMeta meta) {
-
+ public void onVisitAssociation(String propertyName, Class<?> type, T3AccessEntity entity, T3AccessEntityMeta meta) {
if (!deepVisit) {
return;
}
-
T3EntityEnum constant = T3EntityEnum.valueOf(type);
+ T3AccessEntityMeta[] childMeta = dataSource.getMetaForType(constant.getContract());
+ List<TopiaEntity> childs = new ArrayList<>();
TopiaEntity[] tmp;
-
- List<TopiaEntity> childs = Lists.newArrayList();
-
- T3AccessEntityMeta[] childMeta =
- dataSource.getMetaForType(constant.getContract());
-
for (T3AccessEntityMeta accessEntityMeta : childMeta) {
-
tmp = getAssociation(entity, propertyName, meta, accessEntityMeta);
- if (log.isDebugEnabled()) {
- log.debug(toString(entity) + " load association [" + constant + "] (meta:" +
- accessEntityMeta + ") : " + tmp.length);
- }
+ log.debug(String.format("%s load association [%s] (meta:%s) : %d", toString(entity), constant, accessEntityMeta, tmp.length));
if (tmp.length > 0) {
childs.addAll(Arrays.asList(tmp));
}
}
-
if (childs.isEmpty()) {
return;
}
for (TopiaEntity child : childs) {
- if (log.isDebugEnabled()) {
- log.debug("Add association " + child);
- }
-
+ log.debug(String.format("Add association %s", child));
// on lance la découverte du fils
acceptEntity(child);
}
@@ -318,8 +239,24 @@ public class T3DataEntityVisitor extends AbstractT3EntityVisitor {
rows.clear();
}
- @SuppressWarnings({"unchecked"})
- protected <T extends TopiaEntity> T getEntityFromStack(Class<T> type) {
+ protected <P extends TopiaEntity, E extends TopiaEntity, C extends TopiaEntity> ReverseAssociationGetter<P, E, C> newReverseAssociationGetter(
+ Class<P> parentType,
+ Class<E> type,
+ Class<C> childType,
+ String reverseAssociation,
+ String parentAssociation
+ ) {
+ return new ReverseAssociationGetter<>(parentType, type, childType, parentAssociation, reverseAssociation);
+ }
+
+ public List<MissingForeignKey> getMissingForeignKeys() {
+ if (missingForeignKeys == null) {
+ missingForeignKeys = new ArrayList<>();
+ }
+ return missingForeignKeys;
+ }
+
+ private <T extends TopiaEntity> T getEntityFromStack(Class<T> type) {
TopiaEntity entity = null;
for (TopiaEntity e : stack) {
if (type.isAssignableFrom(e.getClass())) {
@@ -327,69 +264,36 @@ public class T3DataEntityVisitor extends AbstractT3EntityVisitor {
break;
}
}
- return (T) entity;
+ return type.cast(entity);
}
- protected TopiaEntity[] getAssociation(TopiaEntity entity,
- String propertyName,
- T3AccessEntityMeta meta,
- T3AccessEntityMeta childMeta) {
+ private TopiaEntity[] getAssociation(TopiaEntity entity, String propertyName, T3AccessEntityMeta meta, T3AccessEntityMeta childMeta) {
TopiaEntity[] childs;
try {
- childs = dataSource.loadAssociation(
- childMeta,
- meta,
- ((T3AccessEntity) entity).getPkey()
- );
+ childs = dataSource.loadAssociation(childMeta, meta, ((T3AccessEntity) entity).getPkey());
} catch (Exception e) {
- throw new IllegalStateException(
- "Could not obtain association [" + propertyName + "]", e);
+ throw new IllegalStateException(String.format("Could not obtain association [%s]", propertyName), e);
}
return childs;
}
- protected <P extends TopiaEntity, E extends TopiaEntity, C extends TopiaEntity> ReverseAssociationGetter<P, E, C> newReverseAssociationGetter(
- Class<P> parentType,
- Class<E> type,
- Class<C> childType,
- String reverseAssociation,
- String parentAssociation
- ) {
- return new ReverseAssociationGetter<P, E, C>(parentType, type, childType, parentAssociation, reverseAssociation);
- }
-
- public List<MissingForeignKey> getMissingForeignKeys() {
- if (missingForeignKeys == null) {
- missingForeignKeys = Lists.newArrayList();
- }
- return missingForeignKeys;
- }
-
protected class ReverseAssociationGetter<P extends TopiaEntity, E extends TopiaEntity, C extends TopiaEntity> {
protected final Class<E> type;
-
- protected final Class<P> parentType;
-
- protected final Class<C> childType;
-
+ final Class<P> parentType;
+ final Class<C> childType;
private final T3EntityEnum typeEnum;
-
private final T3EntityEnum childTypeEnum;
-
private final EntityOperator<P> parentOperator;
-
private final EntityOperator<E> operator;
-
private final String parentAssociation;
-
private final String reverseAssociation;
- protected ReverseAssociationGetter(Class<P> parentType,
- Class<E> type,
- Class<C> childType,
- String parentAssociation,
- String reverseAssociation) {
+ ReverseAssociationGetter(Class<P> parentType,
+ Class<E> type,
+ Class<C> childType,
+ String parentAssociation,
+ String reverseAssociation) {
this.parentType = parentType;
this.type = type;
this.childType = childType;
@@ -402,49 +306,27 @@ public class T3DataEntityVisitor extends AbstractT3EntityVisitor {
}
@SuppressWarnings({"unchecked"})
- public void attachReverseAssocation(T3AccessEntity entity) {
-
- // get child pkey from the pkey of the current entity
+ public void attachReverseAssociation(T3AccessEntity entity) {
+ // get child pKey from the pKey of the current entity
Object[] pKey = getPKey(childTypeEnum);
-
// get the parent entity which contains the association
P parent = getEntityFromStack(parentType);
-
// get the association from the given parent
- Collection<? extends TopiaEntity> childs =
- (Collection<? extends TopiaEntity>)
- parentOperator.get(parentAssociation, parent);
-
+ Collection<? extends TopiaEntity> children = (Collection<? extends TopiaEntity>) parentOperator.get(parentAssociation, parent);
// get the exact reverse association found by his pKey
- TopiaEntity reverse = getEntityForPKey(pKey, childs);
-
+ TopiaEntity reverse = getEntityForPKey(pKey, children);
if (reverse == null) {
-
onReverseNotFound(entity, pKey);
} else {
-
- E topiaEntity = (E) entity;
-
+ E topiaEntity = type.cast(entity);
operator.set(reverseAssociation, topiaEntity, reverse);
}
}
- protected void onReverseNotFound(T3AccessEntity entity, Object[] pKey) {
-
- String message = "Could not find " + childType.getSimpleName() +
- " " +
- Arrays.toString(pKey) + " for " +
- type.getSimpleName() + " " +
- Arrays.toString(entity.getPkey());
- if (log.isDebugEnabled()) {
- log.debug(message);
- }
- MissingForeignKey missingFK = new MissingForeignKey(
- typeEnum,
- childTypeEnum,
- entity.getPkey(),
- pKey
- );
+ void onReverseNotFound(T3AccessEntity entity, Object[] pKey) {
+ String message = String.format("Could not find %s %s for %s %s", childType.getSimpleName(), Arrays.toString(pKey), type.getSimpleName(), Arrays.toString(entity.getPkey()));
+ log.debug(message);
+ MissingForeignKey missingFK = new MissingForeignKey(typeEnum, childTypeEnum, entity.getPkey(), pKey);
getMissingForeignKeys().add(missingFK);
}
}
=====================================
t3-domain/src/main/java/fr/ird/t3/services/migration/T3MigrationCallbackV2_3.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/services/migration/T3MigrationCallbackV2_3.java
+++ b/t3-domain/src/main/java/fr/ird/t3/services/migration/T3MigrationCallbackV2_3.java
@@ -1,5 +1,26 @@
package fr.ird.t3.services.migration;
+/*-
+ * #%L
+ * T3 :: Domain
+ * %%
+ * Copyright (C) 2010 - 2018 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.google.auto.service.AutoService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
=====================================
t3-input-avdthv33/pom.xml
=====================================
--- a/t3-input-avdthv33/pom.xml
+++ b/t3-input-avdthv33/pom.xml
@@ -93,10 +93,6 @@
<groupId>org.nuiton</groupId>
<artifactId>nuiton-version</artifactId>
</dependency>
- <dependency>
- <groupId>org.nuiton.topia</groupId>
- <artifactId>topia-persistence</artifactId>
- </dependency>
<!-- test dependencies -->
=====================================
t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3AccessEntityMetaProviderAvdth33.java
=====================================
--- a/t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3AccessEntityMetaProviderAvdth33.java
+++ b/t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3AccessEntityMetaProviderAvdth33.java
@@ -8,12 +8,12 @@
* it under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -69,9 +69,7 @@ import java.util.Set;
*/
public class T3AccessEntityMetaProviderAvdth33 implements T3AccessEntityMetaProvider {
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(T3AccessEntityMetaProviderAvdth33.class);
+ private static final Log log = LogFactory.getLog(T3AccessEntityMetaProviderAvdth33.class);
@Override
public Set<T3AccessEntityMeta> getMetas() {
@@ -463,64 +461,32 @@ public class T3AccessEntityMetaProviderAvdth33 implements T3AccessEntityMetaProv
WeightCategoryWellPlan.PROPERTY_CODE, Integer.class, "C_CAT_POIDS",
WeightCategoryWellPlan.PROPERTY_LABEL1, String.class, "L_CAT_POIDS"
);
-
return result;
}
-// protected void registerReferentielMeta(Set<T3AccessEntityMeta> universe,
-// T3EntityEnum type,
-// String tableName,
-// String pkey) {
-// registerReferentielMeta(universe,
-// type,
-// tableName,
-// new String[]{pkey},
-// "code",
-// String.class,
-// pkey
-// );
-// }
-
- protected void registerReferentielMeta(Set<T3AccessEntityMeta> universe,
- T3EntityEnum type,
- String tableName,
- String[] pkeys,
- Object... properties) {
- T3AccessEntityMeta meta = new T3AccessReferentielEntityMeta(
- type,
- tableName,
- pkeys,
- properties
- );
+ private void registerReferentielMeta(Set<T3AccessEntityMeta> universe,
+ T3EntityEnum type,
+ String tableName,
+ String[] pKeys,
+ Object... properties) {
+ T3AccessEntityMeta meta = new T3AccessReferentielEntityMeta(type, tableName, pKeys, properties);
registerMeta(universe, meta);
-
}
- protected void registerDataMeta(Set<T3AccessEntityMeta> universe,
- T3EntityEnum type,
- String tableName,
- String[] pkeys,
- Object[] association,
- Object[] reverseProperties,
- Object... properties) {
- T3AccessEntityMeta meta = new T3AccessDataEntityMeta(
- type,
- tableName,
- pkeys,
- association,
- reverseProperties,
- properties
- );
+ private void registerDataMeta(Set<T3AccessEntityMeta> universe,
+ T3EntityEnum type,
+ String tableName,
+ String[] pKeys,
+ Object[] association,
+ Object[] reverseProperties,
+ Object... properties) {
+ T3AccessEntityMeta meta = new T3AccessDataEntityMeta(type, tableName, pKeys, association, reverseProperties, properties);
registerMeta(universe, meta);
}
- protected void registerMeta(Set<T3AccessEntityMeta> universe,
- T3AccessEntityMeta meta) {
- if (log.isDebugEnabled()) {
- log.debug("add " + meta.getType() + ":" + meta.getTableName() +
- " to universe");
- }
+ private void registerMeta(Set<T3AccessEntityMeta> universe, T3AccessEntityMeta meta) {
+ log.debug(String.format("add %s:%s to universe", meta.getType(), meta.getTableName()));
universe.add(meta);
}
}
=====================================
t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3DataEntityVisitorAvdth33.java
=====================================
--- a/t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3DataEntityVisitorAvdth33.java
+++ b/t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3DataEntityVisitorAvdth33.java
@@ -8,12 +8,12 @@
* it under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -21,28 +21,9 @@
package fr.ird.t3.io.input.avdth.v33;
import fr.ird.t3.entities.ReferenceEntityMap;
-import fr.ird.t3.entities.T3EntityEnum;
-import fr.ird.t3.entities.T3TopiaApplicationContext;
-import fr.ird.t3.entities.data.Activity;
-import fr.ird.t3.entities.data.ElementaryCatch;
-import fr.ird.t3.entities.data.ElementaryLanding;
-import fr.ird.t3.entities.data.Sample;
-import fr.ird.t3.entities.data.SampleSet;
-import fr.ird.t3.entities.data.Trip;
-import fr.ird.t3.entities.data.Well;
-import fr.ird.t3.entities.data.WellPlan;
-import fr.ird.t3.entities.reference.WeightCategoryLanding;
-import fr.ird.t3.entities.reference.WeightCategoryLogBook;
-import fr.ird.t3.io.input.MissingForeignKeyInT3;
+import fr.ird.t3.io.input.access.T3AvdthDataEntityVisitor;
import fr.ird.t3.io.input.access.T3AccessDataSource;
-import fr.ird.t3.io.input.access.T3AccessEntity;
-import fr.ird.t3.io.input.access.T3AccessEntityMeta;
import fr.ird.t3.io.input.access.T3DataEntityVisitor;
-import fr.ird.type.CoordinateHelper;
-import java.io.Serializable;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.persistence.TopiaEntity;
/**
* Implementation of {@link T3DataEntityVisitor} for the avdth v33 db.
@@ -50,218 +31,10 @@ import org.nuiton.topia.persistence.TopiaEntity;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 1.0
*/
-public class T3DataEntityVisitorAvdth33 extends T3DataEntityVisitor {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(T3DataEntityVisitorAvdth33.class);
-
- protected final ReverseAssociationGetter<Trip, WellPlan, Activity> wellPlanReverse;
+class T3DataEntityVisitorAvdth33 extends T3AvdthDataEntityVisitor {
- protected final ReverseAssociationGetter<Trip, Sample, Well> sampleReverse;
-
- protected final ReverseAssociationGetter<Trip, SampleSet, Activity> sampleSetReverse;
-
- public T3DataEntityVisitorAvdth33(T3TopiaApplicationContext topiaApplicationContext,
- T3AccessDataSource dataSource,
- ReferenceEntityMap referentiel) {
+ T3DataEntityVisitorAvdth33(T3AccessDataSource dataSource, ReferenceEntityMap referentiel) {
super(dataSource, referentiel);
-
- wellPlanReverse = newReverseAssociationGetter(
- Trip.class,
- WellPlan.class,
- Activity.class,
- Trip.PROPERTY_ACTIVITY,
- WellPlan.PROPERTY_ACTIVITY
- );
-
- sampleReverse = newReverseAssociationGetter(
- Trip.class,
- Sample.class,
- Well.class,
- Trip.PROPERTY_WELL,
- Sample.PROPERTY_WELL
- );
-
- sampleSetReverse = newReverseAssociationGetter(
- Trip.class,
- SampleSet.class,
- Activity.class,
- Trip.PROPERTY_ACTIVITY,
- SampleSet.PROPERTY_ACTIVITY
- );
- }
-
- @Override
- public void onEnd(T3AccessEntity entity, T3AccessEntityMeta meta) {
-
- super.onEnd(entity, meta);
-
- if (!deepVisit) {
- return;
- }
-
- T3EntityEnum type = meta.getType();
-
- if (type == T3EntityEnum.Activity) {
-
- Activity a = (Activity) entity;
-
- Integer quadrant = a.getQuadrant();
- Float latitude = CoordinateHelper.getSignedLatitude(
- quadrant, a.getLatitude());
- Float longitude = CoordinateHelper.getSignedLongitude(
- quadrant, a.getLongitude());
- a.setLatitude(latitude);
- a.setLongitude(longitude);
-
- if (log.isDebugEnabled()) {
- log.debug("Will use for activity " + entity +
- " coordinates <" + a.getLongitude() + "," +
- a.getLatitude() + ">");
- }
- }
- }
-
- @Override
- public void onVisitReverseAssociation(String propertyName,
- T3AccessEntity entity,
- T3AccessEntityMeta meta) {
-
- if (!deepVisit) {
- return;
- }
-
- if (SampleSet.PROPERTY_ACTIVITY.equals(propertyName) &&
- entity instanceof SampleSet) {
-
- // special case, must obtain the activity from the trip
-
- sampleSetReverse.attachReverseAssocation(entity);
- return;
- }
-
- if (WellPlan.PROPERTY_ACTIVITY.equals(propertyName) &&
- entity instanceof WellPlan) {
-
- // special case, must obtain the activity from the trip
-
- wellPlanReverse.attachReverseAssocation(entity);
- return;
- }
-
- if (Sample.PROPERTY_WELL.equals(propertyName) &&
- entity instanceof Sample) {
-
- // special case, must obtain the well from the trip
-
- sampleReverse.attachReverseAssocation(entity);
- return;
- }
-
- super.onVisitReverseAssociation(propertyName, entity, meta);
}
- @Override
- public void onVisitComposition(String propertyName,
- Class<?> type,
- T3AccessEntity entity,
- T3AccessEntityMeta meta) {
-
- if (ElementaryLanding.PROPERTY_WEIGHT_CATEGORY_LANDING.equals(propertyName)
- && entity instanceof ElementaryLanding) {
-
- Serializable codeEspece = getProperty("C_ESP", row);
- Serializable codeCate = getProperty("C_CAT_C", row);
-
- // must found the species
- T3AccessEntityMeta specieMeta =
- dataSource.getMeta(T3EntityEnum.Species);
-
- TopiaEntity specie = getReferenceEntity(specieMeta, codeEspece);
-
- T3AccessEntityMeta categoryMeta =
- dataSource.getMeta(T3EntityEnum.WeightCategoryLanding);
-
- // special case : need to find a reference with two primary keys...
- TopiaEntity ref = getReferenceEntity(
- categoryMeta,
- new String[]{WeightCategoryLanding.PROPERTY_CODE, WeightCategoryLanding.PROPERTY_SPECIES},
- codeCate, specie
- );
-
- if (ref == null) {
-
- if (log.isWarnEnabled()) {
- log.warn("Can't find WeightCategoryLanding for speciesCode / categoryCode: " + codeEspece + "/" + codeCate);
- }
- getMissingForeignKeys().add(new MissingForeignKeyInT3(
- T3EntityEnum.ElementaryLanding,
- T3EntityEnum.WeightCategoryLanding,
- getPKey(T3EntityEnum.ElementaryLanding),
- new Object[]{codeEspece, codeCate}
- ));
-
- } else {
-
- if (log.isDebugEnabled()) {
- log.debug("Detected landing catch weight category : " + ref);
- }
- entity.setProperty(propertyName, ref);
-
- }
-
- return;
- }
-
- if (ElementaryCatch.PROPERTY_WEIGHT_CATEGORY_LOG_BOOK.equals(propertyName)
- && entity instanceof ElementaryCatch) {
-
- // special case : need to find a reference with two primary keys...
-
- Serializable codeEspece = getProperty("C_ESP", row);
- Serializable codeCate = getProperty("C_CAT_T", row);
-
- // must found the species
- T3AccessEntityMeta specieMeta =
- dataSource.getMeta(T3EntityEnum.Species);
-
- TopiaEntity specie = getReferenceEntity(specieMeta, codeEspece);
-
- T3AccessEntityMeta categoryMeta =
- dataSource.getMeta(T3EntityEnum.WeightCategoryLogBook);
-
- // special case : need to find a reference with two primary keys...
- TopiaEntity ref = getReferenceEntity(
- categoryMeta,
- new String[]{WeightCategoryLogBook.PROPERTY_CODE, WeightCategoryLogBook.PROPERTY_SPECIES},
- codeCate, specie
- );
-
- if (ref == null) {
-
- if (log.isWarnEnabled()) {
- log.warn("Can't find weightCategoryLogBook for speciesCode / categoryCode: " + codeEspece + "/" + codeCate);
- }
- getMissingForeignKeys().add(new MissingForeignKeyInT3(
- T3EntityEnum.ElementaryCatch,
- T3EntityEnum.WeightCategoryLogBook,
- getPKey(T3EntityEnum.ElementaryCatch),
- new Object[]{codeCate, codeEspece}
- ));
-
- } else {
-
- if (log.isDebugEnabled()) {
- log.debug("Detected logBook catch weight category : " + ref);
- }
- entity.setProperty(propertyName, ref);
-
- }
-
- return;
- }
-
- super.onVisitComposition(propertyName, type, entity, meta);
- }
}
=====================================
t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3InputAvdth33.java
=====================================
--- a/t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3InputAvdth33.java
+++ b/t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3InputAvdth33.java
@@ -8,12 +8,12 @@
* it under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -27,6 +27,7 @@ import fr.ird.t3.io.input.T3Input;
import fr.ird.t3.io.input.access.AbstractT3InputMSAccess;
import fr.ird.t3.io.input.access.T3AccessDataSource;
import fr.ird.t3.io.input.access.T3DataEntityVisitor;
+
import java.io.File;
/**
@@ -37,18 +38,7 @@ import java.io.File;
*/
public class T3InputAvdth33 extends AbstractT3InputMSAccess {
- @Override
- public T3AccessDataSource newDataSource(File inputFile) {
- return new T3AccessDataSource(inputFile, T3AccessEntityMetaProviderAvdth33.class);
- }
-
- @Override
- public T3DataEntityVisitor newDataVisitor(T3AccessDataSource dataSource, ReferenceEntityMap safeReferences) {
-
- return new T3DataEntityVisitorAvdth33(getConfiguration().getTopiaApplicationContext(), dataSource, safeReferences);
- }
-
- public static final ImmutableSet<T3EntityEnum> REFERENCE_TYPES =
+ private static final ImmutableSet<T3EntityEnum> REFERENCE_TYPES =
ImmutableSet.of(
T3EntityEnum.VesselActivity,
T3EntityEnum.VesselSizeCategory,
@@ -66,18 +56,12 @@ public class T3InputAvdth33 extends AbstractT3InputMSAccess {
T3EntityEnum.WeightCategoryLogBook,
T3EntityEnum.WellDestiny,
T3EntityEnum.WeightCategoryWellPlan);
-
- @Override
- public ImmutableSet<T3EntityEnum> getReferenceTypes() {
- return REFERENCE_TYPES;
- }
-
/**
* Set of all importable data types from ms-access.
*
* @since 2.0
*/
- public static final ImmutableSet<T3EntityEnum> IMPORTABLE_DATA_TYPES =
+ private static final ImmutableSet<T3EntityEnum> IMPORTABLE_DATA_TYPES =
ImmutableSet.of(
T3EntityEnum.Activity,
T3EntityEnum.ActivityFishingContext,
@@ -92,6 +76,22 @@ public class T3InputAvdth33 extends AbstractT3InputMSAccess {
T3EntityEnum.WellPlan);
@Override
+ public T3AccessDataSource newDataSource(File inputFile) {
+ return new T3AccessDataSource(inputFile, T3AccessEntityMetaProviderAvdth33.class);
+ }
+
+ @Override
+ public T3DataEntityVisitor newDataVisitor(T3AccessDataSource dataSource, ReferenceEntityMap safeReferences) {
+
+ return new T3DataEntityVisitorAvdth33(dataSource, safeReferences);
+ }
+
+ @Override
+ public ImmutableSet<T3EntityEnum> getReferenceTypes() {
+ return REFERENCE_TYPES;
+ }
+
+ @Override
public ImmutableSet<T3EntityEnum> getDataTypes() {
return IMPORTABLE_DATA_TYPES;
}
=====================================
t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3InputProviderAvdth33.java
=====================================
--- a/t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3InputProviderAvdth33.java
+++ b/t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3InputProviderAvdth33.java
@@ -8,12 +8,12 @@
* it under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -23,10 +23,11 @@ package fr.ird.t3.io.input.avdth.v33;
import com.google.auto.service.AutoService;
import fr.ird.t3.io.input.T3Input;
import fr.ird.t3.io.input.T3InputProvider;
-import java.io.File;
import org.nuiton.version.Version;
import org.nuiton.version.Versions;
+import java.io.File;
+
/**
* Provides input for avdth.
*
@@ -37,11 +38,8 @@ import org.nuiton.version.Versions;
public class T3InputProviderAvdth33 implements T3InputProvider {
private static final long serialVersionUID = 1L;
-
- public static final Version VERSION = Versions.valueOf("3.3");
-
- public static final String NAME = "AVDTH";
-
+ private static final Version VERSION = Versions.valueOf("3.3");
+ private static final String NAME = "AVDTH";
public static final String ID = NAME + "__" + VERSION;
@Override
@@ -65,8 +63,8 @@ public class T3InputProviderAvdth33 implements T3InputProvider {
}
@Override
- public String getLibelle() {
- return getName() + " - v." + getVersion() + " (" + getInputType() + ")";
+ public String getLabel() {
+ return String.format("%s - v.%s (%s)", getName(), getVersion(), getInputType());
}
@Override
@@ -82,9 +80,7 @@ public class T3InputProviderAvdth33 implements T3InputProvider {
if (!(o instanceof T3InputProvider)) {
return false;
}
-
T3InputProvider that = (T3InputProvider) o;
-
return ID.equals(that.getId());
}
=====================================
t3-input-avdthv35/pom.xml
=====================================
--- a/t3-input-avdthv35/pom.xml
+++ b/t3-input-avdthv35/pom.xml
@@ -94,11 +94,6 @@
<artifactId>nuiton-version</artifactId>
</dependency>
- <dependency>
- <groupId>org.nuiton.topia</groupId>
- <artifactId>topia-persistence</artifactId>
- </dependency>
-
<!-- test dependencies -->
<dependency>
=====================================
t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3AccessEntityMetaProviderAvdth35.java
=====================================
--- a/t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3AccessEntityMetaProviderAvdth35.java
+++ b/t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3AccessEntityMetaProviderAvdth35.java
@@ -20,7 +20,6 @@
*/
package fr.ird.t3.io.input.avdth.v35;
-import com.google.common.collect.Sets;
import fr.ird.msaccess.type.IntToCoordonne;
import fr.ird.t3.entities.T3EntityEnum;
import fr.ird.t3.entities.data.Activity;
@@ -71,6 +70,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.util.Date;
+import java.util.LinkedHashSet;
import java.util.Set;
/**
@@ -81,12 +81,11 @@ import java.util.Set;
*/
public class T3AccessEntityMetaProviderAvdth35 implements T3AccessEntityMetaProvider {
- /** Logger. */
private static final Log log = LogFactory.getLog(T3AccessEntityMetaProviderAvdth35.class);
@Override
public Set<T3AccessEntityMeta> getMetas() {
- Set<T3AccessEntityMeta> result = Sets.newLinkedHashSet();
+ Set<T3AccessEntityMeta> result = new LinkedHashSet<>();
// ACTIVITE : [C_BAT, C_OCEA, C_OPERA, C_TBANC, D_ACT, D_DBQ, F_CUVE_C, F_DON_ORG, F_EXPERT, F_OBS, F_POS_COR, F_POS_VMS_D, H_ACT, N_ACT, Q_ACT, V_COUR_DIR, V_COUR_VIT, V_LAT, V_LON, V_NB_OP, V_POIDS_CAP, V_TEMP_S, V_TMER, V_TPEC]
registerDataMeta(
@@ -655,45 +654,30 @@ public class T3AccessEntityMetaProviderAvdth35 implements T3AccessEntityMetaProv
return result;
}
- protected void registerReferentielMeta(Set<T3AccessEntityMeta> universe,
- T3EntityEnum type,
- String tableName,
- String[] pkeys,
- Object... properties) {
- T3AccessEntityMeta meta = new T3AccessReferentielEntityMeta(
- type,
- tableName,
- pkeys,
- properties
- );
+ private void registerReferentielMeta(Set<T3AccessEntityMeta> universe,
+ T3EntityEnum type,
+ String tableName,
+ String[] pKeys,
+ Object... properties) {
+ T3AccessEntityMeta meta = new T3AccessReferentielEntityMeta(type, tableName, pKeys, properties);
registerMeta(universe, meta);
}
- protected void registerDataMeta(Set<T3AccessEntityMeta> universe,
- T3EntityEnum type,
- String tableName,
- String[] pkeys,
- Object[] association,
- Object[] reverseProperties,
- Object... properties) {
- T3AccessEntityMeta meta = new T3AccessDataEntityMeta(
- type,
- tableName,
- pkeys,
- association,
- reverseProperties,
- properties
- );
+ private void registerDataMeta(Set<T3AccessEntityMeta> universe,
+ T3EntityEnum type,
+ String tableName,
+ String[] pKeys,
+ Object[] association,
+ Object[] reverseProperties,
+ Object... properties) {
+ T3AccessEntityMeta meta = new T3AccessDataEntityMeta(type, tableName, pKeys, association, reverseProperties, properties);
registerMeta(universe, meta);
}
- protected void registerMeta(Set<T3AccessEntityMeta> universe,
- T3AccessEntityMeta meta) {
- if (log.isDebugEnabled()) {
- log.debug("add " + meta.getType() + ":" + meta.getTableName() + " to universe");
- }
+ private void registerMeta(Set<T3AccessEntityMeta> universe, T3AccessEntityMeta meta) {
+ log.debug(String.format("add %s:%s to universe", meta.getType(), meta.getTableName()));
universe.add(meta);
}
}
=====================================
t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3DataEntityVisitorAvdth35.java
=====================================
--- a/t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3DataEntityVisitorAvdth35.java
+++ b/t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3DataEntityVisitorAvdth35.java
@@ -8,12 +8,12 @@
* it under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -21,28 +21,9 @@
package fr.ird.t3.io.input.avdth.v35;
import fr.ird.t3.entities.ReferenceEntityMap;
-import fr.ird.t3.entities.T3EntityEnum;
-import fr.ird.t3.entities.T3TopiaApplicationContext;
-import fr.ird.t3.entities.data.Activity;
-import fr.ird.t3.entities.data.ElementaryCatch;
-import fr.ird.t3.entities.data.ElementaryLanding;
-import fr.ird.t3.entities.data.Sample;
-import fr.ird.t3.entities.data.SampleSet;
-import fr.ird.t3.entities.data.Trip;
-import fr.ird.t3.entities.data.Well;
-import fr.ird.t3.entities.data.WellPlan;
-import fr.ird.t3.entities.reference.WeightCategoryLanding;
-import fr.ird.t3.entities.reference.WeightCategoryLogBook;
-import fr.ird.t3.io.input.MissingForeignKeyInT3;
+import fr.ird.t3.io.input.access.T3AvdthDataEntityVisitor;
import fr.ird.t3.io.input.access.T3AccessDataSource;
-import fr.ird.t3.io.input.access.T3AccessEntity;
-import fr.ird.t3.io.input.access.T3AccessEntityMeta;
import fr.ird.t3.io.input.access.T3DataEntityVisitor;
-import fr.ird.type.CoordinateHelper;
-import java.io.Serializable;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.persistence.TopiaEntity;
/**
* Implementation of {@link T3DataEntityVisitor} for the avdth v35 db.
@@ -50,217 +31,9 @@ import org.nuiton.topia.persistence.TopiaEntity;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 1.0
*/
-public class T3DataEntityVisitorAvdth35 extends T3DataEntityVisitor {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(T3DataEntityVisitorAvdth35.class);
-
- protected final ReverseAssociationGetter<Trip, WellPlan, Activity> wellPlanReverse;
+class T3DataEntityVisitorAvdth35 extends T3AvdthDataEntityVisitor {
- protected final ReverseAssociationGetter<Trip, Sample, Well> sampleReverse;
-
- protected final ReverseAssociationGetter<Trip, SampleSet, Activity> sampleSetReverse;
-
- public T3DataEntityVisitorAvdth35(T3TopiaApplicationContext topiaApplicationContext,
- T3AccessDataSource dataSource,
- ReferenceEntityMap referentiel) {
+ T3DataEntityVisitorAvdth35(T3AccessDataSource dataSource, ReferenceEntityMap referentiel) {
super(dataSource, referentiel);
-
- wellPlanReverse = newReverseAssociationGetter(
- Trip.class,
- WellPlan.class,
- Activity.class,
- Trip.PROPERTY_ACTIVITY,
- WellPlan.PROPERTY_ACTIVITY
- );
-
- sampleReverse = newReverseAssociationGetter(
- Trip.class,
- Sample.class,
- Well.class,
- Trip.PROPERTY_WELL,
- Sample.PROPERTY_WELL
- );
-
- sampleSetReverse = newReverseAssociationGetter(
- Trip.class,
- SampleSet.class,
- Activity.class,
- Trip.PROPERTY_ACTIVITY,
- SampleSet.PROPERTY_ACTIVITY
- );
- }
-
- @Override
- public void onEnd(T3AccessEntity entity, T3AccessEntityMeta meta) {
-
- super.onEnd(entity, meta);
-
- if (!deepVisit) {
- return;
- }
-
- T3EntityEnum type = meta.getType();
-
- if (type == T3EntityEnum.Activity) {
-
- Activity a = (Activity) entity;
-
- Integer quadrant = a.getQuadrant();
- Float latitude = CoordinateHelper.getSignedLatitude(
- quadrant, a.getLatitude());
- Float longitude = CoordinateHelper.getSignedLongitude(
- quadrant, a.getLongitude());
- a.setLatitude(latitude);
- a.setLongitude(longitude);
-
- if (log.isDebugEnabled()) {
- log.debug("Will use for activity " + entity +
- " coordinates <" + a.getLongitude() + "," +
- a.getLatitude() + ">");
- }
- }
- }
-
- @Override
- public void onVisitReverseAssociation(String propertyName,
- T3AccessEntity entity,
- T3AccessEntityMeta meta) {
-
- if (!deepVisit) {
- return;
- }
-
- if (SampleSet.PROPERTY_ACTIVITY.equals(propertyName) &&
- entity instanceof SampleSet) {
-
- // special case, must obtain the activity from the trip
-
- sampleSetReverse.attachReverseAssocation(entity);
- return;
- }
-
- if (WellPlan.PROPERTY_ACTIVITY.equals(propertyName) &&
- entity instanceof WellPlan) {
-
- // special case, must obtain the activity from the trip
-
- wellPlanReverse.attachReverseAssocation(entity);
- return;
- }
-
- if (Sample.PROPERTY_WELL.equals(propertyName) &&
- entity instanceof Sample) {
-
- // special case, must obtain the well from the trip
-
- sampleReverse.attachReverseAssocation(entity);
- return;
- }
-
- super.onVisitReverseAssociation(propertyName, entity, meta);
- }
-
- @Override
- public void onVisitComposition(String propertyName,
- Class<?> type,
- T3AccessEntity entity,
- T3AccessEntityMeta meta) {
-
- if (ElementaryLanding.PROPERTY_WEIGHT_CATEGORY_LANDING.equals(propertyName)
- && entity instanceof ElementaryLanding) {
-
- Serializable codeEspece = getProperty("C_ESP", row);
- Serializable codeCate = getProperty("C_CAT_C", row);
-
- // must found the species
- T3AccessEntityMeta specieMeta =
- dataSource.getMeta(T3EntityEnum.Species);
-
- TopiaEntity specie = getReferenceEntity(specieMeta, codeEspece);
-
- T3AccessEntityMeta categoryMeta =
- dataSource.getMeta(T3EntityEnum.WeightCategoryLanding);
-
- // special case : need to find a reference with two primary keys...
- TopiaEntity ref = getReferenceEntity(
- categoryMeta,
- new String[]{WeightCategoryLanding.PROPERTY_CODE, WeightCategoryLanding.PROPERTY_SPECIES},
- codeCate, specie
- );
-
- if (ref == null) {
-
- if (log.isWarnEnabled()) {
- log.warn("Can't find WeightCategoryLanding for speciesCode / categoryCode: " + codeEspece + "/" + codeCate);
- }
- getMissingForeignKeys().add(new MissingForeignKeyInT3(
- T3EntityEnum.ElementaryLanding,
- T3EntityEnum.WeightCategoryLanding,
- getPKey(T3EntityEnum.ElementaryLanding),
- new Object[]{codeEspece, codeCate}
- ));
-
- } else {
-
- if (log.isDebugEnabled()) {
- log.debug("Detected landing catch weight category : " + ref);
- }
- entity.setProperty(propertyName, ref);
-
- }
-
- return;
- }
-
- if (ElementaryCatch.PROPERTY_WEIGHT_CATEGORY_LOG_BOOK.equals(propertyName)
- && entity instanceof ElementaryCatch) {
-
- // special case : need to find a reference with two primary keys...
-
- Serializable codeEspece = getProperty("C_ESP", row);
- Serializable codeCate = getProperty("C_CAT_T", row);
-
- // must found the species
- T3AccessEntityMeta specieMeta =
- dataSource.getMeta(T3EntityEnum.Species);
-
- TopiaEntity specie = getReferenceEntity(specieMeta, codeEspece);
-
- T3AccessEntityMeta categoryMeta =
- dataSource.getMeta(T3EntityEnum.WeightCategoryLogBook);
-
- // special case : need to find a reference with two primary keys...
- TopiaEntity ref = getReferenceEntity(
- categoryMeta,
- new String[]{WeightCategoryLogBook.PROPERTY_CODE, WeightCategoryLogBook.PROPERTY_SPECIES},
- codeCate, specie
- );
-
- if (ref == null) {
-
- if (log.isWarnEnabled()) {
- log.warn("Can't find weightCategoryLogBook for speciesCode / categoryCode: " + codeEspece + "/" + codeCate);
- }
- getMissingForeignKeys().add(new MissingForeignKeyInT3(
- T3EntityEnum.ElementaryCatch,
- T3EntityEnum.WeightCategoryLogBook,
- getPKey(T3EntityEnum.ElementaryCatch),
- new Object[]{codeCate, codeEspece}
- ));
-
- } else {
-
- if (log.isDebugEnabled()) {
- log.debug("Detected logBook catch weight category : " + ref);
- }
- entity.setProperty(propertyName, ref);
-
- }
-
- return;
- }
-
- super.onVisitComposition(propertyName, type, entity, meta);
}
}
=====================================
t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3InputAvdth35.java
=====================================
--- a/t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3InputAvdth35.java
+++ b/t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3InputAvdth35.java
@@ -27,6 +27,7 @@ import fr.ird.t3.io.input.T3Input;
import fr.ird.t3.io.input.access.AbstractT3InputMSAccess;
import fr.ird.t3.io.input.access.T3AccessDataSource;
import fr.ird.t3.io.input.access.T3DataEntityVisitor;
+
import java.io.File;
/**
@@ -37,21 +38,7 @@ import java.io.File;
*/
public class T3InputAvdth35 extends AbstractT3InputMSAccess {
- @Override
- public T3AccessDataSource newDataSource(File inputFile) {
- return new T3AccessDataSource(inputFile,
- T3AccessEntityMetaProviderAvdth35.class
- );
- }
-
- @Override
- public T3DataEntityVisitor newDataVisitor(T3AccessDataSource dataSource,
- ReferenceEntityMap safeReferences) {
-
- return new T3DataEntityVisitorAvdth35(getConfiguration().getTopiaApplicationContext(), dataSource, safeReferences);
- }
-
- public static final ImmutableSet<T3EntityEnum> REFERENCE_TYPES =
+ private static final ImmutableSet<T3EntityEnum> REFERENCE_TYPES =
ImmutableSet.of(
T3EntityEnum.VesselActivity,
T3EntityEnum.VesselSizeCategory,
@@ -75,19 +62,12 @@ public class T3InputAvdth35 extends AbstractT3InputMSAccess {
T3EntityEnum.FpaZone,
T3EntityEnum.LocalMarketPackagingType,
T3EntityEnum.LocalMarketPackaging);
-
-
- @Override
- public ImmutableSet<T3EntityEnum> getReferenceTypes() {
- return REFERENCE_TYPES;
- }
-
/**
* Set of all importable data types from ms-access.
*
* @since 2.0
*/
- public static final ImmutableSet<T3EntityEnum> IMPORTABLE_DATA_TYPES =
+ private static final ImmutableSet<T3EntityEnum> IMPORTABLE_DATA_TYPES =
ImmutableSet.of(
T3EntityEnum.Activity,
T3EntityEnum.ActivityFishingContext,
@@ -108,6 +88,21 @@ public class T3InputAvdth35 extends AbstractT3InputMSAccess {
T3EntityEnum.LocalMarketSurvey);
@Override
+ public T3AccessDataSource newDataSource(File inputFile) {
+ return new T3AccessDataSource(inputFile, T3AccessEntityMetaProviderAvdth35.class);
+ }
+
+ @Override
+ public ImmutableSet<T3EntityEnum> getReferenceTypes() {
+ return REFERENCE_TYPES;
+ }
+
+ @Override
+ public T3DataEntityVisitor newDataVisitor(T3AccessDataSource dataSource, ReferenceEntityMap safeReferences) {
+ return new T3DataEntityVisitorAvdth35(dataSource, safeReferences);
+ }
+
+ @Override
public ImmutableSet<T3EntityEnum> getDataTypes() {
return IMPORTABLE_DATA_TYPES;
}
=====================================
t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3InputProviderAvdth35.java
=====================================
--- a/t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3InputProviderAvdth35.java
+++ b/t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3InputProviderAvdth35.java
@@ -8,12 +8,12 @@
* it under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -23,10 +23,11 @@ package fr.ird.t3.io.input.avdth.v35;
import com.google.auto.service.AutoService;
import fr.ird.t3.io.input.T3Input;
import fr.ird.t3.io.input.T3InputProvider;
-import java.io.File;
import org.nuiton.version.Version;
import org.nuiton.version.Versions;
+import java.io.File;
+
/**
* Provides input for avdth.
*
@@ -38,9 +39,9 @@ public class T3InputProviderAvdth35 implements T3InputProvider {
private static final long serialVersionUID = 1L;
- public static final Version VERSION = Versions.valueOf("3.5");
+ private static final Version VERSION = Versions.valueOf("3.5");
- public static final String NAME = "AVDTH";
+ private static final String NAME = "AVDTH";
public static final String ID = NAME + "__" + VERSION;
@@ -65,8 +66,8 @@ public class T3InputProviderAvdth35 implements T3InputProvider {
}
@Override
- public String getLibelle() {
- return getName() + " - v." + getVersion() + " (" + getInputType() + ")";
+ public String getLabel() {
+ return String.format("%s - v.%s (%s)", getName(), getVersion(), getInputType());
}
@Override
=====================================
t3-input-avdthv36/pom.xml
=====================================
--- a/t3-input-avdthv36/pom.xml
+++ b/t3-input-avdthv36/pom.xml
@@ -88,11 +88,6 @@
</dependency>
<dependency>
- <groupId>org.nuiton.topia</groupId>
- <artifactId>topia-persistence</artifactId>
- </dependency>
-
- <dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<scope>provided</scope>
=====================================
t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3AccessEntityMetaProviderAvdth36.java
=====================================
--- a/t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3AccessEntityMetaProviderAvdth36.java
+++ b/t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3AccessEntityMetaProviderAvdth36.java
@@ -8,19 +8,18 @@
* it under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package fr.ird.t3.io.input.avdth.v36;
-import com.google.common.collect.Sets;
import fr.ird.msaccess.type.IntToCoordonne;
import fr.ird.t3.entities.T3EntityEnum;
import fr.ird.t3.entities.data.Activity;
@@ -73,6 +72,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.util.Date;
+import java.util.LinkedHashSet;
import java.util.Set;
/**
@@ -83,12 +83,11 @@ import java.util.Set;
*/
public class T3AccessEntityMetaProviderAvdth36 implements T3AccessEntityMetaProvider {
- /** Logger. */
private static final Log log = LogFactory.getLog(T3AccessEntityMetaProviderAvdth36.class);
@Override
public Set<T3AccessEntityMeta> getMetas() {
- Set<T3AccessEntityMeta> result = Sets.newLinkedHashSet();
+ Set<T3AccessEntityMeta> result = new LinkedHashSet<>();
// ACTIVITE : [C_BAT, C_OCEA, C_OPERA, C_TBANC, D_ACT, D_DBQ, F_CUVE_C, F_DON_ORG, F_EXPERT, F_OBS, F_POS_COR, F_POS_VMS_D, H_ACT, N_ACT, Q_ACT, V_COUR_DIR, V_COUR_VIT, V_LAT, V_LON, V_NB_OP, V_POIDS_CAP, V_TEMP_S, V_TMER, V_TPEC]
registerDataMeta(
@@ -681,45 +680,30 @@ public class T3AccessEntityMetaProviderAvdth36 implements T3AccessEntityMetaProv
return result;
}
- protected void registerReferentielMeta(Set<T3AccessEntityMeta> universe,
- T3EntityEnum type,
- String tableName,
- String[] pkeys,
- Object... properties) {
- T3AccessEntityMeta meta = new T3AccessReferentielEntityMeta(
- type,
- tableName,
- pkeys,
- properties
- );
+ private void registerReferentielMeta(Set<T3AccessEntityMeta> universe,
+ T3EntityEnum type,
+ String tableName,
+ String[] pKeys,
+ Object... properties) {
+ T3AccessEntityMeta meta = new T3AccessReferentielEntityMeta(type, tableName, pKeys, properties);
registerMeta(universe, meta);
}
- protected void registerDataMeta(Set<T3AccessEntityMeta> universe,
- T3EntityEnum type,
- String tableName,
- String[] pkeys,
- Object[] association,
- Object[] reverseProperties,
- Object... properties) {
- T3AccessEntityMeta meta = new T3AccessDataEntityMeta(
- type,
- tableName,
- pkeys,
- association,
- reverseProperties,
- properties
- );
+ private void registerDataMeta(Set<T3AccessEntityMeta> universe,
+ T3EntityEnum type,
+ String tableName,
+ String[] pKeys,
+ Object[] association,
+ Object[] reverseProperties,
+ Object... properties) {
+ T3AccessEntityMeta meta = new T3AccessDataEntityMeta(type, tableName, pKeys, association, reverseProperties, properties);
registerMeta(universe, meta);
}
- protected void registerMeta(Set<T3AccessEntityMeta> universe,
- T3AccessEntityMeta meta) {
- if (log.isDebugEnabled()) {
- log.debug("add " + meta.getType() + ":" + meta.getTableName() + " to universe");
- }
+ private void registerMeta(Set<T3AccessEntityMeta> universe, T3AccessEntityMeta meta) {
+ log.debug(String.format("add %s:%s to universe", meta.getType(), meta.getTableName()));
universe.add(meta);
}
}
=====================================
t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3DataEntityVisitorAvdth36.java
=====================================
--- a/t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3DataEntityVisitorAvdth36.java
+++ b/t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3DataEntityVisitorAvdth36.java
@@ -8,12 +8,12 @@
* it under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -21,28 +21,9 @@
package fr.ird.t3.io.input.avdth.v36;
import fr.ird.t3.entities.ReferenceEntityMap;
-import fr.ird.t3.entities.T3EntityEnum;
-import fr.ird.t3.entities.T3TopiaApplicationContext;
-import fr.ird.t3.entities.data.Activity;
-import fr.ird.t3.entities.data.ElementaryCatch;
-import fr.ird.t3.entities.data.ElementaryLanding;
-import fr.ird.t3.entities.data.Sample;
-import fr.ird.t3.entities.data.SampleSet;
-import fr.ird.t3.entities.data.Trip;
-import fr.ird.t3.entities.data.Well;
-import fr.ird.t3.entities.data.WellPlan;
-import fr.ird.t3.entities.reference.WeightCategoryLanding;
-import fr.ird.t3.entities.reference.WeightCategoryLogBook;
-import fr.ird.t3.io.input.MissingForeignKeyInT3;
import fr.ird.t3.io.input.access.T3AccessDataSource;
-import fr.ird.t3.io.input.access.T3AccessEntity;
-import fr.ird.t3.io.input.access.T3AccessEntityMeta;
+import fr.ird.t3.io.input.access.T3AvdthDataEntityVisitor;
import fr.ird.t3.io.input.access.T3DataEntityVisitor;
-import fr.ird.type.CoordinateHelper;
-import java.io.Serializable;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.persistence.TopiaEntity;
/**
* Implementation of {@link T3DataEntityVisitor} for the avdth v36 db.
@@ -50,216 +31,8 @@ import org.nuiton.topia.persistence.TopiaEntity;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 2.0
*/
-public class T3DataEntityVisitorAvdth36 extends T3DataEntityVisitor {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(T3DataEntityVisitorAvdth36.class);
-
- protected final ReverseAssociationGetter<Trip, WellPlan, Activity> wellPlanReverse;
-
- protected final ReverseAssociationGetter<Trip, Sample, Well> sampleReverse;
-
- protected final ReverseAssociationGetter<Trip, SampleSet, Activity> sampleSetReverse;
-
- public T3DataEntityVisitorAvdth36(T3TopiaApplicationContext topiaApplicationContext,
- T3AccessDataSource dataSource,
- ReferenceEntityMap referentiel) {
+class T3DataEntityVisitorAvdth36 extends T3AvdthDataEntityVisitor {
+ T3DataEntityVisitorAvdth36(T3AccessDataSource dataSource, ReferenceEntityMap referentiel) {
super(dataSource, referentiel);
-
- wellPlanReverse = newReverseAssociationGetter(
- Trip.class,
- WellPlan.class,
- Activity.class,
- Trip.PROPERTY_ACTIVITY,
- WellPlan.PROPERTY_ACTIVITY
- );
-
- sampleReverse = newReverseAssociationGetter(
- Trip.class,
- Sample.class,
- Well.class,
- Trip.PROPERTY_WELL,
- Sample.PROPERTY_WELL
- );
-
- sampleSetReverse = newReverseAssociationGetter(
- Trip.class,
- SampleSet.class,
- Activity.class,
- Trip.PROPERTY_ACTIVITY,
- SampleSet.PROPERTY_ACTIVITY
- );
- }
-
- @Override
- public void onEnd(T3AccessEntity entity, T3AccessEntityMeta meta) {
-
- super.onEnd(entity, meta);
-
- if (!deepVisit) {
- return;
- }
-
- T3EntityEnum type = meta.getType();
-
- if (type == T3EntityEnum.Activity) {
-
- Activity a = (Activity) entity;
-
- Integer quadrant = a.getQuadrant();
- Float latitude = CoordinateHelper.getSignedLatitude(
- quadrant, a.getLatitude());
- Float longitude = CoordinateHelper.getSignedLongitude(
- quadrant, a.getLongitude());
- a.setLatitude(latitude);
- a.setLongitude(longitude);
-
- if (log.isDebugEnabled()) {
- log.debug("Will use for activity " + entity +
- " coordinates <" + a.getLongitude() + "," + a.getLatitude() + ">");
- }
- }
- }
-
- @Override
- public void onVisitReverseAssociation(String propertyName,
- T3AccessEntity entity,
- T3AccessEntityMeta meta) {
-
- if (!deepVisit) {
- return;
- }
-
- if (SampleSet.PROPERTY_ACTIVITY.equals(propertyName) &&
- entity instanceof SampleSet) {
-
- // special case, must obtain the activity from the trip
-
- sampleSetReverse.attachReverseAssocation(entity);
- return;
- }
-
- if (WellPlan.PROPERTY_ACTIVITY.equals(propertyName) &&
- entity instanceof WellPlan) {
-
- // special case, must obtain the activity from the trip
-
- wellPlanReverse.attachReverseAssocation(entity);
- return;
- }
-
- if (Sample.PROPERTY_WELL.equals(propertyName) &&
- entity instanceof Sample) {
-
- // special case, must obtain the well from the trip
-
- sampleReverse.attachReverseAssocation(entity);
- return;
- }
-
- super.onVisitReverseAssociation(propertyName, entity, meta);
- }
-
- @Override
- public void onVisitComposition(String propertyName,
- Class<?> type,
- T3AccessEntity entity,
- T3AccessEntityMeta meta) {
-
- if (ElementaryLanding.PROPERTY_WEIGHT_CATEGORY_LANDING.equals(propertyName)
- && entity instanceof ElementaryLanding) {
-
- Serializable codeEspece = getProperty("C_ESP", row);
- Serializable codeCate = getProperty("C_CAT_C", row);
-
- // must found the species
- T3AccessEntityMeta specieMeta =
- dataSource.getMeta(T3EntityEnum.Species);
-
- TopiaEntity specie = getReferenceEntity(specieMeta, codeEspece);
-
- T3AccessEntityMeta categoryMeta =
- dataSource.getMeta(T3EntityEnum.WeightCategoryLanding);
-
- // special case : need to find a reference with two primary keys...
- TopiaEntity ref = getReferenceEntity(
- categoryMeta,
- new String[]{WeightCategoryLanding.PROPERTY_CODE, WeightCategoryLanding.PROPERTY_SPECIES},
- codeCate, specie
- );
-
- if (ref == null) {
-
- if (log.isWarnEnabled()) {
- log.warn("Can't find WeightCategoryLanding for speciesCode / categoryCode: " + codeEspece + "/" + codeCate);
- }
- getMissingForeignKeys().add(new MissingForeignKeyInT3(
- T3EntityEnum.ElementaryLanding,
- T3EntityEnum.WeightCategoryLanding,
- getPKey(T3EntityEnum.ElementaryLanding),
- new Object[]{codeEspece, codeCate}
- ));
-
- } else {
-
- if (log.isDebugEnabled()) {
- log.debug("Detected landing catch weight category : " + ref);
- }
- entity.setProperty(propertyName, ref);
-
- }
-
- return;
- }
-
- if (ElementaryCatch.PROPERTY_WEIGHT_CATEGORY_LOG_BOOK.equals(propertyName)
- && entity instanceof ElementaryCatch) {
-
- // special case : need to find a reference with two primary keys...
-
- Serializable codeEspece = getProperty("C_ESP", row);
- Serializable codeCate = getProperty("C_CAT_T", row);
-
- // must found the species
- T3AccessEntityMeta specieMeta =
- dataSource.getMeta(T3EntityEnum.Species);
-
- TopiaEntity specie = getReferenceEntity(specieMeta, codeEspece);
-
- T3AccessEntityMeta categoryMeta =
- dataSource.getMeta(T3EntityEnum.WeightCategoryLogBook);
-
- // special case : need to find a reference with two primary keys...
- TopiaEntity ref = getReferenceEntity(
- categoryMeta,
- new String[]{WeightCategoryLogBook.PROPERTY_CODE, WeightCategoryLogBook.PROPERTY_SPECIES},
- codeCate, specie
- );
-
- if (ref == null) {
-
- if (log.isWarnEnabled()) {
- log.warn("Can't find weightCategoryLogBook for speciesCode / categoryCode: " + codeEspece + "/" + codeCate);
- }
- getMissingForeignKeys().add(new MissingForeignKeyInT3(
- T3EntityEnum.ElementaryCatch,
- T3EntityEnum.WeightCategoryLogBook,
- getPKey(T3EntityEnum.ElementaryCatch),
- new Object[]{codeCate, codeEspece}
- ));
-
- } else {
-
- if (log.isDebugEnabled()) {
- log.debug("Detected logBook catch weight category : " + ref);
- }
- entity.setProperty(propertyName, ref);
-
- }
-
- return;
- }
-
- super.onVisitComposition(propertyName, type, entity, meta);
}
}
=====================================
t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3InputAvdth36.java
=====================================
--- a/t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3InputAvdth36.java
+++ b/t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3InputAvdth36.java
@@ -8,12 +8,12 @@
* it under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -27,6 +27,7 @@ import fr.ird.t3.io.input.T3Input;
import fr.ird.t3.io.input.access.AbstractT3InputMSAccess;
import fr.ird.t3.io.input.access.T3AccessDataSource;
import fr.ird.t3.io.input.access.T3DataEntityVisitor;
+
import java.io.File;
/**
@@ -37,21 +38,7 @@ import java.io.File;
*/
public class T3InputAvdth36 extends AbstractT3InputMSAccess {
- @Override
- public T3AccessDataSource newDataSource(File inputFile) {
- return new T3AccessDataSource(inputFile, T3AccessEntityMetaProviderAvdth36.class);
- }
-
- @Override
- public T3DataEntityVisitor newDataVisitor(T3AccessDataSource dataSource,
- ReferenceEntityMap safeReferences) {
-
- return new T3DataEntityVisitorAvdth36(getConfiguration().getTopiaApplicationContext(),
- dataSource,
- safeReferences);
- }
-
- public static final ImmutableSet<T3EntityEnum> REFERENCE_TYPES =
+ private static final ImmutableSet<T3EntityEnum> REFERENCE_TYPES =
ImmutableSet.of(
T3EntityEnum.VesselActivity,
T3EntityEnum.VesselSizeCategory,
@@ -77,19 +64,12 @@ public class T3InputAvdth36 extends AbstractT3InputMSAccess {
T3EntityEnum.LocalMarketPackaging,
T3EntityEnum.ElementaryCatchFate,
T3EntityEnum.Company);
-
-
- @Override
- public ImmutableSet<T3EntityEnum> getReferenceTypes() {
- return REFERENCE_TYPES;
- }
-
/**
* Set of all importable data types from ms-access.
*
* @since 2.0
*/
- public static final ImmutableSet<T3EntityEnum> IMPORTABLE_DATA_TYPES =
+ private static final ImmutableSet<T3EntityEnum> IMPORTABLE_DATA_TYPES =
ImmutableSet.of(
T3EntityEnum.Activity,
T3EntityEnum.ActivityFishingContext,
@@ -110,6 +90,21 @@ public class T3InputAvdth36 extends AbstractT3InputMSAccess {
T3EntityEnum.LocalMarketSurvey);
@Override
+ public T3AccessDataSource newDataSource(File inputFile) {
+ return new T3AccessDataSource(inputFile, T3AccessEntityMetaProviderAvdth36.class);
+ }
+
+ @Override
+ public T3DataEntityVisitor newDataVisitor(T3AccessDataSource dataSource, ReferenceEntityMap safeReferences) {
+ return new T3DataEntityVisitorAvdth36(dataSource, safeReferences);
+ }
+
+ @Override
+ public ImmutableSet<T3EntityEnum> getReferenceTypes() {
+ return REFERENCE_TYPES;
+ }
+
+ @Override
public ImmutableSet<T3EntityEnum> getDataTypes() {
return IMPORTABLE_DATA_TYPES;
}
=====================================
t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3InputProviderAvdth36.java
=====================================
--- a/t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3InputProviderAvdth36.java
+++ b/t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3InputProviderAvdth36.java
@@ -8,12 +8,12 @@
* it under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -23,10 +23,11 @@ package fr.ird.t3.io.input.avdth.v36;
import com.google.auto.service.AutoService;
import fr.ird.t3.io.input.T3Input;
import fr.ird.t3.io.input.T3InputProvider;
-import java.io.File;
import org.nuiton.version.Version;
import org.nuiton.version.Versions;
+import java.io.File;
+
/**
* Provides input for avdth.
*
@@ -37,11 +38,8 @@ import org.nuiton.version.Versions;
public class T3InputProviderAvdth36 implements T3InputProvider {
private static final long serialVersionUID = 1L;
-
- public static final Version VERSION = Versions.valueOf("3.6");
-
- public static final String NAME = "AVDTH";
-
+ private static final Version VERSION = Versions.valueOf("3.6");
+ private static final String NAME = "AVDTH";
public static final String ID = NAME + "__" + VERSION;
@Override
@@ -65,8 +63,8 @@ public class T3InputProviderAvdth36 implements T3InputProvider {
}
@Override
- public String getLibelle() {
- return getName() + " - v." + getVersion() + " (" + getInputType() + ")";
+ public String getLabel() {
+ return String.format("%s - v.%s (%s)", getName(), getVersion(), getInputType());
}
@Override
@@ -82,9 +80,7 @@ public class T3InputProviderAvdth36 implements T3InputProvider {
if (!(o instanceof T3InputProvider)) {
return false;
}
-
T3InputProvider that = (T3InputProvider) o;
-
return ID.equals(that.getId());
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/8e373b7d602ee491e2111a69e2769663…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/8e373b7d602ee491e2111a69e2769663…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed new branch feature/116 at ultreiaio / ird-t3
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/tree/feature/116
You're receiving this email because of your account on gitlab.com.
1
0
02 Mar '18
Tony CHEMIT pushed to branch pages at ultreiaio / ird-t3
Commits:
ffdcd2be by 166231 at 2018-03-02T14:57:00Z
Site checkin for project T3 :: Pom
- - - - -
2 changed files:
- aggregate-third-party-report.html
- changelog.html
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/ffdcd2be6c38211e6dcb07079dbbcc67…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/ffdcd2be6c38211e6dcb07079dbbcc67…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-t3][develop] update changelog after release 2.2 [skip ci]
by Tony CHEMIT 02 Mar '18
by Tony CHEMIT 02 Mar '18
02 Mar '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
67840bd9 by Tony CHEMIT at 2018-03-02T14:53:05Z
update changelog after release 2.2 [skip ci]
- - - - -
1 changed file:
- CHANGELOG.md
Changes:
=====================================
CHANGELOG.md
=====================================
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,21 +1,35 @@
# T3 changelog
* Author [Tony Chemit](mailto:dev@tchemit.fr)
- * Last generated at 2018-02-26 00:17.
+ * Last generated at 2018-03-02 14:50.
+
+## Version [2.2](https://gitlab.com/ultreiaio/ird-t3/milestones/32)
+Replace user database by a simple **yaml** file.
+
+**Closed at 2018-03-02.**
+
+### Download
+* [Installer (t3-2.2.zip)](https://oss.sonatype.org/content/repositories/frirdt3-1011/fr/…)
+* [Application (t3-2.2.war)](https://oss.sonatype.org/content/repositories/frirdt3-1011/fr/…)
+
+### Issues
+ * [[Anomalie 201]](https://gitlab.com/ultreiaio/ird-t3/issues/201) **[H2] Base H2 parfois corrompue sur déconnexion/reconnexion à l'application** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT)
+ * [[Evolution 286]](https://gitlab.com/ultreiaio/ird-t3/issues/286) **Remplacer la base interne h2 par un simple fichier au format **yaml**** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT)
## Version [2.1](https://gitlab.com/ultreiaio/ird-t3/milestones/31)
First part of contract 3.0
**Closed at 2018-02-25.**
-### Download
+
+-### Download
* [Installer (t3-2.1.zip)](https://oss.sonatype.org/content/repositories/frirdt3-1010/fr/…)
* [Application (t3-2.1.war)](https://oss.sonatype.org/content/repositories/frirdt3-1010/fr/…)
+
### Issues
* [[Anomalie 154]](https://gitlab.com/ultreiaio/ird-t3/issues/154) **[WIN] Windows/Mauvais affichage des caractères accentués dans le navigateur** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT)
* [[Anomalie 160]](https://gitlab.com/ultreiaio/ird-t3/issues/160) **[N0.4][LOG] Calcul du nombre de calées et durée des calées - Petite erreur dans le log** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT)
- * [[Anomalie 201]](https://gitlab.com/ultreiaio/ird-t3/issues/201) **[H2] Base H2 parfois corrompue sur déconnexion/reconnexion à l'application** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT)
* [[Anomalie 232]](https://gitlab.com/ultreiaio/ird-t3/issues/232) **[UI] Souci de mise en page web** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT)
* [[Anomalie 236]](https://gitlab.com/ultreiaio/ird-t3/issues/236) **[PG] Lorsqu'on arrête l'application, les connexions à la base PostgreSQL ne sont pas libérées** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT)
* [[Anomalie 239]](https://gitlab.com/ultreiaio/ird-t3/issues/239) **[N0.2][LOG] Petite bizarerie dans les logs** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT)
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/67840bd972c5b3a107dcb32d9ab908a9…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/67840bd972c5b3a107dcb32d9ab908a9…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT deleted branch release/2.2 at ultreiaio / ird-t3
---
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed new tag v2.2 at ultreiaio / ird-t3
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/tree/v2.2
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-t3][release/2.2] 3 commits: [jgitflow-maven-plugin]updating poms for branch'release/2.2' with non-snapshot versions[skip ci]
by Tony CHEMIT 02 Mar '18
by Tony CHEMIT 02 Mar '18
02 Mar '18
Tony CHEMIT pushed to branch release/2.2 at ultreiaio / ird-t3
Commits:
21b1e5e5 by Tony Chemit at 2018-03-02T14:01:51Z
[jgitflow-maven-plugin]updating poms for branch'release/2.2' with non-snapshot versions[skip ci]
- - - - -
cf404afa by Tony Chemit at 2018-03-02T14:04:38Z
Fix bad release version on extra modules
- - - - -
6b8af716 by Tony CHEMIT at 2018-03-02T14:37:43Z
optimize i18n
- - - - -
14 changed files:
- pom.xml
- t3-actions/pom.xml
- t3-domain/pom.xml
- t3-input-avdthv33/pom.xml
- t3-input-avdthv35/pom.xml
- t3-input-avdthv36/pom.xml
- t3-installer/pom.xml
- t3-msaccess-importer/pom.xml
- t3-output-balbayav32/pom.xml
- t3-test/pom.xml
- t3-web/pom.xml
- t3-web/src/main/resources/i18n/t3-web_en_GB.properties
- t3-web/src/main/resources/i18n/t3-web_fr_FR.properties
- t3/pom.xml
Changes:
=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.2</version>
<packaging>pom</packaging>
<name>T3 :: Pom</name>
=====================================
t3-actions/pom.xml
=====================================
--- a/t3-actions/pom.xml
+++ b/t3-actions/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.2</version>
</parent>
<artifactId>t3-actions</artifactId>
=====================================
t3-domain/pom.xml
=====================================
--- a/t3-domain/pom.xml
+++ b/t3-domain/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.2</version>
</parent>
<artifactId>t3-domain</artifactId>
=====================================
t3-input-avdthv33/pom.xml
=====================================
--- a/t3-input-avdthv33/pom.xml
+++ b/t3-input-avdthv33/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.2</version>
</parent>
<artifactId>t3-input-avdthv33</artifactId>
=====================================
t3-input-avdthv35/pom.xml
=====================================
--- a/t3-input-avdthv35/pom.xml
+++ b/t3-input-avdthv35/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.2</version>
</parent>
<artifactId>t3-input-avdthv35</artifactId>
=====================================
t3-input-avdthv36/pom.xml
=====================================
--- a/t3-input-avdthv36/pom.xml
+++ b/t3-input-avdthv36/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.2</version>
</parent>
<artifactId>t3-input-avdthv36</artifactId>
=====================================
t3-installer/pom.xml
=====================================
--- a/t3-installer/pom.xml
+++ b/t3-installer/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.2</version>
</parent>
<artifactId>t3-installer</artifactId>
=====================================
t3-msaccess-importer/pom.xml
=====================================
--- a/t3-msaccess-importer/pom.xml
+++ b/t3-msaccess-importer/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.2</version>
</parent>
<artifactId>t3-msaccess-importer</artifactId>
=====================================
t3-output-balbayav32/pom.xml
=====================================
--- a/t3-output-balbayav32/pom.xml
+++ b/t3-output-balbayav32/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.2</version>
</parent>
<artifactId>t3-output-balbayav32</artifactId>
=====================================
t3-test/pom.xml
=====================================
--- a/t3-test/pom.xml
+++ b/t3-test/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.2</version>
</parent>
<artifactId>t3-test</artifactId>
=====================================
t3-web/pom.xml
=====================================
--- a/t3-web/pom.xml
+++ b/t3-web/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.2</version>
</parent>
<artifactId>t3-web</artifactId>
=====================================
t3-web/src/main/resources/i18n/t3-web_en_GB.properties
=====================================
--- a/t3-web/src/main/resources/i18n/t3-web_en_GB.properties
+++ b/t3-web/src/main/resources/i18n/t3-web_en_GB.properties
@@ -121,8 +121,8 @@ t3.common.useReplacementVessel=Use a replacement vessel
t3.common.useSamplesOnly=Database 'Samples only'
t3.common.useWeightCategoriesInStratum=Use Weight categories -10/+10 in stratum
t3.common.useWells=Use wells
-t3.common.user.outputDatabases=List of configured target databases
t3.common.user.inputDatabases=List of configured working databases
+t3.common.user.outputDatabases=List of configured target databases
t3.common.users=Users list
t3.common.vesselFilter=Filter on vessels
t3.common.vesselSimpleTypes.to.select=Types simplifiés de navire à sélectionner
=====================================
t3-web/src/main/resources/i18n/t3-web_fr_FR.properties
=====================================
--- a/t3-web/src/main/resources/i18n/t3-web_fr_FR.properties
+++ b/t3-web/src/main/resources/i18n/t3-web_fr_FR.properties
@@ -121,8 +121,8 @@ t3.common.useReplacementVessel=Utiliser un navire de remplacement
t3.common.useSamplesOnly=Base échantillon seulement
t3.common.useWeightCategoriesInStratum=Utiliser les catégories de poids -10/+10Kg dans la stratification
t3.common.useWells=Utilisation des plans de cuve
-t3.common.user.outputDatabases=Liste des configurations de bases de sortie
t3.common.user.inputDatabases=Liste des configurations de bases de travail
+t3.common.user.outputDatabases=Liste des configurations de bases de sortie
t3.common.users=Liste des utilisateurs
t3.common.vesselFilter=Filter les navires
t3.common.vesselSimpleTypes.to.select=Types simplifiés de navire à sélectionner
=====================================
t3/pom.xml
=====================================
--- a/t3/pom.xml
+++ b/t3/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.2</version>
</parent>
<artifactId>t3</artifactId>
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/011d0e062506a966bacc2cbb5ddef41…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/011d0e062506a966bacc2cbb5ddef41…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-t3][master] 10 commits: [jgitflow-maven-plugin]updating poms for 2.2-SNAPSHOT development[skip ci]
by Tony CHEMIT 02 Mar '18
by Tony CHEMIT 02 Mar '18
02 Mar '18
Tony CHEMIT pushed to branch master at ultreiaio / ird-t3
Commits:
6b22e122 by Tony CHEMIT at 2018-02-25T23:45:43Z
[jgitflow-maven-plugin]updating poms for 2.2-SNAPSHOT development[skip ci]
- - - - -
20ef6c78 by Tony CHEMIT at 2018-02-26T00:55:34Z
[jgitflow-maven-plugin]updating develop poms to master versions to avoid merge conflicts[skip ci]
- - - - -
28897845 by Tony CHEMIT at 2018-02-26T00:55:35Z
[jgitflow-maven-plugin]merging 'master' into 'develop'
- - - - -
84dc5028 by Tony CHEMIT at 2018-02-26T00:55:36Z
[jgitflow-maven-plugin]Updating develop poms back to pre merge state[skip ci]
- - - - -
e71cfbd3 by Tony CHEMIT at 2018-02-26T00:59:46Z
fix release
- - - - -
011d0e06 by Tony CHEMIT at 2018-03-02T00:17:47Z
Remplacer la base interne h2 par un simple fichier au format **yaml** (See #286)
- - - - -
21b1e5e5 by Tony Chemit at 2018-03-02T14:01:51Z
[jgitflow-maven-plugin]updating poms for branch'release/2.2' with non-snapshot versions[skip ci]
- - - - -
cf404afa by Tony Chemit at 2018-03-02T14:04:38Z
Fix bad release version on extra modules
- - - - -
6b8af716 by Tony CHEMIT at 2018-03-02T14:37:43Z
optimize i18n
- - - - -
be9a82ca by Tony CHEMIT at 2018-03-02T14:38:40Z
[jgitflow-maven-plugin]merging 'release/2.2' into 'master'
- - - - -
30 changed files:
- CHANGELOG.md
- pom.xml
- t3-actions/pom.xml
- t3-domain/pom.xml
- t3-domain/src/main/config/T3.ini
- t3-domain/src/main/java/fr/ird/t3/actions/T3ActionContext.java
- t3-domain/src/main/java/fr/ird/t3/entities/T3EntityHelper.java
- − t3-domain/src/main/java/fr/ird/t3/entities/T3UserTopiaApplicationContext.java
- − t3-domain/src/main/java/fr/ird/t3/entities/T3UserTopiaPersistenceContext.java
- t3-domain/src/main/java/fr/ird/t3/entities/user/AbstractT3UserTopiaDao.java → t3-domain/src/main/java/fr/ird/t3/entities/user/JdbcConfiguration.java
- + t3-domain/src/main/java/fr/ird/t3/entities/user/T3User.java
- − t3-domain/src/main/java/fr/ird/t3/entities/user/T3UserImpl.java
- + t3-domain/src/main/java/fr/ird/t3/entities/user/T3Users.java
- + t3-domain/src/main/java/fr/ird/t3/entities/user/UserDatabase.java
- − t3-domain/src/main/java/fr/ird/t3/entities/user/UserDatabaseImpl.java
- t3-domain/src/main/java/fr/ird/t3/services/DecoratorService.java
- t3-domain/src/main/java/fr/ird/t3/services/DefaultT3ServiceContext.java
- t3-domain/src/main/java/fr/ird/t3/services/T3ServiceContext.java
- t3-domain/src/main/java/fr/ird/t3/services/T3ServiceSupport.java
- − t3-domain/src/main/java/fr/ird/t3/services/T3UserTopiaPersistenceContextAware.java
- t3-domain/src/main/java/fr/ird/t3/services/UserService.java
- − t3-domain/src/main/java/fr/ird/t3/services/ioc/InjectorInternalDAO.java
- t3-domain/src/main/resources/i18n/t3-domain_en_GB.properties
- t3-domain/src/main/resources/i18n/t3-domain_fr_FR.properties
- − t3-domain/src/main/xmi/t3-user-persistence.properties
- − t3-domain/src/main/xmi/t3-user-persistence.zargo
- t3-domain/src/test/java/fr/ird/t3/services/migration/T3MigrationTest.java
- t3-input-avdthv33/pom.xml
- t3-input-avdthv35/pom.xml
- t3-input-avdthv36/pom.xml
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/249d50dfed914b839d6c785469297b8…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/249d50dfed914b839d6c785469297b8…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-t3][develop] 8 commits: [jgitflow-maven-plugin]updating poms for branch'release/2.2' with non-snapshot versions[skip ci]
by Tony CHEMIT 02 Mar '18
by Tony CHEMIT 02 Mar '18
02 Mar '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
21b1e5e5 by Tony Chemit at 2018-03-02T14:01:51Z
[jgitflow-maven-plugin]updating poms for branch'release/2.2' with non-snapshot versions[skip ci]
- - - - -
cf404afa by Tony Chemit at 2018-03-02T14:04:38Z
Fix bad release version on extra modules
- - - - -
d6dc6c4a by Tony Chemit at 2018-03-02T14:31:52Z
optimize i18n
- - - - -
6b8af716 by Tony CHEMIT at 2018-03-02T14:37:43Z
optimize i18n
- - - - -
be9a82ca by Tony CHEMIT at 2018-03-02T14:38:40Z
[jgitflow-maven-plugin]merging 'release/2.2' into 'master'
- - - - -
a75c7903 by Tony CHEMIT at 2018-03-02T14:38:41Z
[jgitflow-maven-plugin]updating develop poms to master versions to avoid merge conflicts[skip ci]
- - - - -
7dbe3fb2 by Tony CHEMIT at 2018-03-02T14:38:41Z
[jgitflow-maven-plugin]merging 'master' into 'develop'
- - - - -
671462c7 by Tony CHEMIT at 2018-03-02T14:38:41Z
[jgitflow-maven-plugin]Updating develop poms back to pre merge state[skip ci]
- - - - -
2 changed files:
- t3-web/src/main/resources/i18n/t3-web_en_GB.properties
- t3-web/src/main/resources/i18n/t3-web_fr_FR.properties
Changes:
=====================================
t3-web/src/main/resources/i18n/t3-web_en_GB.properties
=====================================
--- a/t3-web/src/main/resources/i18n/t3-web_en_GB.properties
+++ b/t3-web/src/main/resources/i18n/t3-web_en_GB.properties
@@ -121,8 +121,8 @@ t3.common.useReplacementVessel=Use a replacement vessel
t3.common.useSamplesOnly=Database 'Samples only'
t3.common.useWeightCategoriesInStratum=Use Weight categories -10/+10 in stratum
t3.common.useWells=Use wells
-t3.common.user.outputDatabases=List of configured target databases
t3.common.user.inputDatabases=List of configured working databases
+t3.common.user.outputDatabases=List of configured target databases
t3.common.users=Users list
t3.common.vesselFilter=Filter on vessels
t3.common.vesselSimpleTypes.to.select=Types simplifiés de navire à sélectionner
=====================================
t3-web/src/main/resources/i18n/t3-web_fr_FR.properties
=====================================
--- a/t3-web/src/main/resources/i18n/t3-web_fr_FR.properties
+++ b/t3-web/src/main/resources/i18n/t3-web_fr_FR.properties
@@ -121,8 +121,8 @@ t3.common.useReplacementVessel=Utiliser un navire de remplacement
t3.common.useSamplesOnly=Base échantillon seulement
t3.common.useWeightCategoriesInStratum=Utiliser les catégories de poids -10/+10Kg dans la stratification
t3.common.useWells=Utilisation des plans de cuve
-t3.common.user.outputDatabases=Liste des configurations de bases de sortie
t3.common.user.inputDatabases=Liste des configurations de bases de travail
+t3.common.user.outputDatabases=Liste des configurations de bases de sortie
t3.common.users=Liste des utilisateurs
t3.common.vesselFilter=Filter les navires
t3.common.vesselSimpleTypes.to.select=Types simplifiés de navire à sélectionner
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/a533b2b3dc273fad977e7e77bdba454…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/a533b2b3dc273fad977e7e77bdba454…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-t3][develop] 3 commits: fix release extra model for release
by Tony CHEMIT 02 Mar '18
by Tony CHEMIT 02 Mar '18
02 Mar '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
6a5ab77f by Tony CHEMIT at 2018-03-02T14:27:19Z
fix release extra model for release
- - - - -
d1ff484a by Tony CHEMIT at 2018-03-02T14:27:19Z
fix stage build
- - - - -
a533b2b3 by Tony CHEMIT at 2018-03-02T14:27:49Z
fix release extra module (for the last time)
- - - - -
4 changed files:
- .gitlab-ci.yml
- pom.xml
- t3-installer/pom.xml
- t3/pom.xml
Changes:
=====================================
.gitlab-ci.yml
=====================================
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -56,7 +56,7 @@ image: registry.gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/docker:lat
- if [ -n "${MAKE_STAGE}" ]; then ultreiaio-milestone-close; fi
- if [ -n "${MAKE_STAGE}" ]; then ultreiaio-release-start; fi
- if [ -n "${MAKE_STAGE}" ]; then ultreiaio-release-finish; fi
- - if [ -n "${MAKE_STAGE}" ]; then ultreiaio-stage-drop; fi
+ - if [ -n "${MAKE_STAGE}" ]; then ultreiaio-stage-close; fi
- if [ -n "${MAKE_STAGE}" ]; then ultreiaio-changelog-update-staging; fi
- if [ -n "${MAKE_STAGE}" ]; then ultreiaio-milestone-create; fi
=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -230,6 +230,45 @@
</configuration>
</plugin>
+ <plugin>
+ <groupId>io.ultreia.java4all.jgitflow</groupId>
+ <artifactId>jgitflow-maven-plugin</artifactId>
+ <version>${plugin.version.jgitflow}</version>
+ <configuration>
+ <flowInitContext>
+ <versionTagPrefix>v</versionTagPrefix>
+ <masterBranchName>${jgitflow.masterBranchName}</masterBranchName>
+ <developBranchName>${jgitflow.developBranchName}</developBranchName>
+ </flowInitContext>
+ <scmCommentPrefix>[jgitflow-maven-plugin]</scmCommentPrefix>
+ <scmCommentSuffix>[skip ci]</scmCommentSuffix>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
+ <addScmCommentSuffixOnMerge>false</addScmCommentSuffixOnMerge>
+
+ </configuration>
+ <executions>
+ <execution>
+ <id>default-release-start</id>
+ <goals>
+ <goal>release-start</goal>
+ </goals>
+ <configuration>
+ <pushReleases>true</pushReleases>
+ <enableSshAgent>true</enableSshAgent>
+ </configuration>
+ </execution>
+ <execution>
+ <goals>
+ <goal>release-finish</goal>
+ </goals>
+ <configuration>
+ <pushReleases>true</pushReleases>
+ <enableSshAgent>true</enableSshAgent>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
</pluginManagement>
<plugins>
@@ -276,7 +315,7 @@
<profiles>
<profile>
- <id>release-modules-profile</id>
+ <id>release-profile</id>
<activation>
<property>
<name>performRelease</name>
=====================================
t3-installer/pom.xml
=====================================
--- a/t3-installer/pom.xml
+++ b/t3-installer/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.3-SNAPSHOT</version>
</parent>
<artifactId>t3-installer</artifactId>
=====================================
t3/pom.xml
=====================================
--- a/t3/pom.xml
+++ b/t3/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.3-SNAPSHOT</version>
</parent>
<artifactId>t3</artifactId>
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/88660ade0008e472e0a439b2b75830b…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/88660ade0008e472e0a439b2b75830b…
You're receiving this email because of your account on gitlab.com.
1
0