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] 5 commits: Réusinage de la configuration d'une source de données et des templates associées - Closes #1797
by Tony CHEMIT 11 Mar '21

11 Mar '21
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: af76b2dc by Tony Chemit at 2021-03-11T10:51:24+01:00 Réusinage de la configuration d&#39;une source de données et des templates associées - Closes #1797 - - - - - d219d92e by Tony Chemit at 2021-03-11T10:51:24+01:00 Fix bad reports selection - - - - - c10c0313 by Tony Chemit at 2021-03-11T10:57:10+01:00 Réusinage de la configuration d&#39;une source de données et des templates associées - Closes #1797 - - - - - f1be0811 by Tony Chemit at 2021-03-11T12:15:05+01:00 Bloquer l&#39;import d&#39;une marée si elle contient des identifiants déjà utilisés dans la base cible - Closes #1799 - - - - - 03a7237c by Tony Chemit at 2021-03-11T15:19:13+01:00 Update jaxx - - - - - 27 changed files: - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/report/ReportModel.java - client/datasource/api/src/main/i18n/templates/ObserveSwingDataSource_en_GB.ftl - client/datasource/api/src/main/i18n/templates/ObserveSwingDataSource_es_ES.ftl - client/datasource/api/src/main/i18n/templates/ObserveSwingDataSource_fr_FR.ftl - client/datasource/api/src/main/java/fr/ird/observe/client/datasource/api/config/ConfigSupport.jcss - client/datasource/api/src/main/java/fr/ird/observe/client/datasource/api/config/form/ConfigurationModel.java - client/datasource/api/src/main/java/fr/ird/observe/client/datasource/api/config/form/ServerConfigurationModel.java - client/datasource/api/src/test/java/fr/ird/observe/client/datasource/api/ObserveSwingDataSourceTest.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/menu/DataSourceEditorMenu.jcss - pom.xml - − server/core/.mvn/i18n/parse-java - server/core/pom.xml - − server/core/src/main/i18n/getters/java.getter - server/core/src/main/java/fr/ird/observe/server/request/ObserveWebRequestContext.java - − server/core/src/main/java/fr/ird/observe/server/security/AdminApiKeyNotFoundException.java - − server/core/src/main/java/fr/ird/observe/server/security/AuthenticationTokenNotFoundException.java - − server/core/src/main/java/fr/ird/observe/server/security/BadObserveWebUserPasswordException.java - − server/core/src/main/java/fr/ird/observe/server/security/InvalidAdminKeyApiException.java - server/core/src/main/java/fr/ird/observe/server/security/ObserveWebSecurityApplicationContext.java - − server/core/src/main/java/fr/ird/observe/server/security/UnknownObserveWebUserException.java - − server/core/src/main/java/fr/ird/observe/server/security/UnknownObserveWebUserForDatabaseException.java - − server/core/src/main/java/fr/ird/observe/server/security/UserLoginNotFoundException.java - − server/core/src/main/java/fr/ird/observe/server/security/UserPasswordNotFoundException.java - server/i18n/src/main/i18n/translations/observe_en_GB.properties - server/i18n/src/main/i18n/translations/observe_es_ES.properties - server/i18n/src/main/i18n/translations/observe_fr_FR.properties - services/local-impl/src/main/java/fr/ird/observe/services/local/service/data/TripManagementServiceLocalSupport.java Changes: ===================================== client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/report/ReportModel.java ===================================== @@ -44,6 +44,7 @@ import java.nio.file.Files; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.TreeMap; import java.util.stream.Collectors; @@ -333,7 +334,7 @@ public class ReportModel extends AdminActionModel { if (reportFile == null) { return; } - reports = getAllReports().stream().filter(r -> modelType.toString() == r.getModelType()).collect(Collectors.toList()); + reports = getAllReports().stream().filter(r -> Objects.equals(modelType.toString(), r.getModelType())).collect(Collectors.toList()); firePropertyChange(REPORTS_PROPERTY_NAME, reports); log.info(String.format("Detects %d report(s).", reports.size() - 1)); } ===================================== client/datasource/api/src/main/i18n/templates/ObserveSwingDataSource_en_GB.ftl ===================================== @@ -20,11 +20,13 @@ --> <html> <body> -<#import "ObserveDataSourceConfiguration_en_GB.ftl" as configurationMacros> -<h3>${.data_model.label}</h3> -<@configurationMacros.dataSourceConfiguration .data_model.configuration /> -<#if .data_model.dataSourceInformation??> - <@configurationMacros.dataSourceInformationRights .data_model.dataSourceInformation /> +<#if .data_model?? && .data_model.label??> + <#import "ObserveDataSourceConfiguration_en_GB.ftl" as configurationMacros> + <h3>${.data_model.label}</h3> + <@configurationMacros.dataSourceConfiguration .data_model.configuration /> + <#if .data_model.dataSourceInformation??> + <@configurationMacros.dataSourceInformationRights .data_model.dataSourceInformation /> + </#if> <#else> No data source loaded </#if> ===================================== client/datasource/api/src/main/i18n/templates/ObserveSwingDataSource_es_ES.ftl ===================================== @@ -20,11 +20,13 @@ --> <html> <body> -<#import "ObserveDataSourceConfiguration_es_ES.ftl" as configurationMacros> -<h3>${.data_model.label}</h3> -<@configurationMacros.dataSourceConfiguration .data_model.configuration /> -<#if .data_model.dataSourceInformation??> - <@configurationMacros.dataSourceInformationRights .data_model.dataSourceInformation /> +<#if .data_model?? && .data_model.label??> + <#import "ObserveDataSourceConfiguration_es_ES.ftl" as configurationMacros> + <h3>${.data_model.label}</h3> + <@configurationMacros.dataSourceConfiguration .data_model.configuration /> + <#if .data_model.dataSourceInformation??> + <@configurationMacros.dataSourceInformationRights .data_model.dataSourceInformation /> + </#if> <#else> Ninguna fuente de datos cargada </#if> ===================================== client/datasource/api/src/main/i18n/templates/ObserveSwingDataSource_fr_FR.ftl ===================================== @@ -20,11 +20,13 @@ --> <html> <body> -<#import "ObserveDataSourceConfiguration_fr_FR.ftl" as configurationMacros> -<h3>${.data_model.label}</h3> -<@configurationMacros.dataSourceConfiguration .data_model.configuration /> -<#if .data_model.dataSourceInformation??> - <@configurationMacros.dataSourceInformationRights .data_model.dataSourceInformation /> +<#if .data_model?? && .data_model.label??> + <#import "ObserveDataSourceConfiguration_fr_FR.ftl" as configurationMacros> + <h3>${.data_model.label}</h3> + <@configurationMacros.dataSourceConfiguration .data_model.configuration /> + <#if .data_model.dataSourceInformation??> + <@configurationMacros.dataSourceInformationRights .data_model.dataSourceInformation /> + </#if> <#else> Aucune source de données chargée </#if> ===================================== client/datasource/api/src/main/java/fr/ird/observe/client/datasource/api/config/ConfigSupport.jcss ===================================== @@ -21,7 +21,7 @@ */ #testConnexion { - enabled:{!model.isConnexionSuccess()}; + enabled:{model.isSyntaxValid() && !model.isConnexionSuccess()}; } #saveConfiguration { ===================================== client/datasource/api/src/main/java/fr/ird/observe/client/datasource/api/config/form/ConfigurationModel.java ===================================== @@ -40,6 +40,8 @@ import org.nuiton.version.Versions; import javax.swing.Icon; import java.awt.Color; +import java.io.PrintWriter; +import java.io.StringWriter; import java.lang.reflect.UndeclaredThrowableException; import java.util.Objects; import java.util.function.Function; @@ -70,7 +72,6 @@ public abstract class ConfigurationModel extends AbstractJavaBean implements Wit public static final String CONNEXION_STATUS_ICON_PROPERTY_NAME = "connexionStatusIcon"; public static final String CONNEXION_STATUS_COLOR_PROPERTY_NAME = "connexionStatusColor"; public static final String CAN_CREATE_DATABASE_PROPERTY_NAME = "canCreateDatabase"; - public static final String BUSY_PROPERTY_NAME = "busy"; public static final String SYNTAX_VALID_PROPERTY_NAME = "syntaxValid"; /** @@ -109,11 +110,6 @@ public abstract class ConfigurationModel extends AbstractJavaBean implements Wit * Is configuration syntax is valid? */ private boolean syntaxValid; - - /** - * Is model busy? - */ - private boolean busy; /** * FIXME Add this in DataSourceConnectMode * Cache of colors indexed by connexion status. @@ -124,6 +120,8 @@ public abstract class ConfigurationModel extends AbstractJavaBean implements Wit this.configuration = Objects.requireNonNull(configuration); } + protected abstract boolean testSyntax(); + public void fromConfig(ObserveDataSourceConfiguration config) { String oldLabel = getLabel(); getConfiguration().setLabel(config == null ? null : config.getLabel()); @@ -135,45 +133,28 @@ public abstract class ConfigurationModel extends AbstractJavaBean implements Wit return configuration.getDataSourceType(); } - /** - * Use this as soon as the configuration has been modified. - */ - protected void clearStatus() { - setDataSourceInformation(null); - setConnexionError(null); - setConnexionStatus(ConnexionStatus.UNTESTED); - setSyntaxValid(false); - } - /** * @param dataSourceFunction to get new data source * @return {@code true} if connexion was tested and is valid. */ public final boolean testConnexion(Function<ObserveDataSourceConfiguration, ObserveSwingDataSource> dataSourceFunction) { clearStatus(); - setBusy(true); - boolean syntaxValid = testSyntax(); - setSyntaxValid(syntaxValid); - if (isConnexionFailed()) { + if (!isSyntaxValid() || isConnexionFailed()) { return false; } + ObserveSwingDataSource dataSource = dataSourceFunction.apply(getConfiguration()); try { - ObserveSwingDataSource dataSource = dataSourceFunction.apply(getConfiguration()); - try { - ObserveDataSourceInformation dataSourceInformation = test(dataSource); - testDataSourceInformation(dataSourceInformation); - if (!isConnexionFailed()) { - setConnexionStatus(ConnexionStatus.SUCCESS); - } - } catch (Throwable e) { - onConnexionError(e); - } finally { - if (dataSource.isOpen()) { - dataSource.close(); - } + ObserveDataSourceInformation dataSourceInformation = test(dataSource); + testDataSourceInformation(dataSourceInformation); + if (!isConnexionFailed()) { + setConnexionStatus(ConnexionStatus.SUCCESS); } + } catch (Throwable e) { + onConnexionError(e); } finally { - setBusy(false); + if (dataSource.isOpen()) { + dataSource.close(); + } } return isConnexionSuccess(); } @@ -183,8 +164,9 @@ public abstract class ConfigurationModel extends AbstractJavaBean implements Wit } public void setSyntaxValid(boolean syntaxValid) { + boolean oldValue = isSyntaxValid(); this.syntaxValid = syntaxValid; - firePropertyChange(SYNTAX_VALID_PROPERTY_NAME, syntaxValid); + firePropertyChange(SYNTAX_VALID_PROPERTY_NAME, oldValue, syntaxValid); } public boolean isConnexionSuccess() { @@ -199,20 +181,6 @@ public abstract class ConfigurationModel extends AbstractJavaBean implements Wit return getConnexionStatus() == ConnexionStatus.UNTESTED; } - protected abstract boolean testSyntax(); - - protected void onConnexionError(Throwable e) { - if (e instanceof UndeclaredThrowableException) { - e = ((UndeclaredThrowableException) e).getUndeclaredThrowable(); - } - setConnexionError(e); - setConnexionStatus(ConnexionStatus.FAILED); - } - - public ObserveDataSourceConfiguration getConfiguration() { - return configuration; - } - public String getLabel() { return getConfiguration().getLabel(); } @@ -239,7 +207,16 @@ public abstract class ConfigurationModel extends AbstractJavaBean implements Wit public String getConnexionStatusText() { if (connexionStatusText == null) { - this.connexionStatusText = ConfigurationModelTemplate.generate(this); + try { + this.connexionStatusText = ConfigurationModelTemplate.generate(this); + } catch (Exception e) { + StringWriter out = new StringWriter(4048); + try (PrintWriter writer = new PrintWriter(out)) { + e.printStackTrace(writer); + out.flush(); + } + connexionStatusText = out.toString(); + } } return connexionStatusText; } @@ -292,7 +269,7 @@ public abstract class ConfigurationModel extends AbstractJavaBean implements Wit Throwable oldValue = getConnexionError(); this.connexionError = connexionError; firePropertyChange(CONNEXION_ERROR_PROPERTY_NAME, oldValue, connexionError); - setConnexionStatusError(connexionError == null ? null : connexionError.getMessage()); + setConnexionStatusError(connexionError == null ? null : connexionError.getMessage()==null?connexionError.toString():connexionError.getMessage()); } public ObserveDataSourceInformation getDataSourceInformation() { @@ -318,14 +295,26 @@ public abstract class ConfigurationModel extends AbstractJavaBean implements Wit firePropertyChange(CAN_MIGRATE_PROPERTY_NAME, oldValue, canMigrate); } - public boolean isBusy() { - return busy; + /** + * Use this as soon as the configuration has been modified. + */ + protected void clearStatus() { + setDataSourceInformation(null); + setConnexionError(null); + setConnexionStatus(ConnexionStatus.UNTESTED); + setSyntaxValid(testSyntax()); } - public void setBusy(boolean busy) { - boolean oldValue = isBusy(); - this.busy = busy; - firePropertyChange(BUSY_PROPERTY_NAME, oldValue, busy); + protected void onConnexionError(Throwable e) { + if (e instanceof UndeclaredThrowableException) { + e = ((UndeclaredThrowableException) e).getUndeclaredThrowable(); + } + setConnexionError(e); + setConnexionStatus(ConnexionStatus.FAILED); + } + + public ObserveDataSourceConfiguration getConfiguration() { + return configuration; } protected final ObserveDataSourceInformation test(ObserveSwingDataSource dataSource) throws DatabaseConnexionNotAuthorizedException, DatabaseNotFoundException { ===================================== client/datasource/api/src/main/java/fr/ird/observe/client/datasource/api/config/form/ServerConfigurationModel.java ===================================== @@ -43,7 +43,7 @@ import java.net.URL; public class ServerConfigurationModel extends ConfigurationModel { public static final String LOGIN_PROPERTY_NAME = "login"; public static final String SERVER_URL_PROPERTY_NAME = "serverUrl"; - public static final String OPTIONAL_SERVER_DATABASE_NAME_PROPERTY_NAME = "optionalServerDatabaseName"; + public static final String OPTIONAL_DATABASE_NAME_PROPERTY_NAME = "optionalDatabaseName"; private static final Logger log = LogManager.getLogger(ServerConfigurationModel.class); public ServerConfigurationModel() { @@ -63,7 +63,7 @@ public class ServerConfigurationModel extends ConfigurationModel { firePropertyChange(SERVER_URL_PROPERTY_NAME, oldServerUrl, getServerUrl()); firePropertyChange(LOGIN_PROPERTY_NAME, oldLogin, getLogin()); firePropertyChange(PASSWORD_PROPERTY_NAME, oldPassword, getPassword()); - firePropertyChange(OPTIONAL_SERVER_DATABASE_NAME_PROPERTY_NAME, oldOptionalDatabaseName, getOptionalDatabaseName()); + firePropertyChange(OPTIONAL_DATABASE_NAME_PROPERTY_NAME, oldOptionalDatabaseName, getOptionalDatabaseName()); } public void fromPreset(ServerDataSourceConfiguration configuration) { @@ -79,7 +79,7 @@ public class ServerConfigurationModel extends ConfigurationModel { firePropertyChange(SERVER_URL_PROPERTY_NAME, oldServerUrl, getServerUrl()); firePropertyChange(LOGIN_PROPERTY_NAME, oldLogin, getLogin()); firePropertyChange(PASSWORD_PROPERTY_NAME, oldPassword, getPassword()); - firePropertyChange(OPTIONAL_SERVER_DATABASE_NAME_PROPERTY_NAME, oldOptionalDatabaseName, getOptionalDatabaseName()); + firePropertyChange(OPTIONAL_DATABASE_NAME_PROPERTY_NAME, oldOptionalDatabaseName, getOptionalDatabaseName()); clearStatus(); } @@ -100,9 +100,8 @@ public class ServerConfigurationModel extends ConfigurationModel { @Override protected boolean testSyntax() { - String serverUrl = getConfiguration().getServerUrl(); - if (getServerUrl() == null || getLogin() != null || getPassword() == null) { + if (getServerUrl() == null || getLogin() == null || getPassword() == null) { return false; } try { @@ -110,6 +109,7 @@ public class ServerConfigurationModel extends ConfigurationModel { } catch (MalformedURLException e) { setConnexionStatusError(I18n.t("observe.ui.datasource.storage.error.badUrl", serverUrl)); setConnexionStatus(ConnexionStatus.FAILED); + return false; } return true; } @@ -154,7 +154,7 @@ public class ServerConfigurationModel extends ConfigurationModel { public void setOptionalDatabaseName(String optionalDatabaseName) { String oldValue = getOptionalDatabaseName(); getConfiguration().setOptionalDatabaseName(optionalDatabaseName); - firePropertyChange(OPTIONAL_SERVER_DATABASE_NAME_PROPERTY_NAME, oldValue, optionalDatabaseName); + firePropertyChange(OPTIONAL_DATABASE_NAME_PROPERTY_NAME, oldValue, optionalDatabaseName); clearStatus(); } ===================================== client/datasource/api/src/test/java/fr/ird/observe/client/datasource/api/ObserveSwingDataSourceTest.java ===================================== @@ -145,7 +145,9 @@ public class ObserveSwingDataSourceTest { } private void assertGenerate(ObserveSwingDataSource dataSource) { - String expected = ObserveSwingDataSourceTemplate.generate(dataSource); + String expected = ObserveSwingDataSourceTemplate.generate(null); + Assert.assertNotNull(expected); + expected = ObserveSwingDataSourceTemplate.generate(dataSource); String actual = dataSource.getSummaryText(); Assert.assertNotNull(expected); Assert.assertNotNull(actual); ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/menu/DataSourceEditorMenu.jcss ===================================== @@ -36,6 +36,10 @@ JToolBar { enabled: {uiModel.isStorageReloadEnabled()}; } +#showStorageInfo { + enabled: {uiModel.isStorageCloseEnabled()}; +} + #closeStorage { enabled: {uiModel.isStorageCloseEnabled()}; } ===================================== pom.xml ===================================== @@ -151,7 +151,7 @@ <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format> <buildDate>${maven.build.timestamp}</buildDate> - <toolkit.version>5.0.7</toolkit.version> + <toolkit.version>5.0.8</toolkit.version> <lib.version.ognl>3.1.28</lib.version.ognl> <!--can't use 1.4.197 (date has changed + blob also)--> @@ -161,7 +161,7 @@ <!-- <lib.version.java4all.topia>1.43</lib.version.java4all.topia>--> <!-- <lib.version.java4all.eugene>3.0-alpha-38</lib.version.java4all.eugene>--> - <!-- <lib.version.java4all.jaxx>3.0.0-RC-2</lib.version.java4all.jaxx>--> + <lib.version.java4all.jaxx>3.0.0-RC-3</lib.version.java4all.jaxx> <!--<lib.version.java4all.application-context>1.0.3-SNAPSHOT</lib.version.java4all.application-context>--> <!--<lib.version.java4all.application-template>1.0.2-SNAPSHOT</lib.version.java4all.application-template>--> <!--<lib.version.java4all.i18n>4.0-beta-3-SNAPSHOT</lib.version.java4all.i18n>--> ===================================== server/core/.mvn/i18n/parse-java deleted ===================================== ===================================== server/core/pom.xml ===================================== @@ -88,10 +88,6 @@ <groupId>io.ultreia.java4all.topia</groupId> <artifactId>persistence</artifactId> </dependency> - <dependency> - <groupId>io.ultreia.java4all.i18n</groupId> - <artifactId>i18n-runtime</artifactId> - </dependency> <dependency> <groupId>io.ultreia.java4all</groupId> <artifactId>class-mapping</artifactId> @@ -117,10 +113,10 @@ <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> </dependency> - <dependency> - <groupId>com.google.auto.service</groupId> - <artifactId>auto-service-annotations</artifactId> - </dependency> +<!-- <dependency>--> +<!-- <groupId>com.google.auto.service</groupId>--> +<!-- <artifactId>auto-service-annotations</artifactId>--> +<!-- </dependency>--> <dependency> <groupId>org.nuiton</groupId> ===================================== server/core/src/main/i18n/getters/java.getter deleted ===================================== @@ -1,8 +0,0 @@ -observe.ui.datasource.storage.error.rest.adminApiKey.invalid -observe.ui.datasource.storage.error.rest.adminApiKey.required -observe.ui.datasource.storage.error.rest.authenticationToken.required -observe.ui.datasource.storage.error.rest.database.unknownForUser -observe.ui.datasource.storage.error.rest.password.bad -observe.ui.datasource.storage.error.rest.password.required -observe.ui.datasource.storage.error.rest.user.required -observe.ui.datasource.storage.error.rest.user.unknown ===================================== server/core/src/main/java/fr/ird/observe/server/request/ObserveWebRequestContext.java ===================================== @@ -26,9 +26,9 @@ import fr.ird.observe.dto.db.configuration.ObserveDataSourceConfiguration; import fr.ird.observe.dto.db.configuration.ObserveDataSourceConfigurationAndConnection; import fr.ird.observe.server.ObserveWebApplicationContext; import fr.ird.observe.server.configuration.ObserveServiceInitializerServerConfig; -import fr.ird.observe.server.security.AdminApiKeyNotFoundException; -import fr.ird.observe.server.security.AuthenticationTokenNotFoundException; -import fr.ird.observe.server.security.InvalidAdminKeyApiException; +import fr.ird.observe.services.service.security.AdminApiKeyNotFoundException; +import fr.ird.observe.services.service.security.AuthenticationTokenNotFoundException; +import fr.ird.observe.services.service.security.InvalidAdminKeyApiException; import fr.ird.observe.services.ObserveServiceInitializer; import fr.ird.observe.services.service.ObserveService; import org.debux.webmotion.server.call.HttpContext; ===================================== server/core/src/main/java/fr/ird/observe/server/security/AdminApiKeyNotFoundException.java deleted ===================================== @@ -1,42 +0,0 @@ -package fr.ird.observe.server.security; - -/* - * #%L - * ObServe Server :: Core - * %% - * Copyright (C) 2008 - 2021 IRD, Code Lutin, Ultreia.io - * %% - * This program is free software: you can redistribute it and/or modify - * 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.services.service.security.SecurityExceptionSupport; -import io.ultreia.java4all.i18n.I18n; - -import java.util.Locale; - -/** - * Created on 07/09/15. - * - * @author Tony Chemit - dev(a)tchemit.fr - */ -public class AdminApiKeyNotFoundException extends SecurityExceptionSupport { - - private static final long serialVersionUID = 1L; - - public AdminApiKeyNotFoundException(Locale locale) { - super(I18n.l(locale, "observe.ui.datasource.storage.error.rest.adminApiKey.required")); - } -} ===================================== server/core/src/main/java/fr/ird/observe/server/security/AuthenticationTokenNotFoundException.java deleted ===================================== @@ -1,42 +0,0 @@ -package fr.ird.observe.server.security; - -/* - * #%L - * ObServe Server :: Core - * %% - * Copyright (C) 2008 - 2021 IRD, Code Lutin, Ultreia.io - * %% - * This program is free software: you can redistribute it and/or modify - * 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.services.service.security.SecurityExceptionSupport; -import io.ultreia.java4all.i18n.I18n; - -import java.util.Locale; - -/** - * Created on 07/09/15. - * - * @author Tony Chemit - dev(a)tchemit.fr - */ -public class AuthenticationTokenNotFoundException extends SecurityExceptionSupport { - - private static final long serialVersionUID = 1L; - - public AuthenticationTokenNotFoundException(Locale locale) { - super(I18n.l(locale, "observe.ui.datasource.storage.error.rest.authenticationToken.required")); - } -} ===================================== server/core/src/main/java/fr/ird/observe/server/security/BadObserveWebUserPasswordException.java deleted ===================================== @@ -1,43 +0,0 @@ -package fr.ird.observe.server.security; - -/* - * #%L - * ObServe Server :: Core - * %% - * Copyright (C) 2008 - 2021 IRD, Code Lutin, Ultreia.io - * %% - * This program is free software: you can redistribute it and/or modify - * 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.services.service.security.SecurityExceptionSupport; -import io.ultreia.java4all.i18n.I18n; - -import java.util.Locale; - -/** - * Created on 30/08/15. - * - * @author Tony Chemit - dev(a)tchemit.fr - */ -public class BadObserveWebUserPasswordException extends SecurityExceptionSupport { - - private static final long serialVersionUID = 1L; - - public BadObserveWebUserPasswordException(Locale locale, String userLogin) { - super(I18n.l(locale, "observe.ui.datasource.storage.error.rest.password.bad", userLogin)); - } - -} ===================================== server/core/src/main/java/fr/ird/observe/server/security/InvalidAdminKeyApiException.java deleted ===================================== @@ -1,43 +0,0 @@ -package fr.ird.observe.server.security; - -/* - * #%L - * ObServe Server :: Core - * %% - * Copyright (C) 2008 - 2021 IRD, Code Lutin, Ultreia.io - * %% - * This program is free software: you can redistribute it and/or modify - * 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.services.service.security.SecurityExceptionSupport; -import io.ultreia.java4all.i18n.I18n; - -import java.util.Locale; - -/** - * Created on 02/09/15. - * - * @author Tony Chemit - dev(a)tchemit.fr - */ -public class InvalidAdminKeyApiException extends SecurityExceptionSupport { - - private static final long serialVersionUID = 1L; - - public InvalidAdminKeyApiException(Locale locale) { - super(I18n.l(locale, "observe.ui.datasource.storage.error.rest.adminApiKey.invalid")); - } - -} ===================================== server/core/src/main/java/fr/ird/observe/server/security/ObserveWebSecurityApplicationContext.java ===================================== @@ -35,7 +35,12 @@ import fr.ird.observe.server.configuration.user.ObserveWebUser; import fr.ird.observe.server.configuration.user.ObserveWebUserPermission; import fr.ird.observe.server.configuration.user.ObserveWebUsers; import fr.ird.observe.server.request.ObserveWebRequestContext; +import fr.ird.observe.services.service.security.BadObserveWebUserPasswordException; import fr.ird.observe.services.service.security.InvalidAuthenticationTokenException; +import fr.ird.observe.services.service.security.UnknownObserveWebUserException; +import fr.ird.observe.services.service.security.UnknownObserveWebUserForDatabaseException; +import fr.ird.observe.services.service.security.UserLoginNotFoundException; +import fr.ird.observe.services.service.security.UserPasswordNotFoundException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.nuiton.version.Version; ===================================== server/core/src/main/java/fr/ird/observe/server/security/UnknownObserveWebUserException.java deleted ===================================== @@ -1,43 +0,0 @@ -package fr.ird.observe.server.security; - -/* - * #%L - * ObServe Server :: Core - * %% - * Copyright (C) 2008 - 2021 IRD, Code Lutin, Ultreia.io - * %% - * This program is free software: you can redistribute it and/or modify - * 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.services.service.security.SecurityExceptionSupport; -import io.ultreia.java4all.i18n.I18n; - -import java.util.Locale; - -/** - * Created on 30/08/15. - * - * @author Tony Chemit - dev(a)tchemit.fr - */ -public class UnknownObserveWebUserException extends SecurityExceptionSupport { - - private static final long serialVersionUID = 1L; - - public UnknownObserveWebUserException(Locale locale, String userLogin) { - super(I18n.l(locale, "observe.ui.datasource.storage.error.rest.user.unknown", userLogin)); - } - -} ===================================== server/core/src/main/java/fr/ird/observe/server/security/UnknownObserveWebUserForDatabaseException.java deleted ===================================== @@ -1,42 +0,0 @@ -package fr.ird.observe.server.security; - -/* - * #%L - * ObServe Server :: Core - * %% - * Copyright (C) 2008 - 2021 IRD, Code Lutin, Ultreia.io - * %% - * This program is free software: you can redistribute it and/or modify - * 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.services.service.security.SecurityExceptionSupport; -import io.ultreia.java4all.i18n.I18n; - -import java.util.Locale; - -/** - * Created on 30/08/15. - * - * @author Tony Chemit - dev(a)tchemit.fr - */ -public class UnknownObserveWebUserForDatabaseException extends SecurityExceptionSupport { - - private static final long serialVersionUID = 1L; - - public UnknownObserveWebUserForDatabaseException(Locale locale, String databaseName, String role) { - super(I18n.l(locale, "observe.ui.datasource.storage.error.rest.database.unknownForUser", databaseName, role)); - } -} ===================================== server/core/src/main/java/fr/ird/observe/server/security/UserLoginNotFoundException.java deleted ===================================== @@ -1,42 +0,0 @@ -package fr.ird.observe.server.security; - -/* - * #%L - * ObServe Server :: Core - * %% - * Copyright (C) 2008 - 2021 IRD, Code Lutin, Ultreia.io - * %% - * This program is free software: you can redistribute it and/or modify - * 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.services.service.security.SecurityExceptionSupport; -import io.ultreia.java4all.i18n.I18n; - -import java.util.Locale; - -/** - * Created on 07/09/15. - * - * @author Tony Chemit - dev(a)tchemit.fr - */ -public class UserLoginNotFoundException extends SecurityExceptionSupport { - - private static final long serialVersionUID = 1L; - - public UserLoginNotFoundException(Locale locale) { - super(I18n.l(locale, "observe.ui.datasource.storage.error.rest.user.required")); - } -} ===================================== server/core/src/main/java/fr/ird/observe/server/security/UserPasswordNotFoundException.java deleted ===================================== @@ -1,42 +0,0 @@ -package fr.ird.observe.server.security; - -/* - * #%L - * ObServe Server :: Core - * %% - * Copyright (C) 2008 - 2021 IRD, Code Lutin, Ultreia.io - * %% - * This program is free software: you can redistribute it and/or modify - * 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.services.service.security.SecurityExceptionSupport; -import io.ultreia.java4all.i18n.I18n; - -import java.util.Locale; - -/** - * Created on 07/09/15. - * - * @author Tony Chemit - dev(a)tchemit.fr - */ -public class UserPasswordNotFoundException extends SecurityExceptionSupport { - - private static final long serialVersionUID = 1L; - - public UserPasswordNotFoundException(Locale locale) { - super(I18n.l(locale, "observe.ui.datasource.storage.error.rest.password.required")); - } -} ===================================== server/i18n/src/main/i18n/translations/observe_en_GB.properties ===================================== @@ -1,14 +1,6 @@ ObserveWebApplicationConfig.description=ObServe Web configuration observe.config.client.temporaryFiles.timeout.description=Temporary files delete (in hours) observe.model.version=Model version -observe.ui.datasource.storage.error.rest.adminApiKey.invalid=Admin key not valid -observe.ui.datasource.storage.error.rest.adminApiKey.required=Admin key not found -observe.ui.datasource.storage.error.rest.authenticationToken.required=Authentication token not found -observe.ui.datasource.storage.error.rest.database.unknownForUser=Database "%s" is not defined for user "%s" -observe.ui.datasource.storage.error.rest.password.bad=Password is not valid -observe.ui.datasource.storage.error.rest.password.required=Password is mandatory -observe.ui.datasource.storage.error.rest.user.required=User login is mandatory -observe.ui.datasource.storage.error.rest.user.unknown=User "%s" is not defined on server observeweb.adminApiKey.description=API Key to use the admin mode (You should change it). observeweb.baseDirectory.description=Base directory observeweb.build.date.description=Build date ===================================== server/i18n/src/main/i18n/translations/observe_es_ES.properties ===================================== @@ -1,14 +1,6 @@ ObserveWebApplicationConfig.description=Configuración de Observe web observe.config.client.temporaryFiles.timeout.description=Temporary files delete (in hours) \#TODO observe.model.version=Versión del modelo -observe.ui.datasource.storage.error.rest.adminApiKey.invalid=Admin key not valid \#TODO -observe.ui.datasource.storage.error.rest.adminApiKey.required=Admin key not found \#TODO -observe.ui.datasource.storage.error.rest.authenticationToken.required=Authentication token not found \#TODO -observe.ui.datasource.storage.error.rest.database.unknownForUser=La base de datos "%s" no está configurada para el usuario "%s" -observe.ui.datasource.storage.error.rest.password.bad=Le contraseña es invalida -observe.ui.datasource.storage.error.rest.password.required=Le contraseña es obligatoria -observe.ui.datasource.storage.error.rest.user.required=El usuario es obligatorio -observe.ui.datasource.storage.error.rest.user.unknown=El usuario "%s" no es conocido del servidor observeweb.adminApiKey.description=Llave API Admin (Cambiar). observeweb.baseDirectory.description=Directorio de la aplicación observeweb.build.date.description=Fecha de construcción ===================================== server/i18n/src/main/i18n/translations/observe_fr_FR.properties ===================================== @@ -1,14 +1,6 @@ ObserveWebApplicationConfig.description=Observe web Configuration observe.config.client.temporaryFiles.timeout.description=Nettoyage des fichiers temporaires (en heures) observe.model.version=Version du modèle -observe.ui.datasource.storage.error.rest.adminApiKey.invalid=Pas de clef admin trouvée -observe.ui.datasource.storage.error.rest.adminApiKey.required=Clef admin non valide -observe.ui.datasource.storage.error.rest.authenticationToken.required=Pas de jeton d'authentification trouvé -observe.ui.datasource.storage.error.rest.database.unknownForUser=La base de données "%s" n'est pas définie pour l'utilisateur "%s" -observe.ui.datasource.storage.error.rest.password.bad=Le mot de passe est invalide -observe.ui.datasource.storage.error.rest.password.required=Le mot de passe est obligatoire -observe.ui.datasource.storage.error.rest.user.required=L'utilisateur est obligatoire -observe.ui.datasource.storage.error.rest.user.unknown=L'utilisateur "%s" est inconnu sur le serveur observeweb.adminApiKey.description=Clé API Admin (À changer) observeweb.baseDirectory.description=Répertoire de l'application observeweb.build.date.description=Date de construction ===================================== services/local-impl/src/main/java/fr/ird/observe/services/local/service/data/TripManagementServiceLocalSupport.java ===================================== @@ -42,8 +42,10 @@ import org.apache.logging.log4j.Logger; import org.nuiton.topia.persistence.script.SqlScriptConsumer; import org.nuiton.topia.persistence.script.TopiaBlobsContainer; import org.nuiton.topia.persistence.script.TopiaSqlScript; +import org.nuiton.util.TimeLog; import org.nuiton.version.Version; +import java.util.Collections; import java.util.Set; import java.util.TreeSet; @@ -74,7 +76,7 @@ public class TripManagementServiceLocalSupport extends ObserveServiceLocal imple String tripId = exportRequest.getTripId(); - log.info("Start export of trip: " + tripId); + log.info(String.format("Start export of trip: %s", tripId)); Version dbVersion = serviceContext.getServiceInitializer().optionalConnection().orElseThrow().getDataSourceInformation().getVersion(); AddSqlScriptProducerRequest request = (exportRequest.isForPG() ? AddSqlScriptProducerRequest.forPostgres(dbVersion) : AddSqlScriptProducerRequest.forH2(dbVersion)) @@ -89,17 +91,14 @@ public class TripManagementServiceLocalSupport extends ObserveServiceLocal imple ObserveTopiaPersistenceContext persistenceContext = serviceContext.getTopiaPersistenceContext(); - Set<String> tripSeineIds = new TreeSet<>(persistenceContext.getPsCommonTripDao().findAllIds()); - Set<String> tripLonglineIds = new TreeSet<>(persistenceContext.getLlCommonTripDao().findAllIds()); - String tripId = request.getTripId(); long t0 = System.nanoTime(); - boolean deleted = deleteTrip(persistenceContext, tripId, tripSeineIds, tripLonglineIds); + boolean deleted = deleteTrip(persistenceContext, tripId, Collections.emptySet()); if (deleted) { long time = System.nanoTime() - t0; - log.info("Delete of trip: " + tripId + " done in " + Strings.convertTime(time)); + log.info(String.format("Delete of trip: %s done in %s", tripId, Strings.convertTime(time))); return new DeleteTripResult(request, time); } return null; @@ -110,24 +109,33 @@ public class TripManagementServiceLocalSupport extends ObserveServiceLocal imple ObserveTopiaPersistenceContext persistenceContext = serviceContext.getTopiaPersistenceContext(); - Set<String> tripSeineIds = new TreeSet<>(persistenceContext.getPsCommonTripDao().findAllIds()); - Set<String> tripLonglineIds = new TreeSet<>(persistenceContext.getLlCommonTripDao().findAllIds()); - String tripId = request.getTripId(); - long t0 = System.nanoTime(); + long t1 = TimeLog.getTime(); + TopiaSqlScript sqlContent = request.getSqlContent(); + // detect ids in import script + Set<String> ids = new TreeSet<>(); + for (String sqlStatement : sqlContent.getLocation()) { + if (sqlStatement.toLowerCase().trim().startsWith("insert into")) { + String id = sqlStatement.substring(sqlStatement.indexOf("VALUES") + 6); + id = id.substring(id.indexOf("'") + 1); + id = id.substring(0, id.indexOf("'")); + ids.add(id); + } + } + log.info(String.format("Found in trip: %s, %d ids to import in %s.", tripId, ids.size(), Strings.convertTime(t1, System.nanoTime()))); + t1 = System.nanoTime(); - boolean deleted = deleteTrip(persistenceContext, tripId, tripSeineIds, tripLonglineIds); - long t1 = System.nanoTime(); + boolean deleted = deleteTrip(persistenceContext, tripId, ids); long deleteTime = 0; if (deleted) { - deleteTime = System.nanoTime() - t0; - log.info("Delete of trip: " + tripId + " done in " + Strings.convertTime(deleteTime)); + deleteTime = System.nanoTime() - t1; + log.info(String.format("Delete of trip: %s done in %s", tripId, Strings.convertTime(deleteTime))); } + t1 = System.nanoTime(); - log.info("Start import of trip: " + request.getTripId()); + log.info(String.format("Start import of trip: %s", request.getTripId())); - TopiaSqlScript sqlContent = request.getSqlContent(); Set<TopiaBlobsContainer> blobsContainers = sqlContent.getBlobsContainers(); SqlScriptConsumer.Builder consumerBuilder = SqlScriptConsumer.builder(sqlContent.getLocation()).batchSize(1000); @@ -135,38 +143,42 @@ public class TripManagementServiceLocalSupport extends ObserveServiceLocal imple consumerBuilder.blobs(blobsContainers); } persistenceContext.getSqlSupport().doSqlWork(consumerBuilder.build()); - - persistenceContext.commit(); + persistenceContext.flush(); long t2 = System.nanoTime(); - log.info("Import of trip: " + tripId + " done in " + Strings.convertTime(t1, t2)); + log.info(String.format("Import of trip: %s done in %s", tripId, Strings.convertTime(t1, t2))); return new ImportTripResult(request, true, t2 - t1, deleted, deleteTime); } - private boolean deleteTrip(ObserveTopiaPersistenceContext persistenceContext, String tripId, Set<String> tripSeineIds, Set<String> tripLonglineIds) { + private boolean deleteTrip(ObserveTopiaPersistenceContext persistenceContext, String tripId, Set<String> ids) { long t0 = System.nanoTime(); - boolean deleted = tripSeineIds.contains(tripId) || tripLonglineIds.contains(tripId); + boolean deleted = persistenceContext.exists(tripId); if (deleted) { - log.info("Start delete of trip: " + tripId); + log.info(String.format("Start delete of trip: %s", tripId)); DeleteSqlScriptProducerRequest sqlRequest = DeleteSqlScriptProducerRequest.of(tripId); TopiaSqlScript sqlScript = sqlScriptProducerService.produceDeleteSqlScript(sqlRequest); - //FIXME Make sure this always work!!! For the moment stay as before -// if (tripLonglineIds.contains(tripId) && serviceContext.getTopiaApplicationContext().getConfiguration().isH2Configuration()) { -// serviceContext.getTopiaApplicationContext().executeSqlStatementsWithH2AndRemoveIntegrity(persistenceContext, sqlScript); -// } else { -// persistenceContext.getSqlSupport().doSqlWork(SqlScriptConsumer.of(sqlScript)); -// } persistenceContext.getSqlSupport().doSqlWork(SqlScriptConsumer.of(sqlScript)); - log.info("Delete of trip: " + tripId + " done in " + Strings.convertTime(t0, System.nanoTime())); - persistenceContext.commit(); + log.info(String.format("Delete of trip: %s done in %s", tripId, Strings.convertTime(t0, System.nanoTime()))); + persistenceContext.flush(); + } + Set<String> existingIds = new TreeSet<>(); + if (!ids.isEmpty()) { + for (String id : ids) { + if (persistenceContext.exists(id)) { + log.error(String.format("Can't import trip %s, - found existing id in target database (%s)", tripId, id)); + existingIds.add(id); + } + } + } + if (!existingIds.isEmpty()) { + throw new IllegalStateException(String.format("Next %d id(s) are blocking the import of trip %s:\n%s", existingIds.size(), tripId, String.join("\n", existingIds))); } return deleted; } - } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/df05cdfde7d30588c510d76b… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/df05cdfde7d30588c510d76b… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop] 5 commits: improve ci jobs
by Tony CHEMIT 09 Mar '21

