Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
2cade367
by Tony CHEMIT at 2017-07-26T13:43:11+02:00
-
90699b0c
by Tony CHEMIT at 2017-07-26T13:47:43+02:00
-
8a625d36
by Tony CHEMIT at 2017-07-26T13:48:18+02:00
11 changed files:
- CONTRIBUTING.md
- application-swing-configuration/src/main/config/ObserveSwingApplication.ini
- application-swing-configuration/src/main/resources/i18n/application-swing-configuration_en_GB.properties
- application-swing-configuration/src/main/resources/i18n/application-swing-configuration_es_ES.properties
- application-swing-configuration/src/main/resources/i18n/application-swing-configuration_fr_FR.properties
- application-swing/src/main/java/fr/ird/observe/application/swing/FloatingObjectReferencesManager.java
- application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/menu/config/ShowConfigAction.java
- application-swing/src/main/java/fr/ird/observe/application/swing/ui/storage/StorageUIModel.java
- application-web/src/main/filtered-resources/mapping
- services-topia/src/main/java/fr/ird/observe/services/topia/service/data/seine/FloatingObjectServiceTopia.java
- services/src/main/java/fr/ird/observe/services/service/data/seine/FloatingObjectService.java
Changes:
| ... | ... | @@ -48,6 +48,14 @@ wget -q -O - https://gitlab.com/ultreiaio/pom/raw/master/bin/update-staging-chan |
| 48 | 48 |
mvn clean verify site -DperformRelease scm-publish:publish-scm
|
| 49 | 49 |
```
|
| 50 | 50 |
|
| 51 |
+# Deploy latest demo
|
|
| 52 |
+ |
|
| 53 |
+```
|
|
| 54 |
+wget -q -O - https://gitlab.com/ultreiaio/pom/raw/master/bin/execute-maven.sh | sed 's/$1/-Padd-git-commit-id-to-project-version -N/' | bash
|
|
| 55 |
+wget -q -O - https://gitlab.com/ultreiaio/pom/raw/master/bin/execute-maven.sh | sed 's/$1/install -am -pl application-web -DskipTests -Pdeploy-demo -Dclassifier=latest/' | bash
|
|
| 56 |
+```
|
|
| 57 |
+ |
|
| 58 |
+ |
|
| 51 | 59 |
# Add a referential
|
| 52 | 60 |
|
| 53 | 61 |
Example for *seine.ObjectMaterialType* on version *6.901*
|
| ... | ... | @@ -520,6 +520,12 @@ key = http.timeout |
| 520 | 520 |
type = int
|
| 521 | 521 |
defaultValue = 30000
|
| 522 | 522 |
|
| 523 |
+[option checkServerVersion]
|
|
| 524 |
+description = observe.config.checkServerVersion.description
|
|
| 525 |
+key = server.checkServerVersion
|
|
| 526 |
+type = Boolean
|
|
| 527 |
+defaultValue = true
|
|
| 528 |
+ |
|
| 523 | 529 |
[action help]
|
| 524 | 530 |
description = observe.action.commandline.help
|
| 525 | 531 |
action = "fr.ird.observe.application.swing.ObserveCLAction#help"
|
| ... | ... | @@ -15,6 +15,7 @@ observe.config.backupsFile.description=File to store backups informations |
| 15 | 15 |
observe.config.build.date=Build date
|
| 16 | 16 |
observe.config.build.number=Build number
|
| 17 | 17 |
observe.config.build.version=Build version
|
| 18 |
+observe.config.checkServerVersion.description=Should we check client and server version exact match ?
|
|
| 18 | 19 |
observe.config.configFileName.description=Configuration filename
|
| 19 | 20 |
observe.config.coordinate.format=Position format (DMD, DD, DMS)
|
| 20 | 21 |
observe.config.db.locale=Language of data source
|
| ... | ... | @@ -15,6 +15,7 @@ observe.config.backupsFile.description=File to store backups informations \#TODO |
| 15 | 15 |
observe.config.build.date=Build date \#TODO
|
| 16 | 16 |
observe.config.build.number=Build number \#TODO
|
| 17 | 17 |
observe.config.build.version=Build version \#TODO
|
| 18 |
+observe.config.checkServerVersion.description=Should we check client and server version exact match ? \#TODO
|
|
| 18 | 19 |
observe.config.configFileName.description=Nombre del archivo de configuración
|
| 19 | 20 |
observe.config.coordinate.format=Position format (DMD, DD, DMS) \#TODO
|
| 20 | 21 |
observe.config.db.locale=Idioma del referencial
|
| ... | ... | @@ -15,6 +15,7 @@ observe.config.backupsFile.description=Fichier des informations des sauvegardes |
| 15 | 15 |
observe.config.build.date=Date de version
|
| 16 | 16 |
observe.config.build.number=Numéro de build
|
| 17 | 17 |
observe.config.build.version=Numéro de version
|
| 18 |
+observe.config.checkServerVersion.description=Vérifier la correspondance exacte entre les versions du client et serveur REST ?
|
|
| 18 | 19 |
observe.config.configFileName.description=Le nom du fichier de configuration
|
| 19 | 20 |
observe.config.coordinate.format=Format des positions (DMD, DD, DMS)
|
| 20 | 21 |
observe.config.db.locale=La langue du référentiel
|
| ... | ... | @@ -73,7 +73,8 @@ public class FloatingObjectReferencesManager { |
| 73 | 73 |
|
| 74 | 74 |
void sanitize(ObserveSwingDataSource dataSource) {
|
| 75 | 75 |
|
| 76 |
- Set<String> ids = dataSource.newFloatingObjectService().getAllIds();
|
|
| 76 |
+ Set<String> existingIds = references.stream().map(FloatingObjectReference::getFloatingObjectId).collect(Collectors.toSet());
|
|
| 77 |
+ Set<String> ids = dataSource.newFloatingObjectService().retainExistingIds(existingIds);
|
|
| 77 | 78 |
int beforeSize = references.size();
|
| 78 | 79 |
|
| 79 | 80 |
references.removeIf(reference -> !ids.contains(reference.getFloatingObjectId()));
|
| ... | ... | @@ -268,6 +268,7 @@ public class ShowConfigAction extends AbstractUIAction { |
| 268 | 268 |
helper.addOption(ObserveSwingApplicationConfigOption.BACKUP_USE);
|
| 269 | 269 |
helper.addOption(ObserveSwingApplicationConfigOption.BACKUP_DELAY);
|
| 270 | 270 |
helper.addOption(ObserveSwingApplicationConfigOption.BACKUP_AT_CLOSE);
|
| 271 |
+ helper.addOption(ObserveSwingApplicationConfigOption.CHECK_SERVER_VERSION);
|
|
| 271 | 272 |
|
| 272 | 273 |
helper.addOption(ObserveSwingApplicationConfigOption.CHANGE_SYNCHRO_SRC);
|
| 273 | 274 |
helper.addOption(ObserveSwingApplicationConfigOption.H2_CAN_MIGRATE);
|
| ... | ... | @@ -1690,7 +1690,7 @@ public class StorageUIModel extends WizardModel<StorageStep> { |
| 1690 | 1690 |
if (clientVersion.isSnapshot()) {
|
| 1691 | 1691 |
clientVersion = Versions.removeSnapshot(clientVersion);
|
| 1692 | 1692 |
}
|
| 1693 |
- if (!Objects.equals(serverVersion, clientVersion)) {
|
|
| 1693 |
+ if (ObserveSwingApplicationContext.get().getConfig().isCheckServerVersion() && !Objects.equals(serverVersion, clientVersion)) {
|
|
| 1694 | 1694 |
|
| 1695 | 1695 |
connexionStatusError = t("observe.storage.error.serverVersionMismatch", serverVersion, clientVersion);
|
| 1696 | 1696 |
|
| ... | ... | @@ -152,7 +152,6 @@ GET /api/v1/data/seine/ActivitySeineService/preCreate |
| 152 | 152 |
POST /api/v1/data/seine/ActivitySeineService/save v1.data.seine.ActivitySeineServiceRestApi.save
|
| 153 | 153 |
DELETE /api/v1/data/seine/FloatingObjectService/delete v1.data.seine.FloatingObjectServiceRestApi.delete
|
| 154 | 154 |
GET /api/v1/data/seine/FloatingObjectService/exists v1.data.seine.FloatingObjectServiceRestApi.exists
|
| 155 |
-GET /api/v1/data/seine/FloatingObjectService/getAllIds v1.data.seine.FloatingObjectServiceRestApi.getAllIds
|
|
| 156 | 155 |
GET /api/v1/data/seine/FloatingObjectService/getFloatingObjectByActivitySeine v1.data.seine.FloatingObjectServiceRestApi.getFloatingObjectByActivitySeine
|
| 157 | 156 |
GET /api/v1/data/seine/FloatingObjectService/getFloatingObjectPartByFloatingObject v1.data.seine.FloatingObjectServiceRestApi.getFloatingObjectPartByFloatingObject
|
| 158 | 157 |
GET /api/v1/data/seine/FloatingObjectService/getObjectMaterialHierarchyForDetailedForm v1.data.seine.FloatingObjectServiceRestApi.getObjectMaterialHierarchyForDetailedForm
|
| ... | ... | @@ -161,6 +160,7 @@ GET /api/v1/data/seine/FloatingObjectService/loadDto |
| 161 | 160 |
GET /api/v1/data/seine/FloatingObjectService/loadForm v1.data.seine.FloatingObjectServiceRestApi.loadForm
|
| 162 | 161 |
GET /api/v1/data/seine/FloatingObjectService/loadReferenceToRead v1.data.seine.FloatingObjectServiceRestApi.loadReferenceToRead
|
| 163 | 162 |
GET /api/v1/data/seine/FloatingObjectService/preCreate v1.data.seine.FloatingObjectServiceRestApi.preCreate
|
| 163 |
+GET /api/v1/data/seine/FloatingObjectService/retainExistingIds v1.data.seine.FloatingObjectServiceRestApi.retainExistingIds
|
|
| 164 | 164 |
POST /api/v1/data/seine/FloatingObjectService/save v1.data.seine.FloatingObjectServiceRestApi.save
|
| 165 | 165 |
POST /api/v1/data/seine/FloatingObjectService/save v1.data.seine.FloatingObjectServiceRestApi.save
|
| 166 | 166 |
GET /api/v1/data/seine/NonTargetCatchReleaseService/getSampleSpecies v1.data.seine.NonTargetCatchReleaseServiceRestApi.getSampleSpecies
|
| ... | ... | @@ -102,8 +102,10 @@ public class FloatingObjectServiceTopia extends ObserveServiceTopia implements F |
| 102 | 102 |
}
|
| 103 | 103 |
|
| 104 | 104 |
@Override
|
| 105 |
- public Set<String> getAllIds() {
|
|
| 106 |
- return new LinkedHashSet<>(getTopiaPersistenceContext().getFloatingObjectDao().findAllIds());
|
|
| 105 |
+ public Set<String> retainExistingIds(Set<String> existingIds) {
|
|
| 106 |
+ LinkedHashSet<String> result = new LinkedHashSet<>(existingIds);
|
|
| 107 |
+ result.retainAll(getTopiaPersistenceContext().getFloatingObjectDao().findAllIds());
|
|
| 108 |
+ return result;
|
|
| 107 | 109 |
}
|
| 108 | 110 |
|
| 109 | 111 |
@Override
|
| ... | ... | @@ -63,7 +63,7 @@ public interface FloatingObjectService extends ObserveService { |
| 63 | 63 |
|
| 64 | 64 |
@Get
|
| 65 | 65 |
@ReadDataPermission
|
| 66 |
- Set<String> getAllIds();
|
|
| 66 |
+ Set<String> retainExistingIds(Set<String> existingIds);
|
|
| 67 | 67 |
|
| 68 | 68 |
@Get
|
| 69 | 69 |
@ReadDataPermission
|