Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
2ed5caf6
by Tony CHEMIT at 2017-06-14T09:42:16+02:00
-
074c8908
by Tony CHEMIT at 2017-06-14T09:42:16+02:00
-
332bd022
by Tony CHEMIT at 2017-06-14T09:42:16+02:00
-
991093e3
by Tony CHEMIT at 2017-06-14T09:42:16+02:00
15 changed files:
- application-swing-decoration/src/main/resources/i18n/application-swing-decoration_es_ES.properties
- application-swing-validation/src/main/resources/i18n/application-swing-validation_es_ES.properties
- application-swing/src/main/java/fr/ird/observe/application/swing/RunObserve.java
- application-swing/src/main/java/fr/ird/observe/application/swing/backup/BackupsManager.java
- application-swing/src/main/resources/i18n/application-swing_en_GB.properties
- application-swing/src/main/resources/i18n/application-swing_es_ES.properties
- application-swing/src/main/resources/i18n/application-swing_fr_FR.properties
- application-web-configuration/src/main/java/fr/ird/observe/application/web/configuration/db/ObserveWebDatabasesHelper.java
- application-web-configuration/src/main/java/fr/ird/observe/application/web/configuration/user/ObserveWebUsersHelper.java
- persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaApplicationContext.java
- + persistence/src/test/java/fr/ird/observe/H2TimeZoneTest.java
- pom.xml
- services-topia/src/main/java/fr/ird/observe/services/topia/service/sql/SqlScriptProducerServiceTopia.java
- services-validation/src/main/resources/i18n/services-validation_es_ES.properties
- services/src/main/java/fr/ird/observe/services/gson/DateAdapter.java
Changes:
| ... | ... | @@ -143,7 +143,7 @@ observe.type.nonTargetCatchReleased=Faune accessoire libérée \#TODO |
| 143 | 143 |
observe.type.nonTargetCatchReleasedState=État d'une faune accessoire libérée \#TODO
|
| 144 | 144 |
observe.type.nonTargetCatchReleasedStates=États d'une faune accessoire libérée \#TODO
|
| 145 | 145 |
observe.type.nonTargetCatchReleaseds=Faunes accessoires libérées \#TODO
|
| 146 |
-observe.type.nonTargetCatches=Faunas accesorias conservadas o descartadas
|
|
| 146 |
+observe.type.nonTargetCatches=Fauna accesoria conservada o descartada
|
|
| 147 | 147 |
observe.type.nonTargetLength=Longitud (cm inf.)
|
| 148 | 148 |
observe.type.nonTargetLengths=Longitudes (cm inf.)
|
| 149 | 149 |
observe.type.nonTargetSample=Muestreo de fauna accesoria
|
| ... | ... | @@ -67,11 +67,11 @@ observe.common.gearUseFeaturesSeine=Equipamiento |
| 67 | 67 |
observe.common.gonadeWeight=Peso de las gonadas (g)
|
| 68 | 68 |
observe.common.haulingBreaks=Número de cortes
|
| 69 | 69 |
observe.common.haulingDirectionSameAsSetting=Sentido del arrastre idéntico a lo de la calada
|
| 70 |
-observe.common.haulingEndLatitude=Arrastre Latitude
|
|
| 70 |
+observe.common.haulingEndLatitude=Arrastre Latitud
|
|
| 71 | 71 |
observe.common.haulingEndLongitude=Arrastre Longitud
|
| 72 | 72 |
observe.common.haulingEndQuadrant=Arrastre quadrant
|
| 73 | 73 |
observe.common.haulingEndTimeStamp=Timestamp de fin
|
| 74 |
-observe.common.haulingStartLatitude=Arrastre Latitude
|
|
| 74 |
+observe.common.haulingStartLatitude=Arrastre Latitud
|
|
| 75 | 75 |
observe.common.haulingStartLongitude=Arrastre Longitud
|
| 76 | 76 |
observe.common.haulingStartQuadrant=Arrastre quadrant
|
| 77 | 77 |
observe.common.haulingStartTimeStamp=Timestamp del inicio
|
| ... | ... | @@ -148,13 +148,13 @@ observe.common.sensorBrand=Marca de sensor |
| 148 | 148 |
observe.common.sensorDataFormat=Formato de los datos del sensor
|
| 149 | 149 |
observe.common.sensorSerialNo=Número de serie
|
| 150 | 150 |
observe.common.sensorType=Tipo de sensor
|
| 151 |
-observe.common.settingEndLatitude=Calada latitude
|
|
| 151 |
+observe.common.settingEndLatitude=Calada Latitud
|
|
| 152 | 152 |
observe.common.settingEndLongitude=Calada longitud
|
| 153 | 153 |
observe.common.settingEndQuadrant=Calada quadrant
|
| 154 | 154 |
observe.common.settingEndTimeStamp=Timestamp de fin
|
| 155 | 155 |
observe.common.settingIdentifier=Calada
|
| 156 | 156 |
observe.common.settingShape=Forma de la calada
|
| 157 |
-observe.common.settingStartLatitude=Calada latitude
|
|
| 157 |
+observe.common.settingStartLatitude=Calada Latitud
|
|
| 158 | 158 |
observe.common.settingStartLongitude=Calada longitud
|
| 159 | 159 |
observe.common.settingStartQuadrant=Calada quadrant
|
| 160 | 160 |
observe.common.settingStartTimeStamp=Timestamp de inicio
|
| ... | ... | @@ -610,7 +610,7 @@ validator.ui.transmittingBuoy.null.code=El codigo de la baliza es vacío. |
| 610 | 610 |
validator.ui.transmittingBuoy.required.transmittingBuoyOperation=La selección de una opéración sobre baliza es mandatoria.
|
| 611 | 611 |
validator.ui.transmittingBuoy.required.transmittingBuoyType=La selección de un tipo de baliza es mandatoria.
|
| 612 | 612 |
validator.ui.trip.comment.tobig=El tamaño del comentario está limitado a 1024 caracteres.
|
| 613 |
-validator.ui.trip.desactivated.captain=El capitán seleccionado está desactivado.
|
|
| 613 |
+validator.ui.trip.desactivated.captain=El patrón seleccionado está desactivado.
|
|
| 614 | 614 |
validator.ui.trip.desactivated.dataEntryOperator=El operador de captación seleccionado está desactivado.
|
| 615 | 615 |
validator.ui.trip.desactivated.departureHarbour=El puerto de salida seleccionado está desactivado.
|
| 616 | 616 |
validator.ui.trip.desactivated.landingHarbour=El puerto de llegada seleccionado está desactivado.
|
| ... | ... | @@ -625,13 +625,13 @@ validator.ui.trip.invalid.formsUrl=La URL del formulario no es válida. |
| 625 | 625 |
validator.ui.trip.invalid.loch=La corredera de mañana (%1$s) de la ruta %2$s debe ser superior a la de tarde (%3$s) de la ruta anterior.
|
| 626 | 626 |
validator.ui.trip.invalid.reportsUrl=La URL del informe no es válida.
|
| 627 | 627 |
validator.ui.trip.invalid.startDate=La fecha de comienzo de marea debe ser inferior al día de observación de cualquier ruta (la ruta %1$s es incorrecta).
|
| 628 |
-validator.ui.trip.null.captain=Un capitán debe ser seleccionado.
|
|
| 628 |
+validator.ui.trip.null.captain=Un patrón debe ser seleccionado.
|
|
| 629 | 629 |
validator.ui.trip.null.dataEntryOperator=Un operador de captación debe ser seleccionado.
|
| 630 | 630 |
validator.ui.trip.null.departureHarbour=Un puerto de salida debe ser seleccionado.
|
| 631 | 631 |
validator.ui.trip.null.gearUseFeatureLongline=Usted no seleccionó un equipamiento.
|
| 632 | 632 |
validator.ui.trip.null.gearUseFeatureSeine=Usted no seleccionó un equipamiento (Senne aconsejado).
|
| 633 | 633 |
validator.ui.trip.null.landingHarbour=Un puerto de llegada debe ser seleccionado.
|
| 634 |
-validator.ui.trip.required.comment.for.captain=Se necesita un comentario para el capitán seleccionado.
|
|
| 634 |
+validator.ui.trip.required.comment.for.captain=Se necesita un comentario para el patrón seleccionado.
|
|
| 635 | 635 |
validator.ui.trip.required.comment.for.dataEntryOperator=Se necesita un comentario para el operador de captación seleccionado.
|
| 636 | 636 |
validator.ui.trip.required.comment.for.departureHarbour=Se necesita un comentario para el puerto de salida seleccionado.
|
| 637 | 637 |
validator.ui.trip.required.comment.for.landingHarbour=Se necesita un comentario para el puerto de llegada seleccionado.
|
| ... | ... | @@ -27,6 +27,9 @@ import org.apache.commons.logging.LogFactory; |
| 27 | 27 |
import java.util.Arrays;
|
| 28 | 28 |
import java.util.Date;
|
| 29 | 29 |
|
| 30 |
+ |
|
| 31 |
+import static org.nuiton.i18n.I18n.n;
|
|
| 32 |
+ |
|
| 30 | 33 |
/**
|
| 31 | 34 |
* Pour lancer le client swing {@code ObServe} en mode administrateur.
|
| 32 | 35 |
*
|
| ... | ... | @@ -54,4 +57,10 @@ public class RunObserve extends ObserveRunner { |
| 54 | 57 |
new RunObserve(args).launch();
|
| 55 | 58 |
}
|
| 56 | 59 |
|
| 60 |
+ static {
|
|
| 61 |
+ //TODO Apply this modification in jaxx project
|
|
| 62 |
+ n("jaxx.common.latitude");
|
|
| 63 |
+ }
|
|
| 64 |
+ |
|
| 65 |
+ |
|
| 57 | 66 |
}
|
| ... | ... | @@ -29,6 +29,7 @@ import fr.ird.observe.application.swing.ObserveSwingApplicationDataSourcesManage |
| 29 | 29 |
import fr.ird.observe.application.swing.ObserveSwingTechnicalException;
|
| 30 | 30 |
import fr.ird.observe.application.swing.db.ObserveSwingDataSource;
|
| 31 | 31 |
import fr.ird.observe.services.dto.source.DataSourceCreateConfigurationDto;
|
| 32 |
+import java.nio.charset.StandardCharsets;
|
|
| 32 | 33 |
import org.apache.commons.lang3.StringUtils;
|
| 33 | 34 |
import org.apache.commons.logging.Log;
|
| 34 | 35 |
import org.apache.commons.logging.LogFactory;
|
| ... | ... | @@ -123,7 +124,7 @@ public class BackupsManager implements Closeable { |
| 123 | 124 |
try {
|
| 124 | 125 |
List<BackupStorage> backups;
|
| 125 | 126 |
if (Files.exists(storePath)) {
|
| 126 |
- try (BufferedReader reader = Files.newBufferedReader(storePath)) {
|
|
| 127 |
+ try (BufferedReader reader = Files.newBufferedReader(storePath, StandardCharsets.UTF_8)) {
|
|
| 127 | 128 |
Type typeOfT = new TypeToken<List<BackupStorage>>() {
|
| 128 | 129 |
}.getType();
|
| 129 | 130 |
backups = new Gson().fromJson(reader, typeOfT);
|
| ... | ... | @@ -231,7 +232,7 @@ public class BackupsManager implements Closeable { |
| 231 | 232 |
|
| 232 | 233 |
private void storeBackups() throws IOException {
|
| 233 | 234 |
log.info(String.format("Store %d backups to %s", backups.size(), storePath));
|
| 234 |
- try (BufferedWriter writer = Files.newBufferedWriter(storePath)) {
|
|
| 235 |
+ try (BufferedWriter writer = Files.newBufferedWriter(storePath, StandardCharsets.UTF_8)) {
|
|
| 235 | 236 |
new Gson().toJson(backups, writer);
|
| 236 | 237 |
}
|
| 237 | 238 |
}
|
| ... | ... | @@ -31,6 +31,7 @@ observe.action.choose.sensorUsed.exportData=Export data |
| 31 | 31 |
observe.action.choose.sensorUsed.importData=Import data
|
| 32 | 32 |
observe.action.choose.tdr.exportData=Export data
|
| 33 | 33 |
observe.action.choose.tdr.importData=Import data
|
| 34 |
+jaxx.common.latitude=Latitude
|
|
| 34 | 35 |
observe.action.choose.tripLongline.message=Select target trip
|
| 35 | 36 |
observe.action.choose.tripLongline.title=Move activities to another trip
|
| 36 | 37 |
observe.action.choose.tripSeine.message=Select target trip
|
| ... | ... | @@ -1213,7 +1213,7 @@ observe.content.setSeine.schoolType=Tipo de banco |
| 1213 | 1213 |
observe.content.setSeine.schoolType.not.fill=vacío
|
| 1214 | 1214 |
observe.content.setSeine.sonarUsedAvantSet=Utilización del sonar antes del lance
|
| 1215 | 1215 |
observe.content.setSeine.startTime=Fecha - Hora comienzo lance
|
| 1216 |
-observe.content.setSeine.supportVesselName=Nombre Macicero
|
|
| 1216 |
+observe.content.setSeine.supportVesselName=Nombre del macicero
|
|
| 1217 | 1217 |
observe.content.setSeine.tab.general=Características generales
|
| 1218 | 1218 |
observe.content.setSeine.tab.measurements=Parámetros
|
| 1219 | 1219 |
observe.content.setSeine.targetDiscarded=Descarte de atún
|
| ... | ... | @@ -1610,6 +1610,7 @@ observe.security.role=Rol |
| 1610 | 1610 |
observe.security.role.tip=Número del rol de la base
|
| 1611 | 1611 |
observe.security.technicien=Técnico
|
| 1612 | 1612 |
observe.security.technicien.tip=El rol tiene todos los permisos sobre el referencial y los datos
|
| 1613 |
+jaxx.common.latitude=Latitud
|
|
| 1613 | 1614 |
observe.security.unused=No utilizado
|
| 1614 | 1615 |
observe.security.unused.tip=No usar este rol
|
| 1615 | 1616 |
observe.security.utilisateur=Usuario
|
| ... | ... | @@ -1620,7 +1621,7 @@ observe.storage.action.apply=Utilizar |
| 1620 | 1621 |
observe.storage.action.apply.tip=Utilizar la fuente de datos configuarada
|
| 1621 | 1622 |
observe.storage.action.cancel=Cancelar el cambio de la fuente de datos
|
| 1622 | 1623 |
observe.storage.action.cancel.tip=Cancelar el cambio de la fuente de datos
|
| 1623 |
-observe.storage.activityLongline.coordinate=Coordenadas
|
|
| 1624 |
+observe.storage.activityLongline.coordinate=Coordenada
|
|
| 1624 | 1625 |
observe.storage.activityLongline.fpaZone=Zona FPA
|
| 1625 | 1626 |
observe.storage.activityLongline.message.active.found=Actividad abierta
|
| 1626 | 1627 |
observe.storage.activityLongline.message.active.found.for.other.trip=Existe una actividad abierta en otra ruta.
|
| ... | ... | @@ -31,6 +31,7 @@ observe.action.choose.route.title=Changer la route des activités |
| 31 | 31 |
observe.action.choose.sensorUsed.exportData=Exporter le fichier de données
|
| 32 | 32 |
observe.action.choose.sensorUsed.importData=Importer le fichier de données
|
| 33 | 33 |
observe.action.choose.tdr.exportData=Exporter le fichier de données
|
| 34 |
+jaxx.common.latitude=Latitude
|
|
| 34 | 35 |
observe.action.choose.tdr.importData=Importer le fichier de données
|
| 35 | 36 |
observe.action.choose.tripLongline.message=A quelle marée voulez-vous associer les activités sélectionnées ?
|
| 36 | 37 |
observe.action.choose.tripLongline.title=Changer la marée des activités
|
| ... | ... | @@ -26,23 +26,22 @@ import com.esotericsoftware.yamlbeans.YamlConfig; |
| 26 | 26 |
import com.esotericsoftware.yamlbeans.YamlException;
|
| 27 | 27 |
import com.esotericsoftware.yamlbeans.YamlReader;
|
| 28 | 28 |
import com.esotericsoftware.yamlbeans.YamlWriter;
|
| 29 |
-import com.google.common.base.Charsets;
|
|
| 30 | 29 |
import com.google.common.io.Files;
|
| 31 | 30 |
import fr.ird.observe.application.web.configuration.db.impl.ObserveWebDatabaseBean;
|
| 32 | 31 |
import fr.ird.observe.application.web.configuration.db.impl.ObserveWebDatabaseRoleBean;
|
| 33 | 32 |
import fr.ird.observe.application.web.configuration.db.impl.ObserveWebDatabasesBean;
|
| 34 | 33 |
import fr.ird.observe.application.web.configuration.db.impl.ObserveWebDatabasesImmutable;
|
| 35 |
-import org.apache.commons.collections4.CollectionUtils;
|
|
| 36 |
-import org.apache.commons.lang3.StringUtils;
|
|
| 37 |
-import org.apache.commons.logging.Log;
|
|
| 38 |
-import org.apache.commons.logging.LogFactory;
|
|
| 39 |
- |
|
| 40 | 34 |
import java.io.BufferedWriter;
|
| 41 | 35 |
import java.io.File;
|
| 42 | 36 |
import java.io.Reader;
|
| 43 | 37 |
import java.io.Writer;
|
| 38 |
+import java.nio.charset.StandardCharsets;
|
|
| 44 | 39 |
import java.util.LinkedHashSet;
|
| 45 | 40 |
import java.util.Set;
|
| 41 |
+import org.apache.commons.collections4.CollectionUtils;
|
|
| 42 |
+import org.apache.commons.lang3.StringUtils;
|
|
| 43 |
+import org.apache.commons.logging.Log;
|
|
| 44 |
+import org.apache.commons.logging.LogFactory;
|
|
| 46 | 45 |
|
| 47 | 46 |
/**
|
| 48 | 47 |
* Created on 30/08/15.
|
| ... | ... | @@ -68,7 +67,7 @@ public class ObserveWebDatabasesHelper { |
| 68 | 67 |
log.info("Loading databases from file: " + file);
|
| 69 | 68 |
}
|
| 70 | 69 |
ObserveWebDatabasesBean result;
|
| 71 |
- try (Reader fileReader = Files.newReader(file, Charsets.UTF_8)) {
|
|
| 70 |
+ try (Reader fileReader = Files.newReader(file, StandardCharsets.UTF_8)) {
|
|
| 72 | 71 |
YamlReader reader = new YamlReader(fileReader, createConfig());
|
| 73 | 72 |
result = reader.read(ObserveWebDatabasesBean.class);
|
| 74 | 73 |
fileReader.close();
|
| ... | ... | @@ -164,7 +163,7 @@ public class ObserveWebDatabasesHelper { |
| 164 | 163 |
log.info("Store databases to " + file);
|
| 165 | 164 |
}
|
| 166 | 165 |
|
| 167 |
- try (BufferedWriter writer = Files.newWriter(file, Charsets.UTF_8)) {
|
|
| 166 |
+ try (BufferedWriter writer = Files.newWriter(file, StandardCharsets.UTF_8)) {
|
|
| 168 | 167 |
|
| 169 | 168 |
store(databases, writer);
|
| 170 | 169 |
|
| ... | ... | @@ -26,7 +26,6 @@ import com.esotericsoftware.yamlbeans.YamlConfig; |
| 26 | 26 |
import com.esotericsoftware.yamlbeans.YamlException;
|
| 27 | 27 |
import com.esotericsoftware.yamlbeans.YamlReader;
|
| 28 | 28 |
import com.esotericsoftware.yamlbeans.YamlWriter;
|
| 29 |
-import com.google.common.base.Charsets;
|
|
| 30 | 29 |
import com.google.common.io.Files;
|
| 31 | 30 |
import fr.ird.observe.application.web.configuration.db.ObserveWebDatabase;
|
| 32 | 31 |
import fr.ird.observe.application.web.configuration.db.ObserveWebDatabaseRole;
|
| ... | ... | @@ -35,18 +34,18 @@ import fr.ird.observe.application.web.configuration.user.impl.ObserveWebUserBean |
| 35 | 34 |
import fr.ird.observe.application.web.configuration.user.impl.ObserveWebUserPermissionBean;
|
| 36 | 35 |
import fr.ird.observe.application.web.configuration.user.impl.ObserveWebUsersBean;
|
| 37 | 36 |
import fr.ird.observe.application.web.configuration.user.impl.ObserveWebUsersImmutable;
|
| 38 |
-import org.apache.commons.collections4.CollectionUtils;
|
|
| 39 |
-import org.apache.commons.lang3.StringUtils;
|
|
| 40 |
-import org.apache.commons.logging.Log;
|
|
| 41 |
-import org.apache.commons.logging.LogFactory;
|
|
| 42 |
- |
|
| 43 | 37 |
import java.io.BufferedWriter;
|
| 44 | 38 |
import java.io.File;
|
| 45 | 39 |
import java.io.Reader;
|
| 46 | 40 |
import java.io.Writer;
|
| 41 |
+import java.nio.charset.StandardCharsets;
|
|
| 47 | 42 |
import java.util.LinkedHashSet;
|
| 48 | 43 |
import java.util.Optional;
|
| 49 | 44 |
import java.util.Set;
|
| 45 |
+import org.apache.commons.collections4.CollectionUtils;
|
|
| 46 |
+import org.apache.commons.lang3.StringUtils;
|
|
| 47 |
+import org.apache.commons.logging.Log;
|
|
| 48 |
+import org.apache.commons.logging.LogFactory;
|
|
| 50 | 49 |
|
| 51 | 50 |
/**
|
| 52 | 51 |
* Created on 30/08/15.
|
| ... | ... | @@ -72,7 +71,7 @@ public class ObserveWebUsersHelper { |
| 72 | 71 |
log.info("Loading users from file: " + file);
|
| 73 | 72 |
}
|
| 74 | 73 |
ObserveWebUsersBean result;
|
| 75 |
- try (Reader fileReader = Files.newReader(file, Charsets.UTF_8)) {
|
|
| 74 |
+ try (Reader fileReader = Files.newReader(file, StandardCharsets.UTF_8)) {
|
|
| 76 | 75 |
YamlReader reader = new YamlReader(fileReader, createConfig());
|
| 77 | 76 |
result = reader.read(ObserveWebUsersBean.class);
|
| 78 | 77 |
fileReader.close();
|
| ... | ... | @@ -158,7 +157,7 @@ public class ObserveWebUsersHelper { |
| 158 | 157 |
log.info("Store users to " + file);
|
| 159 | 158 |
}
|
| 160 | 159 |
|
| 161 |
- try (BufferedWriter writer = Files.newWriter(file, Charsets.UTF_8)) {
|
|
| 160 |
+ try (BufferedWriter writer = Files.newWriter(file, StandardCharsets.UTF_8)) {
|
|
| 162 | 161 |
|
| 163 | 162 |
store(users, writer);
|
| 164 | 163 |
|
| ... | ... | @@ -24,8 +24,23 @@ package fr.ird.observe.persistence; |
| 24 | 24 |
|
| 25 | 25 |
import com.google.common.collect.ImmutableSet;
|
| 26 | 26 |
import fr.ird.observe.entities.referentiel.ObserveReferentialEntity;
|
| 27 |
-import fr.ird.observe.persistence.migration.ObserveMigrationConfigurationProvider;
|
|
| 28 | 27 |
import fr.ird.observe.persistence.migration.ObserveMigrationEngine;
|
| 28 |
+import java.io.BufferedInputStream;
|
|
| 29 |
+import java.io.File;
|
|
| 30 |
+import java.io.FileInputStream;
|
|
| 31 |
+import java.io.FileNotFoundException;
|
|
| 32 |
+import java.io.IOException;
|
|
| 33 |
+import java.io.InputStream;
|
|
| 34 |
+import java.nio.file.Files;
|
|
| 35 |
+import java.nio.file.Path;
|
|
| 36 |
+import java.util.EnumSet;
|
|
| 37 |
+import java.util.LinkedHashSet;
|
|
| 38 |
+import java.util.Objects;
|
|
| 39 |
+import java.util.Set;
|
|
| 40 |
+import java.util.UUID;
|
|
| 41 |
+import java.util.stream.Collectors;
|
|
| 42 |
+import java.util.stream.Stream;
|
|
| 43 |
+import java.util.zip.GZIPInputStream;
|
|
| 29 | 44 |
import org.apache.commons.logging.Log;
|
| 30 | 45 |
import org.apache.commons.logging.LogFactory;
|
| 31 | 46 |
import org.hibernate.HibernateException;
|
| ... | ... | @@ -44,17 +59,6 @@ import org.nuiton.topia.service.sql.batch.tables.TopiaSqlTables; |
| 44 | 59 |
import org.nuiton.topia.service.sql.batch.tables.TopiaSqlTablesFactory;
|
| 45 | 60 |
import org.nuiton.util.StringUtil;
|
| 46 | 61 |
|
| 47 |
-import java.io.IOException;
|
|
| 48 |
-import java.nio.file.Files;
|
|
| 49 |
-import java.nio.file.Path;
|
|
| 50 |
-import java.util.EnumSet;
|
|
| 51 |
-import java.util.LinkedHashSet;
|
|
| 52 |
-import java.util.Objects;
|
|
| 53 |
-import java.util.Set;
|
|
| 54 |
-import java.util.UUID;
|
|
| 55 |
-import java.util.stream.Collectors;
|
|
| 56 |
-import java.util.stream.Stream;
|
|
| 57 |
- |
|
| 58 | 62 |
public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicationContext implements TopiaMetadataModelSupport {
|
| 59 | 63 |
|
| 60 | 64 |
/**
|
| ... | ... | @@ -62,9 +66,9 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat |
| 62 | 66 |
*/
|
| 63 | 67 |
private static final Log log = LogFactory.getLog(ObserveTopiaApplicationContext.class);
|
| 64 | 68 |
|
| 65 |
- public static final String MIGRATION_SERVICE_NAME = "migration";
|
|
| 69 |
+ static final String MIGRATION_SERVICE_NAME = "migration";
|
|
| 66 | 70 |
|
| 67 |
- public static final String SQL_BATCH_SERVICE_NAME = "sqlBatch";
|
|
| 71 |
+ static final String SQL_BATCH_SERVICE_NAME = "sqlBatch";
|
|
| 68 | 72 |
|
| 69 | 73 |
private static final String CREATE_SCHEMA_SCRIPT
|
| 70 | 74 |
= "CREATE SCHEMA OBSERVE_COMMON;\n"
|
| ... | ... | @@ -79,19 +83,17 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat |
| 79 | 83 |
protected boolean open;
|
| 80 | 84 |
|
| 81 | 85 |
protected final String authenticationToken;
|
| 82 |
- protected final TopiaMetadataModelSupport topiaMetadataModelSupport;
|
|
| 83 |
- protected final TopiaSqlTablesFactory topiaSqlTablesFactory;
|
|
| 84 |
- protected final ObserveMigrationConfigurationProvider observeMigrationConfigurationProvider;
|
|
| 85 |
- protected TopiaSqlTables tripSeineTables;
|
|
| 86 |
- protected TopiaSqlTables tripLonglineTables;
|
|
| 87 |
- protected TopiaSqlTables referentialTables;
|
|
| 86 |
+ private final TopiaMetadataModelSupport topiaMetadataModelSupport;
|
|
| 87 |
+ private final TopiaSqlTablesFactory topiaSqlTablesFactory;
|
|
| 88 |
+ private TopiaSqlTables tripSeineTables;
|
|
| 89 |
+ private TopiaSqlTables tripLonglineTables;
|
|
| 90 |
+ private TopiaSqlTables referentialTables;
|
|
| 88 | 91 |
|
| 89 | 92 |
public ObserveTopiaApplicationContext(ObserveTopiaConfiguration topiaConfiguration) {
|
| 90 | 93 |
super(topiaConfiguration);
|
| 91 | 94 |
this.authenticationToken = UUID.randomUUID().toString();
|
| 92 | 95 |
this.topiaMetadataModelSupport = new TopiaMetadataModelSupportImpl("fr.ird.observe.persistence", "Observe");
|
| 93 | 96 |
this.topiaSqlTablesFactory = new TopiaSqlTablesFactory(getMetadataModel(), this);
|
| 94 |
- this.observeMigrationConfigurationProvider = ObserveMigrationConfigurationProvider.get();
|
|
| 95 | 97 |
}
|
| 96 | 98 |
|
| 97 | 99 |
@Override
|
| ... | ... | @@ -154,8 +156,8 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat |
| 154 | 156 |
try (ObserveTopiaPersistenceContext topiaPersistenceContext = newPersistenceContext()) {
|
| 155 | 157 |
|
| 156 | 158 |
String sql = Stream.concat(Entities.REFERENCE_ENTITIES_LIST.stream(), Entities.DATA_ENTITIES_LIST.stream())
|
| 157 |
- .map(entity -> String.format(INSERT_LAST_UPDATE_PATTERN, entity.ordinal(), entity.getContract().getCanonicalName()))
|
|
| 158 |
- .collect(Collectors.joining("\n"));
|
|
| 159 |
+ .map(entity -> String.format(INSERT_LAST_UPDATE_PATTERN, entity.ordinal(), entity.getContract().getCanonicalName()))
|
|
| 160 |
+ .collect(Collectors.joining("\n"));
|
|
| 159 | 161 |
|
| 160 | 162 |
topiaPersistenceContext.getSqlSupport().executeSql(sql);
|
| 161 | 163 |
topiaPersistenceContext.commit();
|
| ... | ... | @@ -163,7 +165,7 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat |
| 163 | 165 |
|
| 164 | 166 |
|
| 165 | 167 |
} catch (HibernateException eee) {
|
| 166 |
- throw new TopiaException(String.format("Could insert lastupdateDate for reason: %s", eee.getMessage()), eee);
|
|
| 168 |
+ throw new TopiaException(String.format("Could insert lastUpdateDate for reason: %s", eee.getMessage()), eee);
|
|
| 167 | 169 |
}
|
| 168 | 170 |
|
| 169 | 171 |
}
|
| ... | ... | @@ -178,7 +180,7 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat |
| 178 | 180 |
|
| 179 | 181 |
}
|
| 180 | 182 |
|
| 181 |
- protected void executeSqlStatements0(byte... content) throws IOException {
|
|
| 183 |
+ private void executeSqlStatements0(byte... content) throws IOException {
|
|
| 182 | 184 |
|
| 183 | 185 |
if (getConfiguration().isH2Configuration()) {
|
| 184 | 186 |
|
| ... | ... | @@ -186,7 +188,30 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat |
| 186 | 188 |
log.info(String.format("Restore script size: %s to h2 from file : %s", StringUtil.convertMemory(content.length), tempFile.toString()));
|
| 187 | 189 |
try {
|
| 188 | 190 |
Files.write(tempFile, content);
|
| 189 |
- JdbcH2Helper jdbcH2Helper = new JdbcH2Helper(configuration);
|
|
| 191 |
+ //TODO Push this back in topia
|
|
| 192 |
+ JdbcH2Helper jdbcH2Helper = new JdbcH2Helper(configuration) {
|
|
| 193 |
+ @Override
|
|
| 194 |
+ public void restore(File file) throws FileNotFoundException {
|
|
| 195 |
+ String options = "";
|
|
| 196 |
+ try (InputStream in = new BufferedInputStream(new FileInputStream(file))) {
|
|
| 197 |
+ in.mark(2);
|
|
| 198 |
+ // read header to see if is compressed file
|
|
| 199 |
+ int b = in.read();
|
|
| 200 |
+ // redundant cast : int magic = ((int) in.read() << 8) | b;
|
|
| 201 |
+ int magic = in.read() << 8 | b;
|
|
| 202 |
+ in.reset();
|
|
| 203 |
+ if (magic == GZIPInputStream.GZIP_MAGIC) {
|
|
| 204 |
+ options += " COMPRESSION GZIP";
|
|
| 205 |
+ }
|
|
| 206 |
+ } catch (IOException e) {
|
|
| 207 |
+ throw new RuntimeException(e);
|
|
| 208 |
+ }
|
|
| 209 |
+ |
|
| 210 |
+ options += " CHARSET 'UTF8'";
|
|
| 211 |
+ runUpdate("RUNSCRIPT FROM '" + file.getAbsolutePath() + "'" + options);
|
|
| 212 |
+ }
|
|
| 213 |
+ };
|
|
| 214 |
+ |
|
| 190 | 215 |
jdbcH2Helper.restore(tempFile.toFile());
|
| 191 | 216 |
} finally {
|
| 192 | 217 |
Files.delete(tempFile);
|
| ... | ... | @@ -506,8 +531,8 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat |
| 506 | 531 |
|
| 507 | 532 |
private static class TripReplicateTablesPredicate implements TopiaSqlTablesFactory.TopiaSqlTablesPredicate {
|
| 508 | 533 |
|
| 509 |
- protected final Set<TopiaMetadataEntity> dones = new LinkedHashSet<>();
|
|
| 510 |
- protected final Set<String> sectionsHolders = ImmutableSet.of(
|
|
| 534 |
+ final Set<TopiaMetadataEntity> dones = new LinkedHashSet<>();
|
|
| 535 |
+ final Set<String> sectionsHolders = ImmutableSet.of(
|
|
| 511 | 536 |
ObserveEntityEnum.CatchLongline.name(),
|
| 512 | 537 |
ObserveEntityEnum.Tdr.name()
|
| 513 | 538 |
);
|
| 1 |
+package fr.ird.observe;
|
|
| 2 |
+import java.io.IOException;
|
|
| 3 |
+import java.nio.file.Files;
|
|
| 4 |
+import java.nio.file.Path;
|
|
| 5 |
+import java.nio.file.Paths;
|
|
| 6 |
+import java.sql.Connection;
|
|
| 7 |
+import java.sql.Date;
|
|
| 8 |
+import java.sql.DriverManager;
|
|
| 9 |
+import java.sql.PreparedStatement;
|
|
| 10 |
+import java.sql.ResultSet;
|
|
| 11 |
+import java.sql.SQLException;
|
|
| 12 |
+import java.util.Calendar;
|
|
| 13 |
+import java.util.TimeZone;
|
|
| 14 |
+import org.junit.Assert;
|
|
| 15 |
+import org.junit.BeforeClass;
|
|
| 16 |
+import org.junit.Test;
|
|
| 17 |
+ |
|
| 18 |
+/**
|
|
| 19 |
+ * Created by tchemit on 13/06/17.
|
|
| 20 |
+ *
|
|
| 21 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 22 |
+ */
|
|
| 23 |
+public class H2TimeZoneTest {
|
|
| 24 |
+ |
|
| 25 |
+ public static final TimeZone TIME_ZONE = TimeZone.getTimeZone("Europe/Paris");
|
|
| 26 |
+ static String JDBC_URL;
|
|
| 27 |
+ static Path path;
|
|
| 28 |
+ static java.util.Date expectedDate;
|
|
| 29 |
+ |
|
| 30 |
+ @BeforeClass
|
|
| 31 |
+ public static void beforeClass() throws IOException, SQLException {
|
|
| 32 |
+ |
|
| 33 |
+ Path dir = Paths.get(System.getProperty("java.io.tmpdir"));
|
|
| 34 |
+ Files.createDirectories(dir);
|
|
| 35 |
+ |
|
| 36 |
+ path = dir.resolve("H2TimeZoneTest-" + System.nanoTime());
|
|
| 37 |
+ Files.createDirectories(path);
|
|
| 38 |
+ JDBC_URL = String.format("jdbc:h2:file:%s/test", path.toFile().getAbsolutePath());
|
|
| 39 |
+ |
|
| 40 |
+ Calendar calendar = Calendar.getInstance();
|
|
| 41 |
+ calendar.set(Calendar.YEAR, 2016);
|
|
| 42 |
+ calendar.set(Calendar.MONTH, 1);
|
|
| 43 |
+ calendar.set(Calendar.DAY_OF_MONTH, 1);
|
|
| 44 |
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
| 45 |
+ calendar.set(Calendar.MINUTE, 0);
|
|
| 46 |
+ calendar.set(Calendar.SECOND, 0);
|
|
| 47 |
+ calendar.set(Calendar.MILLISECOND, 0);
|
|
| 48 |
+ |
|
| 49 |
+ expectedDate = calendar.getTime();
|
|
| 50 |
+ |
|
| 51 |
+ |
|
| 52 |
+ try (Connection connection = DriverManager.getConnection(JDBC_URL)) {
|
|
| 53 |
+ try (PreparedStatement preparedStatement = connection.prepareStatement("CREATE TABLE test (simpleDate DATE)")) {
|
|
| 54 |
+ preparedStatement.execute();
|
|
| 55 |
+ }
|
|
| 56 |
+ |
|
| 57 |
+ try (PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO test VALUES( ? );")) {
|
|
| 58 |
+ |
|
| 59 |
+ preparedStatement.setDate(1, new java.sql.Date(expectedDate.getTime()));
|
|
| 60 |
+ preparedStatement.execute();
|
|
| 61 |
+ }
|
|
| 62 |
+ connection.commit();
|
|
| 63 |
+ }
|
|
| 64 |
+ }
|
|
| 65 |
+ |
|
| 66 |
+ @Test
|
|
| 67 |
+ public void testWithDefaultTimeZone() {
|
|
| 68 |
+ |
|
| 69 |
+ TimeZone.setDefault(TIME_ZONE);
|
|
| 70 |
+ try (Connection connection = DriverManager.getConnection(JDBC_URL)) {
|
|
| 71 |
+ try (PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM test LIMIT 1;")) {
|
|
| 72 |
+ try (ResultSet resultSet = preparedStatement.executeQuery()) {
|
|
| 73 |
+ boolean next = resultSet.next();
|
|
| 74 |
+ Date actualDate = resultSet.getDate(1);
|
|
| 75 |
+ Assert.assertEquals(expectedDate, actualDate);
|
|
| 76 |
+ }
|
|
| 77 |
+ }
|
|
| 78 |
+ connection.commit();
|
|
| 79 |
+ } catch (SQLException e) {
|
|
| 80 |
+ e.printStackTrace();
|
|
| 81 |
+ }
|
|
| 82 |
+ }
|
|
| 83 |
+ |
|
| 84 |
+ @Test
|
|
| 85 |
+ public void testWithUtcTimeZone() {
|
|
| 86 |
+ |
|
| 87 |
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
|
|
| 88 |
+ try (Connection connection = DriverManager.getConnection(JDBC_URL)) {
|
|
| 89 |
+ try (PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM test LIMIT 1;")) {
|
|
| 90 |
+ try (ResultSet resultSet = preparedStatement.executeQuery()) {
|
|
| 91 |
+ boolean next = resultSet.next();
|
|
| 92 |
+ Date actualDate = resultSet.getDate(1);
|
|
| 93 |
+ Assert.assertEquals(expectedDate, actualDate);
|
|
| 94 |
+ }
|
|
| 95 |
+ }
|
|
| 96 |
+ connection.commit();
|
|
| 97 |
+ } catch (SQLException e) {
|
|
| 98 |
+ e.printStackTrace();
|
|
| 99 |
+ }
|
|
| 100 |
+ }
|
|
| 101 |
+}
|
| ... | ... | @@ -551,9 +551,7 @@ |
| 551 | 551 |
<dependency>
|
| 552 | 552 |
<groupId>com.h2database</groupId>
|
| 553 | 553 |
<artifactId>h2</artifactId>
|
| 554 |
- <!-- tc20150811 On ne pleut pas utiliser une version plus récente, le format n'est pas compatible -->
|
|
| 555 |
- <!-- FIXME Hum je ne suis pas sur que la 176 soit ok. -->
|
|
| 556 |
- <version>1.3.175</version>
|
|
| 554 |
+ <version>1.4.195</version>
|
|
| 557 | 555 |
</dependency>
|
| 558 | 556 |
|
| 559 | 557 |
<dependency>
|
| ... | ... | @@ -24,16 +24,25 @@ package fr.ird.observe.services.topia.service.sql; |
| 24 | 24 |
|
| 25 | 25 |
import com.google.common.collect.ImmutableSet;
|
| 26 | 26 |
import com.google.common.collect.ListMultimap;
|
| 27 |
+import fr.ird.observe.persistence.Entities;
|
|
| 27 | 28 |
import fr.ird.observe.persistence.ObserveEntityEnum;
|
| 28 | 29 |
import fr.ird.observe.persistence.ObserveTopiaApplicationContext;
|
| 29 |
-import fr.ird.observe.persistence.Entities;
|
|
| 30 |
+import fr.ird.observe.services.dto.ObserveBlobsContainer;
|
|
| 30 | 31 |
import fr.ird.observe.services.dto.referential.ReferentialDto;
|
| 31 | 32 |
import fr.ird.observe.services.service.sql.AddSqlScriptProducerRequest;
|
| 32 | 33 |
import fr.ird.observe.services.service.sql.AddSqlScriptProducerResult;
|
| 33 | 34 |
import fr.ird.observe.services.service.sql.DeleteSqlScriptProducerRequest;
|
| 34 |
-import fr.ird.observe.services.dto.ObserveBlobsContainer;
|
|
| 35 | 35 |
import fr.ird.observe.services.service.sql.SqlScriptProducerService;
|
| 36 | 36 |
import fr.ird.observe.services.topia.ObserveServiceTopia;
|
| 37 |
+import java.io.ByteArrayOutputStream;
|
|
| 38 |
+import java.io.IOException;
|
|
| 39 |
+import java.io.OutputStreamWriter;
|
|
| 40 |
+import java.io.Writer;
|
|
| 41 |
+import java.nio.charset.StandardCharsets;
|
|
| 42 |
+import java.util.List;
|
|
| 43 |
+import java.util.Set;
|
|
| 44 |
+import java.util.stream.Collectors;
|
|
| 45 |
+import java.util.zip.GZIPOutputStream;
|
|
| 37 | 46 |
import org.apache.commons.collections4.CollectionUtils;
|
| 38 | 47 |
import org.apache.commons.logging.Log;
|
| 39 | 48 |
import org.apache.commons.logging.LogFactory;
|
| ... | ... | @@ -44,14 +53,6 @@ import org.nuiton.topia.service.sql.batch.TopiaSqlBatchService; |
| 44 | 53 |
import org.nuiton.topia.service.sql.batch.actions.BlobsContainer;
|
| 45 | 54 |
import org.nuiton.topia.service.sql.batch.actions.TopiaSqlTableSelectArgument;
|
| 46 | 55 |
|
| 47 |
-import java.io.ByteArrayOutputStream;
|
|
| 48 |
-import java.io.IOException;
|
|
| 49 |
-import java.io.OutputStreamWriter;
|
|
| 50 |
-import java.io.Writer;
|
|
| 51 |
-import java.util.List;
|
|
| 52 |
-import java.util.Set;
|
|
| 53 |
-import java.util.stream.Collectors;
|
|
| 54 |
-import java.util.zip.GZIPOutputStream;
|
|
| 55 | 56 |
|
| 56 | 57 |
import static fr.ird.observe.persistence.Entities.IS_LONGLINE_ID;
|
| 57 | 58 |
import static fr.ird.observe.persistence.Entities.IS_SEINE_ID;
|
| ... | ... | @@ -74,7 +75,7 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement |
| 74 | 75 |
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|
| 75 | 76 |
|
| 76 | 77 |
ImmutableSet.Builder<ObserveBlobsContainer> observeBlobContainers = ImmutableSet.builder();
|
| 77 |
- try (Writer writer = new OutputStreamWriter(new GZIPOutputStream(out))) {
|
|
| 78 |
+ try (Writer writer = new OutputStreamWriter(new GZIPOutputStream(out), StandardCharsets.UTF_8)) {
|
|
| 78 | 79 |
|
| 79 | 80 |
TopiaSqlBatchService sqlBatchService = serviceContext.getTopiaApplicationContext().getSqlBatchService();
|
| 80 | 81 |
SqlRequests.Builder builder = sqlBatchService.requestBuilder().to(writer);
|
| ... | ... | @@ -105,7 +106,7 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement |
| 105 | 106 |
}
|
| 106 | 107 |
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|
| 107 | 108 |
|
| 108 |
- try (Writer writer = new OutputStreamWriter(new GZIPOutputStream(out))) {
|
|
| 109 |
+ try (Writer writer = new OutputStreamWriter(new GZIPOutputStream(out), StandardCharsets.UTF_8)) {
|
|
| 109 | 110 |
|
| 110 | 111 |
TopiaSqlBatchService sqlBatchService = serviceContext.getTopiaApplicationContext().getSqlBatchService();
|
| 111 | 112 |
SqlRequests.Builder builder = sqlBatchService.requestBuilder().to(writer);
|
| ... | ... | @@ -122,7 +123,7 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement |
| 122 | 123 |
}
|
| 123 | 124 |
}
|
| 124 | 125 |
|
| 125 |
- protected SqlRequests sqlRequests(AddSqlScriptProducerRequest request, SqlRequests.Builder builder) {
|
|
| 126 |
+ private SqlRequests sqlRequests(AddSqlScriptProducerRequest request, SqlRequests.Builder builder) {
|
|
| 126 | 127 |
|
| 127 | 128 |
if (serviceContext.getTopiaApplicationContext().getConfiguration().isShowSql()) {
|
| 128 | 129 |
builder.showSql();
|
| ... | ... | @@ -147,8 +148,8 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement |
| 147 | 148 |
|
| 148 | 149 |
if (request.isAddReferential()) {
|
| 149 | 150 |
builder.replicateTablesBuilder(metadataModel)
|
| 150 |
- .setTables(topiaApplicationContext.getReferentialTables())
|
|
| 151 |
- .flush();
|
|
| 151 |
+ .setTables(topiaApplicationContext.getReferentialTables())
|
|
| 152 |
+ .flush();
|
|
| 152 | 153 |
|
| 153 | 154 |
}
|
| 154 | 155 |
|
| ... | ... | @@ -162,9 +163,9 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement |
| 162 | 163 |
if (CollectionUtils.isNotEmpty(ids)) {
|
| 163 | 164 |
|
| 164 | 165 |
builder.replicateTablesBuilder(metadataModel)
|
| 165 |
- .setTables(topiaApplicationContext.getReferentialTable(entityType))
|
|
| 166 |
- .setSelectArgument(TopiaSqlTableSelectArgument.of(ids))
|
|
| 167 |
- .flush();
|
|
| 166 |
+ .setTables(topiaApplicationContext.getReferentialTable(entityType))
|
|
| 167 |
+ .setSelectArgument(TopiaSqlTableSelectArgument.of(ids))
|
|
| 168 |
+ .flush();
|
|
| 168 | 169 |
|
| 169 | 170 |
}
|
| 170 | 171 |
}
|
| ... | ... | @@ -177,10 +178,10 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement |
| 177 | 178 |
if (tripIds == null) {
|
| 178 | 179 |
|
| 179 | 180 |
builder.replicateTablesBuilder(metadataModel)
|
| 180 |
- .setTables(topiaApplicationContext.getTripSeineTables())
|
|
| 181 |
- .replicateTablesBuilder(metadataModel)
|
|
| 182 |
- .setTables(topiaApplicationContext.getTripLonglineTables())
|
|
| 183 |
- .flush();
|
|
| 181 |
+ .setTables(topiaApplicationContext.getTripSeineTables())
|
|
| 182 |
+ .replicateTablesBuilder(metadataModel)
|
|
| 183 |
+ .setTables(topiaApplicationContext.getTripLonglineTables())
|
|
| 184 |
+ .flush();
|
|
| 184 | 185 |
|
| 185 | 186 |
} else {
|
| 186 | 187 |
|
| ... | ... | @@ -191,9 +192,9 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement |
| 191 | 192 |
if (!tripIds1.isEmpty()) {
|
| 192 | 193 |
|
| 193 | 194 |
builder.replicateTablesBuilder(metadataModel)
|
| 194 |
- .setTables(topiaApplicationContext.getTripSeineTables())
|
|
| 195 |
- .setSelectArgument(TopiaSqlTableSelectArgument.of(tripIds1))
|
|
| 196 |
- .flush();
|
|
| 195 |
+ .setTables(topiaApplicationContext.getTripSeineTables())
|
|
| 196 |
+ .setSelectArgument(TopiaSqlTableSelectArgument.of(tripIds1))
|
|
| 197 |
+ .flush();
|
|
| 197 | 198 |
|
| 198 | 199 |
}
|
| 199 | 200 |
|
| ... | ... | @@ -206,9 +207,9 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement |
| 206 | 207 |
if (!tripIds1.isEmpty()) {
|
| 207 | 208 |
|
| 208 | 209 |
builder.replicateTablesBuilder(metadataModel)
|
| 209 |
- .setTables(topiaApplicationContext.getTripLonglineTables())
|
|
| 210 |
- .setSelectArgument(TopiaSqlTableSelectArgument.of(tripIds1))
|
|
| 211 |
- .flush();
|
|
| 210 |
+ .setTables(topiaApplicationContext.getTripLonglineTables())
|
|
| 211 |
+ .setSelectArgument(TopiaSqlTableSelectArgument.of(tripIds1))
|
|
| 212 |
+ .flush();
|
|
| 212 | 213 |
|
| 213 | 214 |
}
|
| 214 | 215 |
|
| ... | ... | @@ -221,7 +222,7 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement |
| 221 | 222 |
return builder.build();
|
| 222 | 223 |
}
|
| 223 | 224 |
|
| 224 |
- protected SqlRequests sqlRequests(DeleteSqlScriptProducerRequest request, SqlRequests.Builder builder) {
|
|
| 225 |
+ private SqlRequests sqlRequests(DeleteSqlScriptProducerRequest request, SqlRequests.Builder builder) {
|
|
| 225 | 226 |
|
| 226 | 227 |
if (serviceContext.getTopiaApplicationContext().getConfiguration().isShowSql()) {
|
| 227 | 228 |
builder.showSql();
|
| ... | ... | @@ -235,10 +236,10 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement |
| 235 | 236 |
if (tripIds == null) {
|
| 236 | 237 |
|
| 237 | 238 |
builder.deleteTablesBuilder()
|
| 238 |
- .setTables(topiaApplicationContext.getTripSeineTables())
|
|
| 239 |
- .replicateTablesBuilder(topiaApplicationContext.getMetadataModel())
|
|
| 240 |
- .setTables(topiaApplicationContext.getTripLonglineTables())
|
|
| 241 |
- .flush();
|
|
| 239 |
+ .setTables(topiaApplicationContext.getTripSeineTables())
|
|
| 240 |
+ .replicateTablesBuilder(topiaApplicationContext.getMetadataModel())
|
|
| 241 |
+ .setTables(topiaApplicationContext.getTripLonglineTables())
|
|
| 242 |
+ .flush();
|
|
| 242 | 243 |
|
| 243 | 244 |
} else {
|
| 244 | 245 |
|
| ... | ... | @@ -249,9 +250,9 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement |
| 249 | 250 |
if (!tripIds1.isEmpty()) {
|
| 250 | 251 |
|
| 251 | 252 |
builder.deleteTablesBuilder()
|
| 252 |
- .setTables(topiaApplicationContext.getTripSeineTables())
|
|
| 253 |
- .setSelectArgument(TopiaSqlTableSelectArgument.of(tripIds1))
|
|
| 254 |
- .flush();
|
|
| 253 |
+ .setTables(topiaApplicationContext.getTripSeineTables())
|
|
| 254 |
+ .setSelectArgument(TopiaSqlTableSelectArgument.of(tripIds1))
|
|
| 255 |
+ .flush();
|
|
| 255 | 256 |
|
| 256 | 257 |
}
|
| 257 | 258 |
|
| ... | ... | @@ -264,9 +265,9 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement |
| 264 | 265 |
if (!tripIds1.isEmpty()) {
|
| 265 | 266 |
|
| 266 | 267 |
builder.deleteTablesBuilder()
|
| 267 |
- .setTables(topiaApplicationContext.getTripLonglineTables())
|
|
| 268 |
- .setSelectArgument(TopiaSqlTableSelectArgument.of(tripIds1))
|
|
| 269 |
- .flush();
|
|
| 268 |
+ .setTables(topiaApplicationContext.getTripLonglineTables())
|
|
| 269 |
+ .setSelectArgument(TopiaSqlTableSelectArgument.of(tripIds1))
|
|
| 270 |
+ .flush();
|
|
| 270 | 271 |
|
| 271 | 272 |
}
|
| 272 | 273 |
|
| ... | ... | @@ -169,7 +169,7 @@ observe.common.startLogValue=Corredera de mañana (millas) |
| 169 | 169 |
observe.common.startTime=Fecha - Heuro de inicio de validez
|
| 170 | 170 |
observe.common.status=Estado
|
| 171 | 171 |
observe.common.stomacFullness=Nivel de llenado del estomago
|
| 172 |
-observe.common.supportVesselName=Nombre del supply
|
|
| 172 |
+observe.common.supportVesselName=Nombre del macicero
|
|
| 173 | 173 |
observe.common.surroundingActivity=Actividad circundante
|
| 174 | 174 |
observe.common.swivelWeight=Peso de el destorcedor (kg)
|
| 175 | 175 |
observe.common.targetCatch=Captura de atún
|
| ... | ... | @@ -590,12 +590,12 @@ validator.service.trip.invalid.formsUrl=La URL del formulario no es válida. |
| 590 | 590 |
validator.service.trip.invalid.loch=La corredera de mañana (%1$s) de la ruta %2$s debe ser superior a la de tarde (%3$s) de la ruta anterior.
|
| 591 | 591 |
validator.service.trip.invalid.reportsUrl=La URL del informe no es válida.
|
| 592 | 592 |
validator.service.trip.invalid.startDate=La fecha de comienzo de marea debe ser inferior al día de observación de cualquier ruta (la ruta %1$s es incorrecta).
|
| 593 |
-validator.service.trip.null.captain=Un capitán debe ser seleccionado.
|
|
| 593 |
+validator.service.trip.null.captain=Un patrón debe ser seleccionado.
|
|
| 594 | 594 |
validator.service.trip.null.dataEntryOperator=Un operador de captación debe ser seleccionado.
|
| 595 | 595 |
validator.service.trip.null.departureHarbour=Un puerto de salida debe ser seleccionado.
|
| 596 | 596 |
validator.service.trip.null.gearUseFeatureSeine=Usted no seleccionó un equipamiento (Senne aconsejado).
|
| 597 | 597 |
validator.service.trip.null.landingHarbour=Un puerto de llegada debe ser seleccionado.
|
| 598 |
-validator.service.trip.required.comment.for.captain=Se necesita un comentario para el capitán seleccionado.
|
|
| 598 |
+validator.service.trip.required.comment.for.captain=Se necesita un comentario para el patrón seleccionado.
|
|
| 599 | 599 |
validator.service.trip.required.comment.for.dataEntryOperator=Se necesita un comentario para el operador de captación seleccionado.
|
| 600 | 600 |
validator.service.trip.required.comment.for.departureHarbour=Se necesita un comentario para el puerto de salida seleccionado.
|
| 601 | 601 |
validator.service.trip.required.comment.for.landingHarbour=Se necesita un comentario para el puerto de llegada seleccionado.
|
| ... | ... | @@ -46,7 +46,6 @@ import com.google.gson.JsonPrimitive; |
| 46 | 46 |
import com.google.gson.JsonSerializationContext;
|
| 47 | 47 |
import com.google.gson.JsonSerializer;
|
| 48 | 48 |
import com.google.gson.JsonSyntaxException;
|
| 49 |
- |
|
| 50 | 49 |
import java.lang.reflect.Type;
|
| 51 | 50 |
import java.sql.Timestamp;
|
| 52 | 51 |
import java.text.DateFormat;
|
| ... | ... | @@ -54,7 +53,6 @@ import java.text.ParseException; |
| 54 | 53 |
import java.text.SimpleDateFormat;
|
| 55 | 54 |
import java.util.Date;
|
| 56 | 55 |
import java.util.Objects;
|
| 57 |
-import java.util.TimeZone;
|
|
| 58 | 56 |
|
| 59 | 57 |
/**
|
| 60 | 58 |
* This type adapter supports three subclasses of date: Date, Timestamp, and
|
| ... | ... | @@ -68,9 +66,8 @@ public class DateAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> |
| 68 | 66 |
|
| 69 | 67 |
private final DateFormat iso8601Format;
|
| 70 | 68 |
|
| 71 |
- public DateAdapter() {
|
|
| 69 |
+ DateAdapter() {
|
|
| 72 | 70 |
this.iso8601Format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
| 73 |
- this.iso8601Format.setTimeZone(TimeZone.getTimeZone("UTC"));
|
|
| 74 | 71 |
}
|
| 75 | 72 |
|
| 76 | 73 |
// These methods need to be synchronized since JDK DateFormat classes are not thread-safe
|