09 Mar '21
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 98258f38 by Tony Chemit at 2021-03-09T10:28:05+01:00 improve ci jobs - - - - - 01cb617d by Tony Chemit at 2021-03-09T10:28:05+01:00 Mauvaise génération d&#39;une sauvegarde si toutes les données sont sélectionnées - - - - - 6d7366ad by Tony Chemit at 2021-03-09T10:28:05+01:00 Rendre les déplacements impossible si les parents incriminés sont obsolètes. - Closes #1794 - - - - - 320af6c0 by Tony Chemit at 2021-03-09T10:28:05+01:00 Réusinage de la configuration d&#39;une source de données et des templates associées - Closes #1797 - - - - - df05cdfd by Tony Chemit at 2021-03-09T10:28:05+01:00 Revue de l&#39;opération longue de validation - Closes #1798 - - - - - 30 changed files: - .gitlab-ci.yml - 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/java/fr/ird/observe/client/configuration/ClientConfig.java - + client/configuration/src/main/java/fr/ird/observe/client/configuration/ObserveServiceInitializerConfigClient.java - − client/configuration/src/main/java/fr/ird/observe/client/constants/CreationMode.java - client/core/pom.xml - client/core/src/main/i18n/getters/java.getter - client/core/src/main/i18n/getters/jaxx.getter - − client/core/src/main/i18n/templates/dataSourceInformation_en_GB.ftl - − client/core/src/main/i18n/templates/dataSourceInformation_es_ES.ftl - − client/core/src/main/i18n/templates/dataSourceInformation_fr_FR.ftl - client/core/src/main/java/fr/ird/observe/client/ClientUIContext.java - client/core/src/main/java/fr/ird/observe/client/ObserveSwingApplicationContext.java - client/core/src/main/java/fr/ird/observe/client/datasource/api/ObserveDataSourcesManager.java - client/core/src/main/java/fr/ird/observe/client/datasource/api/ObserveSwingDataSource.java - client/core/src/main/java/fr/ird/observe/client/datasource/h2/backup/BackupsManager.java - client/core/src/main/java/fr/ird/observe/client/main/actions/ReloadApplicationAction.java - client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java - client/core/src/main/java/fr/ird/observe/client/util/ObserveKeyStrokesSupport.java - − client/core/src/main/resources/icons/action-db-local.png - − client/core/src/main/resources/icons/action-db-remote.png - − client/core/src/main/resources/icons/action-db-server.png - client/core/src/main/resources/observe-ui.properties - client/datasource/actions/pom.xml - client/datasource/actions/src/main/i18n/getters/java.getter - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminStep.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminUIBodyContent.java The diff was not included because it is too large. View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/7d45b11ffdbd7f4a764248ac… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/7d45b11ffdbd7f4a764248ac… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop] 6 commits: Réusinage de la configuration d'une source de données et des templates associées - Closes #1797
by Tony CHEMIT 09 Mar '21

