mailman.cloud.codelutin.com
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Observe-commits

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2013 -----
  • December
  • November
  • October
  • September
observe-commits@list.forge.codelutin.com

  • 7199 discussions
[Git][ultreiaio/ird-observe][develop-7.x] [REFERENTIEL] La validation sur les Objets flottant matériaux ne fonctionnent...
by Tony CHEMIT 03 Jul '19

03 Jul '19
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe Commits: 9f2ad3db by tchemit at 2019-07-03T15:50:34Z [REFERENTIEL] La validation sur les Objets flottant matériaux ne fonctionnent plus :( - Closes #1339 - - - - - 2 changed files: - dto/src/main/java/fr/ird/observe/dto/referential/seine/ObjectMaterialDto.java - services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java Changes: ===================================== dto/src/main/java/fr/ird/observe/dto/referential/seine/ObjectMaterialDto.java ===================================== @@ -22,9 +22,13 @@ package fr.ird.observe.dto.referential.seine; * #L% */ -import fr.ird.observe.dto.referential.FormulaHelper; import org.apache.commons.lang3.StringUtils; +import javax.script.Bindings; +import javax.script.ScriptContext; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; + public class ObjectMaterialDto extends GeneratedObjectMaterialDto { private static final long serialVersionUID = 1L; @@ -48,7 +52,15 @@ public class ObjectMaterialDto extends GeneratedObjectMaterialDto { @Override public void setValidation(String validation) { super.setValidation(validation); - boolean result = FormulaHelper.validateObjectMaterialValidation(validation, 10); + Object value = "10"; + if (isBoolean()) { + value = Boolean.TRUE; + } else if (isInteger()) { + value = 10; + }else if (isFloat()) { + value = 10f; + } + boolean result = validateObjectMaterialValidation(validation, value); setValidationValid(result); } @@ -64,4 +76,34 @@ public class ObjectMaterialDto extends GeneratedObjectMaterialDto { return parent != null && parent.getParentId() != null; } + /** moteur d'évaluation d'expression */ + private static ScriptEngine scriptEngine; + + + private static ScriptEngine getScriptEngine() { + if (scriptEngine == null) { + ScriptEngineManager factory = new ScriptEngineManager(); + + scriptEngine = factory.getEngineByExtension("js"); + } + return scriptEngine; + } + + public static boolean validateObjectMaterialValidation(String relation, Object value) { + if (!StringUtils.isEmpty(relation)) { + + ScriptEngine engine = getScriptEngine(); + Bindings bindings = engine.createBindings(); + bindings.put("x", value); + + try { + engine.setBindings(bindings, ScriptContext.ENGINE_SCOPE); + Boolean o = (Boolean) engine.eval(relation); + return true; + } catch (Exception e) { + return false; + } + } + return false; + } } ===================================== services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java ===================================== @@ -183,7 +183,7 @@ public class ValidateServiceLocalTest extends ServiceLocalTestSupport { assertValidateResult(result, GearCaracteristicTypeDto.class, 2); assertValidateResult(result, ObjectOperationDto.class, 2); assertValidateResult(result, SpeciesListDto.class, 2); - assertValidateResult(result, ObjectMaterialDto.class, 10); + assertValidateResult(result, ObjectMaterialDto.class, 9); assertValidateResult(result, TransmittingBuoyOperationDto.class, 3); assertValidateResult(result, HookPositionDto.class, 1); assertValidateResult(result, FpaZoneDto.class, 5); View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/9f2ad3dbea960391b123dbbc658… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/9f2ad3dbea960391b123dbbc658… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop-7.x] [REFERENTIEL] La validation sur les Objets flottant matériaux ne fonctionnent...
by Tony CHEMIT 03 Jul '19

03 Jul '19
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe Commits: db31fe17 by tchemit at 2019-07-03T15:39:45Z [REFERENTIEL] La validation sur les Objets flottant matériaux ne fonctionnent plus :( - Closes #1339 - - - - - 1 changed file: - dto/src/main/java/fr/ird/observe/dto/referential/seine/ObjectMaterialDto.java Changes: ===================================== dto/src/main/java/fr/ird/observe/dto/referential/seine/ObjectMaterialDto.java ===================================== @@ -22,9 +22,13 @@ package fr.ird.observe.dto.referential.seine; * #L% */ -import fr.ird.observe.dto.referential.FormulaHelper; import org.apache.commons.lang3.StringUtils; +import javax.script.Bindings; +import javax.script.ScriptContext; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; + public class ObjectMaterialDto extends GeneratedObjectMaterialDto { private static final long serialVersionUID = 1L; @@ -48,7 +52,15 @@ public class ObjectMaterialDto extends GeneratedObjectMaterialDto { @Override public void setValidation(String validation) { super.setValidation(validation); - boolean result = FormulaHelper.validateObjectMaterialValidation(validation, 10); + Object value = "10"; + if (isBoolean()) { + value = Boolean.TRUE; + } else if (isInteger()) { + value = 10; + }else if (isFloat()) { + value = 10f; + } + boolean result = validateObjectMaterialValidation(validation, value); setValidationValid(result); } @@ -64,4 +76,34 @@ public class ObjectMaterialDto extends GeneratedObjectMaterialDto { return parent != null && parent.getParentId() != null; } + /** moteur d'évaluation d'expression */ + private static ScriptEngine scriptEngine; + + + private static ScriptEngine getScriptEngine() { + if (scriptEngine == null) { + ScriptEngineManager factory = new ScriptEngineManager(); + + scriptEngine = factory.getEngineByExtension("js"); + } + return scriptEngine; + } + + public static boolean validateObjectMaterialValidation(String relation, Object value) { + if (!StringUtils.isEmpty(relation)) { + + ScriptEngine engine = getScriptEngine(); + Bindings bindings = engine.createBindings(); + bindings.put("x", value); + + try { + engine.setBindings(bindings, ScriptContext.ENGINE_SCOPE); + Boolean o = (Boolean) engine.eval(relation); + return true; + } catch (Exception e) { + return false; + } + } + return false; + } } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/db31fe17f54df0f5c7678242cda… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/db31fe17f54df0f5c7678242cda… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop-7.x] [FOB] Découpler la gestion de la hiérarchie FOB des codes métier - Closes #1342
by Tony CHEMIT 03 Jul '19

03 Jul '19
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe Commits: 04fde970 by tchemit at 2019-07-03T15:14:29Z [FOB] Découpler la gestion de la hiérarchie FOB des codes métier - Closes #1342 - - - - - 1 changed file: - pom.xml Changes: ===================================== pom.xml ===================================== @@ -155,7 +155,7 @@ <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format> <buildDate>${maven.build.timestamp}</buildDate> - <observeToolkitVersion>3.7.19-SNAPSHOT</observeToolkitVersion> + <observeToolkitVersion>3.7.19</observeToolkitVersion> <!--<lib.version.java4all.http>1.0.13</lib.version.java4all.http>--> <lib.version.nuiton.validation>3.1</lib.version.nuiton.validation> <!--<lib.version.java4all.config>1.0.3</lib.version.java4all.config>--> @@ -165,7 +165,7 @@ <lib.version.java4all.eugene>3.0-alpha-26</lib.version.java4all.eugene> <!--lib.version.java4all.jaxx>3.0-alpha-50</lib.version.java4all.jaxx--> <!--<lib.version.java4all.i18n>4.0-beta-8-SNAPSHOT</lib.version.java4all.i18n>--> - <lib.version.java4all.topia>1.1.15-SNAPSHOT</lib.version.java4all.topia> + <lib.version.java4all.topia>1.1.15</lib.version.java4all.topia> <!--<lib.version.nuiton.topia>3.6-SNAPSHOT</lib.version.nuiton.topia>--> <!--<lib.version.java4all.eugene>3.0-alpha-21</lib.version.java4all.eugene>--> View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/04fde970f33e186165c05e92e81… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/04fde970f33e186165c05e92e81… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop-7.x] 3 commits: update pom
by Tony CHEMIT 03 Jul '19

03 Jul '19
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe Commits: 603c4e88 by tchemit at 2019-07-03T12:56:02Z update pom - - - - - 4d449fa3 by tchemit at 2019-07-03T13:26:13Z On ne peut pas sauvegarder une configuration d&#39;un serveur distant en mode admin - Closes #1340 - - - - - 5f9d6431 by tchemit at 2019-07-03T14:02:14Z L&#39;assistant migration via serveur pourrait refuser de continuer si l&#39;utilisateur n&#39;est pas assez acrédité - Closes #1145 Assistant création de base PG échoue - Closes #1331 - - - - - 16 changed files: - client-core/src/main/i18n/getters/java.getter - client-core/src/main/java/fr/ird/observe/client/db/ObserveDataSourcesManager.java - client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java - client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/SaveCurrentServerConfigurationUIAction.java - client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/TestRemoteUIAction.java - client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/TestServerUIAction.java - client-core/src/main/java/fr/ird/observe/client/ui/admin/config/ConfigModel.java - client-core/src/main/java/fr/ird/observe/client/ui/storage/StorageUIHandler.java - client-core/src/main/java/fr/ird/observe/client/ui/storage/StorageUIModel.java - observe-i18n/src/main/i18n/translations/observe_en_GB.properties - observe-i18n/src/main/i18n/translations/observe_es_ES.properties - observe-i18n/src/main/i18n/translations/observe_fr_FR.properties - pom.xml - server-core/src/main/filtered-resources/mapping - services-local/src/main/java/fr/ird/observe/services/local/service/DataSourceServiceLocal.java - services/src/main/java/fr/ird/observe/services/service/DataSourceService.java Changes: ===================================== client-core/src/main/i18n/getters/java.getter ===================================== @@ -800,6 +800,7 @@ observe.storage.error.rest.user.required observe.storage.error.rest.user.unknown observe.storage.error.serverVersionMismatch observe.storage.error.serverVersionModelMismatch +observe.storage.error.user.not.owner observe.storage.internalDump.last.modified observe.storage.internalDump.not.exist observe.storage.label.data.import.db ===================================== client-core/src/main/java/fr/ird/observe/client/db/ObserveDataSourcesManager.java ===================================== @@ -37,7 +37,6 @@ import fr.ird.observe.client.ui.ObserveUIMode; import fr.ird.observe.client.ui.actions.main.menu.storage.ChangeStorageAction; import fr.ird.observe.client.ui.storage.StorageUIModel; import fr.ird.observe.client.ui.util.ProgressModel; -import org.nuiton.topia.persistence.script.TopiaSqlScript; import fr.ird.observe.services.ObserveDataSourceConfigurationMainFactory; import fr.ird.observe.services.configuration.DataSourceCreateConfigurationDto; import fr.ird.observe.services.configuration.ObserveDataSourceConfiguration; @@ -48,6 +47,7 @@ import fr.ird.observe.services.configuration.topia.ObserveDataSourceConfiguratio import fr.ird.observe.services.service.BabModelVersionException; import fr.ird.observe.services.service.DatabaseConnexionNotAuthorizedException; import fr.ird.observe.services.service.DatabaseNotFoundException; +import org.nuiton.topia.persistence.script.TopiaSqlScript; import javax.swing.JLabel; import javax.swing.JOptionPane; @@ -123,7 +123,9 @@ public class ObserveDataSourcesManager implements Closeable { dataSource = newDataSource(configuration); break; } - + if (model.getDataSourceInformation() != null) { + dataSource.setOwner(model.getDataSourceInformation().isOwner()); + } return dataSource; } @@ -291,8 +293,8 @@ public class ObserveDataSourcesManager implements Closeable { try { - ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(); - + ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(false); + dataSource.setOwner(dataSourceInformation.isOwner()); dataSource.migrateDataIfPossible(dataSourceInformation, config.getModelVersion()); // la source sera utilisée dans les ui @@ -358,7 +360,8 @@ public class ObserveDataSourcesManager implements Closeable { try { - ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(); + ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(false); + dataSource.setOwner(dataSourceInformation.isOwner()); dataSource.migrateData(dataSourceInformation, config.getModelVersion()); @@ -704,6 +707,7 @@ public class ObserveDataSourcesManager implements Closeable { } } + @SuppressWarnings({"unused", "WeakerAccess"}) public static class InitStorageModel { private final File localDb; private final BackupStorage lastAutomaticBackup; @@ -724,7 +728,7 @@ public class ObserveDataSourcesManager implements Closeable { return lastAutomaticBackup != null; } - String getBackupDate() { + public String getBackupDate() { return Optional.ofNullable(lastAutomaticBackup).map(l -> simpleDateFormat.format(l.getDate())).orElse(""); } } ===================================== client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java ===================================== @@ -10,12 +10,12 @@ package fr.ird.observe.client.db; * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. @@ -120,12 +120,9 @@ import static io.ultreia.java4all.i18n.I18n.t; */ public class ObserveSwingDataSource extends AbstractSerializableBean implements Closeable, ObserveServicesProvider { + public static final ObserveServicesProvider MAIN = new ObserveMainDataSourceServicesProvider(); private static final long serialVersionUID = 1L; - private static final Logger log = LogManager.getLogger(ObserveSwingDataSource.class); - - public static final ObserveServicesProvider MAIN = new ObserveMainDataSourceServicesProvider(); - private final EventListenerList listenerList; private final ObserveDataSourceConfiguration configuration; @@ -143,6 +140,7 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements // indique si une modification a été effectuéé sur la base depuis son ouverture private boolean modified; + private boolean owner; public ObserveSwingDataSource(ObserveDataSourceConfiguration configuration) { this.configuration = configuration; @@ -208,6 +206,7 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements canWriteReferential(), canReadData(), canWriteData(), + isOwner(), getVersion(), getVersion(), ImmutableList.of()); @@ -249,7 +248,7 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements @Override public void close() { - if (connection==null) { + if (connection == null) { return; } checkIsOpen(); @@ -368,6 +367,10 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements } + public boolean isOwner() { + return owner; + } + void migrateDataIfPossible(ObserveDataSourceInformation dataSourceInformation, Version targetVersion) { checkIsNotOpen(); @@ -398,39 +401,30 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements } public <D extends IdDto> ImmutableDtoMap<ReferentialDtoReferenceSet<?>> updateReferentialReferenceSetsCache(Class<D> dtoType) { - ReferentialService referentialService = servicesProvider.getReferentialService(); return referentialCache.loadReferenceSets(referentialService, dtoType); - } - private <R extends ReferentialDtoReference> ReferentialDtoReferenceSet<R> getReferentialReferenceSet(Class<R> type) { - + @SuppressWarnings("unchecked") + public <R extends ReferentialDtoReference> ReferentialDtoReferenceSet<R> getReferentialReferenceSet(Class<R> type) { checkIsOpen(); - ReferentialService referentialService = servicesProvider.getReferentialService(); return referentialCache.getReferentialReferenceSet(referentialService, type); } public <R extends ReferentialDtoReference> Set<R> getReferentialReferences(Class<R> type) { - ReferentialDtoReferenceSet<R> referentialReferenceSet = getReferentialReferenceSet(type); return referentialReferenceSet.toSet(); - } public boolean isOpen() { return connection != null; } - public ObserveDataSourceInformation checkCanConnect() throws DatabaseConnexionNotAuthorizedException, DatabaseNotFoundException { - + public ObserveDataSourceInformation checkCanConnect(boolean canBeEmpty) throws DatabaseConnexionNotAuthorizedException, DatabaseNotFoundException { checkIsNotAlreadyOpen(); - DataSourceService dataSourceService = servicesProvider.getDataSourceService(); - - return dataSourceService.checkCanConnect(configuration); - + return canBeEmpty ? dataSourceService.checkCanConnectOrBeEmpty(configuration) : dataSourceService.checkCanConnect(configuration); } public boolean isLocal() { @@ -454,9 +448,7 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements } public void removeObserveSwingDataSourceListener(ObserveSwingDataSourceListener listener) { - if (log.isInfoEnabled()) { - log.info("removing listener " + listener); - } + log.info("removing listener " + listener); listenerList.remove(ObserveSwingDataSourceListener.class, listener); } @@ -782,4 +774,8 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements public void setProgressModel(ProgressModel progressModel) { this.progressModel = progressModel; } + + public void setOwner(boolean owner) { + this.owner = owner; + } } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/SaveCurrentServerConfigurationUIAction.java ===================================== @@ -22,6 +22,7 @@ package fr.ird.observe.client.ui.actions.storage; * #L% */ +import fr.ird.observe.client.ObserveSwingApplicationContext; import fr.ird.observe.client.ui.ObserveMainUI; import fr.ird.observe.client.ui.actions.main.menu.MenuActionSupport; import fr.ird.observe.client.ui.storage.StorageUIModel; @@ -116,8 +117,7 @@ public class SaveCurrentServerConfigurationUIAction extends MenuActionSupport { configuration.setLogin(model.getRemoteLogin()); configuration.setPassword(new String(model.getRemotePassword())); configuration.setDatabaseName(model.getServerDatabase()); - getMainUI().getConfig().addServerDataSourceConfiguration(configuration); - + ObserveSwingApplicationContext.get().getConfig().addServerDataSourceConfiguration(configuration); configUI.getHandler().addServerConfiguration(getMainUI(), configuration, configUI.getServerMenu().getComponentCount() - 2); } } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/TestRemoteUIAction.java ===================================== @@ -67,7 +67,8 @@ public class TestRemoteUIAction extends PresetsUIActionSupport { ObserveSwingDataSource dataSource = ObserveSwingApplicationContext.get().getDataSourcesManager().newDataSource(config); try { - ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(); + ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(false); + dataSource.setOwner(dataSourceInformation.isOwner()); Version versionDataSource = dataSourceInformation.getVersion(); ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/TestServerUIAction.java ===================================== @@ -102,7 +102,7 @@ public class TestServerUIAction extends PresetsUIActionSupport { } if (connexionStatusError == null) { - ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(); + ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(false); Version versionDataSource = dataSourceInformation.getVersion(); ===================================== client-core/src/main/java/fr/ird/observe/client/ui/admin/config/ConfigModel.java ===================================== @@ -642,7 +642,7 @@ public class ConfigModel extends AdminActionModel { try { - localSourceInformation = localSource.checkCanConnect(); + localSourceInformation = localSource.checkCanConnect(false); } catch (Exception e) { //FIXME ! il faut faire quelque chose dans ce cas précis, au moins avertir l'utilisateur ===================================== client-core/src/main/java/fr/ird/observe/client/ui/storage/StorageUIHandler.java ===================================== @@ -554,8 +554,8 @@ public class StorageUIHandler implements UIHandler<StorageUI> { // si on utilise la base local on lance une migration de la base si necessaire if (DbMode.USE_LOCAL.equals((model.getDbMode()))) { - ObserveDataSourceInformation dataSourceInformation = currentDataSource.checkCanConnect(); - + ObserveDataSourceInformation dataSourceInformation = currentDataSource.checkCanConnect(false); + currentDataSource.setOwner(dataSourceInformation.isOwner()); progressModel.incrementsCurrentStep(); currentDataSource.migrateData(dataSourceInformation, config.getModelVersion()); ===================================== client-core/src/main/java/fr/ird/observe/client/ui/storage/StorageUIModel.java ===================================== @@ -1665,12 +1665,14 @@ public class StorageUIModel extends WizardModel<StorageStep> { if (!error) { - dataSourceInformation = dataSource.checkCanConnect(); + boolean createAction = ObstunaAdminAction.CREATE.equals(adminAction); + dataSourceInformation = dataSource.checkCanConnect(createAction); + dataSource.setOwner(dataSourceInformation.isOwner()); Version versionDataSource = dataSourceInformation.getVersion(); // en mise a jour de la base on ne test pas la version - if (getModelVersion().equals(versionDataSource) || isCanMigrate() || ObstunaAdminAction.CREATE.equals(adminAction)) { + if (isCanMigrate() || createAction || getModelVersion().equals(versionDataSource)) { setConnexionStatus(ConnexionStatus.SUCCESS); @@ -1738,6 +1740,16 @@ public class StorageUIModel extends WizardModel<StorageStep> { setBusy(false); } + if (result && dataSourceInformation != null && adminAction != null) { + + // must be owner of database to perform a such action + if (!dataSourceInformation.isOwner()) { + connexionStatusError = t("observe.storage.error.user.not.owner"); + log.error(connexionStatusError); + setConnexionStatus(ConnexionStatus.FAILED); + result = false; + } + } return result; } @@ -1949,7 +1961,7 @@ public class StorageUIModel extends WizardModel<StorageStep> { if (h2DataSourceInformation == null && localStorageExist) { ObserveSwingDataSource dataSource = ObserveSwingApplicationContext.get().getDataSourcesManager().newDataSource(h2Config); try { - h2DataSourceInformation = dataSource.checkCanConnect(); + h2DataSourceInformation = dataSource.checkCanConnect(false); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug("error on load data source information for local storage", e); ===================================== observe-i18n/src/main/i18n/translations/observe_en_GB.properties ===================================== @@ -2043,6 +2043,7 @@ observe.storage.error.rest.user.required=User login is mandatory observe.storage.error.rest.user.unknown=User "%s" is not defined on server observe.storage.error.serverVersionMismatch=Remote server version (%s) is not compliant with the client version (%s) observe.storage.error.serverVersionModelMismatch=Remote server model version (%s) is not compliant with the client model version (%s) +observe.storage.error.user.not.owner=User must be owner of database to perform this action\! observe.storage.import.data.fromBackup=Import data from a backup of a local database (*.sql.gz) observe.storage.import.data.fromRemoteStorage=Import data from a remote database observe.storage.import.data.fromServerStorage=Import data from a remove server ===================================== observe-i18n/src/main/i18n/translations/observe_es_ES.properties ===================================== @@ -2043,6 +2043,7 @@ observe.storage.error.rest.user.required=El usuario es obligatorio observe.storage.error.rest.user.unknown=El usuario "%s" no es conocido por el servidor observe.storage.error.serverVersionMismatch=La versión del servidor remoto (%s) no es compatible con la versión del modelo (%s) observe.storage.error.serverVersionModelMismatch=La versión del modelo del servidor remoto (%s) no es compatible con la versión del modelo (%s) +observe.storage.error.user.not.owner=User must be owner of database to perform this action\! \#TODO observe.storage.import.data.fromBackup=Importar los datos de una copia de seguridad de la base local (*.sql.gz) observe.storage.import.data.fromRemoteStorage=Importar los datos de una base remota observe.storage.import.data.fromServerStorage=Importar los datos de un servidor remoto ===================================== observe-i18n/src/main/i18n/translations/observe_fr_FR.properties ===================================== @@ -2043,6 +2043,7 @@ observe.storage.error.rest.user.required=L'utilisateur est obligatoire observe.storage.error.rest.user.unknown=L'utilisateur "%s" est inconnu sur le serveur observe.storage.error.serverVersionMismatch=La version du serveur distant (%s) n'est pas compatible avec la version du client (%s) 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) +observe.storage.error.user.not.owner=L'utilisateur doit être le propriétaire de la base pour effectuer cette opération \! observe.storage.import.data.fromBackup=Importer les données depuis une sauvegarde de base locale (*.sql.gz) observe.storage.import.data.fromRemoteStorage=Importer les données depuis une base distante observe.storage.import.data.fromServerStorage=Importer les données depuis un serveur distant ===================================== pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>io.ultreia.maven</groupId> <artifactId>pom</artifactId> - <version>2019.8.22</version> + <version>2019.8.23</version> </parent> <groupId>fr.ird.observe</groupId> @@ -155,7 +155,7 @@ <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format> <buildDate>${maven.build.timestamp}</buildDate> - <observeToolkitVersion>3.7.17</observeToolkitVersion> + <observeToolkitVersion>3.7.19-SNAPSHOT</observeToolkitVersion> <!--<lib.version.java4all.http>1.0.13</lib.version.java4all.http>--> <lib.version.nuiton.validation>3.1</lib.version.nuiton.validation> <!--<lib.version.java4all.config>1.0.3</lib.version.java4all.config>--> @@ -165,7 +165,7 @@ <lib.version.java4all.eugene>3.0-alpha-26</lib.version.java4all.eugene> <!--lib.version.java4all.jaxx>3.0-alpha-50</lib.version.java4all.jaxx--> <!--<lib.version.java4all.i18n>4.0-beta-8-SNAPSHOT</lib.version.java4all.i18n>--> - <lib.version.java4all.topia>1.1.14</lib.version.java4all.topia> + <lib.version.java4all.topia>1.1.15-SNAPSHOT</lib.version.java4all.topia> <!--<lib.version.nuiton.topia>3.6-SNAPSHOT</lib.version.nuiton.topia>--> <!--<lib.version.java4all.eugene>3.0-alpha-21</lib.version.java4all.eugene>--> ===================================== server-core/src/main/filtered-resources/mapping ===================================== @@ -56,6 +56,7 @@ GET /admin/configuration/resetAuthenticationTokens ConfigurationCo GET /api/v1/DataSourceService/applySecurity v1.DataSourceServiceRestApi.applySecurity GET /api/v1/DataSourceService/backup v1.DataSourceServiceRestApi.backup GET /api/v1/DataSourceService/checkCanConnect v1.DataSourceServiceRestApi.checkCanConnect +GET /api/v1/DataSourceService/checkCanConnectOrBeEmpty v1.DataSourceServiceRestApi.checkCanConnectOrBeEmpty GET /api/v1/DataSourceService/close v1.DataSourceServiceRestApi.close GET /api/v1/DataSourceService/create v1.DataSourceServiceRestApi.create GET /api/v1/DataSourceService/destroy v1.DataSourceServiceRestApi.destroy ===================================== services-local/src/main/java/fr/ird/observe/services/local/service/DataSourceServiceLocal.java ===================================== @@ -98,6 +98,95 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS return privileges != null && !privileges.isEmpty(); } + private static boolean isOwner(ObserveDataSourceConfigurationTopiaSupport dataSourceConfiguration, JdbcPostgresHelper jdbcHelper) { + if (dataSourceConfiguration.isH2Database()) { + return true; + } + return jdbcHelper.isOwner(); + } + + @Override + public ObserveDataSourceInformation checkCanConnectOrBeEmpty(ObserveDataSourceConfiguration dataSourceConfiguration) throws DatabaseNotFoundException, DatabaseConnexionNotAuthorizedException { + Preconditions.checkState(dataSourceConfiguration instanceof ObserveDataSourceConfigurationTopiaSupport); + ObserveDataSourceConfigurationTopiaSupport dataSourceConfigurationTopiaSupport = (ObserveDataSourceConfigurationTopiaSupport) dataSourceConfiguration; + + ObserveDataSourceInformation dataSourceInformation; + + if (dataSourceConfigurationTopiaSupport.isH2Database()) { + + ObserveDataSourceConfigurationTopiaH2 h2DataSourceConfiguration = (ObserveDataSourceConfigurationTopiaH2) dataSourceConfigurationTopiaSupport; + + // On vérifie que le fichier de la base existe + File databaseFile = h2DataSourceConfiguration.getDatabaseFile(); + + if (!databaseFile.exists()) { + + String message = l(getApplicationLocale(), "observe.services.topia.error.h2.database.notFound"); + throw new DatabaseNotFoundException(message, dataSourceConfiguration); + + } + + // On vérifier que la base n'est pas déjà en cours d'utilisation + File databaseLockFile = h2DataSourceConfiguration.getLockFile(); + if (databaseLockFile.exists()) { + + String message = l(getApplicationLocale(), "observe.services.topia.error.h2.database.locked"); + if (log.isWarnEnabled()) { + log.warn(message); + } + // FIXME even if file is lock we still authorize to connect, + //throw new DatabaseConnexionNotAuthorizedException(message, dataSourceConfiguration); + } + + // On tente une connection à la base + ObserveTopiaConfiguration topiaConfiguration = ObserveTopiaConfigurationFactory.forH2Database(h2DataSourceConfiguration.getDirectory(), + h2DataSourceConfiguration.getDbName(), + h2DataSourceConfiguration.getUsername(), + new String(h2DataSourceConfiguration.getPassword()), + false, + false); + + + try { + new JdbcHelper(topiaConfiguration).runSelectOnString("SELECT 1;"); + } catch (Exception e) { + + // Authentification refusée + String message = l(getApplicationLocale(), "observe.services.topia.error.h2.database.badAuthentication"); + throw new DatabaseConnexionNotAuthorizedException(message, e, dataSourceConfiguration); + + } + + dataSourceInformation = getDataSourceInformation(h2DataSourceConfiguration, topiaConfiguration, false); + + + } else { + + ObserveDataSourceConfigurationTopiaPG pgDataSourceConfiguration = (ObserveDataSourceConfigurationTopiaPG) dataSourceConfigurationTopiaSupport; + // On tente une connexion au serveur + ObserveTopiaConfiguration topiaConfiguration = ObserveTopiaConfigurationFactory.forPostgresqlDatabase(pgDataSourceConfiguration.getJdbcUrl(), + pgDataSourceConfiguration.getUsername(), + new String(pgDataSourceConfiguration.getPassword()), + false, + false); + + try { + new JdbcHelper(topiaConfiguration).runSelectOnString("SELECT 1;"); + } catch (Exception e) { + + throw new DatabaseConnexionNotAuthorizedException(e.getMessage(), e, dataSourceConfiguration); + + } + + dataSourceInformation = getDataSourceInformation(pgDataSourceConfiguration, topiaConfiguration, true); + + } + + return dataSourceInformation; + + } + + @Override public ObserveDataSourceInformation checkCanConnect(ObserveDataSourceConfiguration dataSourceConfiguration) throws DatabaseNotFoundException, DatabaseConnexionNotAuthorizedException { @@ -134,11 +223,11 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS // On tente une connection à la base ObserveTopiaConfiguration topiaConfiguration = ObserveTopiaConfigurationFactory.forH2Database(h2DataSourceConfiguration.getDirectory(), - h2DataSourceConfiguration.getDbName(), - h2DataSourceConfiguration.getUsername(), - new String(h2DataSourceConfiguration.getPassword()), - false, - false); + h2DataSourceConfiguration.getDbName(), + h2DataSourceConfiguration.getUsername(), + new String(h2DataSourceConfiguration.getPassword()), + false, + false); try { @@ -151,7 +240,7 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS } - dataSourceInformation = getDataSourceInformation(h2DataSourceConfiguration, topiaConfiguration); + dataSourceInformation = getDataSourceInformation(h2DataSourceConfiguration, topiaConfiguration, false); } else { @@ -159,10 +248,10 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS ObserveDataSourceConfigurationTopiaPG pgDataSourceConfiguration = (ObserveDataSourceConfigurationTopiaPG) dataSourceConfigurationTopiaSupport; // On tente une connexion au serveur ObserveTopiaConfiguration topiaConfiguration = ObserveTopiaConfigurationFactory.forPostgresqlDatabase(pgDataSourceConfiguration.getJdbcUrl(), - pgDataSourceConfiguration.getUsername(), - new String(pgDataSourceConfiguration.getPassword()), - false, - false); + pgDataSourceConfiguration.getUsername(), + new String(pgDataSourceConfiguration.getPassword()), + false, + false); try { new JdbcHelper(topiaConfiguration).runSelectOnString("SELECT 1;"); @@ -172,7 +261,7 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS } - dataSourceInformation = getDataSourceInformation(pgDataSourceConfiguration, topiaConfiguration); + dataSourceInformation = getDataSourceInformation(pgDataSourceConfiguration, topiaConfiguration, false); } @@ -359,7 +448,7 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS } - ObserveDataSourceInformation dataSourceInformation = getDataSourceInformation((ObserveDataSourceConfigurationTopiaSupport) dataSourceConfiguration, topiaApplicationContext.getConfiguration()); + ObserveDataSourceInformation dataSourceInformation = getDataSourceInformation((ObserveDataSourceConfigurationTopiaSupport) dataSourceConfiguration, topiaApplicationContext.getConfiguration(), false); return createDataSourceConnection(dataSourceInformation, topiaApplicationContext.getAuthenticationToken()); @@ -529,7 +618,7 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS dataSourceInformation.getVersion()); } - private ObserveDataSourceInformation getDataSourceInformation(ObserveDataSourceConfigurationTopiaSupport dataSourceConfiguration, ObserveTopiaConfiguration topiaConfiguration) { + private ObserveDataSourceInformation getDataSourceInformation(ObserveDataSourceConfigurationTopiaSupport dataSourceConfiguration, ObserveTopiaConfiguration topiaConfiguration, boolean canBeEmpty) { boolean writeReferential; boolean readData; @@ -538,8 +627,37 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS Version version; JdbcPostgresHelper jdbcHelper = new JdbcPostgresHelper(topiaConfiguration); + boolean owner = isOwner(dataSourceConfiguration, jdbcHelper); - version = TMSVersionHibernateDao.getVersion(jdbcHelper, "tms_version").map(TMSVersion::toVersion).orElse(Version.VZERO); + try { + version = TMSVersionHibernateDao.getVersion(jdbcHelper, "tms_version").map(TMSVersion::toVersion).orElse(Version.VZERO); + } catch (Exception e) { + if (!canBeEmpty) { + throw e; + } + if (dataSourceConfiguration.isH2Database()) { + + // Sur une base H2, on a le droit de tout lire, mais uniquement d'écrire les données + writeReferential = false; + readData = true; + writeData = true; + owner = true; + + } else { + writeReferential = true; + readData = true; + writeData = true; + } + return new ObserveDataSourceInformation( + true, + writeReferential, + readData, + writeData, + owner, + ObserveTopiaMigrationServiceAskUserToMigrate.getMinimumVersion(), + null, + null); + } if (dataSourceConfiguration.isH2Database()) { @@ -591,6 +709,7 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS writeReferential, readData, writeData, + owner, ObserveTopiaMigrationServiceAskUserToMigrate.getMinimumVersion(), version, observeMigrationConfigurationProvider.getVersionsAfter(version)); ===================================== services/src/main/java/fr/ird/observe/services/service/DataSourceService.java ===================================== @@ -47,6 +47,9 @@ public interface DataSourceService extends ObserveService, Closeable { @Get(addAuthtoken = false) ObserveDataSourceInformation checkCanConnect(ObserveDataSourceConfiguration dataSourceConfiguration) throws DatabaseNotFoundException, DatabaseConnexionNotAuthorizedException; + @Get(addAuthtoken = false) + ObserveDataSourceInformation checkCanConnectOrBeEmpty(ObserveDataSourceConfiguration dataSourceConfiguration) throws DatabaseNotFoundException, DatabaseConnexionNotAuthorizedException; + @Get(addAuthtoken = false) ObserveDataSourceConnection create(ObserveDataSourceConfiguration dataSourceConfiguration, DataSourceCreateConfigurationDto dataSourceCreateConfiguration) throws IncompatibleDataSourceCreateConfigurationException, DataSourceCreateWithNoReferentialImportException, View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/e7cdd45e47c72f98550065e0db… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/e7cdd45e47c72f98550065e0db… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop-9] 12 commits: update changelog [skip ci]
by Tony CHEMIT 02 Jul '19

02 Jul '19
Tony CHEMIT pushed to branch develop-9 at ultreiaio / ird-observe Commits: 84159b31 by tchemit at 2019-07-02T09:54:27Z update changelog [skip ci] - - - - - e0071322 by tchemit at 2019-07-02T09:54:28Z update libs before release - - - - - 9db5a5ca by tchemit at 2019-07-02T09:54:28Z N° de versions mentionnés par l&#39;assistant migration - Closes #1330 - - - - - 305da5ac by tchemit at 2019-07-02T09:54:28Z On ne peut pas sauvegarder une configuration d&#39;un serveur distant en mode admin - Closes #1340 - - - - - 3fc72f6b by tchemit at 2019-07-02T14:39:38Z Réorganisation des données d’observation PS - Réorganisation des captures et échantillons de cible et bycatch observés - See #1254 - - - - - 317b912e by tchemit at 2019-07-02T14:39:38Z Move to new version 9.0-alpha-1 - - - - - 6be9f395 by tchemit at 2019-07-02T14:39:38Z Réorganisation des données d’observation PS - Re localisation dans la hiérarchie - Closes #1252 - - - - - c3d8c823 by tchemit at 2019-07-02T14:39:39Z Module 2 (first flush) - - - - - f2588846 by tchemit at 2019-07-02T14:39:39Z [PS] Contenu des onglets spécifiques observations et logbooks et le formulaire marée - See #1300 - - - - - 109aba73 by tchemit at 2019-07-02T14:39:40Z Module 2 - second flush - - - - - 25ba1c27 by tchemit at 2019-07-02T14:39:40Z Report from v8 for ps logbook model - - - - - b3b511a6 by tchemit at 2019-07-02T14:39:40Z Choix de nouvelles couleurs pour les symboles de la carte LL - Closes #1293 - - - - - 30 changed files: - + .mvn/gitlab-cache/milestones/898778-artifacts.json - .mvn/gitlab-cache/milestones/898778-issues.json - .mvn/gitlab-cache/milestones/898778.json - + .mvn/gitlab-cache/milestones/921497-issues.json - + .mvn/gitlab-cache/milestones/921497.json - .mvn/pom.gitflow.develop - .mvn/pom.gitflow.master - CHANGELOG.md - client-configuration/.mvn/pom.gitflow.develop - client-configuration/.mvn/pom.gitflow.master - client-configuration/pom.xml - client-configuration/src/main/config/Client.ini - client-configuration/src/main/i18n/getters/config.getter - client-configuration/src/main/i18n/getters/java-enumeration.getter - client-configuration/src/main/i18n/getters/java.getter - client-core/.mvn/pom.gitflow.develop - client-core/.mvn/pom.gitflow.master - client-core/pom.xml - client-core/src/main/dcp-presets/ps/logbook/01-deployment-preset.yml - client-core/src/main/dcp-presets/ps/logbook/02-removal-preset.yml - client-core/src/main/dcp-presets/ps/logbook/03-update-preset.yml - client-core/src/main/dcp-presets/ps/logbook/04-abandonned-preset.yml - client-core/src/main/dcp-presets/ps/observation/01-deployment-preset.yml - client-core/src/main/dcp-presets/ps/observation/02-removal-preset.yml - client-core/src/main/dcp-presets/ps/observation/03-update-preset.yml - client-core/src/main/i18n/getters/java.getter - client-core/src/main/i18n/getters/jaxx.getter - client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java - client-core/src/main/java/fr/ird/observe/client/navigation/RouteCloseCallback.java - client-core/src/main/java/fr/ird/observe/client/ui/ObserveMainUI.jaxx The diff was not included because it is too large. View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/3b10df048c7299681493d74712… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/3b10df048c7299681493d74712… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop] On ne peut pas sauvegarder une configuration d'un serveur distant en mode admin - Closes #1340
by Tony CHEMIT 02 Jul '19

02 Jul '19
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 86710b87 by tchemit at 2019-07-02T09:51:53Z On ne peut pas sauvegarder une configuration d&#39;un serveur distant en mode admin - Closes #1340 - - - - - 1 changed file: - client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/SaveCurrentServerConfigurationUIAction.java Changes: ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/SaveCurrentServerConfigurationUIAction.java ===================================== @@ -22,6 +22,7 @@ package fr.ird.observe.client.ui.actions.storage; * #L% */ +import fr.ird.observe.client.ObserveSwingApplicationContext; import fr.ird.observe.client.ui.ObserveMainUI; import fr.ird.observe.client.ui.actions.main.menu.MenuActionSupport; import fr.ird.observe.client.ui.storage.StorageUIModel; @@ -116,8 +117,7 @@ public class SaveCurrentServerConfigurationUIAction extends MenuActionSupport { configuration.setLogin(model.getRemoteLogin()); configuration.setPassword(new String(model.getRemotePassword())); configuration.setDatabaseName(model.getServerDatabase()); - getMainUI().getConfig().addServerDataSourceConfiguration(configuration); - + ObserveSwingApplicationContext.get().getConfig().addServerDataSourceConfiguration(configuration); configUI.getHandler().addServerConfiguration(getMainUI(), configuration, configUI.getServerMenu().getComponentCount() - 2); } } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/86710b87afec9625c78bb52433c… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/86710b87afec9625c78bb52433c… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop] 2 commits: update libs before release
by Tony CHEMIT 02 Jul '19

02 Jul '19
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: c5872151 by tchemit at 2019-07-02T08:14:45Z update libs before release - - - - - 21b7dfb2 by tchemit at 2019-07-02T09:18:12Z N° de versions mentionnés par l&#39;assistant migration - Closes #1330 - - - - - 30 changed files: - − persistence/src/main/java/fr/ird/observe/entities/migration/DataSourceMigrationForVersion_7_1.java - − persistence/src/main/java/fr/ird/observe/entities/migration/DataSourceMigrationForVersion_7_3.java - persistence/src/main/java/fr/ird/observe/entities/migration/DataSourceMigrationForVersion_7_2.java → persistence/src/main/java/fr/ird/observe/entities/migration/DataSourceMigrationForVersion_8_0.java - persistence/src/main/resources/db/migration/7.1/01_move_wind_referential-H2.sql → persistence/src/main/resources/db/migration/8.0/01_move_wind_referential-H2.sql - persistence/src/main/resources/db/migration/7.1/01_move_wind_referential-PG.sql → persistence/src/main/resources/db/migration/8.0/01_move_wind_referential-PG.sql - persistence/src/main/resources/db/migration/7.1/02_wind_i18n-common.sql → persistence/src/main/resources/db/migration/8.0/02_wind_i18n-common.sql - persistence/src/main/resources/db/migration/7.1/03_update_vesseltype-common.sql → persistence/src/main/resources/db/migration/8.0/03_update_vesseltype-common.sql - persistence/src/main/resources/db/migration/7.1/04_update_person-common.sql → persistence/src/main/resources/db/migration/8.0/04_update_person-common.sql - persistence/src/main/resources/db/migration/7.1/04_update_person2-common.sql → persistence/src/main/resources/db/migration/8.0/04_update_person2-common.sql - persistence/src/main/resources/db/migration/7.1/05_rename_tripType-common.sql → persistence/src/main/resources/db/migration/8.0/05_rename_tripType-common.sql - persistence/src/main/resources/db/migration/7.1/06_fill_vessel_activity-common.sql → persistence/src/main/resources/db/migration/8.0/06_fill_vessel_activity-common.sql - persistence/src/main/resources/db/migration/7.1/07_add_weight_determination_method-common.sql → persistence/src/main/resources/db/migration/8.0/07_add_weight_determination_method-common.sql - persistence/src/main/resources/db/migration/7.1/08_add_weight_category-common.sql → persistence/src/main/resources/db/migration/8.0/08_add_weight_category-common.sql - persistence/src/main/resources/db/migration/7.1/09_add_compagnies-common.sql → persistence/src/main/resources/db/migration/8.0/09_add_compagnies-common.sql - persistence/src/main/resources/db/migration/7.2/01_create_common_schema-common.sql → persistence/src/main/resources/db/migration/8.0/101_create_common_schema-common.sql - persistence/src/main/resources/db/migration/7.2/02_create_ps_common_schema-common.sql → persistence/src/main/resources/db/migration/8.0/102_create_ps_common_schema-common.sql - persistence/src/main/resources/db/migration/7.2/03_create_ps_observation_schema-common.sql → persistence/src/main/resources/db/migration/8.0/103_create_ps_observation_schema-common.sql - persistence/src/main/resources/db/migration/7.2/04_create_ll_common_schema-common.sql → persistence/src/main/resources/db/migration/8.0/104_create_ll_common_schema-common.sql - persistence/src/main/resources/db/migration/7.2/05_create_ll_observation_schema-common.sql → persistence/src/main/resources/db/migration/8.0/105_create_ll_observation_schema-common.sql - persistence/src/main/resources/db/migration/7.2/06_create_ll_logbook_schema-common.sql → persistence/src/main/resources/db/migration/8.0/106_create_ll_logbook_schema-common.sql - persistence/src/main/resources/db/migration/7.2/07_create_ll_landing_schema-common.sql → persistence/src/main/resources/db/migration/8.0/107_create_ll_landing_schema-common.sql - persistence/src/main/resources/db/migration/7.2/08_add_vessel_field-common.sql → persistence/src/main/resources/db/migration/8.0/108_add_vessel_field-common.sql - persistence/src/main/resources/db/migration/7.2/08_fix_trigger-PG.sql → persistence/src/main/resources/db/migration/8.0/108_fix_trigger-PG.sql - persistence/src/main/resources/db/migration/7.2/09_change_vessel_fleetCountry_field-H2.sql → persistence/src/main/resources/db/migration/8.0/109_change_vessel_fleetCountry_field-H2.sql - persistence/src/main/resources/db/migration/7.2/09_change_vessel_fleetCountry_field-PG.sql → persistence/src/main/resources/db/migration/8.0/109_change_vessel_fleetCountry_field-PG.sql - persistence/src/main/resources/db/migration/7.1/10_add_length_measure_method-common.sql → persistence/src/main/resources/db/migration/8.0/10_add_length_measure_method-common.sql - persistence/src/main/resources/db/migration/7.2/10_add_home_id-common.sql → persistence/src/main/resources/db/migration/8.0/110_add_home_id-common.sql - persistence/src/main/resources/db/migration/7.2/11_alter_ll_logbook_activity-H2.sql → persistence/src/main/resources/db/migration/8.0/111_alter_ll_logbook_activity-H2.sql - persistence/src/main/resources/db/migration/7.2/11_alter_ll_logbook_activity-PG.sql → persistence/src/main/resources/db/migration/8.0/111_alter_ll_logbook_activity-PG.sql - persistence/src/main/resources/db/migration/7.2/12_update_ll_speciesList-common.sql → persistence/src/main/resources/db/migration/8.0/112_update_ll_speciesList-common.sql The diff was not included because it is too large. View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/ee1758ad59467bce54f4e5d084… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/ee1758ad59467bce54f4e5d084… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop-9] 11 commits: update changelog [skip ci]
by Tony CHEMIT 02 Jul '19

02 Jul '19
Tony CHEMIT pushed to branch develop-9 at ultreiaio / ird-observe Commits: ee1758ad by tchemit at 2019-07-02T07:53:18Z update changelog [skip ci] - - - - - c5872151 by tchemit at 2019-07-02T08:14:45Z update libs before release - - - - - 21b7dfb2 by tchemit at 2019-07-02T09:18:12Z N° de versions mentionnés par l&#39;assistant migration - Closes #1330 - - - - - f8d36698 by tchemit at 2019-07-02T09:18:49Z Réorganisation des données d’observation PS - Réorganisation des captures et échantillons de cible et bycatch observés - See #1254 - - - - - 9500d701 by tchemit at 2019-07-02T09:18:49Z Move to new version 9.0-alpha-1 - - - - - 12ad45bc by tchemit at 2019-07-02T09:18:49Z Réorganisation des données d’observation PS - Re localisation dans la hiérarchie - Closes #1252 - - - - - 205d3b77 by tchemit at 2019-07-02T09:18:49Z Module 2 (first flush) - - - - - c08374b4 by tchemit at 2019-07-02T09:18:49Z [PS] Contenu des onglets spécifiques observations et logbooks et le formulaire marée - See #1300 - - - - - f86e9cbb by tchemit at 2019-07-02T09:18:50Z Module 2 - second flush - - - - - 80dd5a21 by tchemit at 2019-07-02T09:18:50Z Report from v8 for ps logbook model - - - - - 3b10df04 by tchemit at 2019-07-02T09:18:50Z Choix de nouvelles couleurs pour les symboles de la carte LL - Closes #1293 - - - - - 30 changed files: - + .mvn/gitlab-cache/milestones/898778-artifacts.json - .mvn/gitlab-cache/milestones/898778-issues.json - .mvn/gitlab-cache/milestones/898778.json - + .mvn/gitlab-cache/milestones/921497-issues.json - + .mvn/gitlab-cache/milestones/921497.json - .mvn/pom.gitflow.develop - .mvn/pom.gitflow.master - CHANGELOG.md - client-configuration/.mvn/pom.gitflow.develop - client-configuration/.mvn/pom.gitflow.master - client-configuration/pom.xml - client-configuration/src/main/config/Client.ini - client-configuration/src/main/i18n/getters/config.getter - client-configuration/src/main/i18n/getters/java-enumeration.getter - client-configuration/src/main/i18n/getters/java.getter - client-core/.mvn/pom.gitflow.develop - client-core/.mvn/pom.gitflow.master - client-core/pom.xml - client-core/src/main/dcp-presets/ps/logbook/01-deployment-preset.yml - client-core/src/main/dcp-presets/ps/logbook/02-removal-preset.yml - client-core/src/main/dcp-presets/ps/logbook/03-update-preset.yml - client-core/src/main/dcp-presets/ps/logbook/04-abandonned-preset.yml - client-core/src/main/dcp-presets/ps/observation/01-deployment-preset.yml - client-core/src/main/dcp-presets/ps/observation/02-removal-preset.yml - client-core/src/main/dcp-presets/ps/observation/03-update-preset.yml - client-core/src/main/i18n/getters/java.getter - client-core/src/main/i18n/getters/jaxx.getter - client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java - client-core/src/main/java/fr/ird/observe/client/navigation/RouteCloseCallback.java - client-core/src/main/java/fr/ird/observe/client/ui/ObserveMainUI.jaxx The diff was not included because it is too large. View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/79785afe586bd17b123dfc6d59… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/79785afe586bd17b123dfc6d59… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop] update changelog [skip ci]
by Tony CHEMIT 02 Jul '19

02 Jul '19
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: ee1758ad by tchemit at 2019-07-02T07:53:18Z update changelog [skip ci] - - - - - 6 changed files: - + .mvn/gitlab-cache/milestones/898778-artifacts.json - .mvn/gitlab-cache/milestones/898778-issues.json - .mvn/gitlab-cache/milestones/898778.json - + .mvn/gitlab-cache/milestones/921497-issues.json - + .mvn/gitlab-cache/milestones/921497.json - CHANGELOG.md Changes: ===================================== .mvn/gitlab-cache/milestones/898778-artifacts.json ===================================== @@ -0,0 +1,12 @@ +[ + { + "name": "Application", + "filename": "observe-8.0-RC-3.zip", + "url": "http://repo1.maven.org/maven2/fr/ird/observe/observe/8.0-RC-3/observe-8.0-R…" + }, + { + "name": "Serveur", + "filename": "observe-8.0-RC-3.war", + "url": "http://repo1.maven.org/maven2/fr/ird/observe/observe/8.0-RC-3/observe-8.0-R…" + } +] \ No newline at end of file ===================================== .mvn/gitlab-cache/milestones/898778-issues.json ===================================== @@ -17,7 +17,8 @@ "groupId": 0, "title": "8.0-RC-3", "description": "", - "state": "active" + "dueDate": "Jul 2, 2019 2:00:00 AM", + "state": "closed" }, "assignees": [ { @@ -45,7 +46,7 @@ "_external": false, "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" }, - "userNotesCount": 2, + "userNotesCount": 3, "upVotes": 0, "downVotes": 0, "confidential": false, @@ -53,21 +54,24 @@ "timeEstimate": 0, "totalTimeSpent": 0 }, - "state": "opened", - "updatedAt": "Jun 25, 2019 6:27:13 PM", + "state": "closed", + "updatedAt": "Jul 2, 2019 9:38:33 AM", "createdAt": "May 22, 2019 11:52:43 AM", + "closedAt": "Jun 29, 2019 9:14:19 PM", "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1293" }, { - "id": 21832893, - "iid": 1330, + "id": 22239676, + "iid": 1337, "projectId": 2722779, - "title": "N° de versions mentionnés par l\u0027assistant migration", - "description": "L\u0027assistant migration de la 8 RC2 mentionne des mises à jour jusqu\u0027en 7.2, non pas 8. Est-ce normal?\n\n![image](/uploads/4a1f46b93d6bbda3878922bf0b6fff91/image.png)", + "title": "[PS] Suppression de 2 champs", + "description": "Dans les données d\u0027observation PS, on souhaite purement et simplement supprimer ces 2 champs :\n\n![image](/uploads/d0b341e678318b2c2a7644064ebc36fa/image.png)\n\nSur l\u0027UI comme dans dans la base, avec perte des données associées.\n\nIl sont inutiles.", "labels": [ - "Anomalie", - "Bas", - "Tâche" + "Evolution", + "IRD-2018-02-V9", + "Module 1", + "Normal", + "À facturer" ], "milestone": { "id": 898778, @@ -76,7 +80,8 @@ "groupId": 0, "title": "8.0-RC-3", "description": "", - "state": "active" + "dueDate": "Jul 2, 2019 2:00:00 AM", + "state": "closed" }, "assignees": [ { @@ -104,7 +109,7 @@ "_external": false, "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" }, - "userNotesCount": 3, + "userNotesCount": 2, "upVotes": 0, "downVotes": 0, "confidential": false, @@ -113,21 +118,21 @@ "totalTimeSpent": 0 }, "state": "closed", - "updatedAt": "Jun 12, 2019 1:00:39 PM", - "createdAt": "Jun 12, 2019 12:54:12 PM", - "closedAt": "Jun 12, 2019 12:59:20 PM", - "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1330" + "updatedAt": "Jun 29, 2019 7:08:21 PM", + "createdAt": "Jun 25, 2019 6:35:13 PM", + "closedAt": "Jun 27, 2019 11:12:24 AM", + "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1337" }, { - "id": 18519309, - "iid": 1237, + "id": 21832893, + "iid": 1330, "projectId": 2722779, - "title": "Rafraichissement de la page \u0027A propos\u0027", - "description": "Supprimer les logos d\u0027ObServe et de l\u0027IRD\n\nMettre :\n* Nouveau logo IRD : ![logo-ird-2016](/uploads/f9d9b1214417dc9c6ec941b495e8bedc/logo-ird-2016.png)\n* Logo Ob7 : ![logo_obs7_rvb_300dpi](/uploads/a084234f58b04482878041c358acf18d/logo_obs7_rvb_300dpi.png)\n* Logo FEAMP (financement UE) : ![Logo_l_Europe_s_engage_FEAMP](/uploads/4c462e26a581404d97d0b52fbc125f1f/Logo_l_Europe_s_engage_FEAMP.png)\n* Logo SFA (en attente d\u0027un logo avec transparence) : ![logo_sfa_high_resolution](/uploads/fe872d782e73a3c158f0ed42771df3a3/logo_sfa_high_resolution.jpg)\n* Logo CRO (en attente d\u0027un logo avec transparence) : ![logo_CRO_Couleur_haute_résolution](/uploads/4d30fda473961d4ad022eda7bbea69bc/logo_CRO_Couleur_haute_résolution.jpeg)\n\nNouveau texte :\n\nObServe\n\nSystème informatique de gestion de données d\u0027observations embarquées de pêche à la senne et à la palangre.\n\nCe projet a été initiée par l\u0027IRD en 2009. Les contributeurs financiers sont : \n* Institut de Recherche pour le Développement (IRD)\n* Fond Européen pour les Affaires Maritimes et la Pêche (FEAMP)\n* Seychelles Fishing Authority (SFA)\n* AZTI Tecnalia\n* Orthongel\n\nIl est réalisé par les sociétés Code Lutin et Ultreia.io depuis 2009.\n \nPour plus d\u0027informations, veuillez visiter le site du projet.", + "title": "N° de versions mentionnés par l\u0027assistant migration", + "description": "L\u0027assistant migration de la 8 RC2 mentionne des mises à jour jusqu\u0027en 7.2, non pas 8. Est-ce normal?\n\n![image](/uploads/4a1f46b93d6bbda3878922bf0b6fff91/image.png)", "labels": [ + "Anomalie", "Bas", - "Evolution", - "À facturer" + "Tâche" ], "milestone": { "id": 898778, @@ -136,25 +141,26 @@ "groupId": 0, "title": "8.0-RC-3", "description": "", - "state": "active" + "dueDate": "Jul 2, 2019 2:00:00 AM", + "state": "closed" }, "assignees": [ { - "_id": 1111318, - "_username": "pcauquil", - "_name": "Pascal Cauquil", + "_id": 166231, + "_username": "tchemit", + "_name": "Tony CHEMIT", "_state": "active", "_external": false, - "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" + "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…" } ], "assignee": { - "_id": 1111318, - "_username": "pcauquil", - "_name": "Pascal Cauquil", + "_id": 166231, + "_username": "tchemit", + "_name": "Tony CHEMIT", "_state": "active", "_external": false, - "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" + "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…" }, "author": { "_id": 1111318, @@ -164,7 +170,7 @@ "_external": false, "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" }, - "userNotesCount": 2, + "userNotesCount": 3, "upVotes": 0, "downVotes": 0, "confidential": false, @@ -172,20 +178,22 @@ "timeEstimate": 0, "totalTimeSpent": 0 }, - "state": "opened", - "updatedAt": "Jun 8, 2019 6:38:47 PM", - "createdAt": "Feb 22, 2019 4:32:32 PM", - "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1237" + "state": "closed", + "updatedAt": "Jun 12, 2019 1:00:39 PM", + "createdAt": "Jun 12, 2019 12:54:12 PM", + "closedAt": "Jun 12, 2019 12:59:20 PM", + "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1330" }, { - "id": 21873545, - "iid": 1333, + "id": 14951410, + "iid": 1145, "projectId": 2722779, - "title": "[PS FOB] Intégration du nœud Balise en tant qu\u0027onglet du formulaire FOB", - "description": "Cette évolution permettra une meilleure intégration avec le nouveau système de pré-configurations sur FOB (Voir #1321) (sinon celui-ci agirait sur deux formulaires de deux nœud différents, ce qui n\u0027est pas une bonne chose en terme d\u0027ergonomie).\n\nÇa donne ça :\n\n![image](/uploads/11189f70e84e3f66a0e6f109d6012c6a/image.png)", + "title": "L\u0027assistant migration via serveur pourrait refuser de continuer si l\u0027utilisateur n\u0027est pas assez acrédité", + "description": "L\u0027assistant migration via serveur pourrait idéalement refuser de continuer si l\u0027utilisateur n\u0027est mappé sur le rôle propriétaire de la base.\n\nPour la migration en connexion directe, je ne me souviens plus si ce prérequis est testé. Si ce n\u0027est pas le cas, cela pourrait s\u0027appliquer à cette méthode de migration également.", "labels": [ + "Bas", "Evolution", - "IRD-2018-01-V8" + "À facturer" ], "milestone": { "id": 898778, @@ -194,7 +202,8 @@ "groupId": 0, "title": "8.0-RC-3", "description": "", - "state": "active" + "dueDate": "Jul 2, 2019 2:00:00 AM", + "state": "closed" }, "assignees": [ { @@ -215,14 +224,14 @@ "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…" }, "author": { - "_id": 166231, - "_username": "tchemit", - "_name": "Tony CHEMIT", + "_id": 1111318, + "_username": "pcauquil", + "_name": "Pascal Cauquil", "_state": "active", "_external": false, - "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…" + "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" }, - "userNotesCount": 0, + "userNotesCount": 1, "upVotes": 0, "downVotes": 0, "confidential": false, @@ -231,18 +240,19 @@ "totalTimeSpent": 0 }, "state": "closed", - "updatedAt": "Jun 13, 2019 2:35:01 PM", - "createdAt": "Jun 13, 2019 1:36:28 PM", - "closedAt": "Jun 13, 2019 2:35:01 PM", - "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1333" + "updatedAt": "Jun 29, 2019 7:08:22 PM", + "createdAt": "Oct 15, 2018 11:33:14 AM", + "closedAt": "Jun 28, 2019 5:52:13 PM", + "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1145" }, { - "id": 21839813, - "iid": 1332, + "id": 21873545, + "iid": 1333, "projectId": 2722779, - "title": "[V8] Schémas", - "description": "Après migration d\u0027une base V7, j\u0027obtiens les schémas suivants :\n\n![image](/uploads/0830acc831b73688c0b44d464ad982ef/image.png)\n\nPlusieurs schémas viennent de la base d\u0027origine, par contre le schéma ll_landing a bien été créé par la migration. Or a priori ce schéma n\u0027a pas lieu d\u0027être. On devrait avoir :\n* common\n* ll_common\n* ll_observation\n* ll_logbook\n* ps_common\n* ps_observation\n* ps_logbook (ne sera créé qu\u0027en V)\n\nEt les LL landings devraient se retrouver dans ll_logbook (tout comme les échantillons).\n\nSinon, logiquement en V9 il faudrait alors créer des schémas pour les plans de cuves, les débarquements, le faux poisson, ce qui fait beaucoup.", + "title": "[PS FOB] Intégration du nœud Balise en tant qu\u0027onglet du formulaire FOB", + "description": "Cette évolution permettra une meilleure intégration avec le nouveau système de pré-configurations sur FOB (Voir #1321) (sinon celui-ci agirait sur deux formulaires de deux nœud différents, ce qui n\u0027est pas une bonne chose en terme d\u0027ergonomie).\n\nÇa donne ça :\n\n![image](/uploads/11189f70e84e3f66a0e6f109d6012c6a/image.png)", "labels": [ + "Evolution", "IRD-2018-01-V8" ], "milestone": { @@ -252,7 +262,8 @@ "groupId": 0, "title": "8.0-RC-3", "description": "", - "state": "active" + "dueDate": "Jul 2, 2019 2:00:00 AM", + "state": "closed" }, "assignees": [ { @@ -273,14 +284,14 @@ "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…" }, "author": { - "_id": 1111318, - "_username": "pcauquil", - "_name": "Pascal Cauquil", + "_id": 166231, + "_username": "tchemit", + "_name": "Tony CHEMIT", "_state": "active", "_external": false, - "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" + "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…" }, - "userNotesCount": 3, + "userNotesCount": 0, "upVotes": 0, "downVotes": 0, "confidential": false, @@ -288,10 +299,11 @@ "timeEstimate": 0, "totalTimeSpent": 0 }, - "state": "opened", - "updatedAt": "Jun 13, 2019 3:32:44 PM", - "createdAt": "Jun 12, 2019 3:44:04 PM", - "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1332" + "state": "closed", + "updatedAt": "Jun 13, 2019 2:35:01 PM", + "createdAt": "Jun 13, 2019 1:36:28 PM", + "closedAt": "Jun 13, 2019 2:35:01 PM", + "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1333" }, { "id": 21833130, @@ -310,7 +322,8 @@ "groupId": 0, "title": "8.0-RC-3", "description": "", - "state": "active" + "dueDate": "Jul 2, 2019 2:00:00 AM", + "state": "closed" }, "assignees": [ { @@ -338,7 +351,7 @@ "_external": false, "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" }, - "userNotesCount": 0, + "userNotesCount": 1, "upVotes": 0, "downVotes": 0, "confidential": false, @@ -346,9 +359,10 @@ "timeEstimate": 0, "totalTimeSpent": 0 }, - "state": "opened", - "updatedAt": "Jun 12, 2019 1:06:09 PM", + "state": "closed", + "updatedAt": "Jun 29, 2019 7:08:22 PM", "createdAt": "Jun 12, 2019 1:06:09 PM", + "closedAt": "Jun 28, 2019 5:52:13 PM", "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1331" }, { @@ -368,7 +382,8 @@ "groupId": 0, "title": "8.0-RC-3", "description": "", - "state": "active" + "dueDate": "Jul 2, 2019 2:00:00 AM", + "state": "closed" }, "assignees": [ { @@ -428,7 +443,8 @@ "groupId": 0, "title": "8.0-RC-3", "description": "", - "state": "active" + "dueDate": "Jul 2, 2019 2:00:00 AM", + "state": "closed" }, "assignees": [ { @@ -488,7 +504,8 @@ "groupId": 0, "title": "8.0-RC-3", "description": "", - "state": "active" + "dueDate": "Jul 2, 2019 2:00:00 AM", + "state": "closed" }, "assignees": [ { @@ -529,43 +546,5 @@ "createdAt": "Jun 10, 2019 4:07:34 PM", "closedAt": "Jun 21, 2019 6:29:25 PM", "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1321" - }, - { - "id": 21224725, - "iid": 1299, - "projectId": 2722779, - "title": "[V8][V9] Piur l\u0027algorithme d\u0027appariement d\u0027activités LL/PS, décider du comprtement vis-à-vis de l\u0027absence d\u0027heures sur les activités (cas très fréquent sur les logbooks)", - "description": "[V8][V9] Pour l\u0027algorithme d\u0027appariement d\u0027activités LL/PS, décider du comportement vis-à-vis de l\u0027absence d\u0027heures sur les activités (cas très fréquent sur les logbooks)", - "labels": [], - "milestone": { - "id": 898778, - "iid": 143, - "projectId": 2722779, - "groupId": 0, - "title": "8.0-RC-3", - "description": "", - "state": "active" - }, - "assignees": [], - "author": { - "_id": 1111318, - "_username": "pcauquil", - "_name": "Pascal Cauquil", - "_state": "active", - "_external": false, - "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" - }, - "userNotesCount": 0, - "upVotes": 0, - "downVotes": 0, - "confidential": false, - "timeStats": { - "timeEstimate": 0, - "totalTimeSpent": 0 - }, - "state": "opened", - "updatedAt": "Jun 9, 2019 5:55:22 PM", - "createdAt": "May 23, 2019 4:23:51 PM", - "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1299" } ] \ No newline at end of file ===================================== .mvn/gitlab-cache/milestones/898778.json ===================================== @@ -5,5 +5,6 @@ "groupId": 0, "title": "8.0-RC-3", "description": "", - "state": "active" + "dueDate": "Jul 2, 2019 2:00:00 AM", + "state": "closed" } \ No newline at end of file ===================================== .mvn/gitlab-cache/milestones/921497-issues.json ===================================== @@ -0,0 +1,179 @@ +[ + { + "id": 18519309, + "iid": 1237, + "projectId": 2722779, + "title": "Rafraichissement de la page \u0027A propos\u0027", + "description": "Supprimer les logos d\u0027ObServe et de l\u0027IRD\n\nMettre :\n* Nouveau logo IRD : ![logo-ird-2016](/uploads/f9d9b1214417dc9c6ec941b495e8bedc/logo-ird-2016.png)\n* Logo Ob7 : ![logo_obs7_rvb_300dpi](/uploads/a084234f58b04482878041c358acf18d/logo_obs7_rvb_300dpi.png)\n* Logo FEAMP (financement UE) : ![Logo_l_Europe_s_engage_FEAMP](/uploads/4c462e26a581404d97d0b52fbc125f1f/Logo_l_Europe_s_engage_FEAMP.png)\n* Logo SFA (en attente d\u0027un logo avec transparence) : ![logo_sfa_high_resolution](/uploads/fe872d782e73a3c158f0ed42771df3a3/logo_sfa_high_resolution.jpg)\n* Logo CRO (en attente d\u0027un logo avec transparence) : ![logo_CRO_Couleur_haute_résolution](/uploads/4d30fda473961d4ad022eda7bbea69bc/logo_CRO_Couleur_haute_résolution.jpeg)\n\nNouveau texte :\n\nObServe\n\nSystème informatique de gestion de données d\u0027observations embarquées de pêche à la senne et à la palangre.\n\nCe projet a été initiée par l\u0027IRD en 2009. Les contributeurs financiers sont : \n* Institut de Recherche pour le Développement (IRD)\n* Fond Européen pour les Affaires Maritimes et la Pêche (FEAMP)\n* Seychelles Fishing Authority (SFA)\n* AZTI Tecnalia\n* Orthongel\n\nIl est réalisé par les sociétés Code Lutin et Ultreia.io depuis 2009.\n \nPour plus d\u0027informations, veuillez visiter le site du projet.", + "labels": [ + "Bas", + "Evolution", + "À facturer" + ], + "milestone": { + "id": 921497, + "iid": 146, + "projectId": 2722779, + "groupId": 0, + "title": "8.0-RC-4", + "description": "", + "startDate": "Jul 3, 2019 2:00:00 AM", + "state": "active" + }, + "assignees": [ + { + "_id": 1111318, + "_username": "pcauquil", + "_name": "Pascal Cauquil", + "_state": "active", + "_external": false, + "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" + } + ], + "assignee": { + "_id": 1111318, + "_username": "pcauquil", + "_name": "Pascal Cauquil", + "_state": "active", + "_external": false, + "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" + }, + "author": { + "_id": 1111318, + "_username": "pcauquil", + "_name": "Pascal Cauquil", + "_state": "active", + "_external": false, + "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" + }, + "userNotesCount": 2, + "upVotes": 0, + "downVotes": 0, + "confidential": false, + "timeStats": { + "timeEstimate": 0, + "totalTimeSpent": 0 + }, + "state": "opened", + "updatedAt": "Jul 2, 2019 9:41:47 AM", + "createdAt": "Feb 22, 2019 4:32:32 PM", + "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1237" + }, + { + "id": 21839813, + "iid": 1332, + "projectId": 2722779, + "title": "[V8] Schémas", + "description": "Après migration d\u0027une base V7, j\u0027obtiens les schémas suivants :\n\n![image](/uploads/0830acc831b73688c0b44d464ad982ef/image.png)\n\nPlusieurs schémas viennent de la base d\u0027origine, par contre le schéma ll_landing a bien été créé par la migration. Or a priori ce schéma n\u0027a pas lieu d\u0027être. On devrait avoir :\n* common\n* ll_common\n* ll_observation\n* ll_logbook\n* ps_common\n* ps_observation\n* ps_logbook (ne sera créé qu\u0027en V)\n\nEt les LL landings devraient se retrouver dans ll_logbook (tout comme les échantillons).\n\nSinon, logiquement en V9 il faudrait alors créer des schémas pour les plans de cuves, les débarquements, le faux poisson, ce qui fait beaucoup.", + "labels": [ + "IRD-2018-01-V8" + ], + "milestone": { + "id": 921497, + "iid": 146, + "projectId": 2722779, + "groupId": 0, + "title": "8.0-RC-4", + "description": "", + "startDate": "Jul 3, 2019 2:00:00 AM", + "state": "active" + }, + "assignees": [ + { + "_id": 166231, + "_username": "tchemit", + "_name": "Tony CHEMIT", + "_state": "active", + "_external": false, + "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…" + } + ], + "assignee": { + "_id": 166231, + "_username": "tchemit", + "_name": "Tony CHEMIT", + "_state": "active", + "_external": false, + "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…" + }, + "author": { + "_id": 1111318, + "_username": "pcauquil", + "_name": "Pascal Cauquil", + "_state": "active", + "_external": false, + "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" + }, + "userNotesCount": 3, + "upVotes": 0, + "downVotes": 0, + "confidential": false, + "timeStats": { + "timeEstimate": 0, + "totalTimeSpent": 0 + }, + "state": "opened", + "updatedAt": "Jul 2, 2019 9:42:02 AM", + "createdAt": "Jun 12, 2019 3:44:04 PM", + "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1332" + }, + { + "id": 21224725, + "iid": 1299, + "projectId": 2722779, + "title": "[V8][V9] Piur l\u0027algorithme d\u0027appariement d\u0027activités LL/PS, décider du comprtement vis-à-vis de l\u0027absence d\u0027heures sur les activités (cas très fréquent sur les logbooks)", + "description": "[V8][V9] Pour l\u0027algorithme d\u0027appariement d\u0027activités LL/PS, décider du comportement vis-à-vis de l\u0027absence d\u0027heures sur les activités (cas très fréquent sur les logbooks)", + "labels": [ + "Evolution", + "IRD-2018-01-V8" + ], + "milestone": { + "id": 921497, + "iid": 146, + "projectId": 2722779, + "groupId": 0, + "title": "8.0-RC-4", + "description": "", + "startDate": "Jul 3, 2019 2:00:00 AM", + "state": "active" + }, + "assignees": [ + { + "_id": 166231, + "_username": "tchemit", + "_name": "Tony CHEMIT", + "_state": "active", + "_external": false, + "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…" + } + ], + "assignee": { + "_id": 166231, + "_username": "tchemit", + "_name": "Tony CHEMIT", + "_state": "active", + "_external": false, + "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…" + }, + "author": { + "_id": 1111318, + "_username": "pcauquil", + "_name": "Pascal Cauquil", + "_state": "active", + "_external": false, + "_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…" + }, + "userNotesCount": 0, + "upVotes": 0, + "downVotes": 0, + "confidential": false, + "timeStats": { + "timeEstimate": 0, + "totalTimeSpent": 0 + }, + "state": "opened", + "updatedAt": "Jul 2, 2019 9:42:21 AM", + "createdAt": "May 23, 2019 4:23:51 PM", + "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1299" + } +] \ No newline at end of file ===================================== .mvn/gitlab-cache/milestones/921497.json ===================================== @@ -0,0 +1,10 @@ +{ + "id": 921497, + "iid": 146, + "projectId": 2722779, + "groupId": 0, + "title": "8.0-RC-4", + "description": "", + "startDate": "Jul 3, 2019 2:00:00 AM", + "state": "active" +} \ No newline at end of file ===================================== CHANGELOG.md ===================================== @@ -1,7 +1,27 @@ # ObServe changelog * Author [Tony Chemit](mailto:dev@tchemit.fr) - * Last generated at 2019-06-27 08:55. + * Last generated at 2019-07-02 09:52. + +## Version [8.0-RC-3](https://gitlab.com/ultreiaio/ird-observe/milestones/143) + +**Closed at 2019-07-02.** + +### Download +* [Application (observe-8.0-RC-3.zip)](http://repo1.maven.org/maven2/fr/ird/observe/observe…) +* [Serveur (observe-8.0-RC-3.war)](http://repo1.maven.org/maven2/fr/ird/observe/observe…) + +### Issues + * [[Anomalie 1326]](https://gitlab.com/ultreiaio/ird-observe/issues/1326) **[PS FOB Buoys] Revoir cet écran** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT) + * [[Anomalie 1330]](https://gitlab.com/ultreiaio/ird-observe/issues/1330) **N° de versions mentionnés par l&#39;assistant migration** (Thanks to Tony CHEMIT) (Reported by Pascal Cauquil) + * [[Anomalie 1331]](https://gitlab.com/ultreiaio/ird-observe/issues/1331) **Assistant création de base PG échoue** (Thanks to Tony CHEMIT) (Reported by Pascal Cauquil) + * [[Evolution 1145]](https://gitlab.com/ultreiaio/ird-observe/issues/1145) **L&#39;assistant migration via serveur pourrait refuser de continuer si l&#39;utilisateur n&#39;est pas assez acrédité** (Thanks to Tony CHEMIT) (Reported by Pascal Cauquil) + * [[Evolution 1293]](https://gitlab.com/ultreiaio/ird-observe/issues/1293) **Choix de nouvelles couleurs pour les symboles de la carte LL** (Thanks to Pascal Cauquil) (Reported by Pascal Cauquil) + * [[Evolution 1321]](https://gitlab.com/ultreiaio/ird-observe/issues/1321) **[PS FOB] Mise en place des nouvelles templates de FOB** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT) + * [[Evolution 1322]](https://gitlab.com/ultreiaio/ird-observe/issues/1322) **[PS] Transformation de deux énumérations en référentiels** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT) + * [[Evolution 1333]](https://gitlab.com/ultreiaio/ird-observe/issues/1333) **[PS FOB] Intégration du nœud Balise en tant qu&#39;onglet du formulaire FOB** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT) + * [[Evolution 1337]](https://gitlab.com/ultreiaio/ird-observe/issues/1337) **[PS] Suppression de 2 champs** (Thanks to Tony CHEMIT) (Reported by Pascal Cauquil) + * [[Tâche 1330]](https://gitlab.com/ultreiaio/ird-observe/issues/1330) **N° de versions mentionnés par l&#39;assistant migration** (Thanks to Tony CHEMIT) (Reported by Pascal Cauquil) ## Version [8.0-RC-2](https://gitlab.com/ultreiaio/ird-observe/milestones/142) View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/ee1758ad59467bce54f4e5d0843… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/ee1758ad59467bce54f4e5d0843… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop] Amélioration de l'API de TripMap - See #1293
by Tony CHEMIT 02 Jul '19

02 Jul '19
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 994ae443 by tchemit at 2019-07-02T07:26:24Z Amélioration de l&#39;API de TripMap - See #1293 - - - - - 16 changed files: - client-core/src/main/java/fr/ird/observe/client/ui/content/data/TripUI.java - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUI.jaxx - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUIHandler.java - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/common/TripSeineUI.jaxx - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/common/TripSeineUIHandler.java - client-core/src/main/java/fr/ird/observe/client/ui/util/tripMap/TripMapUI.jaxx - client-core/src/main/java/fr/ird/observe/client/ui/util/tripMap/TripMapUI.jcss - client-core/src/main/java/fr/ird/observe/client/ui/util/tripMap/TripMapUIHandler.java - services-local/src/main/java/fr/ird/observe/services/local/service/data/TripMapDtoFactory.java → dto/src/main/java/fr/ird/observe/dto/data/TripMapConfigDto.java - dto/src/main/java/fr/ird/observe/dto/data/TripMapDto.java - persistence/src/main/java/fr/ird/observe/entities/data/ll/common/TripLonglineTopiaDao.java - persistence/src/main/java/fr/ird/observe/entities/data/ps/common/TripSeineTopiaDao.java - services-local/src/main/java/fr/ird/observe/services/local/service/data/ll/common/TripLonglineServiceLocal.java - services-local/src/main/java/fr/ird/observe/services/local/service/data/ps/common/TripSeineServiceLocal.java - services/src/main/java/fr/ird/observe/services/service/data/ll/common/TripLonglineService.java - services/src/main/java/fr/ird/observe/services/service/data/ps/common/TripSeineService.java Changes: ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/TripUI.java ===================================== @@ -10,19 +10,31 @@ package fr.ird.observe.client.ui.content.data; * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% */ +import fr.ird.observe.client.ObserveSwingApplicationContext; +import fr.ird.observe.client.configuration.ClientConfig; +import fr.ird.observe.client.ui.content.api.data.open.ContentOpenableUI; import fr.ird.observe.client.ui.util.tripMap.TripMapUI; +import fr.ird.observe.dto.data.TripMapConfigDto; +import fr.ird.observe.dto.data.TripMapDto; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.JComponent; +import javax.swing.JTabbedPane; +import javax.swing.SwingUtilities; +import javax.swing.event.ChangeEvent; /** * Created by tchemit on 25/08/17. @@ -33,4 +45,97 @@ public interface TripUI { TripMapUI getTripMap(); + JTabbedPane getMainTabbedPane(); + + Boolean isBuildMap(); + + void setBuildMap(Boolean buildMap); + + abstract class TripUIHelper<U extends ContentOpenableUI & TripUI> { + + private static final Logger log = LogManager.getLogger(TripUIHelper.class); + + private final U ui; + private final String prefix; + + protected TripUIHelper(U ui, String prefix) { + this.ui = ui; + this.prefix = prefix; + } + + protected abstract TripMapDto getMap(TripMapConfigDto tripMapConfig); + + public void installMap() { + + TripMapUI tripMap = ui.getTripMap(); + + TripMapConfigDto tripMapConfig = tripMap.getTripMapConfig(); + tripMapConfig.setAddObservations(true); + tripMapConfig.setAddLogbook(true); + SwingUtilities.invokeLater(tripMap::validate); + ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); + ClientConfig config = applicationContext.getConfig(); + + tripMap.getHandler().setConfig(config); + tripMap.getHandler().init(ui.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)); + tripMapConfig.addPropertyChangeListener(TripMapConfigDto.PROPERTY_ADD_OBSERVATIONS, e -> updateMapModel()); + tripMapConfig.addPropertyChangeListener(TripMapConfigDto.PROPERTY_ADD_LOGBOOK, e -> updateMapModel()); + + ui.getMainTabbedPane().addChangeListener(this::onTabChanged); + + } + + public void onOpenAfterOpenModel() { + ui.getMainTabbedPane().setSelectedIndex(0); + closeMap(); + } + + void closeMap() { + ui.getTripMap().getHandler().doCloseMap(); + ui.setBuildMap(true); + } + + private void buildTripMap() { + SwingUtilities.invokeLater(() -> { + ObserveSwingApplicationContext.get().getMainUI().getModel().setBusy(true); + try { + TripMapUI tripMap = ui.getTripMap(); + TripMapConfigDto tripMapConfig = tripMap.getTripMapConfig(); + log.info(prefix + String.format("Ask to build map: show observation? %s, show logbook? %s", tripMapConfig.isAddObservations(), tripMapConfig.isAddLogbook())); + TripMapDto tripLonglineMap = getMap(tripMapConfig); + tripMap.getHandler().doOpenMap(tripLonglineMap); + } finally { + ObserveSwingApplicationContext.get().getMainUI().getModel().setBusy(false); + } + }); + } + + private void onTabChanged(ChangeEvent e) { + JTabbedPane selectedComponent = (JTabbedPane) e.getSource(); + TripMapUI tripMap1 = ui.getTripMap(); + if (selectedComponent.getSelectedComponent().equals(tripMap1)) { + ui.getActions().setVisible(false); + if (ui.isBuildMap()) { + try { + buildTripMap(); + } finally { + ui.setBuildMap(false); + } + } + } else { + ui.getActions().setVisible(true); + } + } + + private void updateMapModel() { + ui.getTripMap().getHandler().doCloseMap(); + buildTripMap(); + } + + public void onOpenModel(String tripId) { + TripMapUI tripMap = ui.getTripMap(); + TripMapConfigDto tripMapConfig = tripMap.getTripMapConfig(); + tripMapConfig.setTripId(tripId); + } + } } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUI.jaxx ===================================== @@ -64,6 +64,8 @@ <TripLonglineDto id='bean'/> + <Boolean id="buildMap" javaBean="true"/> + <BeanValidator id='validator' beanClass='fr.ird.observe.dto.data.ll.common.TripLonglineDto' errorTableModel='{getErrorTableModel()}' autoField='true' context='update'> <field name='activityLonglineObs' component='{actionDown}'/> ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUIHandler.java ===================================== @@ -28,8 +28,8 @@ import fr.ird.observe.client.ui.content.api.data.open.ContentOpenableUIHandler; import fr.ird.observe.client.ui.content.api.spi.ContentUIReferenceCache; import fr.ird.observe.client.ui.content.api.spi.ReferentialReferencesFilter; import fr.ird.observe.client.ui.content.api.ui.ObserveLayoutFocusTraversalPolicy; +import fr.ird.observe.client.ui.content.data.TripUI; import fr.ird.observe.client.ui.util.UIHelper; -import fr.ird.observe.client.ui.util.tripMap.TripMapUI; import fr.ird.observe.dto.data.TripMapDto; import fr.ird.observe.dto.data.ll.common.TripLonglineDto; import fr.ird.observe.dto.data.ll.common.TripLonglineReference; @@ -41,13 +41,11 @@ import fr.ird.observe.dto.referential.common.SpeciesReference; import fr.ird.observe.dto.referential.common.VesselDto; import fr.ird.observe.dto.referential.common.VesselHelper; import fr.ird.observe.dto.referential.common.VesselReference; +import fr.ird.observe.dto.data.TripMapConfigDto; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.spi.UIHandler; -import javax.swing.JComponent; -import javax.swing.JTabbedPane; -import javax.swing.SwingUtilities; import java.awt.Component; import java.awt.Container; import java.beans.PropertyChangeEvent; @@ -67,9 +65,9 @@ class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto, Tr private static final Logger log = LogManager.getLogger(TripLonglineUIHandler.class); - private boolean buildTripMap = true; private final VetoableChangeListener logbooksAvailabilityListener; private final VetoableChangeListener observationsAvailabilityListener; + private TripUI.TripUIHelper<TripLonglineUI> tripUIHelper; TripLonglineUIHandler() { logbooksAvailabilityListener = this::onLogbooksAvailabilityChanged; @@ -101,29 +99,14 @@ class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto, Tr @Override public void afterInit(TripLonglineUI ui) { super.afterInit(ui); - TripMapUI tripMap = ui.getTripMap(); - ClientConfig config = ObserveSwingApplicationContext.get().getConfig(); - tripMap.getHandler().setConfig(config); - tripMap.getHandler().init(ui.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)); - tripMap.addPropertyChangeListener(TripMapUI.PROPERTY_SHOW_OBSERVATION, e -> updateMapModel()); - tripMap.addPropertyChangeListener(TripMapUI.PROPERTY_SHOW_LOGBOOK, e -> updateMapModel()); - ui.getMainTabbedPane().addChangeListener(e -> { - JTabbedPane tripLonglineTabPane = (JTabbedPane) e.getSource(); - TripLonglineUI ui1 = getUi(); - TripMapUI tripMap1 = ui1.getTripMap(); - if (tripLonglineTabPane.getSelectedComponent().equals(tripMap1)) { - ui1.getActions().setVisible(false); - - if (buildTripMap) { - buildTripMap(); - buildTripMap = false; - } - - } else { - ui1.getActions().setVisible(true); + tripUIHelper = new TripUI.TripUIHelper<TripLonglineUI>(ui, prefix) { + @Override + protected TripMapDto getMap(TripMapConfigDto tripMapConfig) { + return getTripLonglineService().getTripLonglineMap(tripMapConfig); } - }); + }; + tripUIHelper.installMap(); ui.getVessel().getIndexes().setSelectedButton(1); ui.getDepartureHarbour().getIndexes().setSelectedButton(1); @@ -192,7 +175,7 @@ class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto, Tr log.info(prefix + "programId = " + programId); log.info(prefix + "tripId = " + tripId); - + tripUIHelper.onOpenModel(tripId); boolean create = tripId == null; Form<TripLonglineDto> form; @@ -209,9 +192,7 @@ class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto, Tr @Override protected void onOpenAfterOpenModel() { super.onOpenAfterOpenModel(); - ui.getMainTabbedPane().setSelectedIndex(0); - ui.getTripMap().getHandler().doCloseMap(); - buildTripMap = true; + tripUIHelper.onOpenAfterOpenModel(); } @Override @@ -251,25 +232,5 @@ class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto, Tr } } - private void buildTripMap() { - SwingUtilities.invokeLater(() -> { - ObserveSwingApplicationContext.get().getMainUI().getModel().setBusy(true); - try { - TripMapUI tripMap = ui.getTripMap(); - Boolean showObservation = tripMap.isShowObservation(); - Boolean showLogbook = tripMap.isShowLogbook(); - log.info(prefix + String.format("Ask to build map: show observation? %s, show logbook? %s", showObservation, showLogbook)); - TripMapDto tripLonglineMap = getTripLonglineService().getTripLonglineMap(ui.getModel().getSelectedId(), showObservation, showLogbook); - tripMap.getHandler().doOpenMap(tripLonglineMap); - } finally { - ObserveSwingApplicationContext.get().getMainUI().getModel().setBusy(false); - } - }); - } - - private void updateMapModel() { - ui.getTripMap().getHandler().doCloseMap(); - buildTripMap(); - } } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/common/TripSeineUI.jaxx ===================================== @@ -69,6 +69,8 @@ <!-- edit bean --> <TripSeineDto id='bean'/> + <Boolean id="buildMap" javaBean="true"/> + <!-- validator --> <BeanValidator id='validator' beanClass='fr.ird.observe.dto.data.ps.common.TripSeineDto' errorTableModel='{getErrorTableModel()}' autoField='true' context='update'> ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/common/TripSeineUIHandler.java ===================================== @@ -8,12 +8,12 @@ * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. @@ -27,7 +27,7 @@ import fr.ird.observe.client.ui.content.api.data.open.ContentOpenableUIHandler; import fr.ird.observe.client.ui.content.api.spi.ContentUIReferenceCache; import fr.ird.observe.client.ui.content.api.spi.ReferentialReferencesFilter; import fr.ird.observe.client.ui.content.api.ui.ObserveLayoutFocusTraversalPolicy; -import fr.ird.observe.client.ui.util.tripMap.TripMapUI; +import fr.ird.observe.client.ui.content.data.TripUI; import fr.ird.observe.dto.data.TripMapDto; import fr.ird.observe.dto.data.ps.common.TripSeineDto; import fr.ird.observe.dto.data.ps.common.TripSeineReference; @@ -37,13 +37,11 @@ import fr.ird.observe.dto.referential.common.PersonReference; import fr.ird.observe.dto.referential.common.VesselDto; import fr.ird.observe.dto.referential.common.VesselHelper; import fr.ird.observe.dto.referential.common.VesselReference; +import fr.ird.observe.dto.data.TripMapConfigDto; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.spi.UIHandler; -import javax.swing.JComponent; -import javax.swing.JTabbedPane; -import javax.swing.SwingUtilities; import java.awt.Component; import java.awt.Container; @@ -55,7 +53,7 @@ class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto, TripSein static private final Logger log = LogManager.getLogger(TripSeineUIHandler.class); - private boolean buildTripMap = true; + private TripUI.TripUIHelper<TripSeineUI> tripUIHelper; @Override public TripSeineUIModel getModel() { @@ -76,37 +74,15 @@ class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto, TripSein @Override public void afterInit(TripSeineUI ui) { super.afterInit(ui); + tripUIHelper = new TripUI.TripUIHelper<TripSeineUI>(ui, prefix) { - TripMapUI tripMap = ui.getTripMap(); - tripMap.getConfig().setVisible(false); - SwingUtilities.invokeLater(tripMap::validate); - ClientConfig config = ObserveSwingApplicationContext.get().getConfig(); - - tripMap.getHandler().setConfig(config); - tripMap.getHandler().init(ui.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)); - - ui.getMainTabbedPane().addChangeListener(e -> { - JTabbedPane tripSeineTabPane = (JTabbedPane) e.getSource(); - TripMapUI tripMap1 = ui.getTripMap(); - if (tripSeineTabPane.getSelectedComponent().equals(tripMap1)) { - ui.getActions().setVisible(false); - if (buildTripMap) { - SwingUtilities.invokeLater(() -> { - ObserveSwingApplicationContext.get().getMainUI().getModel().setBusy(true); - try { - TripMapDto tripSeineMap = getTripSeineService().getTripSeineMap(getModel().getSelectedId()); - ui.getTripMap().getHandler().doOpenMap(tripSeineMap); - } finally { - ObserveSwingApplicationContext.get().getMainUI().getModel().setBusy(false); - } - }); - buildTripMap = false; - } - - } else { - ui.getActions().setVisible(true); + @Override + protected TripMapDto getMap(TripMapConfigDto tripMapConfig) { + return getTripSeineService().getTripSeineMap(tripMapConfig); } - }); + }; + tripUIHelper.installMap(); + ui.getTripMap().getConfig().setVisible(false); ui.getVessel().getIndexes().setSelectedButton(1); ui.getDepartureHarbour().getIndexes().setSelectedButton(1); @@ -140,9 +116,9 @@ class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto, TripSein TripSeineUIModel model = getModel(); String programId = model.getSelectedParentId(); String tripId = model.getSelectedId(); - log.info(prefix + "programId = " + programId); log.info(prefix + "tripId = " + tripId); + tripUIHelper.onOpenModel(tripId); boolean create = tripId == null; Form<TripSeineDto> form; @@ -159,9 +135,7 @@ class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto, TripSein @Override protected void onOpenAfterOpenModel() { super.onOpenAfterOpenModel(); - getUi().getMainTabbedPane().setSelectedIndex(0); - getUi().getTripMap().getHandler().doCloseMap(); - buildTripMap = true; + tripUIHelper.onOpenAfterOpenModel(); } @Override ===================================== client-core/src/main/java/fr/ird/observe/client/ui/util/tripMap/TripMapUI.jaxx ===================================== @@ -26,12 +26,13 @@ fr.ird.observe.client.ui.actions.tripMap.ZoomItUIAction fr.ird.observe.client.ui.actions.tripMap.ZoomMoinsUIAction fr.ird.observe.client.ui.actions.tripMap.ZoomPlusUIAction + fr.ird.observe.client.ui.util.BeanCheckBox + fr.ird.observe.dto.data.TripMapConfigDto java.awt.CardLayout </import> <CardLayout id="contentLayout"/> - <Boolean id="showObservation" javaBean="true"/> - <Boolean id="showLogbook" javaBean="true"/> + <TripMapConfigDto id="tripMapConfig"/> <JPanel constraints="BorderLayout.NORTH" layout="{new BorderLayout()}"> <JToolBar constraints="BorderLayout.CENTER"> <JButton id='zoomIt'/> @@ -39,9 +40,9 @@ <JButton id='zoomMoins'/> <JButton id='exportPng'/> </JToolBar> - <JPanel id="config" constraints="BorderLayout.SOUTH" layout="{new GridLayout(1,0)}"> - <JCheckBox id="showObservationEditor" onItemStateChanged='setShowObservation(showObservationEditor.isSelected())'/> - <JCheckBox id="showLogbookEditor" onItemStateChanged='setShowLogbook(showLogbookEditor.isSelected())'/> + <JPanel id="config" constraints="BorderLayout.SOUTH" layout="{new GridLayout(1,0)}" beanScope="tripMapConfig"> + <BeanCheckBox id="addObservations"/> + <BeanCheckBox id="addLogbook"/> </JPanel> </JPanel> ===================================== client-core/src/main/java/fr/ird/observe/client/ui/util/tripMap/TripMapUI.jcss ===================================== @@ -44,12 +44,10 @@ _observeAction:{ExportPngUIAction.ACTION_NAME}; } -#showObservationEditor { +#addObservations { text: "observe.content.map.showObservation"; - selected:{isShowObservation()}; } -#showLogbookEditor { +#addLogbook { text: "observe.content.map.showLogbook"; - selected:{isShowLogbook()}; } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/util/tripMap/TripMapUIHandler.java ===================================== @@ -29,9 +29,11 @@ import fr.ird.observe.client.configuration.ClientConfig; import fr.ird.observe.client.ui.ObserveKeyStrokes; import fr.ird.observe.client.ui.actions.tripMap.TripMapActionSupport; import fr.ird.observe.client.ui.content.api.spi.ObserveActionMap; +import fr.ird.observe.client.ui.util.BeanCheckBox; import fr.ird.observe.dto.data.TripMapDto; import fr.ird.observe.dto.data.TripMapPoint; import fr.ird.observe.spi.DtoModelClasses; +import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.geotools.geometry.DirectPosition2D; @@ -43,8 +45,8 @@ import org.nuiton.jaxx.runtime.spi.UIHandler; import javax.swing.AbstractAction; import javax.swing.AbstractButton; -import javax.swing.Action; import javax.swing.InputMap; +import javax.swing.KeyStroke; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; @@ -110,11 +112,11 @@ public class TripMapUIHandler implements UIHandler<TripMapUI> { mapContentBuilder.addLayer(layerFile); } - if (DtoModelClasses.isSeineId(tripMapDto.getId())) { + if (DtoModelClasses.isSeineId(tripMapDto.getTripId())) { mapContentBuilder.addTripLine(tripMapPoints); - } else if (DtoModelClasses.isLonglineId(tripMapDto.getId())) { + } else if (DtoModelClasses.isLonglineId(tripMapDto.getTripId())) { mapContentBuilder.addLonglineObsFishingZone(tripMapPoints); mapContentBuilder.addLonglineObsLine(tripMapPoints); @@ -210,13 +212,6 @@ public class TripMapUIHandler implements UIHandler<TripMapUI> { mapPane.addMouseMotionListener(mouseMapListener); mapPane.addMouseListener(mouseMapListener); mapPane.addMapPaneListener(new TripMapListener()); - - ui.addPropertyChangeListener("showObservation", e -> { - - }); - ui.addPropertyChangeListener("showLogbook", e -> { - - }); rendererRunning = false; } @@ -229,27 +224,8 @@ public class TripMapUIHandler implements UIHandler<TripMapUI> { init(actionMap, inputMap, ui.zoomPlus); init(actionMap, inputMap, ui.exportPng); - ui.getShowLogbookEditor().setText(ObserveKeyStrokes.suffixTextWithKeyStroke(ui.getShowLogbookEditor().getText(), ObserveKeyStrokes.KEY_STROKE_SHOW_LONGLINE_LOGBOOK)); - ui.getShowObservationEditor().setText(ObserveKeyStrokes.suffixTextWithKeyStroke(ui.getShowObservationEditor().getText(), ObserveKeyStrokes.KEY_STROKE_SHOW_LONGLINE_OBS)); - - AbstractAction observationAction = new AbstractAction() { - - @Override - public void actionPerformed(ActionEvent e) { - ui.setShowObservation(!ui.isShowObservation()); - } - }; - Action logbookAction = new AbstractAction() { - - @Override - public void actionPerformed(ActionEvent e) { - ui.setShowLogbook(!ui.isShowLogbook()); - } - }; - inputMap.put(ObserveKeyStrokes.KEY_STROKE_SHOW_LONGLINE_OBS, "toggleObservation"); - actionMap.put("toggleObservation", observationAction); - inputMap.put(ObserveKeyStrokes.KEY_STROKE_SHOW_LONGLINE_LOGBOOK, "toggleLogbook"); - actionMap.put("toggleLogbook", logbookAction); + init(ui.getAddObservations(),inputMap, actionMap, ObserveKeyStrokes.KEY_STROKE_SHOW_LONGLINE_OBS); + init(ui.getAddLogbook(),inputMap, actionMap, ObserveKeyStrokes.KEY_STROKE_SHOW_LONGLINE_LOGBOOK); } public ReferencedEnvelope getTripArea() { @@ -284,6 +260,27 @@ public class TripMapUIHandler implements UIHandler<TripMapUI> { } + protected void init(BeanCheckBox editor, InputMap inputMap, ObserveActionMap actionMap, KeyStroke keyStroke) { + log.debug("init simple boolean editor " + editor.getName()); + String propertyName = editor.getProperty(); + if (StringUtils.isEmpty(propertyName)) { + editor.setProperty(editor.getName()); + } + editor.setSelected(true); + editor.init(true, true); + + editor.setText(ObserveKeyStrokes.suffixTextWithKeyStroke(editor.getText(), keyStroke)); + + AbstractAction observationAction = new AbstractAction() { + @Override + public void actionPerformed(ActionEvent e) { + editor.doClick(); + } + }; + inputMap.put(keyStroke, "toggle" + editor.getName()); + actionMap.put("toggle" + editor.getName(), observationAction); + } + private class MouseMapListener implements MouseWheelListener, MouseListener, MouseMotionListener { Point2D startPointInWorld; ===================================== services-local/src/main/java/fr/ird/observe/services/local/service/data/TripMapDtoFactory.java → dto/src/main/java/fr/ird/observe/dto/data/TripMapConfigDto.java ===================================== @@ -1,8 +1,8 @@ -package fr.ird.observe.services.local.service.data; +package fr.ird.observe.dto.data; /*- * #%L - * ObServe :: Services local implementation + * ObServe :: Dto * %% * Copyright (C) 2008 - 2019 IRD, Code Lutin, Ultreia.io * %% @@ -10,35 +10,66 @@ package fr.ird.observe.services.local.service.data; * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% */ -import fr.ird.observe.dto.data.TripMapDto; -import fr.ird.observe.dto.data.TripMapPoint; - -import java.util.LinkedHashSet; +import fr.ird.observe.dto.ObserveDto; +import io.ultreia.java4all.bean.AbstractJavaBean; +import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition; /** - * Created on 09/01/16. + * Created on 30/06/19. * * @author Tony Chemit - dev(a)tchemit.fr + * @since ? */ -public class TripMapDtoFactory { +@GenerateJavaBeanDefinition +public class TripMapConfigDto extends AbstractJavaBean implements ObserveDto { + + public static final String PROPERTY_TRIP_ID = "tripId"; + public static final String PROPERTY_ADD_OBSERVATIONS = "addObservations"; + public static final String PROPERTY_ADD_LOGBOOK = "addLogbook"; + private String tripId; + private boolean addObservations; + private boolean addLogbook; + + public String getTripId() { + return tripId; + } + - public static TripMapDto of(String tripId, LinkedHashSet<TripMapPoint> points) { - TripMapDto tripMapDto = new TripMapDto(); - tripMapDto.setId(tripId); - tripMapDto.setPoints(points); - return tripMapDto; + public boolean isAddObservations() { + return addObservations; } + public boolean isAddLogbook() { + return addLogbook; + } + + public void setTripId(String tripId) { + String oldValue = getTripId(); + this.tripId = tripId; + firePropertyChange(PROPERTY_TRIP_ID, oldValue, tripId); + } + + public void setAddObservations(boolean addObservations) { + boolean oldValue = isAddObservations(); + this.addObservations = addObservations; + firePropertyChange(PROPERTY_ADD_OBSERVATIONS, oldValue, addObservations); + } + + public void setAddLogbook(boolean addLogbook) { + boolean oldValue = isAddLogbook(); + this.addLogbook = addLogbook; + firePropertyChange(PROPERTY_ADD_LOGBOOK, oldValue, addLogbook); + } } ===================================== dto/src/main/java/fr/ird/observe/dto/data/TripMapDto.java ===================================== @@ -22,22 +22,36 @@ package fr.ird.observe.dto.data; * #L% */ -import fr.ird.observe.dto.IdDto; +import fr.ird.observe.dto.ObserveDto; +import io.ultreia.java4all.bean.AbstractJavaBean; +import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition; -import java.util.Collection; import java.util.LinkedHashSet; -public class TripMapDto extends IdDto { +@GenerateJavaBeanDefinition +public class TripMapDto extends AbstractJavaBean implements ObserveDto { + public static final String PROPERTY_TRIP_ID = "tripId"; public static final String PROPERTY_POINTS = "points"; - private static final long serialVersionUID = 3487020005850232420L; + private String tripId; + private LinkedHashSet<TripMapPoint> points; - protected LinkedHashSet<TripMapPoint> points; + public static TripMapDto of(String tripId, LinkedHashSet<TripMapPoint> points) { + TripMapDto tripMapDto = new TripMapDto(); + tripMapDto.setTripId(tripId); + tripMapDto.setPoints(points); + return tripMapDto; + } + + public String getTripId() { + return tripId; + } - public TripMapPoint getPoints(int index) { - TripMapPoint o = getChild(points, index); - return o; + public void setTripId(String tripId) { + String oldValue = getTripId(); + this.tripId = tripId; + firePropertyChange(PROPERTY_TRIP_ID, oldValue, tripId); } public boolean isPointsEmpty() { @@ -48,42 +62,6 @@ public class TripMapDto extends IdDto { return points == null ? 0 : points.size(); } - public void addPoints(TripMapPoint points) { - getPoints().add(points); - firePropertyChange(PROPERTY_POINTS, null, points); - } - - public void addAllPoints(Collection<TripMapPoint> points) { - getPoints().addAll(points); - firePropertyChange(PROPERTY_POINTS, null, points); - } - - public boolean removePoints(TripMapPoint points) { - boolean removed = getPoints().remove(points); - if (removed) { - firePropertyChange(PROPERTY_POINTS, points, null); - } - return removed; - } - - public boolean removeAllPoints(Collection<TripMapPoint> points) { - boolean removed = getPoints().removeAll(points); - if (removed) { - firePropertyChange(PROPERTY_POINTS, points, null); - } - return removed; - } - - public boolean containsPoints(TripMapPoint points) { - boolean contains = getPoints().contains(points); - return contains; - } - - public boolean containsAllPoints(Collection<TripMapPoint> points) { - boolean contains = getPoints().containsAll(points); - return contains; - } - public LinkedHashSet<TripMapPoint> getPoints() { if (points == null) { points = new LinkedHashSet<>(); ===================================== persistence/src/main/java/fr/ird/observe/entities/data/ll/common/TripLonglineTopiaDao.java ===================================== @@ -24,6 +24,7 @@ package fr.ird.observe.entities.data.ll.common; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; +import fr.ird.observe.dto.data.TripMapConfigDto; import fr.ird.observe.dto.data.TripMapPoint; import fr.ird.observe.dto.data.TripMapPointType; import fr.ird.observe.entities.referential.common.Harbour; @@ -53,8 +54,11 @@ public class TripLonglineTopiaDao extends AbstractTripLonglineTopiaDao<TripLongl //FIXME-PROTECTED-ID public static final String ACTIVITY_LOGBOOK_STATION_ID= "fr.ird.referential.ll.common.VesselActivityLongline#1239832686138#0.3"; - public LinkedHashSet<TripMapPoint> extractTripMapActivityPoints(String tripId, boolean addObservation, boolean addLogbook) { + public LinkedHashSet<TripMapPoint> extractTripMapActivityPoints(TripMapConfigDto tripMapConfig) { + String tripId = tripMapConfig.getTripId(); + boolean addObservation = tripMapConfig.isAddObservations(); + boolean addLogbook = tripMapConfig.isAddLogbook(); TripLongline tripLongline = forTopiaIdEquals(tripId).findUnique(); LinkedHashSet<TripMapPoint> tripMapPoints = new LinkedHashSet<>(); ===================================== persistence/src/main/java/fr/ird/observe/entities/data/ps/common/TripSeineTopiaDao.java ===================================== @@ -22,6 +22,7 @@ package fr.ird.observe.entities.data.ps.common; import com.google.common.collect.ImmutableMap; +import fr.ird.observe.dto.data.TripMapConfigDto; import fr.ird.observe.dto.data.TripMapPoint; import fr.ird.observe.dto.data.TripMapPointType; import fr.ird.observe.dto.referential.ps.common.SchoolTypeHelper; @@ -51,8 +52,8 @@ public class TripSeineTopiaDao extends AbstractTripSeineTopiaDao<TripSeine> { //FIXME-PROTECTED-ID public static final String ACTIVITY_HARBOUR_ID= "fr.ird.referential.ps.common.VesselActivitySeine#1239832675349#0.363119635949572"; - public LinkedHashSet<TripMapPoint> extractTripMapActivityPoints(String tripId) { - + public LinkedHashSet<TripMapPoint> extractTripMapActivityPoints(TripMapConfigDto tripMapConfig) { + String tripId = tripMapConfig.getTripId(); TripSeine tripSeine = forTopiaIdEquals(tripId).findUnique(); LinkedHashSet<TripMapPoint> tripMapPoints = new LinkedHashSet<>(); ===================================== services-local/src/main/java/fr/ird/observe/services/local/service/data/ll/common/TripLonglineServiceLocal.java ===================================== @@ -23,6 +23,7 @@ package fr.ird.observe.services.local.service.data.ll.common; */ import com.google.common.collect.ImmutableSet; +import fr.ird.observe.dto.data.TripMapConfigDto; import fr.ird.observe.dto.data.TripMapDto; import fr.ird.observe.dto.data.TripMapPoint; import fr.ird.observe.dto.data.ll.common.TripLonglineDto; @@ -42,7 +43,6 @@ import fr.ird.observe.entities.referential.common.Species2; import fr.ird.observe.entities.referential.common.SpeciesList; import fr.ird.observe.services.local.ObserveServiceContextLocal; import fr.ird.observe.services.local.service.ObserveServiceLocal; -import fr.ird.observe.services.local.service.data.TripMapDtoFactory; import fr.ird.observe.services.service.data.ll.common.TripLonglineService; import fr.ird.observe.services.service.sql.DeleteSqlScriptProducerRequest; import fr.ird.observe.services.service.sql.SqlScriptProducerService; @@ -113,9 +113,9 @@ public class TripLonglineServiceLocal extends ObserveServiceLocal implements Tri } @Override - public TripMapDto getTripLonglineMap(String tripLonglineId, boolean addObservation, boolean addLogbook) { - LinkedHashSet<TripMapPoint> points = TRIP_LONGLINE_SPI.getDao(getTopiaPersistenceContext()).extractTripMapActivityPoints(tripLonglineId, addObservation, addLogbook); - return TripMapDtoFactory.of(tripLonglineId, points); + public TripMapDto getTripLonglineMap(TripMapConfigDto config) { + LinkedHashSet<TripMapPoint> points = TRIP_LONGLINE_SPI.getDao(getTopiaPersistenceContext()).extractTripMapActivityPoints(config); + return TripMapDto.of(config.getTripId(), points); } @Override ===================================== services-local/src/main/java/fr/ird/observe/services/local/service/data/ps/common/TripSeineServiceLocal.java ===================================== @@ -40,7 +40,7 @@ import fr.ird.observe.entities.referential.common.Species2; import fr.ird.observe.entities.referential.common.SpeciesList; import fr.ird.observe.services.local.ObserveServiceContextLocal; import fr.ird.observe.services.local.service.ObserveServiceLocal; -import fr.ird.observe.services.local.service.data.TripMapDtoFactory; +import fr.ird.observe.dto.data.TripMapConfigDto; import fr.ird.observe.services.service.data.ps.common.TripSeineService; import fr.ird.observe.services.service.sql.DeleteSqlScriptProducerRequest; import fr.ird.observe.services.service.sql.SqlScriptProducerService; @@ -98,9 +98,9 @@ public class TripSeineServiceLocal extends ObserveServiceLocal implements TripSe } @Override - public TripMapDto getTripSeineMap(String tripSeineId) { - LinkedHashSet<TripMapPoint> points = TRIP_SEINE_SPI.getDao(getTopiaPersistenceContext()).extractTripMapActivityPoints(tripSeineId); - return TripMapDtoFactory.of(tripSeineId, points); + public TripMapDto getTripSeineMap(TripMapConfigDto config) { + LinkedHashSet<TripMapPoint> points = TRIP_SEINE_SPI.getDao(getTopiaPersistenceContext()).extractTripMapActivityPoints(config); + return TripMapDto.of(config.getTripId(), points); } @Override ===================================== services/src/main/java/fr/ird/observe/services/service/data/ll/common/TripLonglineService.java ===================================== @@ -32,6 +32,7 @@ import fr.ird.observe.dto.reference.ReferentialDtoReferenceSet; import fr.ird.observe.dto.referential.common.SpeciesReference; import fr.ird.observe.dto.result.SaveResultDto; import fr.ird.observe.services.service.ObserveService; +import fr.ird.observe.dto.data.TripMapConfigDto; import fr.ird.observe.services.service.data.TripService; import fr.ird.observe.services.spi.ReadDataPermission; import fr.ird.observe.services.spi.Write; @@ -42,7 +43,6 @@ import io.ultreia.java4all.http.spi.Nullable; import io.ultreia.java4all.http.spi.Post; import java.util.Date; -import java.util.Set; /** * @author Tony Chemit - dev(a)tchemit.fr @@ -55,7 +55,7 @@ public interface TripLonglineService extends ObserveService, TripService { @Get @ReadDataPermission - TripMapDto getTripLonglineMap(String tripLonglineId, boolean addObservation, boolean addLogbook); + TripMapDto getTripLonglineMap(TripMapConfigDto config); @Get @ReadDataPermission ===================================== services/src/main/java/fr/ird/observe/services/service/data/ps/common/TripSeineService.java ===================================== @@ -32,6 +32,7 @@ import fr.ird.observe.dto.reference.ReferentialDtoReferenceSet; import fr.ird.observe.dto.referential.common.SpeciesReference; import fr.ird.observe.dto.result.SaveResultDto; import fr.ird.observe.services.service.ObserveService; +import fr.ird.observe.dto.data.TripMapConfigDto; import fr.ird.observe.services.service.data.TripService; import fr.ird.observe.services.spi.ReadDataPermission; import fr.ird.observe.services.spi.Write; @@ -42,7 +43,6 @@ import io.ultreia.java4all.http.spi.Nullable; import io.ultreia.java4all.http.spi.Post; import java.util.Date; -import java.util.Set; /** * @author Tony Chemit - dev(a)tchemit.fr @@ -55,7 +55,7 @@ public interface TripSeineService extends ObserveService , TripService { @Get @ReadDataPermission - TripMapDto getTripSeineMap(String tripSeineId); + TripMapDto getTripSeineMap(TripMapConfigDto config); @Get @ReadDataPermission View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/994ae443c89808b510377447d2c… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/994ae443c89808b510377447d2c… You're receiving this email because of your account on gitlab.com.
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 322
  • 323
  • 324
  • 325
  • 326
  • 327
  • 328
  • ...
  • 720
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.