Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
57b3dc7f
by Tony CHEMIT at 2017-07-05T00:07:39+02:00
9 changed files:
- application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java
- application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SectionsTableModel.java
- application-swing/src/main/java/fr/ird/observe/application/swing/ui/storage/StorageUIModel.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/src/main/filtered-resources/mapping
- application-web/src/main/java/fr/ird/observe/application/web/controller/v1/PingServiceController.java
- services/src/main/java/fr/ird/observe/services/service/PingService.java
Changes:
| ... | ... | @@ -501,8 +501,8 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong |
| 501 | 501 |
|
| 502 | 502 |
template = sectionTemplates.get(0);
|
| 503 | 503 |
|
| 504 |
- boolean compiliantWithBasketCount = template.isCompiliantWithBasketCount(basketsCount);
|
|
| 505 |
- if (!compiliantWithBasketCount) {
|
|
| 504 |
+ boolean compliantWithBasketCount = template.isCompiliantWithBasketCount(basketsCount);
|
|
| 505 |
+ if (!compliantWithBasketCount) {
|
|
| 506 | 506 |
|
| 507 | 507 |
if (log.isWarnEnabled()) {
|
| 508 | 508 |
log.warn("sectionTemplate " + template + " is not compliant with basketCount: " + basketsCount);
|
| ... | ... | @@ -153,9 +153,9 @@ public class SectionsTableModel extends LonglineCompositionTableModelSupport<Sec |
| 153 | 153 |
|
| 154 | 154 |
// check if can use this template
|
| 155 | 155 |
int basketsCount = row.sizeBasket();
|
| 156 |
- boolean compiliantWithBasketCount = sectionTemplate.isCompiliantWithBasketCount(basketsCount);
|
|
| 156 |
+ boolean compliantWithBasketCount = sectionTemplate.isCompiliantWithBasketCount(basketsCount);
|
|
| 157 | 157 |
|
| 158 |
- if (!compiliantWithBasketCount) {
|
|
| 158 |
+ if (!compliantWithBasketCount) {
|
|
| 159 | 159 |
|
| 160 | 160 |
// We can't use this value
|
| 161 | 161 |
if (log.isWarnEnabled()) {
|
| ... | ... | @@ -76,6 +76,7 @@ import org.nuiton.jaxx.runtime.JAXXContext; |
| 76 | 76 |
import org.nuiton.jaxx.runtime.swing.wizard.WizardModel;
|
| 77 | 77 |
import org.nuiton.jaxx.runtime.swing.wizard.WizardUILancher;
|
| 78 | 78 |
import org.nuiton.version.Version;
|
| 79 |
+import org.nuiton.version.Versions;
|
|
| 79 | 80 |
|
| 80 | 81 |
|
| 81 | 82 |
import static fr.ird.observe.application.swing.ui.admin.AdminUIModel.LOG_PROPERTY_CHANGE_LISTENER;
|
| ... | ... | @@ -1684,17 +1685,34 @@ public class StorageUIModel extends WizardModel<StorageStep> { |
| 1684 | 1685 |
|
| 1685 | 1686 |
PingService pingService = dataSource.newPingService();
|
| 1686 | 1687 |
|
| 1687 |
- Version modelServerVersion = pingService.ping();
|
|
| 1688 |
- |
|
| 1689 |
- if (!getModelVersion().equals(modelServerVersion)) {
|
|
| 1688 |
+ Version serverVersion = pingService.getServerVersion();
|
|
| 1689 |
+ Version clientVersion = ObserveSwingApplicationContext.get().getConfig().getVersion();
|
|
| 1690 |
+ if (clientVersion.isSnapshot()) {
|
|
| 1691 |
+ clientVersion=Versions.removeSnapshot(clientVersion);
|
|
| 1692 |
+ }
|
|
| 1693 |
+ if (!Objects.equals(serverVersion, clientVersion)) {
|
|
| 1690 | 1694 |
|
| 1691 |
- connexionStatusError = t("observe.storage.error.serverVersionMismatch", modelServerVersion, getModelVersion());
|
|
| 1695 |
+ connexionStatusError = t("observe.storage.error.serverVersionMismatch", serverVersion, clientVersion);
|
|
| 1692 | 1696 |
|
| 1693 | 1697 |
setConnexionStatus(ConnexionStatus.FAILED);
|
| 1694 | 1698 |
|
| 1695 | 1699 |
error = true;
|
| 1696 | 1700 |
}
|
| 1697 | 1701 |
|
| 1702 |
+ if (!error) {
|
|
| 1703 |
+ |
|
| 1704 |
+ Version modelServerVersion = pingService.ping();
|
|
| 1705 |
+ |
|
| 1706 |
+ Version clientModelVersion = getModelVersion();
|
|
| 1707 |
+ if (!Objects.equals(clientModelVersion, modelServerVersion)) {
|
|
| 1708 |
+ |
|
| 1709 |
+ connexionStatusError = t("observe.storage.error.serverVersionModelMismatch", modelServerVersion, clientModelVersion);
|
|
| 1710 |
+ |
|
| 1711 |
+ setConnexionStatus(ConnexionStatus.FAILED);
|
|
| 1712 |
+ |
|
| 1713 |
+ error = true;
|
|
| 1714 |
+ }
|
|
| 1715 |
+ }
|
|
| 1698 | 1716 |
}
|
| 1699 | 1717 |
|
| 1700 | 1718 |
if (!error) {
|
| ... | ... | @@ -1684,13 +1684,14 @@ observe.storage.config.right.storage=Right data source configuration |
| 1684 | 1684 |
observe.storage.config.source.storage=Configuration of data source to update
|
| 1685 | 1685 |
observe.storage.config.target.storage=Configuration of target data source
|
| 1686 | 1686 |
observe.storage.error.badUrl=The url format is not valid (%s)
|
| 1687 |
-observe.storage.error.dbVersionMismatch=Version of remote database (%s) is not compiliant with the model version (%s)
|
|
| 1687 |
+observe.storage.error.dbVersionMismatch=Version of remote database (%s) is not compliant with the model version (%s)
|
|
| 1688 | 1688 |
observe.storage.error.rest.database.unknownForUser=Database "%s" is not defined for user "%s"
|
| 1689 | 1689 |
observe.storage.error.rest.password.bad=Password is not valid
|
| 1690 | 1690 |
observe.storage.error.rest.pasword.required=Password is mandatory
|
| 1691 | 1691 |
observe.storage.error.rest.user.required=User login is mandatory
|
| 1692 | 1692 |
observe.storage.error.rest.user.unknown=User "%s" is not defined on server
|
| 1693 |
-observe.storage.error.serverVersionMismatch=Remote server version (%s) is not compiliant with the model version (%s)
|
|
| 1693 |
+observe.storage.error.serverVersionMismatch=Remote server version (%s) is not compliant with the client version (%s)
|
|
| 1694 |
+observe.storage.error.serverVersionModelMismatch=Remote server model version (%s) is not compliant with the client model version (%s)
|
|
| 1694 | 1695 |
observe.storage.import.data.fromBackup=Import data from a backup of a local database (*.sql.gz)
|
| 1695 | 1696 |
observe.storage.import.data.fromRemoteStorage=Import data from a remote database
|
| 1696 | 1697 |
observe.storage.import.data.fromServerStorage=Import data from a remove server
|
| ... | ... | @@ -1693,6 +1693,7 @@ observe.storage.error.rest.pasword.required=Le contraseña es obligatoria |
| 1693 | 1693 |
observe.storage.error.rest.user.required=El usuario es obligatorio
|
| 1694 | 1694 |
observe.storage.error.rest.user.unknown=El usuario "%s" no es conocido del servidor
|
| 1695 | 1695 |
observe.storage.error.serverVersionMismatch=La versión del servidor remoto (%s) no es compatible con la versión del modelo (%s)
|
| 1696 |
+observe.storage.error.serverVersionModelMismatch=La version du modèle du serveur distant (%s) n'est pas compatible avec la version du modèle du client (%s) \#TODO
|
|
| 1696 | 1697 |
observe.storage.import.data.fromBackup=Importar los datos de una copia de seguridad de una base local (*.sql.gz)
|
| 1697 | 1698 |
observe.storage.import.data.fromRemoteStorage=Importar los datos de una base remota
|
| 1698 | 1699 |
observe.storage.import.data.fromServerStorage=Importar los datos de un servidor remoto
|
| ... | ... | @@ -1697,12 +1697,13 @@ observe.storage.error.rest.password.bad=Le mot de passe est invalide |
| 1697 | 1697 |
observe.storage.error.rest.pasword.required=Le mot de passe est obligatoire
|
| 1698 | 1698 |
observe.storage.error.rest.user.required=L'utilisateur est obligatoire
|
| 1699 | 1699 |
observe.storage.error.rest.user.unknown=L'utilisateur "%s" est inconnu sur le serveur
|
| 1700 |
-observe.storage.error.serverVersionMismatch=La version du serveur distant (%s) n'est pas compatible avec la version du modèle (%s)
|
|
| 1700 |
+observe.storage.error.serverVersionMismatch=La version du serveur distant (%s) n'est pas compatible avec la version du client (%s)
|
|
| 1701 |
+observe.storage.error.serverVersionModelMismatch=La version du modèle du serveur distant (%s) n'est pas compatible avec la version du modèle du client (%s)
|
|
| 1701 | 1702 |
observe.storage.import.data.fromBackup=Importer les données depuis une sauvegarde de base locale (*.sql.gz)
|
| 1702 | 1703 |
observe.storage.import.data.fromRemoteStorage=Importer les données depuis une base distante
|
| 1703 | 1704 |
observe.storage.import.data.fromServerStorage=Importer les données depuis un serveur distant
|
| 1704 | 1705 |
observe.storage.importExternalDump.config=Sélection de la sauvegarde à utiliser
|
| 1705 |
-observe.storage.importExternalDump.description=Veuillez sélectionner le fichier d'une sauvegarde (*.sql.gz).
|
|
| 1706 |
+observe.storage.importExternalDump.description=Veuillez sélectionner le fichier d'une sauvegarde (*.sql.gz).
|
|
| 1706 | 1707 |
observe.storage.importExternalDumpData.config=Choisir la sauvegarde contenant les données à importer
|
| 1707 | 1708 |
observe.storage.importExternalDumpReferentiel.config=Choisir la sauvegarde contenant le référentiel à importer
|
| 1708 | 1709 |
observe.storage.importRemoteStorage.config=Sélection de la base distante à importer
|
| ... | ... | @@ -76,6 +76,7 @@ GET /api/v1/DataSourceService/migrateData |
| 76 | 76 |
GET /api/v1/DataSourceService/open v1.DataSourceServiceController.open
|
| 77 | 77 |
GET /api/v1/LastUpdateDateService/updateDataLastUpdateDates v1.LastUpdateDateServiceController.updateDataLastUpdateDates
|
| 78 | 78 |
GET /api/v1/LastUpdateDateService/updateReferentialLastUpdateDates v1.LastUpdateDateServiceController.updateReferentialLastUpdateDates
|
| 79 |
+GET /api/v1/PingService/getServerVersion v1.PingServiceController.getServerVersion
|
|
| 79 | 80 |
GET /api/v1/PingService/ping v1.PingServiceController.ping
|
| 80 | 81 |
GET /api/v1/actions/synchro/referential/diff/ReferentialSynchronizeDiffService/getEnabledReferentialReferenceSet v1.actions.synchro.referential.diff.ReferentialSynchronizeDiffServiceController.getEnabledReferentialReferenceSet
|
| 81 | 82 |
GET /api/v1/actions/synchro/referential/diff/ReferentialSynchronizeDiffService/getSourceReferentialStates v1.actions.synchro.referential.diff.ReferentialSynchronizeDiffServiceController.getSourceReferentialStates
|
| ... | ... | @@ -22,10 +22,10 @@ package fr.ird.observe.application.web.controller.v1; |
| 22 | 22 |
* #L%
|
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 |
-import fr.ird.observe.application.web.configuration.ObserveWebApplicationConfig;
|
|
| 26 | 25 |
import fr.ird.observe.application.web.controller.ObserveWebMotionController;
|
| 27 | 26 |
import fr.ird.observe.services.service.PingService;
|
| 28 | 27 |
import org.nuiton.version.Version;
|
| 28 |
+import org.nuiton.version.Versions;
|
|
| 29 | 29 |
|
| 30 | 30 |
/**
|
| 31 | 31 |
* Created on 06/09/15.
|
| ... | ... | @@ -34,11 +34,16 @@ import org.nuiton.version.Version; |
| 34 | 34 |
*/
|
| 35 | 35 |
public class PingServiceController extends ObserveWebMotionController implements PingService {
|
| 36 | 36 |
|
| 37 |
+ @Override
|
|
| 37 | 38 |
public Version ping() {
|
| 39 |
+ return getApplicationConfiguration().getModelVersion();
|
|
| 40 |
+ }
|
|
| 38 | 41 |
|
| 39 |
- ObserveWebApplicationConfig configuration = getApplicationConfiguration();
|
|
| 40 |
- |
|
| 41 |
- return configuration.getModelVersion();
|
|
| 42 |
+ @Override
|
|
| 43 |
+ public Version getServerVersion() {
|
|
| 44 |
+ Version buildVersion = getApplicationConfiguration().getBuildVersion();
|
|
| 45 |
+ return buildVersion.isSnapshot() ? Versions.removeSnapshot(buildVersion) : buildVersion;
|
|
| 42 | 46 |
}
|
| 43 | 47 |
|
| 48 |
+ |
|
| 44 | 49 |
}
|
| ... | ... | @@ -36,4 +36,7 @@ public interface PingService extends ObserveService { |
| 36 | 36 |
@NoDataAccess
|
| 37 | 37 |
Version ping();
|
| 38 | 38 |
|
| 39 |
+ @NoDataAccess
|
|
| 40 |
+ Version getServerVersion();
|
|
| 41 |
+ |
|
| 39 | 42 |
}
|