09 Mar '21
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 58ea1957 by Tony Chemit at 2021-03-08T12:27:14+01:00 Réusinage de la configuration d&#39;une source de données et des templates associées - Closes #1797 - - - - - a6a25f7f by Tony Chemit at 2021-03-08T12:35:55+01:00 Réusinage de la configuration d&#39;une source de données et des templates associées - Closes #1797 - - - - - 003c74ad by Tony Chemit at 2021-03-08T12:55:26+01:00 Réusinage de la configuration d&#39;une source de données et des templates associées - Closes #1797 - - - - - a36d3e96 by Tony Chemit at 2021-03-08T14:34:19+01:00 Réusinage de la configuration d&#39;une source de données et des templates associées - Closes #1797 - - - - - 4621bda3 by Tony Chemit at 2021-03-08T14:34:45+01:00 Fix Admin Validate action launch + review handler code - - - - - 7d45b11f by Tony Chemit at 2021-03-09T10:25:36+01:00 Revue de l&#39;opération longue de validation - Closes #1798 - - - - - 30 changed files: - 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/java/fr/ird/observe/client/configuration/ClientConfig.java - + client/configuration/src/main/java/fr/ird/observe/client/configuration/ObserveServiceInitializerConfigClient.java - − client/configuration/src/main/java/fr/ird/observe/client/constants/CreationMode.java - client/core/pom.xml - client/core/src/main/i18n/getters/java.getter - client/core/src/main/i18n/getters/jaxx.getter - − client/core/src/main/i18n/templates/dataSourceInformation_en_GB.ftl - − client/core/src/main/i18n/templates/dataSourceInformation_es_ES.ftl - − client/core/src/main/i18n/templates/dataSourceInformation_fr_FR.ftl - client/core/src/main/java/fr/ird/observe/client/datasource/api/ObserveSwingDataSource.java - client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java - client/core/src/main/java/fr/ird/observe/client/util/ObserveKeyStrokesSupport.java - − client/core/src/main/resources/icons/action-db-local.png - − client/core/src/main/resources/icons/action-db-remote.png - − client/core/src/main/resources/icons/action-db-server.png - client/core/src/main/resources/observe-ui.properties - client/datasource/actions/pom.xml - client/datasource/actions/src/main/i18n/getters/java.getter - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminStep.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminUIHandler.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminUIModel.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/config/ConfigModel.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/config/SelectDataModel.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/export/actions/Prepare.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/data/actions/Start.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidateConfigUI.jaxx The diff was not included because it is too large. View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/bdb000e6fc203682e1e855b6… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/bdb000e6fc203682e1e855b6… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop] Introduce client-datasource-api module and review all templates around storage.
by Tony CHEMIT 07 Mar '21

