Observe-commits
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
August 2020
- 1 participants
- 52 discussions
[Git][ultreiaio/ird-observe][develop] Penser à tester le comportement des large objects sur la V7 - Closes #927
by Tony CHEMIT 10 Aug '20
by Tony CHEMIT 10 Aug '20
10 Aug '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
128560c7 by Tony Chemit at 2020-08-10T13:32:06+02:00
Penser à tester le comportement des large objects sur la V7 - Closes #927
- - - - -
5 changed files:
- common-persistence/pom.xml
- + common-persistence/src/main/java/fr/ird/observe/entities/BlobIdsIterator.java
- persistence/src/main/java/fr/ird/observe/entities/ObserveTopiaApplicationContext.java
- services-local/src/main/java/fr/ird/observe/services/local/ObserveSecurityHelper.java
- services-local/src/main/java/fr/ird/observe/services/local/service/DataSourceServiceLocal.java
Changes:
=====================================
common-persistence/pom.xml
=====================================
@@ -47,6 +47,10 @@
<groupId>org.nuiton.topia</groupId>
<artifactId>topia-persistence</artifactId>
</dependency>
+ <dependency>
+ <groupId>io.ultreia.java4all.topia</groupId>
+ <artifactId>persistence</artifactId>
+ </dependency>
<dependency>
<groupId>io.ultreia.java4all.topia</groupId>
<artifactId>service-migration</artifactId>
=====================================
common-persistence/src/main/java/fr/ird/observe/entities/BlobIdsIterator.java
=====================================
@@ -0,0 +1,148 @@
+package fr.ird.observe.entities;
+
+/*-
+ * #%L
+ * ObServe Toolkit :: Common Persistence
+ * %%
+ * Copyright (C) 2008 - 2020 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 org.nuiton.topia.persistence.TopiaApplicationContext;
+import org.nuiton.topia.persistence.jdbc.JdbcPostgresHelper;
+import org.nuiton.topia.persistence.metadata.TopiaMetadataEntity;
+import org.nuiton.topia.persistence.metadata.TopiaMetadataModel;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.Closeable;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Iterator;
+import java.util.Objects;
+
+public class BlobIdsIterator implements Iterator<String>, Closeable {
+
+ private final TopiaMetadataModel model;
+
+ private final Path cachePath;
+ private final JdbcPostgresHelper jdbcHelper;
+ private FileIterator iterator;
+
+ public BlobIdsIterator(TopiaMetadataModel model, Path cachePath, TopiaApplicationContext<?> applicationContext) {
+ this.model = Objects.requireNonNull(model);
+ this.cachePath = Objects.requireNonNull(cachePath);
+ this.jdbcHelper = new JdbcPostgresHelper(Objects.requireNonNull(applicationContext).getConfiguration());
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator().hasNext();
+ }
+
+ @Override
+ public String next() {
+ return iterator().next();
+ }
+
+ public FileIterator iterator() {
+ if (iterator == null) {
+ iterator = new FileIterator(cachePath, model, jdbcHelper);
+ }
+ return iterator;
+ }
+
+ @Override
+ public void close() throws IOException {
+ if (iterator != null) {
+ iterator.close();
+ iterator = null;
+ }
+ }
+
+ private static class FileIterator implements Iterator<String>, Closeable {
+ private final Iterator<String> iterator;
+ private final BufferedReader bufferedReader;
+
+ public FileIterator(Path cachePath, TopiaMetadataModel model, JdbcPostgresHelper jdbcHelper) {
+ if (Files.notExists(cachePath)) {
+ try {
+ createCache(jdbcHelper, model, cachePath);
+ } catch (IOException e) {
+ throw new IllegalStateException("can't create cache at " + cachePath, e);
+ }
+ }
+ try {
+ bufferedReader = Files.newBufferedReader(Objects.requireNonNull(cachePath));
+ } catch (IOException e) {
+ throw new IllegalStateException("can't create reader on " + cachePath, e);
+ }
+ iterator = bufferedReader.lines().iterator();
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public String next() {
+ return iterator.next();
+ }
+
+ @Override
+ public void close() throws IOException {
+ bufferedReader.close();
+ }
+
+ private void createCache(JdbcPostgresHelper jdbcHelper, TopiaMetadataModel model, Path cachePath) throws IOException {
+ if (Files.notExists(cachePath.getParent())) {
+ Files.createDirectory(cachePath.getParent());
+ }
+ try (BufferedWriter writer = Files.newBufferedWriter(cachePath)) {
+ for (TopiaMetadataEntity metadataEntity : model) {
+ if (metadataEntity.withBlob()) {
+ for (String blobProperty : metadataEntity.getBlobProperties()) {
+ fillCache(jdbcHelper, metadataEntity.getDbSchemaName(), metadataEntity.getDbTableName(), metadataEntity.getDbColumnName(blobProperty), writer);
+ }
+ }
+ }
+ writer.flush();
+ }
+ }
+
+ private void fillCache(JdbcPostgresHelper jdbcHelper, String dbSchemaName, String dbTableName, String dbColumnName, BufferedWriter writer) {
+ String sql = String.format("SELECT %1$s FROM %2$s.%3$s WHERE %1$s IS NOT NULL ORDER BY topiaId ASC", dbColumnName, dbSchemaName, dbTableName);
+ jdbcHelper.consume(c -> {
+ try (PreparedStatement preparedStatement = c.prepareStatement(sql)) {
+ try (ResultSet resultSet = preparedStatement.executeQuery()) {
+ while (resultSet.next()) {
+ writer.write(resultSet.getString(1));
+ writer.newLine();
+ }
+ }
+ } catch (SQLException | IOException e) {
+ throw new IllegalStateException(e);
+ }
+ });
+ }
+ }
+}
=====================================
persistence/src/main/java/fr/ird/observe/entities/ObserveTopiaApplicationContext.java
=====================================
@@ -43,6 +43,7 @@ import org.nuiton.topia.service.script.table.TopiaSqlTable;
import org.nuiton.topia.service.script.table.TopiaSqlTables;
import org.nuiton.topia.service.script.table.TopiaSqlTablesFactory;
+import java.nio.file.Path;
import java.util.EnumSet;
import java.util.LinkedHashSet;
import java.util.Objects;
@@ -330,6 +331,10 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat
}
+ public BlobIdsIterator newBlobIdsIterator(Path blobIdsPath) {
+ return new BlobIdsIterator(getMetadataModel(), blobIdsPath, this);
+ }
+
private static class TripReplicateTablesPredicate implements TopiaSqlTablesFactory.TopiaSqlTablesPredicate {
private final Set<TopiaMetadataEntity> done = new LinkedHashSet<>();
=====================================
services-local/src/main/java/fr/ird/observe/services/local/ObserveSecurityHelper.java
=====================================
@@ -25,9 +25,9 @@ package fr.ird.observe.services.local;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.dto.ObserveDbRole;
import fr.ird.observe.dto.db.ObserveDbUserDto;
+import fr.ird.observe.entities.BlobIdsIterator;
import fr.ird.observe.entities.Entities;
import fr.ird.observe.entities.ObserveTopiaApplicationContext;
-import fr.ird.observe.entities.ObserveTopiaConfiguration;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -49,6 +49,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Objects;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -62,7 +63,11 @@ public class ObserveSecurityHelper {
public static final String OBSERVE_SEINE_COMMON_SCHEMA_NAME = "ps_common";
private static final Function<String, String> ESCAPE_STRING = input -> "\"" + input + "\"";
private static final String REVOKE_ON_TABLE_ALL_PATTERN = "REVOKE ALL ON %s.%s FROM %s CASCADE;";
+ private static final String REVOKE_ON_LARGE_OBJECT_ALL_PATTERN = "REVOKE ALL ON LARGE OBJECT %s FROM %s CASCADE;";
private static final String SET_ON_TABLE_OWNER_PATTERN = "ALTER TABLE %s.%s OWNER TO %s;";
+ private static final String SET_ON_LARGE_OBJECT_OWNER_PATTERN = "ALTER LARGE OBJECT %s OWNER TO %s;";
+ private static final String GRANT_ON_LARGE_OBJECT_READ_PATTERN = "GRANT SELECT ON LARGE OBJECT %s TO %s;";
+ private static final String GRANT_ON_LARGE_OBJECT_ALL_PATTERN = "GRANT ALL ON LARGE OBJECT %s TO %s;";
private static final String GRANT_ON_TABLE_READ_PATTERN = "GRANT SELECT ON %s.%s TO %s;";
private static final String GRANT_ON_TABLE_ALL_PATTERN = "GRANT ALL ON %s.%s TO %s;";
private static final String GRANT_ON_FUNCTION_PATTERN = "GRANT EXECUTE ON FUNCTION %s TO %s;";
@@ -82,11 +87,13 @@ public class ObserveSecurityHelper {
private static final Logger log = LogManager.getLogger(ObserveSecurityHelper.class);
private final JdbcPostgresHelper jdbcHelper;
private final Path temporaryDirectory;
+ private final ObserveTopiaApplicationContext applicationContext;
- public ObserveSecurityHelper(ObserveTopiaConfiguration jdbcConfiguration) {
- this.jdbcHelper = new JdbcPostgresHelper(jdbcConfiguration);
- this.temporaryDirectory = jdbcConfiguration.getTemporaryDirectory();
+ public ObserveSecurityHelper(ObserveTopiaApplicationContext applicationContext) {
+ this.applicationContext = Objects.requireNonNull(applicationContext);
+ this.jdbcHelper = new JdbcPostgresHelper(applicationContext.getConfiguration());
+ this.temporaryDirectory = applicationContext.getConfiguration().getTemporaryDirectory();
}
public void applySecurity(Set<ObserveDbUserDto> users) {
@@ -99,10 +106,11 @@ public class ObserveSecurityHelper {
} catch (IOException e) {
throw new IllegalStateException("Can't create temporary path", e);
}
+ Path blobIdsPath = scriptPath.getParent().resolve(scriptPath.toFile().getName().replace(".sql",".blob-ids"));
try {
try (SqlScriptWriter sqlScriptWriter = SqlScriptWriter.of(scriptPath)) {
- createSecurityScript(users, sqlScriptWriter);
+ createSecurityScript(users, sqlScriptWriter, blobIdsPath);
log.info(String.format("Generate security script %d statements(s) at %s", sqlScriptWriter.getStatementCount(), scriptPath));
}
jdbcHelper.consume(SqlScriptConsumer.of(scriptPath));
@@ -111,7 +119,7 @@ public class ObserveSecurityHelper {
}
}
- private void createSecurityScript(Set<ObserveDbUserDto> users, SqlScriptWriter sqlScriptWriter) {
+ private void createSecurityScript(Set<ObserveDbUserDto> users, SqlScriptWriter sqlScriptWriter, Path blobIdsPath) throws IOException {
Set<String> schemas = ImmutableSet.<String>builder().add(SCHEMA_PUBLIC).addAll(ObserveTopiaApplicationContext.newModelSupport().getMetadataModel().getSchemaNames()).build();
@@ -151,6 +159,7 @@ public class ObserveSecurityHelper {
Set<String> referentialEscapedNames = escapedNames(referentialNames);
Set<String> unusedEscapedNames = escapedNames(unusedNames);
+ BlobIdsIterator blobIdsIterator = applicationContext.newBlobIdsIterator(blobIdsPath);
// suppression de tous les droits
{
@@ -165,6 +174,7 @@ public class ObserveSecurityHelper {
addOnTablesForRole(REVOKE_ON_TABLE_ALL_PATTERN, sqlScriptWriter, tables, roles);
addOnSchemaForRole(REVOKE_ON_SCHEMA_ALL_PATTERN, sqlScriptWriter, schemas, roles);
addOnFunctionForRole(REVOKE_ON_FUNCTIONS_PATTERN, sqlScriptWriter, allPostgisFunctions, roles);
+ addOnLargeObjectForRole(REVOKE_ON_LARGE_OBJECT_ALL_PATTERN, sqlScriptWriter, blobIdsIterator, roles);
}
@@ -172,6 +182,8 @@ public class ObserveSecurityHelper {
addOnTablesForRole(SET_ON_TABLE_OWNER_PATTERN, sqlScriptWriter, tables, administratorEscapedName);
addOnSchemaForRole(GRANT_ON_SCHEMA_ALL_PATTERN, sqlScriptWriter, schemas, administratorEscapedName);
addOnSchemaForRole(GRANT_ON_FUNCTION_PATTERN, sqlScriptWriter, allPostgisFunctions, administratorEscapedName);
+ addOnLargeObjectForRole(SET_ON_LARGE_OBJECT_OWNER_PATTERN, sqlScriptWriter, blobIdsIterator, administratorEscapedName);
+ addOnLargeObjectForRole(GRANT_ON_LARGE_OBJECT_ALL_PATTERN, sqlScriptWriter, blobIdsIterator, administratorEscapedName);
// ajout administrateurs
if (!technicalEscapedNames.isEmpty()) {
@@ -179,6 +191,7 @@ public class ObserveSecurityHelper {
addOnTablesForRole(GRANT_ON_TABLE_ALL_PATTERN, sqlScriptWriter, tables, roles);
addOnSchemaForRole(GRANT_ON_SCHEMA_ALL_PATTERN, sqlScriptWriter, schemas, roles);
addOnSchemaForRole(GRANT_ON_FUNCTION_PATTERN, sqlScriptWriter, allPostgisFunctions, roles);
+ addOnLargeObjectForRole(GRANT_ON_LARGE_OBJECT_ALL_PATTERN, sqlScriptWriter, blobIdsIterator, roles);
}
// ajout utilisateur
@@ -187,6 +200,7 @@ public class ObserveSecurityHelper {
addOnTablesForRole(GRANT_ON_TABLE_READ_PATTERN, sqlScriptWriter, tables, roles);
addOnSchemaForRole(GRANT_ON_SCHEMA_ALL_PATTERN, sqlScriptWriter, schemas, roles);
addOnSchemaForRole(GRANT_ON_FUNCTION_PATTERN, sqlScriptWriter, allPostgisFunctions, roles);
+ addOnLargeObjectForRole(GRANT_ON_LARGE_OBJECT_READ_PATTERN, sqlScriptWriter, blobIdsIterator, roles);
}
// ajout referentiel
@@ -273,6 +287,18 @@ public class ObserveSecurityHelper {
}
}
+ private void addOnLargeObjectForRole(String pattern, SqlScriptWriter builder, BlobIdsIterator blobIdsIterator, String role) throws IOException {
+ try {
+ while (blobIdsIterator.hasNext()) {
+ String blobId = blobIdsIterator.next();
+ builder.writeSql(String.format(pattern, blobId, role));
+ }
+ } finally {
+ blobIdsIterator.close();
+ }
+
+ }
+
private void addOnFunctionForRole(String pattern, SqlScriptWriter builder, Set<String> functions, String role) {
for (String t : functions) {
builder.writeSql(String.format(pattern, t, role));
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/DataSourceServiceLocal.java
=====================================
@@ -516,10 +516,8 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS
// pas de securité pour les bases autres que postgresql
if (dataSourceConfiguration instanceof ObserveDataSourceConfigurationTopiaPG) {
ObserveDataSourceConfigurationTopiaPG sourceConfiguration = (ObserveDataSourceConfigurationTopiaPG) dataSourceConfiguration;
- ObserveTopiaConfiguration topiaConfiguration;
- try (ObserveTopiaApplicationContext optionalTopiaApplicationContext = ObserveTopiaApplicationContextFactory.getOrCreateTopiaApplicationContext(sourceConfiguration)) {
- topiaConfiguration = optionalTopiaApplicationContext.getConfiguration();
- new ObserveSecurityHelper(topiaConfiguration).applySecurity(users);
+ try (ObserveTopiaApplicationContext topiaApplicationContext = ObserveTopiaApplicationContextFactory.getOrCreateTopiaApplicationContext(sourceConfiguration)) {
+ new ObserveSecurityHelper(topiaApplicationContext).applySecurity(users);
}
}
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/128560c791b0d7baae937372c…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/128560c791b0d7baae937372c…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] Penser à tester le comportement des large objects sur la V7 - Closes #927
by Tony CHEMIT 06 Aug '20
by Tony CHEMIT 06 Aug '20
06 Aug '20
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
2d50c6fb by Tony Chemit at 2020-08-06T21:24:45+02:00
Penser à tester le comportement des large objects sur la V7 - Closes #927
- - - - -
5 changed files:
- common-persistence/pom.xml
- + common-persistence/src/main/java/fr/ird/observe/entities/BlobIdsIterator.java
- persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaApplicationContext.java
- services-local/src/main/java/fr/ird/observe/services/local/ObserveSecurityHelper.java
- services-local/src/main/java/fr/ird/observe/services/local/service/DataSourceServiceLocal.java
Changes:
=====================================
common-persistence/pom.xml
=====================================
@@ -47,6 +47,10 @@
<groupId>org.nuiton.topia</groupId>
<artifactId>topia-persistence</artifactId>
</dependency>
+ <dependency>
+ <groupId>io.ultreia.java4all.topia</groupId>
+ <artifactId>persistence</artifactId>
+ </dependency>
<dependency>
<groupId>io.ultreia.java4all.topia</groupId>
<artifactId>service-migration</artifactId>
=====================================
common-persistence/src/main/java/fr/ird/observe/entities/BlobIdsIterator.java
=====================================
@@ -0,0 +1,148 @@
+package fr.ird.observe.entities;
+
+/*-
+ * #%L
+ * ObServe Toolkit :: Common Persistence
+ * %%
+ * Copyright (C) 2008 - 2020 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 org.nuiton.topia.persistence.TopiaApplicationContext;
+import org.nuiton.topia.persistence.jdbc.JdbcPostgresHelper;
+import org.nuiton.topia.persistence.metadata.TopiaMetadataEntity;
+import org.nuiton.topia.persistence.metadata.TopiaMetadataModel;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.Closeable;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Iterator;
+import java.util.Objects;
+
+public class BlobIdsIterator implements Iterator<String>, Closeable {
+
+ private final TopiaMetadataModel model;
+
+ private final Path cachePath;
+ private final JdbcPostgresHelper jdbcHelper;
+ private FileIterator iterator;
+
+ public BlobIdsIterator(TopiaMetadataModel model, Path cachePath, TopiaApplicationContext<?> applicationContext) {
+ this.model = Objects.requireNonNull(model);
+ this.cachePath = Objects.requireNonNull(cachePath);
+ this.jdbcHelper = new JdbcPostgresHelper(Objects.requireNonNull(applicationContext).getConfiguration());
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator().hasNext();
+ }
+
+ @Override
+ public String next() {
+ return iterator().next();
+ }
+
+ public FileIterator iterator() {
+ if (iterator == null) {
+ iterator = new FileIterator(cachePath, model, jdbcHelper);
+ }
+ return iterator;
+ }
+
+ @Override
+ public void close() throws IOException {
+ if (iterator != null) {
+ iterator.close();
+ iterator = null;
+ }
+ }
+
+ private static class FileIterator implements Iterator<String>, Closeable {
+ private final Iterator<String> iterator;
+ private final BufferedReader bufferedReader;
+
+ public FileIterator(Path cachePath, TopiaMetadataModel model, JdbcPostgresHelper jdbcHelper) {
+ if (Files.notExists(cachePath)) {
+ try {
+ createCache(jdbcHelper, model, cachePath);
+ } catch (IOException e) {
+ throw new IllegalStateException("can't create cache at " + cachePath, e);
+ }
+ }
+ try {
+ bufferedReader = Files.newBufferedReader(Objects.requireNonNull(cachePath));
+ } catch (IOException e) {
+ throw new IllegalStateException("can't create reader on " + cachePath, e);
+ }
+ iterator = bufferedReader.lines().iterator();
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public String next() {
+ return iterator.next();
+ }
+
+ @Override
+ public void close() throws IOException {
+ bufferedReader.close();
+ }
+
+ private void createCache(JdbcPostgresHelper jdbcHelper, TopiaMetadataModel model, Path cachePath) throws IOException {
+ if (Files.notExists(cachePath.getParent())) {
+ Files.createDirectory(cachePath.getParent());
+ }
+ try (BufferedWriter writer = Files.newBufferedWriter(cachePath)) {
+ for (TopiaMetadataEntity metadataEntity : model) {
+ if (metadataEntity.withBlob()) {
+ for (String blobProperty : metadataEntity.getBlobProperties()) {
+ fillCache(jdbcHelper, metadataEntity.getDbSchemaName(), metadataEntity.getDbTableName(), metadataEntity.getDbColumnName(blobProperty), writer);
+ }
+ }
+ }
+ writer.flush();
+ }
+ }
+
+ private void fillCache(JdbcPostgresHelper jdbcHelper, String dbSchemaName, String dbTableName, String dbColumnName, BufferedWriter writer) {
+ String sql = String.format("SELECT %1$s FROM %2$s.%3$s WHERE %1$s IS NOT NULL ORDER BY topiaId ASC", dbColumnName, dbSchemaName, dbTableName);
+ jdbcHelper.consume(c -> {
+ try (PreparedStatement preparedStatement = c.prepareStatement(sql)) {
+ try (ResultSet resultSet = preparedStatement.executeQuery()) {
+ while (resultSet.next()) {
+ writer.write(resultSet.getString(1));
+ writer.newLine();
+ }
+ }
+ } catch (SQLException | IOException e) {
+ throw new IllegalStateException(e);
+ }
+ });
+ }
+ }
+}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaApplicationContext.java
=====================================
@@ -23,6 +23,7 @@ package fr.ird.observe.persistence;
*/
import com.google.common.collect.ImmutableSet;
+import fr.ird.observe.entities.BlobIdsIterator;
import fr.ird.observe.entities.referentiel.ObserveReferentialEntity;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -46,6 +47,7 @@ import org.nuiton.topia.service.script.table.TopiaSqlTable;
import org.nuiton.topia.service.script.table.TopiaSqlTables;
import org.nuiton.topia.service.script.table.TopiaSqlTablesFactory;
+import java.nio.file.Path;
import java.util.EnumSet;
import java.util.LinkedHashSet;
import java.util.List;
@@ -335,6 +337,9 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat
return referentialTables = topiaSqlTablesFactory.newReplicateEntityTables(new TripReplicateTablesPredicate(), entityEnum);
}
+ public BlobIdsIterator newBlobIdsIterator(Path blobIdsPath) {
+ return new BlobIdsIterator(getMetadataModel(), blobIdsPath, this);
+ }
private static class TripReplicateTablesPredicate implements TopiaSqlTablesFactory.TopiaSqlTablesPredicate {
=====================================
services-local/src/main/java/fr/ird/observe/services/local/ObserveSecurityHelper.java
=====================================
@@ -26,8 +26,9 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import fr.ird.observe.dto.ObserveDbRole;
import fr.ird.observe.dto.db.ObserveDbUserDto;
+import fr.ird.observe.entities.BlobIdsIterator;
import fr.ird.observe.persistence.Entities;
-import fr.ird.observe.persistence.ObserveTopiaConfiguration;
+import fr.ird.observe.persistence.ObserveTopiaApplicationContext;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -49,6 +50,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Objects;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -63,7 +65,11 @@ public class ObserveSecurityHelper {
private static final String OBSERVE_LONGLINE_SCHEMA_NAME = "observe_longline";
private static final Function<String, String> ESCAPE_STRING = input -> "\"" + input + "\"";
private static final String REVOKE_ON_TABLE_ALL_PATTERN = "REVOKE ALL ON %s.%s FROM %s CASCADE;";
+ private static final String REVOKE_ON_LARGE_OBJECT_ALL_PATTERN = "REVOKE ALL ON LARGE OBJECT %s FROM %s CASCADE;";
private static final String SET_ON_TABLE_OWNER_PATTERN = "ALTER TABLE %s.%s OWNER TO %s;";
+ private static final String SET_ON_LARGE_OBJECT_OWNER_PATTERN = "ALTER LARGE OBJECT %s OWNER TO %s;";
+ private static final String GRANT_ON_LARGE_OBJECT_READ_PATTERN = "GRANT SELECT ON LARGE OBJECT %s TO %s;";
+ private static final String GRANT_ON_LARGE_OBJECT_ALL_PATTERN = "GRANT ALL ON LARGE OBJECT %s TO %s;";
private static final String GRANT_ON_TABLE_READ_PATTERN = "GRANT SELECT ON %s.%s TO %s;";
private static final String GRANT_ON_TABLE_ALL_PATTERN = "GRANT ALL ON %s.%s TO %s;";
private static final String GRANT_ON_FUNCTION_PATTERN = "GRANT EXECUTE ON FUNCTION %s TO %s;";
@@ -74,24 +80,26 @@ public class ObserveSecurityHelper {
TMSVersionHibernateDao.TABLE_NAME,
TMSVersionHibernateDao.LEGACY_TABLE_NAME);
private static final Set<String> FUNCTION_NAMES_PREFIXS = ImmutableSet.of("ST_MakePoint",
- "ST_SetSRID",
- "sync_",
- "tr_sync",
- "ot_enhanced_school_type",
- "observe_");
+ "ST_SetSRID",
+ "sync_",
+ "tr_sync",
+ "ot_enhanced_school_type",
+ "observe_");
private static final String SCHEMA_PUBLIC = "public";
private static final Set<String> SCHEMAS = ImmutableSet.of(SCHEMA_PUBLIC,
- OBSERVE_COMMON_SCHEMA_NAME,
- OBSERVE_SEINE_SCHEMA_NAME,
- OBSERVE_LONGLINE_SCHEMA_NAME);
+ OBSERVE_COMMON_SCHEMA_NAME,
+ OBSERVE_SEINE_SCHEMA_NAME,
+ OBSERVE_LONGLINE_SCHEMA_NAME);
private static final Logger log = LogManager.getLogger(ObserveSecurityHelper.class);
private final JdbcPostgresHelper jdbcHelper;
private final Path temporaryDirectory;
+ private final ObserveTopiaApplicationContext applicationContext;
- public ObserveSecurityHelper(ObserveTopiaConfiguration jdbcConfiguration) {
- this.jdbcHelper = new JdbcPostgresHelper(jdbcConfiguration);
- this.temporaryDirectory = jdbcConfiguration.getTemporaryDirectory();
+ public ObserveSecurityHelper(ObserveTopiaApplicationContext applicationContext) {
+ this.applicationContext = Objects.requireNonNull(applicationContext);
+ this.jdbcHelper = new JdbcPostgresHelper(applicationContext.getConfiguration());
+ this.temporaryDirectory = applicationContext.getConfiguration().getTemporaryDirectory();
}
public void applySecurity(Set<ObserveDbUserDto> users) {
@@ -104,10 +112,11 @@ public class ObserveSecurityHelper {
} catch (IOException e) {
throw new IllegalStateException("Can't create temporary path", e);
}
+ Path blobIdsPath = scriptPath.getParent().resolve(scriptPath.toFile().getName().replace(".sql",".blob-ids"));
try {
try (SqlScriptWriter sqlScriptWriter = SqlScriptWriter.of(scriptPath)) {
- createSecurityScript(users, sqlScriptWriter);
+ createSecurityScript(users, sqlScriptWriter, blobIdsPath);
log.info(String.format("Generate security script %d statements(s) at %s", sqlScriptWriter.getStatementCount(), scriptPath));
}
jdbcHelper.consume(SqlScriptConsumer.of(scriptPath));
@@ -116,7 +125,7 @@ public class ObserveSecurityHelper {
}
}
- private void createSecurityScript(Set<ObserveDbUserDto> users, SqlScriptWriter sqlScriptWriter) {
+ private void createSecurityScript(Set<ObserveDbUserDto> users, SqlScriptWriter sqlScriptWriter, Path blobIdsPath) throws IOException {
List<Pair<String, String>> tables = jdbcHelper.getTables(SCHEMAS, EXTRA_TABLES);
@@ -154,6 +163,7 @@ public class ObserveSecurityHelper {
Set<String> referentialEscapedNames = escapedNames(referentialNames);
Set<String> unusedEscapedNames = escapedNames(unusedNames);
+ BlobIdsIterator blobIdsIterator = applicationContext.newBlobIdsIterator(blobIdsPath);
// suppression de tous les droits
{
@@ -168,6 +178,7 @@ public class ObserveSecurityHelper {
addOnTablesForRole(REVOKE_ON_TABLE_ALL_PATTERN, sqlScriptWriter, tables, roles);
addOnSchemaForRole(REVOKE_ON_SCHEMA_ALL_PATTERN, sqlScriptWriter, SCHEMAS, roles);
addOnFunctionForRole(REVOKE_ON_FUNCTIONS_PATTERN, sqlScriptWriter, allPostgisFunctions, roles);
+ addOnLargeObjectForRole(REVOKE_ON_LARGE_OBJECT_ALL_PATTERN, sqlScriptWriter, blobIdsIterator, roles);
}
@@ -175,6 +186,8 @@ public class ObserveSecurityHelper {
addOnTablesForRole(SET_ON_TABLE_OWNER_PATTERN, sqlScriptWriter, tables, administratorEscapedName);
addOnSchemaForRole(GRANT_ON_SCHEMA_ALL_PATTERN, sqlScriptWriter, SCHEMAS, administratorEscapedName);
addOnSchemaForRole(GRANT_ON_FUNCTION_PATTERN, sqlScriptWriter, allPostgisFunctions, administratorEscapedName);
+ addOnLargeObjectForRole(SET_ON_LARGE_OBJECT_OWNER_PATTERN, sqlScriptWriter, blobIdsIterator, administratorEscapedName);
+ addOnLargeObjectForRole(GRANT_ON_LARGE_OBJECT_ALL_PATTERN, sqlScriptWriter, blobIdsIterator, administratorEscapedName);
// ajout administrateurs
if (!technicalEscapedNames.isEmpty()) {
@@ -182,6 +195,7 @@ public class ObserveSecurityHelper {
addOnTablesForRole(GRANT_ON_TABLE_ALL_PATTERN, sqlScriptWriter, tables, roles);
addOnSchemaForRole(GRANT_ON_SCHEMA_ALL_PATTERN, sqlScriptWriter, SCHEMAS, roles);
addOnSchemaForRole(GRANT_ON_FUNCTION_PATTERN, sqlScriptWriter, allPostgisFunctions, roles);
+ addOnLargeObjectForRole(GRANT_ON_LARGE_OBJECT_ALL_PATTERN, sqlScriptWriter, blobIdsIterator, roles);
}
// ajout utilisateur
@@ -190,6 +204,7 @@ public class ObserveSecurityHelper {
addOnTablesForRole(GRANT_ON_TABLE_READ_PATTERN, sqlScriptWriter, tables, roles);
addOnSchemaForRole(GRANT_ON_SCHEMA_ALL_PATTERN, sqlScriptWriter, SCHEMAS, roles);
addOnSchemaForRole(GRANT_ON_FUNCTION_PATTERN, sqlScriptWriter, allPostgisFunctions, roles);
+ addOnLargeObjectForRole(GRANT_ON_LARGE_OBJECT_READ_PATTERN, sqlScriptWriter, blobIdsIterator, roles);
}
// ajout referentiel
@@ -272,6 +287,18 @@ public class ObserveSecurityHelper {
}
}
+ private void addOnLargeObjectForRole(String pattern, SqlScriptWriter builder, BlobIdsIterator blobIdsIterator, String role) throws IOException {
+ try {
+ while (blobIdsIterator.hasNext()) {
+ String blobId = blobIdsIterator.next();
+ builder.writeSql(String.format(pattern, blobId, role));
+ }
+ } finally {
+ blobIdsIterator.close();
+ }
+
+ }
+
private void addOnFunctionForRole(String pattern, SqlScriptWriter builder, Set<String> functions, String role) {
for (String t : functions) {
builder.writeSql(String.format(pattern, t, role));
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/DataSourceServiceLocal.java
=====================================
@@ -582,11 +582,8 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS
ObserveDataSourceConfigurationTopiaPG sourceConfiguration = (ObserveDataSourceConfigurationTopiaPG) dataSourceConfiguration;
- ObserveTopiaConfiguration topiaConfiguration;
- try (ObserveTopiaApplicationContext optionalTopiaApplicationContext = ObserveTopiaApplicationContextFactory.getOrCreateTopiaApplicationContext(sourceConfiguration)) {
-
- topiaConfiguration = optionalTopiaApplicationContext.getConfiguration();
- new ObserveSecurityHelper(topiaConfiguration).applySecurity(users);
+ try (ObserveTopiaApplicationContext topiaApplicationContext = ObserveTopiaApplicationContextFactory.getOrCreateTopiaApplicationContext(sourceConfiguration)) {
+ new ObserveSecurityHelper(topiaApplicationContext).applySecurity(users);
}
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/2d50c6fbb9a495004f77010dc…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/2d50c6fbb9a495004f77010dc…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
b5415148 by Tony Chemit at 2020-08-05T19:17:50+02:00
update pom and changelog
- - - - -
2 changed files:
- CHANGELOG.md
- pom.xml
Changes:
=====================================
CHANGELOG.md
=====================================
The diff for this file was not included because it is too large.
=====================================
pom.xml
=====================================
@@ -24,7 +24,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2020.42</version>
+ <version>2020.43</version>
</parent>
<groupId>fr.ird.observe</groupId>
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/b54151489b66bb43d64b50dd7…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/b54151489b66bb43d64b50dd7…
You're receiving this email because of your account on gitlab.com.
1
0
05 Aug '20
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
dd7d2368 by Tony Chemit at 2020-08-05T19:17:12+02:00
update pom (but stalled jaxx)
- - - - -
1 changed file:
- pom.xml
Changes:
=====================================
pom.xml
=====================================
@@ -24,7 +24,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2020.39</version>
+ <version>2020.43</version>
</parent>
<groupId>fr.ird.observe</groupId>
@@ -167,6 +167,7 @@
<lib.version.java4all.eugene>3.0-alpha-26</lib.version.java4all.eugene>
<lib.version.java4all.topia>1.1.17</lib.version.java4all.topia>
<lib.version.nuiton.utils>3.0</lib.version.nuiton.utils>
+ <lib.version.java4all.jaxx>3.0-alpha-75</lib.version.java4all.jaxx>
<!--<lib.version.java4all.http>1.0.13</lib.version.java4all.http>-->
<!--<lib.version.java4all.config>1.0.3</lib.version.java4all.config>-->
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/dd7d2368a0d4a85b521682cab…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/dd7d2368a0d4a85b521682cab…
You're receiving this email because of your account on gitlab.com.
1
0
05 Aug '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
81cb7d87 by Tony Chemit at 2020-08-05T18:02:24+02:00
update changelog [skip ci]
- - - - -
1 changed file:
- CHANGELOG.md
Changes:
=====================================
CHANGELOG.md
=====================================
@@ -1,7 +1,7 @@
# ObServe changelog
* Author [Tony Chemit](mailto:dev@tchemit.fr)
- * Last generated at 2020-07-09 08:01.
+ * Last generated at 2020-08-05 18:01.
## Version [8.0.0-RC-8](https://gitlab.com/ultreiaio/ird-observe/milestones/167)
@@ -283,6 +283,17 @@
* [[Evolution 1181]](https://gitlab.com/ultreiaio/ird-observe/issues/1181) **Ajouter un champ vessel.lloydid** (Thanks to Tony CHEMIT) (Reported by Pascal Cauquil)
* [[Evolution 1183]](https://gitlab.com/ultreiaio/ird-observe/issues/1183) **[V8][DATA MODEL] Transformer Vessel.fleetcountry (int4) en topiaid** (Thanks to Tony CHEMIT) (Reported by Pascal Cauquil)
+## Version [7.6.5](https://gitlab.com/ultreiaio/ird-observe/milestones/169)
+
+**Closed at 2020-08-05.**
+
+
+### Issues
+ * [[Anomalie 1584]](https://gitlab.com/ultreiaio/ird-observe/issues/1584) **[UI] Correction des libellés des tables de référence du schéma observe.longline dans Observe** (Thanks to Tony CHEMIT) (Reported by Philippe Sabarros)
+ * [[Anomalie 1585]](https://gitlab.com/ultreiaio/ird-observe/issues/1585) **Listes à choix multiples et mode permissif sur référentiels désactivés** (Thanks to Tony CHEMIT) (Reported by Pascal Cauquil)
+ * [[Anomalie 1587]](https://gitlab.com/ultreiaio/ird-observe/issues/1587) **traductions manquantes (UI validation)** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT)
+ * [[Evolution 1583]](https://gitlab.com/ultreiaio/ird-observe/issues/1583) **[PS] Contrôle de la saisie des espèces dans faune accessoire par systèmes observés (cas requin baleine)** (Thanks to Tony CHEMIT) (Reported by Philippe Sabarros)
+
## Version [7.6.4](https://gitlab.com/ultreiaio/ird-observe/milestones/166)
**Closed at 2020-07-08.**
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/81cb7d872fcddddc8f0f3d12e…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/81cb7d872fcddddc8f0f3d12e…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] traductions manquantes (UI validation) - Closes #1587
by Tony CHEMIT 05 Aug '20
by Tony CHEMIT 05 Aug '20
05 Aug '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
7d4b7ecb by Tony Chemit at 2020-08-05T17:46:12+02:00
traductions manquantes (UI validation) - Closes #1587
- - - - -
5 changed files:
- dto/src/main/i18n/getters/java.getter
- dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nLabelsBuilder.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
Changes:
=====================================
dto/src/main/i18n/getters/java.getter
=====================================
@@ -64,3 +64,7 @@ observe.ui.tree.referential.ll.landing
observe.ui.tree.referential.ll.obs
observe.ui.tree.referential.ps.common
observe.ui.tree.referential.ps.obs
+validator.scope.error.label
+validator.scope.fatal.label
+validator.scope.info.label
+validator.scope.warning.label
=====================================
dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nLabelsBuilder.java
=====================================
@@ -50,6 +50,10 @@ import static io.ultreia.java4all.i18n.I18n.t;
public class ObserveI18nLabelsBuilder extends BeanPropertyI18nKeyProducerSupport {
static {
+ n("validator.scope.error.label");
+ n("validator.scope.fatal.label");
+ n("validator.scope.info.label");
+ n("validator.scope.warning.label");
n("observe.Id.comment");
n("observe.Id.species");
n("observe.Id.country");
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -2669,3 +2669,7 @@ observeweb.sessionExpirationDelay.description=Session expiration delay (in minut
observeweb.sessionMaximumSize.description=Session maximum size
observeweb.temporaryDirectory.description=Path to temporary directory
observeweb.usersConfigurationFile.description=Path to users configuration file
+validator.scope.error.label=Error
+validator.scope.fatal.label=Fatal error
+validator.scope.info.label=Information
+validator.scope.warning.label=Warning
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -2669,3 +2669,7 @@ observeweb.sessionExpirationDelay.description=Duración máxima de una sesión (
observeweb.sessionMaximumSize.description=Tamaño máximo de la sesión
observeweb.temporaryDirectory.description=Ubicación del directorio temporal
observeweb.usersConfigurationFile.description=Ubicación del archivo de configuración de los usuarios
+validator.scope.error.label=Error
+validator.scope.fatal.label=Fatal Error
+validator.scope.info.label=Información
+validator.scope.warning.label=Advertencias
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -2669,3 +2669,7 @@ observeweb.sessionExpirationDelay.description=Temps maximum d'une session (en mi
observeweb.sessionMaximumSize.description=Taille maximum de session
observeweb.temporaryDirectory.description=Chemin vers le répertoire temporaire
observeweb.usersConfigurationFile.description=Chemin vers le fichier de configuration des utilisateurs
+validator.scope.error.label=Erreur
+validator.scope.fatal.label=Erreur fatale
+validator.scope.info.label=Information
+validator.scope.warning.label=Avertissement
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/7d4b7ecbaffe8eecd780a42bf…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/7d4b7ecbaffe8eecd780a42bf…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] traductions manquantes (UI validation) - See #1587
by Tony CHEMIT 05 Aug '20
by Tony CHEMIT 05 Aug '20
05 Aug '20
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
bce23550 by Tony Chemit at 2020-08-05T17:29:56+02:00
traductions manquantes (UI validation) - See #1587
- - - - -
5 changed files:
- dto/src/main/i18n/getters/java.getter
- dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nLabelsBuilder.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
Changes:
=====================================
dto/src/main/i18n/getters/java.getter
=====================================
@@ -55,3 +55,7 @@ observe.type.reference.longline
observe.type.reference.seine
observe.validation.activity.speed.bound
observe.validation.activity.speed.bound.inter
+validator.scope.error.label
+validator.scope.fatal.label
+validator.scope.info.label
+validator.scope.warning.label
=====================================
dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nLabelsBuilder.java
=====================================
@@ -50,6 +50,10 @@ import static io.ultreia.java4all.i18n.I18n.n;
public class ObserveI18nLabelsBuilder extends BeanPropertyI18nKeyProducerSupport {
static {
+ n("validator.scope.error.label");
+ n("validator.scope.fatal.label");
+ n("validator.scope.info.label");
+ n("validator.scope.warning.label");
n("observe.common.IdDto.comment");
n("observe.common.IdDto.species");
n("observe.common.IdDto.country");
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -2348,3 +2348,7 @@ observeweb.sessionExpirationDelay.description=Session expiration deplay (in minu
observeweb.sessionMaximumSize.description=Session maximum size
observeweb.temporaryDirectory.description=Path to temporary directory
observeweb.usersConfigurationFile.description=Path to users configuration file
+validator.scope.error.label=Error
+validator.scope.fatal.label=Fatal error
+validator.scope.info.label=Information
+validator.scope.warning.label=Warning
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -2348,3 +2348,7 @@ observeweb.sessionExpirationDelay.description=Duración máxima de una sesión (
observeweb.sessionMaximumSize.description=Tamaño máximo de la sesión
observeweb.temporaryDirectory.description=Ubicación del directorio temporal
observeweb.usersConfigurationFile.description=Ubicación del archivo de configuración de los usuarios
+validator.scope.error.label=Error
+validator.scope.fatal.label=Fatal Error
+validator.scope.info.label=Información
+validator.scope.warning.label=Advertencias
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -2348,3 +2348,7 @@ observeweb.sessionExpirationDelay.description=Temps maximum d'une session (en mi
observeweb.sessionMaximumSize.description=Taille maximum de session
observeweb.temporaryDirectory.description=Chemin vers le répertoire temporaire
observeweb.usersConfigurationFile.description=Chemin vers le fichier de configuration des utilisateurs
+validator.scope.error.label=Erreur
+validator.scope.fatal.label=Erreur fatale
+validator.scope.info.label=Information
+validator.scope.warning.label=Avertissement
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/bce23550e61f7d38116369910…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/bce23550e61f7d38116369910…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [UI] Correction des libellés des tables de référence du schéma observe.longline dans Observe
by Tony CHEMIT 05 Aug '20
by Tony CHEMIT 05 Aug '20
05 Aug '20
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
2ead6b27 by Tony Chemit at 2020-08-05T16:18:40+02:00
[UI] Correction des libellés des tables de référence du schéma observe.longline dans Observe
- See #1584
- - - - -
22 changed files:
- client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java
- client-core/src/main/java/fr/ird/observe/client/ui/admin/AdminTabUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ContentReferenceUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ReferenceHomeUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ReferenceHomeUIModel.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDeleteUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDeleteUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDesactivateUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDesactivateUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDisplayUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDisplayUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageUIHandlerSupport.java
- client-core/src/main/java/fr/ird/observe/client/ui/tree/navigation/nodes/referential/ReferentialNavigationTreeNode.java
- client-core/src/main/java/fr/ird/observe/client/ui/tree/navigation/nodes/referential/ReferentialsNavigationTreeNodeSupport.java
- client-core/src/main/java/fr/ird/observe/client/ui/tree/selection/nodes/ReferentialsSelectionTreeNode.java
- common-dto/src/main/java/fr/ird/observe/dto/decoration/I18nDecoratorHelper.java
- common-dto/src/main/java/fr/ird/observe/spi/map/ImmutableSetMap.java
- dto/src/main/i18n/getters/eugene.getter
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
- templates/src/main/java/fr/ird/observe/toolkit/eugene/templates/DtoReferenceTransformer.java
Changes:
=====================================
client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java
=====================================
@@ -552,12 +552,11 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements
return ObserveServiceMainFactory.get().newService(observeServiceInitializer, serviceType);
}
- public ImmutableSetDtoMap<ReferentialDtoReference> getReferentialMap(ImmutableSetStringMap referentialIds) {
-
- ImmutableSetDtoMap.Builder<ReferentialDtoReference> result = ImmutableSetDtoMap.builder();
- for (Class<? extends ReferentialDtoReference> dtoType : referentialIds.referentialReferenceTypes()) {
+ public ImmutableSetDtoMap<ReferentialDtoReference<?, ?>> getReferentialMap(ImmutableSetStringMap referentialIds) {
+ ImmutableSetDtoMap.Builder<ReferentialDtoReference<?, ?>> result = ImmutableSetDtoMap.builder();
+ for (Class<? extends ReferentialDtoReference<?, ?>> dtoType : referentialIds.referentialReferenceTypes()) {
Set<String> ids = referentialIds.get(dtoType);
- Set<ReferentialDtoReference> references = getReferentialReferenceSet(dtoType).toSet().stream()
+ Set<ReferentialDtoReference<?, ?>> references = getReferentialReferenceSet(dtoType).toSet().stream()
.filter(r -> ids.contains(r.getId()))
.collect(Collectors.toSet());
result.put(dtoType, references);
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/admin/AdminTabUIHandler.java
=====================================
@@ -284,8 +284,8 @@ public class AdminTabUIHandler<U extends AdminTabUI> {
String message = t("observe.message.show.usage.for.missingReferentials2", centralSourceLabel, targetSourceLabel);
- ImmutableSetDtoMap<ReferentialDtoReference> usages = centralSource.getReferentialMap(missingReferentialResult.getMissingIds());
- UsageForDisplayUI usagesUI = UsageForDisplayUI.build(message, usages);
+ ImmutableSetDtoMap<ReferentialDtoReference<?,?>> usages = centralSource.getReferentialMap(missingReferentialResult.getMissingIds());
+ UsageForDisplayUI<?> usagesUI = UsageForDisplayUI.build(message, usages);
int response = UIHelper.askUser(null,
t("observe.title.can.not.export.data2", targetSourceLabel),
@@ -302,12 +302,12 @@ public class AdminTabUIHandler<U extends AdminTabUI> {
log.info(String.format("Base «%s» - Insertion des référentiels manquants.", targetSourceLabel));
- for (Class<? extends ReferentialDtoReference> key : usages.referentialReferenceTypes()) {
- Set<? extends ReferentialDtoReference> references = usages.get(key);
- String type = t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(key));
+ for (Class<? extends ReferentialDtoReference<?,?>> key : usages.referentialReferenceTypes()) {
+ Set<? extends ReferentialDtoReference<?,?>> references = usages.get(key);
+ String type = t(ObserveI18nDecoratorHelper.getTypeI18nKey(key));
sendMessage(t("observe.actions.exportData.message.add.missing.referentials2", targetSourceLabel, references.size(), type));
- Decorator decorator = decoratorService.getReferenceDecorator(key);
- for (DtoReference reference : references) {
+ Decorator<?> decorator = decoratorService.getReferenceDecorator(key);
+ for (DtoReference<?,?> reference : references) {
sendMessage(t("observe.actions.exportData.message.add.missing.referential", decorator.toString(reference)));
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ContentReferenceUI.jaxx
=====================================
@@ -19,8 +19,8 @@
-->
<fr.ird.observe.client.ui.content.ContentUI abstract='true' superGenericType='E, U'
- title="{pluralTypeI18nKey}"
- contentTitle='{t("observe.type.management", pluralTypeI18nKey)}'
+ title="{typeI18nKey}"
+ contentTitle='{t("observe.type.management", typeI18nKey)}'
genericType='E extends ReferentialDto, R extends ReferentialDtoReference<E, R>, U extends ContentReferenceUI<E, R, U>'>
<import>
@@ -57,11 +57,9 @@
static io.ultreia.java4all.i18n.I18n.t
</import>
- <java.lang.String id='pluralTypeI18nKey'
- initializer='t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(bean.getClass()))'/>
<java.lang.String id='typeI18nKey' initializer='t(ObserveI18nDecoratorHelper.getTypeI18nKey(bean.getClass()))'/>
- <java.lang.String id='listText' initializer='t("observe.type.list", pluralTypeI18nKey)'/>
+ <java.lang.String id='listText' initializer='t("observe.type.list", typeI18nKey)'/>
<java.lang.String id='createToolTip' initializer='t("observe.type.action.create", typeI18nKey)'/>
<java.lang.String id='detailToolTip' initializer='t("observe.type.action.view", typeI18nKey)'/>
<java.lang.String id='modifyToolTip' initializer='t("observe.type.action.edit", typeI18nKey)'/>
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ReferenceHomeUIHandler.java
=====================================
@@ -92,7 +92,7 @@ public class ReferenceHomeUIHandler extends ContentUIHandler<ProgramDto, Referen
for (Class<? extends ReferentialDto> type : ui.getModel().getTypes()) {
- String text = t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(type));
+ String text = t(ObserveI18nDecoratorHelper.getTypeI18nKey(type));
JButton button = new JButton(text);
button.addActionListener(e -> navigation.selectSafeNode(referentialNode.findChildByClass(type)));
panel.add(button);
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ReferenceHomeUIModel.java
=====================================
@@ -68,7 +68,7 @@ public abstract class ReferenceHomeUIModel extends ContentUIModel<ProgramDto> {
protected ReferenceHomeUIModel(List<Class<? extends ReferentialDto>> types, String nodeName) {
super(ProgramDto.class);
- this.types = ImmutableList.copyOf(ObserveI18nDecoratorHelper.sortPluralTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale()));
+ this.types = ImmutableList.copyOf(ObserveI18nDecoratorHelper.sortTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale()));
this.nodeName = nodeName;
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDeleteUI.jaxx
=====================================
@@ -21,7 +21,7 @@
<!--
Interface graphique pour afficher la liste des usages d'une entitee donnee.
-->
-<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference">
+<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference< ?, R>">
<import>
@@ -37,7 +37,7 @@ Interface graphique pour afficher la liste des usages d'une entitee donnee.
<script><![CDATA[
-public static <R extends ReferentialDtoReference> UsageForDeleteUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages, List references) {
+public static <R extends ReferentialDtoReference<?, R>> UsageForDeleteUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages, List references) {
return new UsageForDeleteUI<>(new JAXXInitialContext().add(message).add(usages).add(references));
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDeleteUIHandler.java
=====================================
@@ -36,7 +36,7 @@ import javax.swing.JPanel;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 5.1
*/
-public class UsageForDeleteUIHandler<R extends ReferentialDtoReference> extends UsageUIHandlerSupport<R, UsageForDeleteUI<R>> {
+public class UsageForDeleteUIHandler<R extends ReferentialDtoReference<?, R>> extends UsageUIHandlerSupport<R, UsageForDeleteUI<R>> {
@Override
protected JLabel getMessage() {
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDesactivateUI.jaxx
=====================================
@@ -21,7 +21,7 @@
<!--
Interface graphique pour afficher la liste des usages d'une entitee donnee.
-->
-<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference">
+<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference< ?, R>">
<import>
fr.ird.observe.dto.reference.DtoReference
@@ -37,7 +37,7 @@ Interface graphique pour afficher la liste des usages d'une entitee donnee.
<script><![CDATA[
-public static <R extends ReferentialDtoReference> UsageForDesactivateUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages, List references) {
+public static <R extends ReferentialDtoReference<?, R>> UsageForDesactivateUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages, List references) {
return new UsageForDesactivateUI<>(new JAXXInitialContext().add(message).add(usages).add(references));
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDesactivateUIHandler.java
=====================================
@@ -36,7 +36,7 @@ import javax.swing.JPanel;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 5.1
*/
-public class UsageForDesactivateUIHandler<R extends ReferentialDtoReference> extends UsageUIHandlerSupport<R, UsageForDesactivateUI<R>> {
+public class UsageForDesactivateUIHandler<R extends ReferentialDtoReference<?, R>> extends UsageUIHandlerSupport<R, UsageForDesactivateUI<R>> {
@Override
protected JLabel getMessage() {
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDisplayUI.jaxx
=====================================
@@ -21,7 +21,7 @@
<!--
Interface graphique pour afficher la liste des usages d'une entitee donnee.
-->
-<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference">
+<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference< ?, R>">
<import>
@@ -35,7 +35,7 @@ Interface graphique pour afficher la liste des usages d'une entitee donnee.
<script><![CDATA[
-public static <R extends ReferentialDtoReference> UsageForDisplayUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages) {
+public static <R extends ReferentialDtoReference<?, R>> UsageForDisplayUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages) {
return new UsageForDisplayUI<>(new JAXXInitialContext().add(message).add(usages));
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDisplayUIHandler.java
=====================================
@@ -34,7 +34,7 @@ import javax.swing.JPanel;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 5.1
*/
-public class UsageForDisplayUIHandler<R extends ReferentialDtoReference> extends UsageUIHandlerSupport<R, UsageForDisplayUI<R>> {
+public class UsageForDisplayUIHandler<R extends ReferentialDtoReference<?, R>> extends UsageUIHandlerSupport<R, UsageForDisplayUI<R>> {
@Override
protected JLabel getMessage() {
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageUIHandlerSupport.java
=====================================
@@ -64,40 +64,60 @@ import static io.ultreia.java4all.i18n.I18n.t;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 5.1
*/
-public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U extends JAXXObject> implements UIHandler<U> {
+public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference<?, R>, U extends JAXXObject> implements UIHandler<U> {
U ui;
+ public static JButton findButton(Container c, String text) {
+
+ for (Component component : c.getComponents()) {
+ if (component instanceof JButton) {
+ if (text.equals(((JButton) component).getText())) {
+ return (JButton) component;
+ }
+ continue;
+ }
+ if (component instanceof Container) {
+ JButton button = findButton((Container) component, text);
+ if (button != null) {
+ return button;
+ }
+ }
+ }
+ return null;
+ }
+
protected abstract JLabel getMessage();
protected abstract JPanel getUsages();
protected abstract JaxxComboBox<R> getReplace();
- @Override
+ @Override
public void beforeInit(U ui) {
this.ui = ui;
}
- @Override
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
public void afterInit(U ui) {
String message = ui.getContextValue(String.class);
getMessage().setText(message);
- ImmutableSetDtoMap<ReferentialDtoReference> usages = ui.getContextValue(ImmutableSetDtoMap.class);
+ ImmutableSetDtoMap<ReferentialDtoReference<?, ?>> usages = ui.getContextValue(ImmutableSetDtoMap.class);
if (usages.isEmpty()) {
getUsages().add(new JLabel(t("observe.message.no.usage.for.entity")));
} else {
- for (Class<? extends ReferentialDtoReference> dtoType : usages.referentialReferenceTypes()) {
+ for (Class<? extends ReferentialDtoReference<?, ?>> dtoType : usages.referentialReferenceTypes()) {
Set references = usages.get(dtoType);
String typeTitle = t(ObserveI18nDecoratorHelper.getTypeI18nKey(dtoType));
- addReferentialReferenceUsages(dtoType, references, typeTitle);
+ addReferentialReferenceUsages((Class) dtoType, references, typeTitle);
}
- for (Class<? extends DataDtoReference> dtoType : usages.dataReferenceTypes()) {
+ for (Class<? extends DataDtoReference<?, ?>> dtoType : usages.dataReferenceTypes()) {
Set references = usages.get(dtoType);
String typeTitle = t(ObserveI18nDecoratorHelper.getTypeI18nKey(dtoType));
- addDataReferenceUsages(dtoType, references, typeTitle);
+ addDataReferenceUsages((Class) dtoType, references, typeTitle);
}
}
@@ -124,9 +144,9 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
});
}
- protected <D extends DataDto, R extends DataDtoReference<D, R>> void addDataReferenceUsages(Class<R> dtoType,
- Set<R> references,
- String typeTitle) {
+ protected <D extends DataDto, RR extends DataDtoReference<D, RR>> void addDataReferenceUsages(Class<RR> dtoType,
+ Set<RR> references,
+ String typeTitle) {
String typetitle = n("observe.common.Dto.label.usage.data.title");
typetitle = t(typetitle, typeTitle, references.size());
@@ -137,10 +157,9 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
buildUsagePanel(decorator, references, typetitle);
}
-
- protected <D extends ReferentialDto, R extends ReferentialDtoReference<D, R>> void addReferentialReferenceUsages(Class<R> referenceType,
- Set<R> references,
- String typeTitle) {
+ protected <D extends ReferentialDto, RR extends ReferentialDtoReference<D, RR>> void addReferentialReferenceUsages(Class<RR> referenceType,
+ Set<RR> references,
+ String typeTitle) {
String title = n("observe.common.Dto.label.usage.referential.title");
title = t(title, typeTitle, references.size());
@@ -151,7 +170,7 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
buildUsagePanel(decorator, references, title);
}
- protected <D extends IdDto, R extends DtoReference<D, R>> void buildUsagePanel(Decorator<?> decorator, Set<R> references, String typetitle) {
+ protected <D extends IdDto, RR extends DtoReference<D, RR>> void buildUsagePanel(Decorator<?> decorator, Set<RR> references, String typeTitle) {
List<String> data = new ArrayList<>(references.size());
data.addAll(references.stream().map(decorator::toString).collect(Collectors.toList()));
@@ -163,12 +182,12 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
pane.setMinimumSize(new Dimension(300, 30));
- pane.setColumnHeaderView(new JLabel(typetitle));
+ pane.setColumnHeaderView(new JLabel(typeTitle));
pane.setViewportView(l);
getUsages().add(pane);
}
- private class DisabledItemSelectionModel extends DefaultListSelectionModel {
+ private static class DisabledItemSelectionModel extends DefaultListSelectionModel {
private static final long serialVersionUID = 1L;
@@ -183,23 +202,4 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
}
- public static JButton findButton(Container c, String text) {
-
- for (Component component : c.getComponents()) {
- if (component instanceof JButton) {
- if (text.equals(((JButton) component).getText())) {
- return (JButton) component;
- }
- continue;
- }
- if (component instanceof Container) {
- JButton button = findButton((Container) component, text);
- if (button != null) {
- return button;
- }
- }
- }
- return null;
- }
-
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/tree/navigation/nodes/referential/ReferentialNavigationTreeNode.java
=====================================
@@ -40,9 +40,10 @@ import static io.ultreia.java4all.i18n.I18n.t;
public class ReferentialNavigationTreeNode<D extends ReferentialDto> extends ClassNavigationTreeNode<D> {
ReferentialNavigationTreeNode(Class<D> data) {
- super(data, true, t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(data)));
+ super(data, true, t(ObserveI18nDecoratorHelper.getTypeI18nKey(data)));
}
+ @SuppressWarnings({"unchecked", "rawtypes"})
@Override
public Class<? extends ContentUI<?, ?>> getContentClass() {
String packageName = getData().getPackage().getName();
@@ -55,7 +56,7 @@ public class ReferentialNavigationTreeNode<D extends ReferentialDto> extends Cla
} else {
packagePrefix = "common.";
}
- //FIXME Use a ClassMaping
+ //FIXME Use a ClassMapping
String className = String.format("fr.ird.observe.client.ui.content.ref.%s%sUI", packagePrefix, StringUtils.removeEnd(getData().getSimpleName(), "Dto"));
try {
return (Class) Class.forName(className);
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/tree/navigation/nodes/referential/ReferentialsNavigationTreeNodeSupport.java
=====================================
@@ -38,8 +38,8 @@ public abstract class ReferentialsNavigationTreeNodeSupport extends StringNaviga
ReferentialsNavigationTreeNodeSupport(String name, ImmutableSet<Class<? extends ReferentialDto>> types) {
super(name, true);
- for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortPluralTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) {
- ReferentialNavigationTreeNode child = new ReferentialNavigationTreeNode<>(aClass);
+ for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) {
+ ReferentialNavigationTreeNode<?> child = new ReferentialNavigationTreeNode<>(aClass);
add(child);
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/tree/selection/nodes/ReferentialsSelectionTreeNode.java
=====================================
@@ -44,8 +44,8 @@ public class ReferentialsSelectionTreeNode extends SelectionTreeNodeSupport<Stri
public static ReferentialsSelectionTreeNode of(String name, ImmutableSet<Class<? extends ReferentialDto>> types) {
ReferentialsSelectionTreeNode result = new ReferentialsSelectionTreeNode(t(name));
- for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortPluralTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) {
- ReferentialSelectionTreeNode child = new ReferentialSelectionTreeNode<>(aClass);
+ for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) {
+ ReferentialSelectionTreeNode<?> child = new ReferentialSelectionTreeNode<>(aClass);
result.add(child);
}
=====================================
common-dto/src/main/java/fr/ird/observe/dto/decoration/I18nDecoratorHelper.java
=====================================
@@ -51,28 +51,20 @@ public abstract class I18nDecoratorHelper extends BeanPropertyI18nKeyProducerPro
return ObserveUtil.sortTypes(types, klass -> t(getTypeI18nKey(klass)), locale);
}
- public static <C extends Class<?>> List<C> sortPluralTypes(Collection<C> types, Locale locale) {
- return ObserveUtil.sortTypes(types, klass -> t(getTypePluralI18nKey(klass)), locale);
- }
-
- public static String getPropertyName(Class key) {
+ public static String getPropertyName(Class<?> key) {
String name = IdHelper.cleanId(key);
return Introspector.decapitalize(name);
}
- public static String getTitle(Class key) {
+ public static String getTitle(Class<?> key) {
return load(key) + ".title";
}
- public static String getTypeI18nKey(Class key) {
+ public static String getTypeI18nKey(Class<?> key) {
return load(key) + ".type";
}
- public static String getTypePluralI18nKey(Class key) {
- return load(key) + ".types";
- }
-
- public static String getPropertyI18nKey(Class type, String propertyName) {
+ public static String getPropertyI18nKey(Class<?> type, String propertyName) {
I18nDecoratorHelper i18nDecoratorHelper = get();
return i18nDecoratorHelper.getDefaultLabelsBuilder().getI18nPropertyKey(type, propertyName);
}
@@ -118,7 +110,7 @@ public abstract class I18nDecoratorHelper extends BeanPropertyI18nKeyProducerPro
result.append(String.format("%1$td/%1$tm/%1$tY", date));
}
- private static String load(Class key) {
+ private static String load(Class<?> key) {
I18nDecoratorHelper i18nDecoratorHelper = get();
return i18nDecoratorHelper.getCommonPrefix() + i18nDecoratorHelper.getDefaultLabelsBuilder().getI18nTypeKey(key);
}
=====================================
common-dto/src/main/java/fr/ird/observe/spi/map/ImmutableSetMap.java
=====================================
@@ -77,12 +77,12 @@ public abstract class ImmutableSetMap<V> implements ObserveDto {
}
@SuppressWarnings("unchecked")
- public Set<Class<? extends ReferentialDtoReference>> referentialReferenceTypes() {
+ public Set<Class<? extends ReferentialDtoReference<?, ?>>> referentialReferenceTypes() {
return (Set) types.values().stream().filter(IdHelper::isReferential).collect(Collectors.toSet());
}
@SuppressWarnings("unchecked")
- public Set<Class<? extends DataDtoReference>> dataReferenceTypes() {
+ public Set<Class<? extends DataDtoReference<?,?>>> dataReferenceTypes() {
return (Set) types.values().stream().filter(IdHelper::isData).collect(Collectors.toSet());
}
=====================================
dto/src/main/i18n/getters/eugene.getter
=====================================
@@ -1,231 +1,132 @@
observe.common.ActivityLonglineDto.title
observe.common.ActivityLonglineDto.type
-observe.common.ActivityLonglineDto.types
observe.common.ActivitySeineDto.title
observe.common.ActivitySeineDto.type
-observe.common.ActivitySeineDto.types
observe.common.BaitHaulingStatusDto.type
-observe.common.BaitHaulingStatusDto.types
observe.common.BaitSettingStatusDto.type
-observe.common.BaitSettingStatusDto.types
observe.common.BaitTypeDto.type
-observe.common.BaitTypeDto.types
observe.common.BaitsCompositionDto.title
observe.common.BaitsCompositionDto.type
-observe.common.BaitsCompositionDto.types
observe.common.BasketDto.type
-observe.common.BasketDto.types
observe.common.BranchlineDto.title
observe.common.BranchlineDto.type
-observe.common.BranchlineDto.types
observe.common.BranchlinesCompositionDto.title
observe.common.BranchlinesCompositionDto.type
-observe.common.BranchlinesCompositionDto.types
observe.common.CatchFateLonglineDto.type
-observe.common.CatchFateLonglineDto.types
observe.common.CatchLonglineDto.title
observe.common.CatchLonglineDto.type
-observe.common.CatchLonglineDto.types
observe.common.CountryDto.type
-observe.common.CountryDto.types
observe.common.DataQualityDto.type
-observe.common.DataQualityDto.types
observe.common.DetectionModeDto.type
-observe.common.DetectionModeDto.types
observe.common.EncounterDto.title
observe.common.EncounterDto.type
-observe.common.EncounterDto.types
observe.common.EncounterTypeDto.type
-observe.common.EncounterTypeDto.types
observe.common.FloatingObjectDto.title
observe.common.FloatingObjectDto.type
-observe.common.FloatingObjectDto.types
observe.common.FloatingObjectPartDto.title
observe.common.FloatingObjectPartDto.type
-observe.common.FloatingObjectPartDto.types
observe.common.FloatlinesCompositionDto.title
observe.common.FloatlinesCompositionDto.type
-observe.common.FloatlinesCompositionDto.types
observe.common.FpaZoneDto.type
-observe.common.FpaZoneDto.types
observe.common.GearCaracteristicDto.type
-observe.common.GearCaracteristicDto.types
observe.common.GearCaracteristicTypeDto.type
-observe.common.GearCaracteristicTypeDto.types
observe.common.GearDto.type
-observe.common.GearDto.types
observe.common.GearUseFeaturesLonglineDto.title
observe.common.GearUseFeaturesLonglineDto.type
-observe.common.GearUseFeaturesLonglineDto.types
observe.common.GearUseFeaturesMeasurementLonglineDto.title
observe.common.GearUseFeaturesMeasurementSeineDto.title
observe.common.GearUseFeaturesSeineDto.title
observe.common.GearUseFeaturesSeineDto.type
-observe.common.GearUseFeaturesSeineDto.types
observe.common.HarbourDto.type
-observe.common.HarbourDto.types
observe.common.HealthStatusDto.type
-observe.common.HealthStatusDto.types
observe.common.HookPositionDto.type
-observe.common.HookPositionDto.types
observe.common.HookSizeDto.type
-observe.common.HookSizeDto.types
observe.common.HookTypeDto.type
-observe.common.HookTypeDto.types
observe.common.HooksCompositionDto.title
observe.common.HooksCompositionDto.type
-observe.common.HooksCompositionDto.types
observe.common.ItemHorizontalPositionDto.type
-observe.common.ItemHorizontalPositionDto.types
observe.common.ItemVerticalPositionDto.type
-observe.common.ItemVerticalPositionDto.types
observe.common.LengthLengthParameterDto.type
-observe.common.LengthLengthParameterDto.types
observe.common.LengthWeightParameterDto.type
-observe.common.LengthWeightParameterDto.types
observe.common.LightsticksColorDto.type
-observe.common.LightsticksColorDto.types
observe.common.LightsticksTypeDto.type
-observe.common.LightsticksTypeDto.types
observe.common.LineTypeDto.type
-observe.common.LineTypeDto.types
observe.common.MaturityStatusDto.type
-observe.common.MaturityStatusDto.types
observe.common.MitigationTypeDto.type
-observe.common.MitigationTypeDto.types
observe.common.NonTargetCatchDto.title
observe.common.NonTargetCatchDto.type
-observe.common.NonTargetCatchDto.types
observe.common.NonTargetCatchReleaseConformityDto.type
-observe.common.NonTargetCatchReleaseConformityDto.types
observe.common.NonTargetCatchReleaseDto.title
observe.common.NonTargetCatchReleaseDto.type
-observe.common.NonTargetCatchReleaseDto.types
observe.common.NonTargetCatchReleaseStatusDto.type
-observe.common.NonTargetCatchReleaseStatusDto.types
observe.common.NonTargetCatchReleasingTimeDto.type
-observe.common.NonTargetCatchReleasingTimeDto.types
observe.common.NonTargetLengthDto.title
observe.common.NonTargetLengthDto.type
-observe.common.NonTargetLengthDto.types
observe.common.ObjectMaterialDto.type
-observe.common.ObjectMaterialDto.types
observe.common.ObjectMaterialTypeDto.type
-observe.common.ObjectMaterialTypeDto.types
observe.common.ObjectObservedSpeciesDto.title
observe.common.ObjectObservedSpeciesDto.type
-observe.common.ObjectObservedSpeciesDto.types
observe.common.ObjectOperationDto.type
-observe.common.ObjectOperationDto.types
observe.common.ObjectSchoolEstimateDto.title
observe.common.ObjectSchoolEstimateDto.type
-observe.common.ObjectSchoolEstimateDto.types
observe.common.ObservedSystemDto.type
-observe.common.ObservedSystemDto.types
observe.common.OceanDto.type
-observe.common.OceanDto.types
observe.common.OrganismDto.type
-observe.common.OrganismDto.types
observe.common.PersonDto.type
-observe.common.PersonDto.types
observe.common.ProgramDto.type
-observe.common.ProgramDto.types
observe.common.ReasonForDiscardDto.type
-observe.common.ReasonForDiscardDto.types
observe.common.ReasonForNoFishingDto.type
-observe.common.ReasonForNoFishingDto.types
observe.common.ReasonForNullSetDto.type
-observe.common.ReasonForNullSetDto.types
observe.common.RouteDto.type
-observe.common.RouteDto.types
observe.common.SchoolEstimateDto.title
observe.common.SchoolEstimateDto.type
-observe.common.SchoolEstimateDto.types
observe.common.SectionDto.type
-observe.common.SectionDto.types
observe.common.SensorBrandDto.type
-observe.common.SensorBrandDto.types
observe.common.SensorDataFormatDto.type
-observe.common.SensorDataFormatDto.types
observe.common.SensorTypeDto.type
-observe.common.SensorTypeDto.types
observe.common.SensorUsedDto.title
observe.common.SensorUsedDto.type
-observe.common.SensorUsedDto.types
observe.common.SetLonglineDto.title
observe.common.SetLonglineDto.type
-observe.common.SetLonglineDto.types
observe.common.SetLonglineGlobalCompositionDto.title
observe.common.SetSeineDto.title
observe.common.SetSeineDto.type
-observe.common.SetSeineDto.types
observe.common.SettingShapeDto.type
-observe.common.SettingShapeDto.types
observe.common.SexDto.type
-observe.common.SexDto.types
observe.common.ShipOwnerDto.type
-observe.common.ShipOwnerDto.types
observe.common.SizeMeasureDto.title
observe.common.SizeMeasureDto.type
-observe.common.SizeMeasureDto.types
observe.common.SizeMeasureTypeDto.type
-observe.common.SizeMeasureTypeDto.types
observe.common.SpeciesDto.type
-observe.common.SpeciesDto.types
observe.common.SpeciesFateDto.type
-observe.common.SpeciesFateDto.types
observe.common.SpeciesGroupDto.type
-observe.common.SpeciesGroupDto.types
observe.common.SpeciesGroupReleaseModeDto.type
-observe.common.SpeciesGroupReleaseModeDto.types
observe.common.SpeciesListDto.type
-observe.common.SpeciesListDto.types
observe.common.SpeciesStatusDto.type
-observe.common.SpeciesStatusDto.types
observe.common.StomachFullnessDto.type
-observe.common.StomachFullnessDto.types
observe.common.SurroundingActivityDto.type
-observe.common.SurroundingActivityDto.types
observe.common.TargetCatchDto.title
observe.common.TargetCatchDto.type
-observe.common.TargetCatchDto.types
observe.common.TargetLengthDto.title
observe.common.TargetLengthDto.type
-observe.common.TargetLengthDto.types
observe.common.TdrDto.title
observe.common.TdrDto.type
-observe.common.TdrDto.types
observe.common.TransmittingBuoyDto.title
observe.common.TransmittingBuoyDto.type
-observe.common.TransmittingBuoyDto.types
observe.common.TransmittingBuoyOperationDto.type
-observe.common.TransmittingBuoyOperationDto.types
observe.common.TransmittingBuoyTypeDto.type
-observe.common.TransmittingBuoyTypeDto.types
observe.common.TripLonglineDto.title
observe.common.TripLonglineDto.type
-observe.common.TripLonglineDto.types
observe.common.TripSeineDto.title
observe.common.TripSeineDto.type
-observe.common.TripSeineDto.types
observe.common.TripTypeDto.type
-observe.common.TripTypeDto.types
observe.common.VesselActivityLonglineDto.type
-observe.common.VesselActivityLonglineDto.types
observe.common.VesselActivitySeineDto.type
-observe.common.VesselActivitySeineDto.types
observe.common.VesselDto.type
-observe.common.VesselDto.types
observe.common.VesselSizeCategoryDto.type
-observe.common.VesselSizeCategoryDto.types
observe.common.VesselTypeDto.type
-observe.common.VesselTypeDto.types
observe.common.WeightCategoryDto.type
-observe.common.WeightCategoryDto.types
observe.common.WeightMeasureDto.title
observe.common.WeightMeasureDto.type
-observe.common.WeightMeasureDto.types
observe.common.WeightMeasureTypeDto.type
-observe.common.WeightMeasureTypeDto.types
observe.common.WindDto.type
-observe.common.WindDto.types
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -2214,8 +2214,8 @@ observe.type.action.view=View selected %s
observe.type.activityLongline.unsaved=New activity
observe.type.activitySeine.unsaved=New activity
observe.type.floatingObject.unsaved=New floating object (FOB)
-observe.type.list=List of %s
-observe.type.management=Management of %s
+observe.type.list=List of referential of type `%s`
+observe.type.management=Management of referential of type `%s`
observe.type.reference.common=Common Referential
observe.type.reference.longline=Longline Referential
observe.type.reference.seine=Seine Referential
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -2214,8 +2214,8 @@ observe.type.action.view=Ver los detalles del objeto de tipo '%s' seleccionado
observe.type.activityLongline.unsaved=Nueva actividad
observe.type.activitySeine.unsaved=Nueva actividad
observe.type.floatingObject.unsaved=Nuevo FOB
-observe.type.list=Lista de %s
-observe.type.management=Gestión de %s
+observe.type.list=Lista de Referencial of type `%s` \#TODO
+observe.type.management=Gestión de Referencial of type `%s` \#TODO
observe.type.reference.common=Referencial Común
observe.type.reference.longline=Referencial de Palangre
observe.type.reference.seine=Referencial de Cerco
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -2214,8 +2214,8 @@ observe.type.action.view=Voir les détails de l'objet de type '%s' sélectionné
observe.type.activityLongline.unsaved=Nouvelle activité
observe.type.activitySeine.unsaved=Nouvelle activité
observe.type.floatingObject.unsaved=Nouvel objet flottant (FOB)
-observe.type.list=Liste des %s
-observe.type.management=Gestion des %s
+observe.type.list=Liste des référentiels de type `%s`
+observe.type.management=Gestion des référentiels de type `%s`
observe.type.reference.common=Référentiel commun
observe.type.reference.longline=Référentiel Palangre
observe.type.reference.seine=Référentiel Senne
=====================================
templates/src/main/java/fr/ird/observe/toolkit/eugene/templates/DtoReferenceTransformer.java
=====================================
@@ -247,7 +247,6 @@ public class DtoReferenceTransformer extends ObjectModelTransformerToJava {
String referenceName = beanClass.getName() + "Reference";
i18nGetterFile.addKey("observe.common." + dtoName + ".type");
- i18nGetterFile.addKey("observe.common." + dtoName + ".types");
StringBuilder body = new StringBuilder();
body.append("" /*{
<%=flushMethodName%>(<%=referenceName%>.DEFINITION);}*/);
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/2ead6b27b8911860ac6a57ac6…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/2ead6b27b8911860ac6a57ac6…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [UI] Correction des libellés des tables de référence du schéma observe.longline dans Observe
by Tony CHEMIT 05 Aug '20
by Tony CHEMIT 05 Aug '20
05 Aug '20
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
c9e5dd41 by Tony Chemit at 2020-08-05T16:12:49+02:00
[UI] Correction des libellés des tables de référence du schéma observe.longline dans Observe
- See #1584
- - - - -
22 changed files:
- client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java
- client-core/src/main/java/fr/ird/observe/client/ui/admin/AdminTabUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ContentReferenceUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ReferenceHomeUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ReferenceHomeUIModel.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDeleteUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDeleteUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDesactivateUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDesactivateUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDisplayUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDisplayUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageUIHandlerSupport.java
- client-core/src/main/java/fr/ird/observe/client/ui/tree/navigation/nodes/referential/ReferentialNavigationTreeNode.java
- client-core/src/main/java/fr/ird/observe/client/ui/tree/navigation/nodes/referential/ReferentialsNavigationTreeNodeSupport.java
- client-core/src/main/java/fr/ird/observe/client/ui/tree/selection/nodes/ReferentialsSelectionTreeNode.java
- common-dto/src/main/java/fr/ird/observe/dto/decoration/I18nDecoratorHelper.java
- common-dto/src/main/java/fr/ird/observe/spi/map/ImmutableSetMap.java
- dto/src/main/i18n/getters/eugene.getter
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
- templates/src/main/java/fr/ird/observe/toolkit/eugene/templates/DtoReferenceTransformer.java
Changes:
=====================================
client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java
=====================================
@@ -552,12 +552,11 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements
return ObserveServiceMainFactory.get().newService(observeServiceInitializer, serviceType);
}
- public ImmutableSetDtoMap<ReferentialDtoReference> getReferentialMap(ImmutableSetStringMap referentialIds) {
-
- ImmutableSetDtoMap.Builder<ReferentialDtoReference> result = ImmutableSetDtoMap.builder();
- for (Class<? extends ReferentialDtoReference> dtoType : referentialIds.referentialReferenceTypes()) {
+ public ImmutableSetDtoMap<ReferentialDtoReference<?, ?>> getReferentialMap(ImmutableSetStringMap referentialIds) {
+ ImmutableSetDtoMap.Builder<ReferentialDtoReference<?, ?>> result = ImmutableSetDtoMap.builder();
+ for (Class<? extends ReferentialDtoReference<?, ?>> dtoType : referentialIds.referentialReferenceTypes()) {
Set<String> ids = referentialIds.get(dtoType);
- Set<ReferentialDtoReference> references = getReferentialReferenceSet(dtoType).toSet().stream()
+ Set<ReferentialDtoReference<?, ?>> references = getReferentialReferenceSet(dtoType).toSet().stream()
.filter(r -> ids.contains(r.getId()))
.collect(Collectors.toSet());
result.put(dtoType, references);
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/admin/AdminTabUIHandler.java
=====================================
@@ -284,8 +284,8 @@ public class AdminTabUIHandler<U extends AdminTabUI> {
String message = t("observe.message.show.usage.for.missingReferentials2", centralSourceLabel, targetSourceLabel);
- ImmutableSetDtoMap<ReferentialDtoReference> usages = centralSource.getReferentialMap(missingReferentialResult.getMissingIds());
- UsageForDisplayUI usagesUI = UsageForDisplayUI.build(message, usages);
+ ImmutableSetDtoMap<ReferentialDtoReference<?,?>> usages = centralSource.getReferentialMap(missingReferentialResult.getMissingIds());
+ UsageForDisplayUI<?> usagesUI = UsageForDisplayUI.build(message, usages);
int response = UIHelper.askUser(null,
t("observe.title.can.not.export.data2", targetSourceLabel),
@@ -302,12 +302,12 @@ public class AdminTabUIHandler<U extends AdminTabUI> {
log.info(String.format("Base «%s» - Insertion des référentiels manquants.", targetSourceLabel));
- for (Class<? extends ReferentialDtoReference> key : usages.referentialReferenceTypes()) {
- Set<? extends ReferentialDtoReference> references = usages.get(key);
- String type = t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(key));
+ for (Class<? extends ReferentialDtoReference<?,?>> key : usages.referentialReferenceTypes()) {
+ Set<? extends ReferentialDtoReference<?,?>> references = usages.get(key);
+ String type = t(ObserveI18nDecoratorHelper.getTypeI18nKey(key));
sendMessage(t("observe.actions.exportData.message.add.missing.referentials2", targetSourceLabel, references.size(), type));
- Decorator decorator = decoratorService.getReferenceDecorator(key);
- for (DtoReference reference : references) {
+ Decorator<?> decorator = decoratorService.getReferenceDecorator(key);
+ for (DtoReference<?,?> reference : references) {
sendMessage(t("observe.actions.exportData.message.add.missing.referential", decorator.toString(reference)));
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ContentReferenceUI.jaxx
=====================================
@@ -19,8 +19,8 @@
-->
<fr.ird.observe.client.ui.content.ContentUI abstract='true' superGenericType='E, U'
- title="{pluralTypeI18nKey}"
- contentTitle='{t("observe.type.management", pluralTypeI18nKey)}'
+ title="{typeI18nKey}"
+ contentTitle='{t("observe.type.management", typeI18nKey)}'
genericType='E extends ReferentialDto, R extends ReferentialDtoReference<E, R>, U extends ContentReferenceUI<E, R, U>'>
<import>
@@ -57,11 +57,9 @@
static io.ultreia.java4all.i18n.I18n.t
</import>
- <java.lang.String id='pluralTypeI18nKey'
- initializer='t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(bean.getClass()))'/>
<java.lang.String id='typeI18nKey' initializer='t(ObserveI18nDecoratorHelper.getTypeI18nKey(bean.getClass()))'/>
- <java.lang.String id='listText' initializer='t("observe.type.list", pluralTypeI18nKey)'/>
+ <java.lang.String id='listText' initializer='t("observe.type.list", typeI18nKey)'/>
<java.lang.String id='createToolTip' initializer='t("observe.type.action.create", typeI18nKey)'/>
<java.lang.String id='detailToolTip' initializer='t("observe.type.action.view", typeI18nKey)'/>
<java.lang.String id='modifyToolTip' initializer='t("observe.type.action.edit", typeI18nKey)'/>
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ReferenceHomeUIHandler.java
=====================================
@@ -92,7 +92,7 @@ public class ReferenceHomeUIHandler extends ContentUIHandler<ProgramDto, Referen
for (Class<? extends ReferentialDto> type : ui.getModel().getTypes()) {
- String text = t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(type));
+ String text = t(ObserveI18nDecoratorHelper.getTypeI18nKey(type));
JButton button = new JButton(text);
button.addActionListener(e -> navigation.selectSafeNode(referentialNode.findChildByClass(type)));
panel.add(button);
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/ReferenceHomeUIModel.java
=====================================
@@ -68,7 +68,7 @@ public abstract class ReferenceHomeUIModel extends ContentUIModel<ProgramDto> {
protected ReferenceHomeUIModel(List<Class<? extends ReferentialDto>> types, String nodeName) {
super(ProgramDto.class);
- this.types = ImmutableList.copyOf(ObserveI18nDecoratorHelper.sortPluralTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale()));
+ this.types = ImmutableList.copyOf(ObserveI18nDecoratorHelper.sortTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale()));
this.nodeName = nodeName;
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDeleteUI.jaxx
=====================================
@@ -21,7 +21,7 @@
<!--
Interface graphique pour afficher la liste des usages d'une entitee donnee.
-->
-<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference">
+<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference< ?, R>">
<import>
@@ -37,7 +37,7 @@ Interface graphique pour afficher la liste des usages d'une entitee donnee.
<script><![CDATA[
-public static <R extends ReferentialDtoReference> UsageForDeleteUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages, List references) {
+public static <R extends ReferentialDtoReference<?, R>> UsageForDeleteUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages, List references) {
return new UsageForDeleteUI<>(new JAXXInitialContext().add(message).add(usages).add(references));
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDeleteUIHandler.java
=====================================
@@ -36,7 +36,7 @@ import javax.swing.JPanel;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 5.1
*/
-public class UsageForDeleteUIHandler<R extends ReferentialDtoReference> extends UsageUIHandlerSupport<R, UsageForDeleteUI<R>> {
+public class UsageForDeleteUIHandler<R extends ReferentialDtoReference<?, R>> extends UsageUIHandlerSupport<R, UsageForDeleteUI<R>> {
@Override
protected JLabel getMessage() {
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDesactivateUI.jaxx
=====================================
@@ -21,7 +21,7 @@
<!--
Interface graphique pour afficher la liste des usages d'une entitee donnee.
-->
-<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference">
+<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference< ?, R>">
<import>
fr.ird.observe.dto.reference.DtoReference
@@ -37,7 +37,7 @@ Interface graphique pour afficher la liste des usages d'une entitee donnee.
<script><![CDATA[
-public static <R extends ReferentialDtoReference> UsageForDesactivateUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages, List references) {
+public static <R extends ReferentialDtoReference<?, R>> UsageForDesactivateUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages, List references) {
return new UsageForDesactivateUI<>(new JAXXInitialContext().add(message).add(usages).add(references));
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDesactivateUIHandler.java
=====================================
@@ -36,7 +36,7 @@ import javax.swing.JPanel;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 5.1
*/
-public class UsageForDesactivateUIHandler<R extends ReferentialDtoReference> extends UsageUIHandlerSupport<R, UsageForDesactivateUI<R>> {
+public class UsageForDesactivateUIHandler<R extends ReferentialDtoReference<?, R>> extends UsageUIHandlerSupport<R, UsageForDesactivateUI<R>> {
@Override
protected JLabel getMessage() {
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDisplayUI.jaxx
=====================================
@@ -21,7 +21,7 @@
<!--
Interface graphique pour afficher la liste des usages d'une entitee donnee.
-->
-<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference">
+<JPanel layout='{new BorderLayout()}' genericType="R extends ReferentialDtoReference< ?, R>">
<import>
@@ -35,7 +35,7 @@ Interface graphique pour afficher la liste des usages d'une entitee donnee.
<script><![CDATA[
-public static <R extends ReferentialDtoReference> UsageForDisplayUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages) {
+public static <R extends ReferentialDtoReference<?, R>> UsageForDisplayUI<R> build(String message, ImmutableSetDtoMap<? extends DtoReference> usages) {
return new UsageForDisplayUI<>(new JAXXInitialContext().add(message).add(usages));
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDisplayUIHandler.java
=====================================
@@ -34,7 +34,7 @@ import javax.swing.JPanel;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 5.1
*/
-public class UsageForDisplayUIHandler<R extends ReferentialDtoReference> extends UsageUIHandlerSupport<R, UsageForDisplayUI<R>> {
+public class UsageForDisplayUIHandler<R extends ReferentialDtoReference<?, R>> extends UsageUIHandlerSupport<R, UsageForDisplayUI<R>> {
@Override
protected JLabel getMessage() {
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageUIHandlerSupport.java
=====================================
@@ -64,40 +64,60 @@ import static io.ultreia.java4all.i18n.I18n.t;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 5.1
*/
-public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U extends JAXXObject> implements UIHandler<U> {
+public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference<?, R>, U extends JAXXObject> implements UIHandler<U> {
U ui;
+ public static JButton findButton(Container c, String text) {
+
+ for (Component component : c.getComponents()) {
+ if (component instanceof JButton) {
+ if (text.equals(((JButton) component).getText())) {
+ return (JButton) component;
+ }
+ continue;
+ }
+ if (component instanceof Container) {
+ JButton button = findButton((Container) component, text);
+ if (button != null) {
+ return button;
+ }
+ }
+ }
+ return null;
+ }
+
protected abstract JLabel getMessage();
protected abstract JPanel getUsages();
protected abstract JaxxComboBox<R> getReplace();
- @Override
+ @Override
public void beforeInit(U ui) {
this.ui = ui;
}
- @Override
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
public void afterInit(U ui) {
String message = ui.getContextValue(String.class);
getMessage().setText(message);
- ImmutableSetDtoMap<ReferentialDtoReference> usages = ui.getContextValue(ImmutableSetDtoMap.class);
+ ImmutableSetDtoMap<ReferentialDtoReference<?, ?>> usages = ui.getContextValue(ImmutableSetDtoMap.class);
if (usages.isEmpty()) {
getUsages().add(new JLabel(t("observe.message.no.usage.for.entity")));
} else {
- for (Class<? extends ReferentialDtoReference> dtoType : usages.referentialReferenceTypes()) {
+ for (Class<? extends ReferentialDtoReference<?, ?>> dtoType : usages.referentialReferenceTypes()) {
Set references = usages.get(dtoType);
String typeTitle = t(ObserveI18nDecoratorHelper.getTypeI18nKey(dtoType));
- addReferentialReferenceUsages(dtoType, references, typeTitle);
+ addReferentialReferenceUsages((Class) dtoType, references, typeTitle);
}
- for (Class<? extends DataDtoReference> dtoType : usages.dataReferenceTypes()) {
+ for (Class<? extends DataDtoReference<?, ?>> dtoType : usages.dataReferenceTypes()) {
Set references = usages.get(dtoType);
String typeTitle = t(ObserveI18nDecoratorHelper.getTypeI18nKey(dtoType));
- addDataReferenceUsages(dtoType, references, typeTitle);
+ addDataReferenceUsages((Class) dtoType, references, typeTitle);
}
}
@@ -124,9 +144,9 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
});
}
- protected <D extends DataDto, R extends DataDtoReference<D, R>> void addDataReferenceUsages(Class<R> dtoType,
- Set<R> references,
- String typeTitle) {
+ protected <D extends DataDto, RR extends DataDtoReference<D, RR>> void addDataReferenceUsages(Class<RR> dtoType,
+ Set<RR> references,
+ String typeTitle) {
String typetitle = n("observe.common.Dto.label.usage.data.title");
typetitle = t(typetitle, typeTitle, references.size());
@@ -137,10 +157,9 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
buildUsagePanel(decorator, references, typetitle);
}
-
- protected <D extends ReferentialDto, R extends ReferentialDtoReference<D, R>> void addReferentialReferenceUsages(Class<R> referenceType,
- Set<R> references,
- String typeTitle) {
+ protected <D extends ReferentialDto, RR extends ReferentialDtoReference<D, RR>> void addReferentialReferenceUsages(Class<RR> referenceType,
+ Set<RR> references,
+ String typeTitle) {
String title = n("observe.common.Dto.label.usage.referential.title");
title = t(title, typeTitle, references.size());
@@ -151,7 +170,7 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
buildUsagePanel(decorator, references, title);
}
- protected <D extends IdDto, R extends DtoReference<D, R>> void buildUsagePanel(Decorator<?> decorator, Set<R> references, String typetitle) {
+ protected <D extends IdDto, RR extends DtoReference<D, RR>> void buildUsagePanel(Decorator<?> decorator, Set<RR> references, String typeTitle) {
List<String> data = new ArrayList<>(references.size());
data.addAll(references.stream().map(decorator::toString).collect(Collectors.toList()));
@@ -163,12 +182,12 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
pane.setMinimumSize(new Dimension(300, 30));
- pane.setColumnHeaderView(new JLabel(typetitle));
+ pane.setColumnHeaderView(new JLabel(typeTitle));
pane.setViewportView(l);
getUsages().add(pane);
}
- private class DisabledItemSelectionModel extends DefaultListSelectionModel {
+ private static class DisabledItemSelectionModel extends DefaultListSelectionModel {
private static final long serialVersionUID = 1L;
@@ -183,23 +202,4 @@ public abstract class UsageUIHandlerSupport<R extends ReferentialDtoReference, U
}
- public static JButton findButton(Container c, String text) {
-
- for (Component component : c.getComponents()) {
- if (component instanceof JButton) {
- if (text.equals(((JButton) component).getText())) {
- return (JButton) component;
- }
- continue;
- }
- if (component instanceof Container) {
- JButton button = findButton((Container) component, text);
- if (button != null) {
- return button;
- }
- }
- }
- return null;
- }
-
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/tree/navigation/nodes/referential/ReferentialNavigationTreeNode.java
=====================================
@@ -40,9 +40,10 @@ import static io.ultreia.java4all.i18n.I18n.t;
public class ReferentialNavigationTreeNode<D extends ReferentialDto> extends ClassNavigationTreeNode<D> {
ReferentialNavigationTreeNode(Class<D> data) {
- super(data, true, t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(data)));
+ super(data, true, t(ObserveI18nDecoratorHelper.getTypeI18nKey(data)));
}
+ @SuppressWarnings({"unchecked", "rawtypes"})
@Override
public Class<? extends ContentUI<?, ?>> getContentClass() {
String packageName = getData().getPackage().getName();
@@ -55,7 +56,7 @@ public class ReferentialNavigationTreeNode<D extends ReferentialDto> extends Cla
} else {
packagePrefix = "common.";
}
- //FIXME Use a ClassMaping
+ //FIXME Use a ClassMapping
String className = String.format("fr.ird.observe.client.ui.content.ref.%s%sUI", packagePrefix, StringUtils.removeEnd(getData().getSimpleName(), "Dto"));
try {
return (Class) Class.forName(className);
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/tree/navigation/nodes/referential/ReferentialsNavigationTreeNodeSupport.java
=====================================
@@ -38,8 +38,8 @@ public abstract class ReferentialsNavigationTreeNodeSupport extends StringNaviga
ReferentialsNavigationTreeNodeSupport(String name, ImmutableSet<Class<? extends ReferentialDto>> types) {
super(name, true);
- for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortPluralTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) {
- ReferentialNavigationTreeNode child = new ReferentialNavigationTreeNode<>(aClass);
+ for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) {
+ ReferentialNavigationTreeNode<?> child = new ReferentialNavigationTreeNode<>(aClass);
add(child);
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/tree/selection/nodes/ReferentialsSelectionTreeNode.java
=====================================
@@ -44,8 +44,8 @@ public class ReferentialsSelectionTreeNode extends SelectionTreeNodeSupport<Stri
public static ReferentialsSelectionTreeNode of(String name, ImmutableSet<Class<? extends ReferentialDto>> types) {
ReferentialsSelectionTreeNode result = new ReferentialsSelectionTreeNode(t(name));
- for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortPluralTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) {
- ReferentialSelectionTreeNode child = new ReferentialSelectionTreeNode<>(aClass);
+ for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) {
+ ReferentialSelectionTreeNode<?> child = new ReferentialSelectionTreeNode<>(aClass);
result.add(child);
}
=====================================
common-dto/src/main/java/fr/ird/observe/dto/decoration/I18nDecoratorHelper.java
=====================================
@@ -51,28 +51,20 @@ public abstract class I18nDecoratorHelper extends BeanPropertyI18nKeyProducerPro
return ObserveUtil.sortTypes(types, klass -> t(getTypeI18nKey(klass)), locale);
}
- public static <C extends Class<?>> List<C> sortPluralTypes(Collection<C> types, Locale locale) {
- return ObserveUtil.sortTypes(types, klass -> t(getTypePluralI18nKey(klass)), locale);
- }
-
- public static String getPropertyName(Class key) {
+ public static String getPropertyName(Class<?> key) {
String name = IdHelper.cleanId(key);
return Introspector.decapitalize(name);
}
- public static String getTitle(Class key) {
+ public static String getTitle(Class<?> key) {
return load(key) + ".title";
}
- public static String getTypeI18nKey(Class key) {
+ public static String getTypeI18nKey(Class<?> key) {
return load(key) + ".type";
}
- public static String getTypePluralI18nKey(Class key) {
- return load(key) + ".types";
- }
-
- public static String getPropertyI18nKey(Class type, String propertyName) {
+ public static String getPropertyI18nKey(Class<?> type, String propertyName) {
I18nDecoratorHelper i18nDecoratorHelper = get();
return i18nDecoratorHelper.getDefaultLabelsBuilder().getI18nPropertyKey(type, propertyName);
}
@@ -118,7 +110,7 @@ public abstract class I18nDecoratorHelper extends BeanPropertyI18nKeyProducerPro
result.append(String.format("%1$td/%1$tm/%1$tY", date));
}
- private static String load(Class key) {
+ private static String load(Class<?> key) {
I18nDecoratorHelper i18nDecoratorHelper = get();
return i18nDecoratorHelper.getCommonPrefix() + i18nDecoratorHelper.getDefaultLabelsBuilder().getI18nTypeKey(key);
}
=====================================
common-dto/src/main/java/fr/ird/observe/spi/map/ImmutableSetMap.java
=====================================
@@ -77,12 +77,12 @@ public abstract class ImmutableSetMap<V> implements ObserveDto {
}
@SuppressWarnings("unchecked")
- public Set<Class<? extends ReferentialDtoReference>> referentialReferenceTypes() {
+ public Set<Class<? extends ReferentialDtoReference<?, ?>>> referentialReferenceTypes() {
return (Set) types.values().stream().filter(IdHelper::isReferential).collect(Collectors.toSet());
}
@SuppressWarnings("unchecked")
- public Set<Class<? extends DataDtoReference>> dataReferenceTypes() {
+ public Set<Class<? extends DataDtoReference<?,?>>> dataReferenceTypes() {
return (Set) types.values().stream().filter(IdHelper::isData).collect(Collectors.toSet());
}
=====================================
dto/src/main/i18n/getters/eugene.getter
=====================================
@@ -1,231 +1,132 @@
observe.common.ActivityLonglineDto.title
observe.common.ActivityLonglineDto.type
-observe.common.ActivityLonglineDto.types
observe.common.ActivitySeineDto.title
observe.common.ActivitySeineDto.type
-observe.common.ActivitySeineDto.types
observe.common.BaitHaulingStatusDto.type
-observe.common.BaitHaulingStatusDto.types
observe.common.BaitSettingStatusDto.type
-observe.common.BaitSettingStatusDto.types
observe.common.BaitTypeDto.type
-observe.common.BaitTypeDto.types
observe.common.BaitsCompositionDto.title
observe.common.BaitsCompositionDto.type
-observe.common.BaitsCompositionDto.types
observe.common.BasketDto.type
-observe.common.BasketDto.types
observe.common.BranchlineDto.title
observe.common.BranchlineDto.type
-observe.common.BranchlineDto.types
observe.common.BranchlinesCompositionDto.title
observe.common.BranchlinesCompositionDto.type
-observe.common.BranchlinesCompositionDto.types
observe.common.CatchFateLonglineDto.type
-observe.common.CatchFateLonglineDto.types
observe.common.CatchLonglineDto.title
observe.common.CatchLonglineDto.type
-observe.common.CatchLonglineDto.types
observe.common.CountryDto.type
-observe.common.CountryDto.types
observe.common.DataQualityDto.type
-observe.common.DataQualityDto.types
observe.common.DetectionModeDto.type
-observe.common.DetectionModeDto.types
observe.common.EncounterDto.title
observe.common.EncounterDto.type
-observe.common.EncounterDto.types
observe.common.EncounterTypeDto.type
-observe.common.EncounterTypeDto.types
observe.common.FloatingObjectDto.title
observe.common.FloatingObjectDto.type
-observe.common.FloatingObjectDto.types
observe.common.FloatingObjectPartDto.title
observe.common.FloatingObjectPartDto.type
-observe.common.FloatingObjectPartDto.types
observe.common.FloatlinesCompositionDto.title
observe.common.FloatlinesCompositionDto.type
-observe.common.FloatlinesCompositionDto.types
observe.common.FpaZoneDto.type
-observe.common.FpaZoneDto.types
observe.common.GearCaracteristicDto.type
-observe.common.GearCaracteristicDto.types
observe.common.GearCaracteristicTypeDto.type
-observe.common.GearCaracteristicTypeDto.types
observe.common.GearDto.type
-observe.common.GearDto.types
observe.common.GearUseFeaturesLonglineDto.title
observe.common.GearUseFeaturesLonglineDto.type
-observe.common.GearUseFeaturesLonglineDto.types
observe.common.GearUseFeaturesMeasurementLonglineDto.title
observe.common.GearUseFeaturesMeasurementSeineDto.title
observe.common.GearUseFeaturesSeineDto.title
observe.common.GearUseFeaturesSeineDto.type
-observe.common.GearUseFeaturesSeineDto.types
observe.common.HarbourDto.type
-observe.common.HarbourDto.types
observe.common.HealthStatusDto.type
-observe.common.HealthStatusDto.types
observe.common.HookPositionDto.type
-observe.common.HookPositionDto.types
observe.common.HookSizeDto.type
-observe.common.HookSizeDto.types
observe.common.HookTypeDto.type
-observe.common.HookTypeDto.types
observe.common.HooksCompositionDto.title
observe.common.HooksCompositionDto.type
-observe.common.HooksCompositionDto.types
observe.common.ItemHorizontalPositionDto.type
-observe.common.ItemHorizontalPositionDto.types
observe.common.ItemVerticalPositionDto.type
-observe.common.ItemVerticalPositionDto.types
observe.common.LengthLengthParameterDto.type
-observe.common.LengthLengthParameterDto.types
observe.common.LengthWeightParameterDto.type
-observe.common.LengthWeightParameterDto.types
observe.common.LightsticksColorDto.type
-observe.common.LightsticksColorDto.types
observe.common.LightsticksTypeDto.type
-observe.common.LightsticksTypeDto.types
observe.common.LineTypeDto.type
-observe.common.LineTypeDto.types
observe.common.MaturityStatusDto.type
-observe.common.MaturityStatusDto.types
observe.common.MitigationTypeDto.type
-observe.common.MitigationTypeDto.types
observe.common.NonTargetCatchDto.title
observe.common.NonTargetCatchDto.type
-observe.common.NonTargetCatchDto.types
observe.common.NonTargetCatchReleaseConformityDto.type
-observe.common.NonTargetCatchReleaseConformityDto.types
observe.common.NonTargetCatchReleaseDto.title
observe.common.NonTargetCatchReleaseDto.type
-observe.common.NonTargetCatchReleaseDto.types
observe.common.NonTargetCatchReleaseStatusDto.type
-observe.common.NonTargetCatchReleaseStatusDto.types
observe.common.NonTargetCatchReleasingTimeDto.type
-observe.common.NonTargetCatchReleasingTimeDto.types
observe.common.NonTargetLengthDto.title
observe.common.NonTargetLengthDto.type
-observe.common.NonTargetLengthDto.types
observe.common.ObjectMaterialDto.type
-observe.common.ObjectMaterialDto.types
observe.common.ObjectMaterialTypeDto.type
-observe.common.ObjectMaterialTypeDto.types
observe.common.ObjectObservedSpeciesDto.title
observe.common.ObjectObservedSpeciesDto.type
-observe.common.ObjectObservedSpeciesDto.types
observe.common.ObjectOperationDto.type
-observe.common.ObjectOperationDto.types
observe.common.ObjectSchoolEstimateDto.title
observe.common.ObjectSchoolEstimateDto.type
-observe.common.ObjectSchoolEstimateDto.types
observe.common.ObservedSystemDto.type
-observe.common.ObservedSystemDto.types
observe.common.OceanDto.type
-observe.common.OceanDto.types
observe.common.OrganismDto.type
-observe.common.OrganismDto.types
observe.common.PersonDto.type
-observe.common.PersonDto.types
observe.common.ProgramDto.type
-observe.common.ProgramDto.types
observe.common.ReasonForDiscardDto.type
-observe.common.ReasonForDiscardDto.types
observe.common.ReasonForNoFishingDto.type
-observe.common.ReasonForNoFishingDto.types
observe.common.ReasonForNullSetDto.type
-observe.common.ReasonForNullSetDto.types
observe.common.RouteDto.type
-observe.common.RouteDto.types
observe.common.SchoolEstimateDto.title
observe.common.SchoolEstimateDto.type
-observe.common.SchoolEstimateDto.types
observe.common.SectionDto.type
-observe.common.SectionDto.types
observe.common.SensorBrandDto.type
-observe.common.SensorBrandDto.types
observe.common.SensorDataFormatDto.type
-observe.common.SensorDataFormatDto.types
observe.common.SensorTypeDto.type
-observe.common.SensorTypeDto.types
observe.common.SensorUsedDto.title
observe.common.SensorUsedDto.type
-observe.common.SensorUsedDto.types
observe.common.SetLonglineDto.title
observe.common.SetLonglineDto.type
-observe.common.SetLonglineDto.types
observe.common.SetLonglineGlobalCompositionDto.title
observe.common.SetSeineDto.title
observe.common.SetSeineDto.type
-observe.common.SetSeineDto.types
observe.common.SettingShapeDto.type
-observe.common.SettingShapeDto.types
observe.common.SexDto.type
-observe.common.SexDto.types
observe.common.ShipOwnerDto.type
-observe.common.ShipOwnerDto.types
observe.common.SizeMeasureDto.title
observe.common.SizeMeasureDto.type
-observe.common.SizeMeasureDto.types
observe.common.SizeMeasureTypeDto.type
-observe.common.SizeMeasureTypeDto.types
observe.common.SpeciesDto.type
-observe.common.SpeciesDto.types
observe.common.SpeciesFateDto.type
-observe.common.SpeciesFateDto.types
observe.common.SpeciesGroupDto.type
-observe.common.SpeciesGroupDto.types
observe.common.SpeciesGroupReleaseModeDto.type
-observe.common.SpeciesGroupReleaseModeDto.types
observe.common.SpeciesListDto.type
-observe.common.SpeciesListDto.types
observe.common.SpeciesStatusDto.type
-observe.common.SpeciesStatusDto.types
observe.common.StomachFullnessDto.type
-observe.common.StomachFullnessDto.types
observe.common.SurroundingActivityDto.type
-observe.common.SurroundingActivityDto.types
observe.common.TargetCatchDto.title
observe.common.TargetCatchDto.type
-observe.common.TargetCatchDto.types
observe.common.TargetLengthDto.title
observe.common.TargetLengthDto.type
-observe.common.TargetLengthDto.types
observe.common.TdrDto.title
observe.common.TdrDto.type
-observe.common.TdrDto.types
observe.common.TransmittingBuoyDto.title
observe.common.TransmittingBuoyDto.type
-observe.common.TransmittingBuoyDto.types
observe.common.TransmittingBuoyOperationDto.type
-observe.common.TransmittingBuoyOperationDto.types
observe.common.TransmittingBuoyTypeDto.type
-observe.common.TransmittingBuoyTypeDto.types
observe.common.TripLonglineDto.title
observe.common.TripLonglineDto.type
-observe.common.TripLonglineDto.types
observe.common.TripSeineDto.title
observe.common.TripSeineDto.type
-observe.common.TripSeineDto.types
observe.common.TripTypeDto.type
-observe.common.TripTypeDto.types
observe.common.VesselActivityLonglineDto.type
-observe.common.VesselActivityLonglineDto.types
observe.common.VesselActivitySeineDto.type
-observe.common.VesselActivitySeineDto.types
observe.common.VesselDto.type
-observe.common.VesselDto.types
observe.common.VesselSizeCategoryDto.type
-observe.common.VesselSizeCategoryDto.types
observe.common.VesselTypeDto.type
-observe.common.VesselTypeDto.types
observe.common.WeightCategoryDto.type
-observe.common.WeightCategoryDto.types
observe.common.WeightMeasureDto.title
observe.common.WeightMeasureDto.type
-observe.common.WeightMeasureDto.types
observe.common.WeightMeasureTypeDto.type
-observe.common.WeightMeasureTypeDto.types
observe.common.WindDto.type
-observe.common.WindDto.types
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -2214,8 +2214,8 @@ observe.type.action.view=View selected %s
observe.type.activityLongline.unsaved=New activity
observe.type.activitySeine.unsaved=New activity
observe.type.floatingObject.unsaved=New floating object (FOB)
-observe.type.list=List of %s
-observe.type.management=Management of %s
+observe.type.list=List of referential of type `%s`
+observe.type.management=Management of referential of type `%s`
observe.type.reference.common=Common Referential
observe.type.reference.longline=Longline Referential
observe.type.reference.seine=Seine Referential
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -2214,8 +2214,8 @@ observe.type.action.view=Ver los detalles del objeto de tipo '%s' seleccionado
observe.type.activityLongline.unsaved=Nueva actividad
observe.type.activitySeine.unsaved=Nueva actividad
observe.type.floatingObject.unsaved=Nuevo FOB
-observe.type.list=Lista de %s
-observe.type.management=Gestión de %s
+observe.type.list=Lista de Referencial of type `%s` #TODO
+observe.type.management=Gestión de Referencial of type `%s` #TODO
observe.type.reference.common=Referencial Común
observe.type.reference.longline=Referencial de Palangre
observe.type.reference.seine=Referencial de Cerco
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -2214,8 +2214,8 @@ observe.type.action.view=Voir les détails de l'objet de type '%s' sélectionné
observe.type.activityLongline.unsaved=Nouvelle activité
observe.type.activitySeine.unsaved=Nouvelle activité
observe.type.floatingObject.unsaved=Nouvel objet flottant (FOB)
-observe.type.list=Liste des %s
-observe.type.management=Gestion des %s
+observe.type.list=Liste des référentiels de type `%s`
+observe.type.management=Gestion des référentiels de type `%s`
observe.type.reference.common=Référentiel commun
observe.type.reference.longline=Référentiel Palangre
observe.type.reference.seine=Référentiel Senne
=====================================
templates/src/main/java/fr/ird/observe/toolkit/eugene/templates/DtoReferenceTransformer.java
=====================================
@@ -247,7 +247,6 @@ public class DtoReferenceTransformer extends ObjectModelTransformerToJava {
String referenceName = beanClass.getName() + "Reference";
i18nGetterFile.addKey("observe.common." + dtoName + ".type");
- i18nGetterFile.addKey("observe.common." + dtoName + ".types");
StringBuilder body = new StringBuilder();
body.append("" /*{
<%=flushMethodName%>(<%=referenceName%>.DEFINITION);}*/);
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/c9e5dd41f3b3dce8756547652…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/c9e5dd41f3b3dce8756547652…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] [PS] Contrôle de la saisie des espèces dans faune accessoire par systèmes...
by Tony CHEMIT 05 Aug '20
by Tony CHEMIT 05 Aug '20
05 Aug '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
d3048d73 by Tony Chemit at 2020-08-05T15:10:18+02:00
[PS] Contrôle de la saisie des espèces dans faune accessoire par systèmes observés (cas requin baleine) - Closes #1583 (report v8)
- - - - -
2 changed files:
- client-configuration/src/main/config/Client.ini
- client-configuration/src/test/java/fr/ird/observe/client/configuration/ClientConfigTest.java
Changes:
=====================================
client-configuration/src/main/config/Client.ini
=====================================
@@ -733,7 +733,7 @@ defaultValue = true
description = observe.config.ui.seineBycatchObservedSystem.description
key = ui.seineBycatchObservedSystem
type = fr.ird.observe.validation.SeineBycatchObservedSystemConfig
-defaultValue = {\"fr.ird.referential.common.Species#1239832684290#0.04680507324710936\": [\"fr.ird.referential.ps.observation.ObservedSystem#0#1.0\",\"fr.ird.referential.ps.observation.ObservedSystem#0#1.1\"]}
+defaultValue = {\"fr.ird.referential.common.Species#1239832684290#0.04680507324710936\": [\"fr.ird.referential.ps.observation.ObservedSystem#0#1.0\",\"fr.ird.referential.ps.observation.ObservedSystem#0#1.1\",\"fr.ird.referential.ps.observation.ObservedSystem#1239832686428#0.9217864901728908\"]}
[option temporaryFilesTimeout]
description = observe.config.temporaryFilesTimeout.description
=====================================
client-configuration/src/test/java/fr/ird/observe/client/configuration/ClientConfigTest.java
=====================================
@@ -56,10 +56,11 @@ public class ClientConfigTest {
{
Collection<String> requiredObservedSystemBySpeciesId = seineBycatchObservedSystem.getRequiredObservedSystemBySpeciesId("fr.ird.referential.common.Species#1239832684290#0.04680507324710936");
Assert.assertNotNull(requiredObservedSystemBySpeciesId);
- Assert.assertEquals(2, requiredObservedSystemBySpeciesId.size());
+ Assert.assertEquals(3, requiredObservedSystemBySpeciesId.size());
Iterator<String> iterator = requiredObservedSystemBySpeciesId.iterator();
Assert.assertEquals("fr.ird.referential.ps.observation.ObservedSystem#0#1.0", iterator.next());
Assert.assertEquals("fr.ird.referential.ps.observation.ObservedSystem#0#1.1", iterator.next());
+ Assert.assertEquals("fr.ird.referential.ps.observation.ObservedSystem#1239832686428#0.9217864901728908", iterator.next());
}
{
Collection<String> requiredObservedSystemBySpeciesId = seineBycatchObservedSystem.getRequiredObservedSystemBySpeciesId("fr.ird.referential.common.Species#1239832684290#0.04680507324710936_fake");
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/d3048d736958842611d9dd609…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/d3048d736958842611d9dd609…
You're receiving this email because of your account on gitlab.com.
1
0