07 Mar '21
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: bdb000e6 by Tony Chemit at 2021-03-07T18:34:19+01:00 Introduce client-datasource-api module and review all templates around storage. - - - - - 30 changed files: - 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/java/fr/ird/observe/client/configuration/ClientConfig.java - + client/configuration/src/main/java/fr/ird/observe/client/configuration/ObserveServiceInitializerConfigClient.java - − client/configuration/src/main/java/fr/ird/observe/client/constants/CreationMode.java - client/core/pom.xml - client/core/src/main/i18n/getters/java.getter - client/core/src/main/i18n/getters/jaxx.getter - − client/core/src/main/i18n/templates/dataSourceInformation_en_GB.ftl - − client/core/src/main/i18n/templates/dataSourceInformation_es_ES.ftl - − client/core/src/main/i18n/templates/dataSourceInformation_fr_FR.ftl - client/core/src/main/java/fr/ird/observe/client/datasource/api/ObserveSwingDataSource.java - client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java - client/core/src/main/java/fr/ird/observe/client/util/ObserveKeyStrokesSupport.java - − client/core/src/main/resources/icons/action-db-local.png - − client/core/src/main/resources/icons/action-db-remote.png - − client/core/src/main/resources/icons/action-db-server.png - client/core/src/main/resources/observe-ui.properties - client/datasource/actions/pom.xml - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminStep.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminUIModel.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/config/ConfigModel.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/data/actions/Start.java - + client/datasource/api/.mvn/i18n/parse-java - + client/datasource/api/.mvn/jaxx-generate - + client/datasource/api/.mvn/pom.gitflow.develop - + client/datasource/api/.mvn/pom.gitflow.master - + client/datasource/api/.mvn/pom.organizationId The diff was not included because it is too large. View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/bdb000e6fc203682e1e855b63… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/bdb000e6fc203682e1e855b63… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop] 3 commits: Use updated db configuration dto API from toolkit
by Tony CHEMIT 07 Mar '21

07 Mar '21
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 04e60326 by Tony Chemit at 2021-03-06T08:29:18+01:00 Use updated db configuration dto API from toolkit - - - - - d5f3cf67 by Tony Chemit at 2021-03-06T08:29:18+01:00 update pom - - - - - fb1e88a8 by Tony Chemit at 2021-03-07T16:35:27+01:00 Introduce client-datasource-api module and review all templates around storage. - - - - - 30 changed files: - 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/java/fr/ird/observe/client/configuration/ClientConfig.java - + client/configuration/src/main/java/fr/ird/observe/client/configuration/ObserveServiceInitializerConfigClient.java - − client/configuration/src/main/java/fr/ird/observe/client/constants/CreationMode.java - client/core/pom.xml - client/core/src/main/i18n/getters/java.getter - client/core/src/main/i18n/getters/jaxx.getter - − client/core/src/main/i18n/templates/dataSourceInformation_en_GB.ftl - − client/core/src/main/i18n/templates/dataSourceInformation_es_ES.ftl - − client/core/src/main/i18n/templates/dataSourceInformation_fr_FR.ftl - client/core/src/main/java/fr/ird/observe/client/ClientUIContext.java - client/core/src/main/java/fr/ird/observe/client/ObserveSwingApplicationContext.java - client/core/src/main/java/fr/ird/observe/client/datasource/api/ObserveDataSourcesManager.java - client/core/src/main/java/fr/ird/observe/client/datasource/api/ObserveSwingDataSource.java - client/core/src/main/java/fr/ird/observe/client/datasource/h2/backup/BackupsManager.java - client/core/src/main/java/fr/ird/observe/client/main/actions/ReloadApplicationAction.java - client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java - client/core/src/main/java/fr/ird/observe/client/util/ObserveKeyStrokesSupport.java - − client/core/src/main/resources/icons/action-db-local.png - − client/core/src/main/resources/icons/action-db-remote.png - − client/core/src/main/resources/icons/action-db-server.png - client/core/src/main/resources/observe-ui.properties - client/datasource/actions/pom.xml - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminStep.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminUIBodyContent.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminUIModel.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/actions/AdminTabUIActionSupport.java The diff was not included because it is too large. View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/9cd900ba0112e50a2294cf4d… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/9cd900ba0112e50a2294cf4d… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop] Review storage configuration and improve it.
by Tony CHEMIT 25 Feb '21

25 Feb '21
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 9cd900ba by Tony Chemit at 2021-02-25T19:41:00+01:00 Review storage configuration and improve it. Still need to finish the templates refactor (nearly done). - - - - - 30 changed files: - client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java - client/core/src/main/i18n/getters/java.getter - client/core/src/main/i18n/getters/jaxx.getter - + client/core/src/main/i18n/templates/connexion-test-remote_en_GB.ftl - + client/core/src/main/i18n/templates/connexion-test-remote_es_ES.ftl - + client/core/src/main/i18n/templates/connexion-test-remote_fr_FR.ftl - + client/core/src/main/i18n/templates/connexion-test-server_en_GB.ftl - + client/core/src/main/i18n/templates/connexion-test-server_es_ES.ftl - + client/core/src/main/i18n/templates/connexion-test-server_fr_FR.ftl - + client/core/src/main/i18n/templates/dataSource_en_GB.ftl - + client/core/src/main/i18n/templates/dataSource_es_ES.ftl - + client/core/src/main/i18n/templates/dataSource_fr_FR.ftl - client/core/src/main/java/fr/ird/observe/client/datasource/api/ObserveDataSourcesManager.java - client/core/src/main/java/fr/ird/observe/client/datasource/api/ObserveSwingDataSource.java - + client/core/src/main/java/fr/ird/observe/client/datasource/config/ConfigSupport.jaxx - + client/core/src/main/java/fr/ird/observe/client/datasource/config/ConfigSupport.jcss - + client/core/src/main/java/fr/ird/observe/client/datasource/config/ConfigSupportModel.java - + client/core/src/main/java/fr/ird/observe/client/datasource/config/RemoteConfig.jaxx - + client/core/src/main/java/fr/ird/observe/client/datasource/config/RemoteConfig.jcss - + client/core/src/main/java/fr/ird/observe/client/datasource/config/RemoteConfigHandler.java - + client/core/src/main/java/fr/ird/observe/client/datasource/config/RemoteConfigModel.java - + client/core/src/main/java/fr/ird/observe/client/datasource/config/ServerConfig.jaxx - + client/core/src/main/java/fr/ird/observe/client/datasource/config/ServerConfig.jcss - + client/core/src/main/java/fr/ird/observe/client/datasource/config/ServerConfigHandler.java - + client/core/src/main/java/fr/ird/observe/client/datasource/config/ServerConfigModel.java - + client/core/src/main/java/fr/ird/observe/client/datasource/config/actions/ConfigSupportAction.java - + client/core/src/main/java/fr/ird/observe/client/datasource/config/actions/PresetMenuAction.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/wizard/tabs/actions/ConfigUISaveRemoteConfigurationAction.java → client/core/src/main/java/fr/ird/observe/client/datasource/config/actions/RemoteConfigSaveConfiguration.java - + client/core/src/main/java/fr/ird/observe/client/datasource/config/actions/RemoteConfigToggleConfigurations.java - + client/core/src/main/java/fr/ird/observe/client/datasource/config/actions/RemoteConfigUseConfiguration.java The diff was not included because it is too large. View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/9cd900ba0112e50a2294cf4df… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/9cd900ba0112e50a2294cf4df… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop] Little improvements on editor APi (use a little more ShortIdDto in it).
by Tony CHEMIT 23 Feb '21

23 Feb '21
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: d305908b by Tony Chemit at 2021-02-23T09:35:46+01:00 Little improvements on editor APi (use a little more ShortIdDto in it). - - - - - 14 changed files: - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/actions/save/SaveRequest.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/edit/ContentEditUIModelStates.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/edit/ContentEditUINavigationInitializer.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/list/ContentListUIModelStates.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/list/ContentListUINavigationInitializer.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/open/ContentOpenableUIModelStates.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/open/ContentOpenableUINavigationInitializer.java - client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/logbook/SetUIModelStates.java - client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/data/edit/GenerateContentEditUIModel.java - client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/data/edit/GenerateContentEditUIModelStates.java - client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/data/list/GenerateContentListUIModelStates.java - client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/data/openable/GenerateContentOpenableUIModel.java - client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/data/openable/GenerateContentOpenableUIModelStates.java - client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/helper/ContentUIModelHelper.java Changes: ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/actions/save/SaveRequest.java ===================================== @@ -23,8 +23,10 @@ package fr.ird.observe.client.datasource.editor.api.content.actions.save; */ import fr.ird.observe.dto.IdDto; +import fr.ird.observe.dto.ShortIdDto; import java.util.Objects; +import java.util.Optional; import java.util.function.Predicate; import java.util.function.Supplier; @@ -36,21 +38,19 @@ import java.util.function.Supplier; */ public class SaveRequest { - private final Class<? extends IdDto> parentType; - private final String parentId; + private final ShortIdDto parent; private final String id; private final Supplier<? extends IdDto> beanSupplier; private final boolean notPersisted; private final Predicate<String> predicate; private IdDto bean; - public SaveRequest(Class<? extends IdDto> parentType, String parentId, String id, Supplier<? extends IdDto> beanSupplier) { - this(parentType, parentId, id, beanSupplier, t -> true); + public SaveRequest(ShortIdDto parentId, String id, Supplier<? extends IdDto> beanSupplier) { + this(parentId, id, beanSupplier, t -> true); } - public SaveRequest(Class<? extends IdDto> parentType, String parentId, String id, Supplier<? extends IdDto> beanSupplier, Predicate<String> predicate) { - this.parentType = Objects.requireNonNull(parentType); - this.parentId = Objects.requireNonNull(parentId); + public SaveRequest(ShortIdDto parentId, String id, Supplier<? extends IdDto> beanSupplier, Predicate<String> predicate) { + this.parent = Objects.requireNonNull(parentId); this.id = id; this.notPersisted = id == null; this.beanSupplier = Objects.requireNonNull(beanSupplier); @@ -58,20 +58,15 @@ public class SaveRequest { } public SaveRequest(String id, Supplier<? extends IdDto> beanSupplier, Predicate<String> predicate) { - this.parentType = null; - this.parentId = null; + this.parent = null; this.id = id; this.notPersisted = id == null; this.beanSupplier = Objects.requireNonNull(beanSupplier); this.predicate = predicate; } - public Class<? extends IdDto> getParentType() { - return parentType; - } - public String getParentId() { - return parentId; + return Optional.ofNullable(parent).map(ShortIdDto::getId).orElse(null); } public String getId() { ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/edit/ContentEditUIModelStates.java ===================================== @@ -24,8 +24,11 @@ package fr.ird.observe.client.datasource.editor.api.content.data.edit; import fr.ird.observe.client.datasource.editor.api.content.data.simple.ContentSimpleUIModelStatesSupport; import fr.ird.observe.client.datasource.editor.api.content.data.simple.ContentSimpleUIModelSupport; +import fr.ird.observe.dto.ShortIdDto; import fr.ird.observe.dto.data.EditableDto; +import java.util.Objects; + /** * Created on 30/10/2020. * @@ -36,15 +39,19 @@ public class ContentEditUIModelStates<D extends EditableDto> extends ContentSimp /** * Parent Data id. */ - private final String selectedParentId; + private final ShortIdDto selectedParent; - public ContentEditUIModelStates(ContentSimpleUIModelSupport<D> model, D bean, String selectedId, String selectedParentId) { + public ContentEditUIModelStates(ContentSimpleUIModelSupport<D> model, D bean, String selectedId, ShortIdDto selectedParent) { super(model, bean, selectedId); - this.selectedParentId = selectedParentId; + this.selectedParent = Objects.requireNonNull(selectedParent); + } + + public final ShortIdDto selectedParent() { + return selectedParent; } public final String getSelectedParentId() { - return selectedParentId; + return selectedParent().getId(); } } ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/edit/ContentEditUINavigationInitializer.java ===================================== @@ -25,6 +25,7 @@ package fr.ird.observe.client.datasource.editor.api.content.data.edit; import fr.ird.observe.client.datasource.editor.api.navigation.tree.NavigationContext; import fr.ird.observe.client.datasource.editor.api.navigation.tree.NavigationInitializer; import fr.ird.observe.client.datasource.editor.api.navigation.tree.NavigationScope; +import fr.ird.observe.dto.ShortIdDto; import fr.ird.observe.dto.reference.DataDtoReference; import fr.ird.observe.dto.reference.DtoReference; @@ -78,6 +79,10 @@ public class ContentEditUINavigationInitializer extends NavigationInitializer<Co return parentReference; } + public ShortIdDto getParentShortReference() { + return parentReference.toShortReference(); + } + public DataDtoReference getReference() { return reference; } ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/list/ContentListUIModelStates.java ===================================== @@ -28,6 +28,7 @@ import fr.ird.observe.client.datasource.editor.api.content.ContentMode; import fr.ird.observe.client.datasource.editor.api.content.ContentUIModel; import fr.ird.observe.client.datasource.editor.api.content.ContentUIModelStates; import fr.ird.observe.dto.IdDto; +import fr.ird.observe.dto.ShortIdDto; import fr.ird.observe.dto.reference.DataDtoReference; import fr.ird.observe.dto.reference.DtoReference; import org.apache.commons.collections4.CollectionUtils; @@ -53,16 +54,16 @@ public class ContentListUIModelStates<R extends DataDtoReference> extends Conten public static final String PROPERTY_LAYOUT_NAME = "layoutName"; private static final Logger log = LogManager.getLogger(ContentListUIModelStates.class); private final ReferencesCache referenceCache; - private final String selectedParentId; + private final ShortIdDto selectedParent; private final String editNodeId; private final boolean parentOpen; private List<R> data; private List<R> selectedDatas; private String layoutName; - public ContentListUIModelStates(ContentListUIModel<R> model, String selectedParentId, String editNodeId, boolean parentOpen) { + public ContentListUIModelStates(ContentListUIModel<R> model, ShortIdDto selectedParent, String editNodeId, boolean parentOpen) { this.referenceCache = Objects.requireNonNull(model).getSource().getContext().newReferenceCache(); - this.selectedParentId = selectedParentId; + this.selectedParent = selectedParent; this.editNodeId = editNodeId; this.parentOpen = parentOpen; } @@ -88,8 +89,7 @@ public class ContentListUIModelStates<R extends DataDtoReference> extends Conten } }); - String selectedId = getSelectedParentId(); - log.info(source.getInitializer().getLogPrefix() + "parentSelectedId = " + selectedId); + log.info(String.format("%s parentSelectedId = %s", source.getInitializer().getLogPrefix(), selectedParent())); @SuppressWarnings("unchecked") List<R> data = (List<R>) source.getReferences(); setData(data); } @@ -102,8 +102,12 @@ public class ContentListUIModelStates<R extends DataDtoReference> extends Conten return editNodeId; } + public ShortIdDto selectedParent() { + return selectedParent; + } + public String getSelectedParentId() { - return selectedParentId; + return selectedParent().getId(); } public List<R> getData() { ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/list/ContentListUINavigationInitializer.java ===================================== @@ -25,6 +25,7 @@ package fr.ird.observe.client.datasource.editor.api.content.data.list; import fr.ird.observe.client.datasource.editor.api.navigation.tree.NavigationContext; import fr.ird.observe.client.datasource.editor.api.navigation.tree.NavigationInitializer; import fr.ird.observe.client.datasource.editor.api.navigation.tree.NavigationScope; +import fr.ird.observe.dto.ShortIdDto; import fr.ird.observe.dto.reference.DataDtoReference; import fr.ird.observe.dto.reference.DtoReference; import fr.ird.observe.dto.reference.LazyDataDtoReferenceSet; @@ -84,6 +85,10 @@ public class ContentListUINavigationInitializer extends NavigationInitializer<Co return parentReference; } + public ShortIdDto getParentShortReference() { + return parentReference.toShortReference(); + } + public final String getSelectedParentId() { return getParentReference().getId(); } ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/open/ContentOpenableUIModelStates.java ===================================== @@ -26,6 +26,7 @@ import fr.ird.observe.client.datasource.editor.api.content.ContentUIModel; import fr.ird.observe.client.datasource.editor.api.content.data.simple.ContentSimpleUIModelStatesSupport; import fr.ird.observe.client.datasource.validation.ClientValidationContext; import fr.ird.observe.client.datasource.validation.ClientValidationContextApplicationComponent; +import fr.ird.observe.dto.ShortIdDto; import fr.ird.observe.dto.data.OpenableDto; import fr.ird.observe.dto.data.ps.common.TripDto; import org.apache.logging.log4j.LogManager; @@ -43,20 +44,24 @@ public class ContentOpenableUIModelStates<D extends OpenableDto> extends Content /** * Parent Data id. */ - private final String selectedParentId; + private final ShortIdDto selectedParent; /** * Historical data (found on trip data). */ private boolean historicalData; - public ContentOpenableUIModelStates(ContentOpenableUIModel<D> model, D bean, String selectedId, String selectedParentId) { + public ContentOpenableUIModelStates(ContentOpenableUIModel<D> model, D bean, String selectedId, ShortIdDto selectedParent) { super(model, bean, selectedId); - this.selectedParentId = selectedParentId; + this.selectedParent = selectedParent; + } + + public ShortIdDto selectedParent() { + return selectedParent; } public final String getSelectedParentId() { - return selectedParentId; + return selectedParent().getId(); } // @Override ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/open/ContentOpenableUINavigationInitializer.java ===================================== @@ -25,6 +25,7 @@ package fr.ird.observe.client.datasource.editor.api.content.data.open; import fr.ird.observe.client.datasource.editor.api.navigation.tree.NavigationContext; import fr.ird.observe.client.datasource.editor.api.navigation.tree.NavigationInitializer; import fr.ird.observe.client.datasource.editor.api.navigation.tree.NavigationScope; +import fr.ird.observe.dto.ShortIdDto; import fr.ird.observe.dto.reference.DataDtoReference; import fr.ird.observe.dto.reference.DtoReference; import io.ultreia.java4all.bean.definition.JavaBeanPropertyDefinition; @@ -90,6 +91,10 @@ public final class ContentOpenableUINavigationInitializer extends NavigationInit return parentReference; } + public ShortIdDto getParentShortReference() { + return parentReference.toShortReference(); + } + public final DataDtoReference getReference() { return reference; } ===================================== client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/logbook/SetUIModelStates.java ===================================== @@ -23,6 +23,7 @@ package fr.ird.observe.client.datasource.editor.ll.data.logbook; */ import fr.ird.observe.client.datasource.editor.api.content.actions.save.SaveRequest; +import fr.ird.observe.dto.ShortIdDto; import fr.ird.observe.dto.data.ll.logbook.SetDto; import fr.ird.observe.dto.data.ll.logbook.SetStubDto; import fr.ird.observe.dto.form.Form; @@ -63,12 +64,12 @@ public class SetUIModelStates extends GeneratedSetUIModelStates { firePropertyChange("copySetCandidate", oldValue, copySetCandidate); } - public String getSetIdToCopy() { - return copySetCandidate == null ? null : copySetCandidate.getId(); + public SaveRequest toSaveRequestWithCopy() { + return new SaveRequest(setIdToCopy(), getSelectedId(), this::getBeanToSave); } - public SaveRequest toSaveRequestWithCopy() { - return new SaveRequest(SetDto.class, getSetIdToCopy(), getSelectedId(), this::getBeanToSave); + private ShortIdDto setIdToCopy() { + return copySetCandidate == null ? null : copySetCandidate.toShortReference(); } private void updateCopySetCandidate(Date newValue) { ===================================== client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/data/edit/GenerateContentEditUIModel.java ===================================== @@ -37,13 +37,12 @@ public class GenerateContentEditUIModel extends GenerateContentEditUISupport { public static final String TO_SAVE_REQUEST = "" + " @Override\n" + " public SaveRequest toSaveRequest() {\n" + - " return new SaveRequest(%1$s.class, getStates().getSelectedParentId(), getStates().getSelectedId(), getStates()::getBeanToSave);\n" + + " return new SaveRequest(getStates().selectedParent(), getStates().getSelectedId(), getStates()::getBeanToSave);\n" + " }\n\n"; @Override protected String generateAbstractContent0(Path sourceDirectory, Path targetDirectory, Path path, String packageName, String namePrefix) { - String save = String.format(TO_SAVE_REQUEST, scopeBuilder.parentDtoReferenceType.getName()); - return uiModelHelper.generateModelGeneratedContent(dtoType, referenceType, ContentUIModelHelper.generateStates(cleanClassName), save); + return uiModelHelper.generateModelGeneratedContent(dtoType, referenceType, ContentUIModelHelper.generateStates(cleanClassName), TO_SAVE_REQUEST); } @Override ===================================== client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/data/edit/GenerateContentEditUIModelStates.java ===================================== @@ -37,7 +37,7 @@ import java.util.List; public class GenerateContentEditUIModelStates extends GenerateContentEditUISupport { private static final String GENERATED_CONSTRUCTOR = "" + " public Generated%1$sUIModelStates(Generated%1$sUIModel model) {\n" + - " super(model, %1$sDto.newDto(new java.util.Date()), model.getSource().getInitializer().getSelectId(), model.getSource().getInitializer().getSelectedParentId());\n" + + " super(model, %1$sDto.newDto(new java.util.Date()), model.getSource().getInitializer().getSelectId(), model.getSource().getInitializer().getParentShortReference());\n" + " }\n\n"; private static final String CONSTRUCTOR = "" + " public %1$sUIModelStates(Generated%1$sUIModel model) {\n" + ===================================== client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/data/list/GenerateContentListUIModelStates.java ===================================== @@ -37,7 +37,7 @@ import java.util.List; public class GenerateContentListUIModelStates extends GenerateContentListUISupport { private static final String GENERATED_CONSTRUCTOR = "" + " public Generated%1$sModelStates(Generated%1$sModel model) {\n" + - " super(model, model.getSource().getInitializer().getSelectedParentId(), model.getSource().getInitializer().getEditNodeId(), model.getSource().getInitializer().isOpen());\n" + + " super(model, model.getSource().getInitializer().getParentShortReference(), model.getSource().getInitializer().getEditNodeId(), model.getSource().getInitializer().isOpen());\n" + " }\n\n"; private static final String CONSTRUCTOR = "" + " public %1$sModelStates(Generated%1$sModel model) {\n" + ===================================== client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/data/openable/GenerateContentOpenableUIModel.java ===================================== @@ -37,13 +37,12 @@ public class GenerateContentOpenableUIModel extends GenerateContentOpenableUISup public static final String TO_SAVE_REQUEST = "" + " @Override\n" + " public SaveRequest toSaveRequest() {\n" + - " return new SaveRequest(%1$s.class, getStates().getSelectedParentId(), getStates().getSelectedId(), getStates()::getBeanToSave);\n" + + " return new SaveRequest(getStates().selectedParent(), getStates().getSelectedId(), getStates()::getBeanToSave);\n" + " }\n\n"; @Override protected String generateAbstractContent0(Path sourceDirectory, Path targetDirectory, Path path, String packageName, String namePrefix) { - String save = String.format(TO_SAVE_REQUEST, scopeBuilder.parentDtoReferenceType.getName()); - return uiModelHelper.generateModelGeneratedContent(dtoType, referenceType, ContentUIModelHelper.generateStates(cleanClassName), save); + return uiModelHelper.generateModelGeneratedContent(dtoType, referenceType, ContentUIModelHelper.generateStates(cleanClassName), TO_SAVE_REQUEST); } @Override ===================================== client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/data/openable/GenerateContentOpenableUIModelStates.java ===================================== @@ -37,7 +37,7 @@ import java.util.List; public class GenerateContentOpenableUIModelStates extends GenerateContentOpenableUISupport { private static final String GENERATED_CONSTRUCTOR = "" + " public Generated%1$sUIModelStates(Generated%1$sUIModel model) {\n" + - " super(model, %1$sDto.newDto(new java.util.Date()), model.getSource().getInitializer().getSelectId(), model.getSource().getInitializer().getSelectedParentId());\n" + + " super(model, %1$sDto.newDto(new java.util.Date()), model.getSource().getInitializer().getSelectId(), model.getSource().getInitializer().getParentShortReference());\n" + " }\n\n"; private static final String CONSTRUCTOR = "" + " public %1$sUIModelStates(Generated%1$sUIModel model) {\n" + ===================================== client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/helper/ContentUIModelHelper.java ===================================== @@ -120,14 +120,14 @@ public class ContentUIModelHelper extends ContentUIHelperSupport { " @Override\n" + " public MoveRequestBuilder.StepSetParentCandidates toMoveRequest() {\n" + " return MoveRequestBuilder\n" + - " .create(%1$s.class, getSource().getParentReference().toShortReference(), toReference(getStates().getBean()))\n" + + " .create(%1$s.class, getStates().selectedParent(), toReference(getStates().getBean()))\n" + " .setEditNode(getSource().getInitializer().getEditNode());\n" + " }\n\n"; public static final String TO_MOVE_REQUEST_MULTIPLE = "" + " @Override\n" + " public MoveRequestBuilder.StepSetParentCandidates toMoveRequest() {\n" + " return MoveRequestBuilder\n" + - " .create(%1$s.class, getSource().getParentReference().toShortReference(), getStates().getSelectedDatas())\n" + + " .create(%1$s.class, getStates().selectedParent(), getStates().getSelectedDatas())\n" + " .setEditNode(getSource().getInitializer().getEditNode());\n" + " }\n\n"; public static final String CREATE_FORM = "" + View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/d305908bbab6c3356580228aa… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/d305908bbab6c3356580228aa… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][develop] 2 commits: fixup! build ci on features
by Tony CHEMIT 22 Feb '21

22 Feb '21
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 45db1344 by Tony Chemit at 2021-02-22T20:14:50+01:00 fixup! build ci on features - - - - - 1e7bb086 by Tony Chemit at 2021-02-22T21:24:18+01:00 Rendre les déplacements impossible si les parents incriminés sont obsolètes. - Closes #1794 - - - - - 6 changed files: - .gitlab-ci.yml - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/actions/move/MoveRequest.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/actions/move/MoveRequestBuilder.java - client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/logbook/ActivitySampleUIModel.java - client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/helper/ContentUIModelHelper.java - services/api-test/src/main/java/fr/ird/observe/services/service/data/OpenableDataServiceFixtures.java Changes: ===================================== .gitlab-ci.yml ===================================== @@ -101,7 +101,7 @@ trigger-make-stage: .automatic: &automatic only: - /^develop.*$/i - - /^features/.+$/i + - /^feature/.+$/i except: - triggers @@ -155,7 +155,7 @@ release-deploy-demo: .manual: &manual only: - /^develop.*$/i - - /^features/.+$/i + - /^feature/.+$/i when: manual create-docker: ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/actions/move/MoveRequest.java ===================================== @@ -35,20 +35,13 @@ import java.util.StringJoiner; * @author Tony Chemit - dev(a)tchemit.fr * @since 8.0.1 */ +@SuppressWarnings("unchecked") public class MoveRequest { /** * Reference type of data to move. */ private final Class<? extends DataDtoReference> referenceType; - /** - * Reference type of parent data to move. - */ - private final Class<? extends DtoReference> parentReferenceType; - /** - * Reference type of parent target. - */ - private final Class<? extends DtoReference> parentTargetReferenceType; /** * Id of parent data to move. */ @@ -66,13 +59,11 @@ public class MoveRequest { */ private final boolean selectTarget; - public MoveRequest(Class<? extends DataDtoReference> referenceType, Class<? extends DtoReference> parentReferenceType, Class<? extends DtoReference> parentTargetReferenceType, String oldParentId, ImmutableSet<String> ids, String newParentId, boolean selectTarget) { + public MoveRequest(Class<? extends DataDtoReference> referenceType, ShortIdDto oldParentId, ImmutableSet<String> ids, ShortIdDto newParentId, boolean selectTarget) { this.referenceType = referenceType; - this.parentReferenceType = parentReferenceType; - this.parentTargetReferenceType = parentTargetReferenceType; - this.oldParentId = ShortIdDto.of(parentReferenceType, oldParentId); + this.oldParentId = oldParentId; this.ids = ids; - this.newParentId = ShortIdDto.of(parentTargetReferenceType, newParentId); + this.newParentId = newParentId; this.selectTarget = selectTarget; } @@ -81,11 +72,11 @@ public class MoveRequest { } public Class<? extends DtoReference> getParentReferenceType() { - return parentReferenceType; + return (Class<? extends DtoReference>) oldParentId.getType(); } public Class<? extends DtoReference> getParentTargetReferenceType() { - return parentTargetReferenceType; + return (Class<? extends DtoReference>) newParentId.getType(); } public ShortIdDto getOldParentId() { ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/actions/move/MoveRequestBuilder.java ===================================== @@ -30,6 +30,7 @@ import fr.ird.observe.client.datasource.editor.api.content.actions.mode.ChangeMo import fr.ird.observe.client.datasource.editor.api.content.data.open.ContentOpenableUII18nHelper; import fr.ird.observe.client.datasource.editor.api.content.referential.usage.UsageUIHandlerSupport; import fr.ird.observe.client.util.UIHelper; +import fr.ird.observe.dto.ShortIdDto; import fr.ird.observe.dto.reference.DataDtoReference; import fr.ird.observe.dto.reference.DtoReference; import fr.ird.observe.dto.reference.DtoReferenceCollection; @@ -85,14 +86,10 @@ public class MoveRequestBuilder { * Reference type of data to move. */ private final Class<? extends DataDtoReference> referenceType; - /** - * Reference type of parent data to move. - */ - private final Class<? extends DtoReference> parentReferenceType; /** * Id of parent data to move. */ - private final String oldParentId; + private final ShortIdDto oldParentId; /** * Data to delete. */ @@ -181,18 +178,17 @@ public class MoveRequestBuilder { } } - public static StepSetParentCandidates create(Class<? extends DataDtoReference> referenceType, Class<? extends DtoReference> parentReferenceType, String oldParentId, DtoReference id) { - return create(referenceType, parentReferenceType, oldParentId, ImmutableSet.of(id)); + public static StepSetParentCandidates create(Class<? extends DataDtoReference> referenceType, ShortIdDto oldParentId, DtoReference id) { + return create(referenceType, oldParentId, ImmutableSet.of(id)); } - public static StepSetParentCandidates create(Class<? extends DataDtoReference> referenceType, Class<? extends DtoReference> parentReferenceType, String oldParentId, Collection<? extends DtoReference> data) { - MoveRequestBuilder builder = new MoveRequestBuilder(referenceType, parentReferenceType, oldParentId, data); + public static StepSetParentCandidates create(Class<? extends DataDtoReference> referenceType, ShortIdDto oldParentId, Collection<? extends DtoReference> data) { + MoveRequestBuilder builder = new MoveRequestBuilder(referenceType, oldParentId, data); return new BuilderImpl(builder); } - private MoveRequestBuilder(Class<? extends DataDtoReference> referenceType, Class<? extends DtoReference> parentReferenceType, String oldParentId, Collection<? extends DtoReference> data) { + private MoveRequestBuilder(Class<? extends DataDtoReference> referenceType, ShortIdDto oldParentId, Collection<? extends DtoReference> data) { this.referenceType = Objects.requireNonNull(referenceType); - this.parentReferenceType = Objects.requireNonNull(parentReferenceType); this.oldParentId = Objects.requireNonNull(oldParentId); this.data = Objects.requireNonNull(data); KeyStroke keyStroke = ObserveKeyStrokesEditorApi.KEY_STROKE_SELECT_TARGET; @@ -247,9 +243,10 @@ public class MoveRequestBuilder { return this; } + @SuppressWarnings("unchecked") public Optional<MoveRequest> build(DataSourceEditor dataSourceEditor) { if (parentTargetReferenceType == null) { - parentTargetReferenceType = parentReferenceType; + parentTargetReferenceType = (Class<? extends DtoReference>) oldParentId.getType(); } if (askNewParentTitle == null) { askNewParentTitle = ContentOpenableUII18nHelper.getActionMoveChooseParentTitle(referenceType); @@ -258,7 +255,7 @@ public class MoveRequestBuilder { askNewParentMessage = ContentOpenableUII18nHelper.getActionMoveChooseParentMessage(referenceType); } - DtoReferenceCollection<?> parentCandidates = Objects.requireNonNull(this.parentCandidates, "No parent candidates set.").apply(oldParentId); + DtoReferenceCollection<?> parentCandidates = Objects.requireNonNull(this.parentCandidates, "No parent candidates set.").apply(oldParentId.getId()); String newParentId = askNewParent(parentCandidates.toList(), askNewParentTitle, askNewParentMessage).orElse(null); if (newParentId == null) { return Optional.empty(); @@ -275,7 +272,7 @@ public class MoveRequestBuilder { } } } - return Optional.of(new MoveRequest(referenceType, parentReferenceType, parentTargetReferenceType, oldParentId, ids, newParentId, selectTarget.isSelected())); + return Optional.of(new MoveRequest(referenceType, oldParentId, ids, ShortIdDto.of(parentTargetReferenceType, newParentId), selectTarget.isSelected())); } private <R extends DtoReference> Optional<String> askNewParent(List<R> parentCandidates, String dialogTitle, String dialogMessage) { ===================================== client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/logbook/ActivitySampleUIModel.java ===================================== @@ -24,7 +24,6 @@ package fr.ird.observe.client.datasource.editor.ll.data.logbook; import fr.ird.observe.client.datasource.editor.api.content.actions.move.MoveRequestBuilder; -import fr.ird.observe.dto.data.ll.logbook.ActivityReference; import fr.ird.observe.dto.data.ll.logbook.ActivitySampleReference; public class ActivitySampleUIModel extends GeneratedActivitySampleUIModel { @@ -34,6 +33,6 @@ public class ActivitySampleUIModel extends GeneratedActivitySampleUIModel { } public MoveRequestBuilder.StepSetParentCandidates toMoveRequest() { - return MoveRequestBuilder.create(ActivitySampleReference.class, ActivityReference.class, getStates().getSelectedParentId(), toReference(getStates().getBean())); + return MoveRequestBuilder.create(ActivitySampleReference.class, getSource().getParentReference().toShortReference(), toReference(getStates().getBean())); } } ===================================== client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/helper/ContentUIModelHelper.java ===================================== @@ -120,14 +120,14 @@ public class ContentUIModelHelper extends ContentUIHelperSupport { " @Override\n" + " public MoveRequestBuilder.StepSetParentCandidates toMoveRequest() {\n" + " return MoveRequestBuilder\n" + - " .create(%1$s.class, %2$s.class, getStates().getSelectedParentId(), toReference(getStates().getBean()))\n" + + " .create(%1$s.class, getSource().getParentReference().toShortReference(), toReference(getStates().getBean()))\n" + " .setEditNode(getSource().getInitializer().getEditNode());\n" + " }\n\n"; public static final String TO_MOVE_REQUEST_MULTIPLE = "" + " @Override\n" + " public MoveRequestBuilder.StepSetParentCandidates toMoveRequest() {\n" + " return MoveRequestBuilder\n" + - " .create(%1$s.class, %2$s.class, getStates().getSelectedParentId(), getStates().getSelectedDatas())\n" + + " .create(%1$s.class, getSource().getParentReference().toShortReference(), getStates().getSelectedDatas())\n" + " .setEditNode(getSource().getInitializer().getEditNode());\n" + " }\n\n"; public static final String CREATE_FORM = "" + @@ -193,14 +193,14 @@ public class ContentUIModelHelper extends ContentUIHelperSupport { extraMethods += String.format(TO_DELETE_REQUEST_MULTIPLE, referenceType.getSimpleName()); imports.add(MoveRequestBuilder.class.getName()); imports.add(generator.scopeBuilder.parentDtoReferenceType.getName()); - extraMethods += String.format(TO_MOVE_REQUEST_MULTIPLE, referenceType.getSimpleName(), generator.scopeBuilder.parentDtoReferenceType.getSimpleName()); + extraMethods += String.format(TO_MOVE_REQUEST_MULTIPLE, referenceType.getSimpleName()); } else if (uiModel == ContentEditUIModel.class) { extraMethods += String.format(TO_DELETE_REQUEST, referenceType.getSimpleName()); } else if (uiModel == ContentOpenableUIModel.class) { imports.add(MoveRequestBuilder.class.getName()); extraMethods += String.format(TO_DELETE_REQUEST_WITH_EDIT, referenceType.getSimpleName()); imports.add(generator.scopeBuilder.parentDtoReferenceType.getName()); - extraMethods += String.format(TO_MOVE_REQUEST, referenceType.getSimpleName(), generator.scopeBuilder.parentDtoReferenceType.getSimpleName()); + extraMethods += String.format(TO_MOVE_REQUEST, referenceType.getSimpleName()); } } return generate(UI_MODEL_GENERATED, imports, generator.cleanClassName, uiModel, generics, extraMethods); ===================================== services/api-test/src/main/java/fr/ird/observe/services/service/data/OpenableDataServiceFixtures.java ===================================== @@ -87,6 +87,38 @@ public class OpenableDataServiceFixtures { ShortIdDto oldParentId = getIdReference(fixtures, "move.oldParentId"); ShortIdDto newParentId = getIdReference(fixtures, "move.newParentId"); service.move(oldParentId, newParentId, ImmutableSet.of(id)); + + // move back to original + service.move(newParentId, oldParentId, ImmutableSet.of(id)); + + {// try to move them back using bad timestamp (will fail) + ShortIdDto oldParentId2 = oldParentId.of(new Date(0)); + try { + service.move(oldParentId2, newParentId, ImmutableSet.of(id)); + Assert.fail(String.format("Should got a concurrent modification on move %s", id)); + } catch (ConcurrentModificationException e) { + Assert.assertTrue(true); + } + } + {// try to move them back using bad timestamp (will fail) + ShortIdDto newParentId2 = newParentId.of(new Date(0)); + try { + service.move(oldParentId, newParentId2, ImmutableSet.of(id)); + Assert.fail(String.format("Should got a concurrent modification on move %s", id)); + } catch (ConcurrentModificationException e) { + Assert.assertTrue(true); + } + } + {// try to move them back using bad timestamp (will fail) + ShortIdDto oldParentId2 = oldParentId.of(new Date(0)); + ShortIdDto newParentId2 = newParentId.of(new Date(0)); + try { + service.move(oldParentId2, newParentId2, ImmutableSet.of(id)); + Assert.fail(String.format("Should got a concurrent modification on move %s", id)); + } catch (ConcurrentModificationException e) { + Assert.assertTrue(true); + } + } } public static ShortIdDto getIdReference(ObserveServiceFixtures<?> fixtures, String property) { @@ -97,7 +129,7 @@ public class OpenableDataServiceFixtures { return ObserveBusinessProject.get().toShortDto(id); } else { type = Objects2.forName(id.substring(0, index)); - id = id.substring(index+1); + id = id.substring(index + 1); return ShortIdDto.of(type, id); } } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/35cca7670d8ae0b8d0c24c6e… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/35cca7670d8ae0b8d0c24c6e… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][feature/migration_catches] build ci on features
by Tony CHEMIT 22 Feb '21

22 Feb '21
Tony CHEMIT pushed to branch feature/migration_catches at ultreiaio / ird-observe Commits: 3db474be by Tony Chemit at 2021-02-22T19:35:47+01:00 build ci on features - - - - - 1 changed file: - .gitlab-ci.yml Changes: ===================================== .gitlab-ci.yml ===================================== @@ -101,7 +101,7 @@ trigger-make-stage: .automatic: &automatic only: - /^develop.*$/i - - /^features/.+$/i + - /^feature/.+$/i except: - triggers @@ -155,7 +155,7 @@ release-deploy-demo: .manual: &manual only: - /^develop.*$/i - - /^features/.+$/i + - /^feature/.+$/i when: manual create-docker: View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/3db474beb87dd0da16b551c24… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/3db474beb87dd0da16b551c24… You're receiving this email because of your account on gitlab.com.
1 0
0 0
[Git][ultreiaio/ird-observe][feature/migration_catches] 5 commits: build ci on features
by Tony CHEMIT 22 Feb '21

22 Feb '21
Tony CHEMIT pushed to branch feature/migration_catches at ultreiaio / ird-observe Commits: 35cca767 by Tony Chemit at 2021-02-22T19:29:19+01:00 build ci on features - - - - - 9d998535 by Tony Chemit at 2021-02-22T19:34:29+01:00 Move to 9.0.0-RC-1 and go to 9 baseline - - - - - 6ee6af07 by Tony Chemit at 2021-02-22T19:34:36+01:00 stash - - - - - ddde304b by Tony Chemit at 2021-02-22T19:34:36+01:00 stash persistence tests - - - - - b5fa30c0 by Tony Chemit at 2021-02-22T19:34:36+01:00 stash services tests - - - - - 30 changed files: - .gitlab-ci.yml - .mvn/pom.gitflow.develop - .mvn/pom.gitflow.master - client/.mvn/pom.gitflow.develop - client/.mvn/pom.gitflow.master - 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/core/.mvn/pom.gitflow.develop - client/core/.mvn/pom.gitflow.master - client/core/pom.xml - client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java - + client/datasource/.mvn/pom.gitflow.develop - + client/datasource/.mvn/pom.gitflow.master - + client/datasource/.mvn/pom.organizationId - + client/datasource/.mvn/pom.projectId - + client/datasource/.mvn/pom.stageId - client/datasource/actions/.mvn/pom.gitflow.develop - client/datasource/actions/.mvn/pom.gitflow.master - client/datasource/actions/pom.xml - + client/datasource/editor/.mvn/pom.gitflow.develop - + client/datasource/editor/.mvn/pom.gitflow.master - + client/datasource/editor/.mvn/pom.organizationId - + client/datasource/editor/.mvn/pom.projectId - + client/datasource/editor/.mvn/pom.stageId - client/datasource/editor/api-test/.mvn/pom.gitflow.develop - client/datasource/editor/api-test/.mvn/pom.gitflow.master - client/datasource/editor/api-test/pom.xml The diff was not included because it is too large. View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/41f3f7a7f1b1dfcf9b9f885a… -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/41f3f7a7f1b1dfcf9b9f885a… You're receiving this email because of your account on gitlab.com.
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • ...
  • 720
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.