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
- 7338 discussions
06 Sep '24
Tony CHEMIT deleted branch feature/issue_1203 at ultreiaio / ird-observe
--
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Deleted 4 commits: update decorator and pom
by Tony CHEMIT (@tchemit) 06 Sep '24
by Tony CHEMIT (@tchemit) 06 Sep '24
06 Sep '24
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below.
Deleted commits:
d16efe06 by Tony Chemit at 2024-09-06T12:42:50+02:00
update decorator and pom
- - - - -
9daea82d by Tony Chemit at 2024-09-06T12:52:39+02:00
override DecoratorSorted.getComparator
- - - - -
62e6eeaf by Tony Chemit at 2024-09-06T12:52:39+02:00
use Decorator comparator in RowSorter
- - - - -
e78ff0dd by Tony Chemit at 2024-09-06T12:53:14+02:00
Merge branch 'feature/issue_1203' into develop
Tableaux de saisie (captures, échantillons, équipements...) - Classement en cliquant sur les en-têtes de colonnes
- Closes #1203
- - - - -
5 changed files:
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/table/ContentTableUITableModel.java
- pom.xml
- toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/DefaultDecoratorRenderer.java
- toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/JavaBeanDecoratorRenderer.java
- toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/ToolkitIdLabelDecoratorRenderer.java
Changes:
=====================================
client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/table/ContentTableUITableModel.java
=====================================
@@ -26,11 +26,16 @@ import fr.ird.observe.client.datasource.editor.api.content.data.table.actions.en
import fr.ird.observe.client.datasource.editor.api.content.ui.table.EditableTable;
import fr.ird.observe.client.util.UIHelper;
import fr.ird.observe.client.util.table.EditableTableModelWithCache;
+import fr.ird.observe.decoration.DecoratorService;
import fr.ird.observe.dto.IdDto;
import fr.ird.observe.dto.data.ContainerChildDto;
import fr.ird.observe.dto.data.DataDto;
import fr.ird.observe.dto.data.WithIndex;
import io.ultreia.java4all.bean.JavaBean;
+import io.ultreia.java4all.decoration.Decorated;
+import io.ultreia.java4all.decoration.DecoratedSorter;
+import io.ultreia.java4all.decoration.Decorator;
+import io.ultreia.java4all.decoration.DecoratorDefinition;
import io.ultreia.java4all.i18n.I18n;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -189,6 +194,20 @@ public abstract class ContentTableUITableModel<D extends DataDto, C extends Cont
if (getColumnMeta(0).getType().equals(int.class)) {
sorter.setComparator(0, Comparator.comparingInt(v -> (int) v));
}
+ int index=-1;
+ for (ContentTableMeta<C> meta : metas) {
+ index++;
+ Class<?> type = meta.getType();
+ if (Decorated.class.isAssignableFrom(type)) {
+ DecoratorService decoratorService = getContext().getModel().getDecoratorService();
+ Decorator decorator = decoratorService.getDecoratorByType(type);
+ int decoratorIndex = decorator.configuration().getIndex();
+ DecoratedSorter<?> decoratedSorter = decorator.definition().sorter();
+ Comparator<?> comparator = decoratedSorter.getComparator((DecoratorDefinition) decorator.definition(), decoratorService.getReferentialLocale().getLocale(), decoratorIndex);
+ sorter.setComparator(index, comparator);
+ }
+ }
+
table.setSortable(true);
}
=====================================
pom.xml
=====================================
@@ -23,7 +23,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2024.34</version>
+ <version>2024.36-SNAPSHOT</version>
</parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
=====================================
toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/DefaultDecoratorRenderer.java
=====================================
@@ -144,4 +144,8 @@ public class DefaultDecoratorRenderer<O> extends DecoratorRenderer<O> {
return propertyName.toLowerCase().contains("timestamp");
}
+ protected boolean isTemporal(String propertyName) {
+ return isDate(propertyName) || isTimestamp(propertyName) || propertyName.toLowerCase().contains("time");
+ }
+
}
=====================================
toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/JavaBeanDecoratorRenderer.java
=====================================
@@ -34,6 +34,7 @@ import io.ultreia.java4all.lang.Strings;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Locale;
@@ -96,6 +97,36 @@ public class JavaBeanDecoratorRenderer<O extends JavaBean> extends DefaultDecora
defaultSort(propertyName, definition, locale, pos, dataList);
}
+ @Override
+ public Comparator<O> getComparator(DecoratorDefinition<O, ?> definition, Locale locale, int pos) {
+ String propertyName = definition.properties().get(pos);
+ if (getCodeProperties().contains(propertyName)) {
+ return Comparator.comparing(d -> {
+ Object context = d.get(propertyName);
+ if (context == null) {
+ return null;
+ }
+ String text = String.valueOf(context);
+ return sortByCodeFunction(text);
+ });
+ }
+ if (isTemporal(propertyName)) {
+ // sort on date, can not use toString render to sort (wrong order when using date pattern dd/MM/yyyy)
+ return Comparator.comparing(d -> ((Date) d.get(propertyName)).getTime());
+ }
+ JavaBeanPropertyDefinition<JavaBean, Object> propertyDefinition = getJavaBeanDefinition().readProperty(propertyName);
+ if (Number.class.isAssignableFrom(propertyDefinition.type()) ||
+ int.class.isAssignableFrom(propertyDefinition.type()) ||
+ float.class.isAssignableFrom(propertyDefinition.type()) ||
+ long.class.isAssignableFrom(propertyDefinition.type())) {
+ return Comparator.comparing(d -> d.get(propertyName));
+ }
+ if (StatisticValue.class.isAssignableFrom(propertyDefinition.type())) {
+ return Comparator.comparingLong(d -> ((StatisticValue) d.get(propertyName)).getValue());
+ }
+ return Comparator.comparing(d -> definition.decorate(locale, d, pos));
+ }
+
protected void defaultSort(String propertyName, DecoratorDefinition<O, ?> definition, Locale locale, int pos, List<O> dataList) {
super.sort(definition, locale, pos, dataList);
}
=====================================
toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/ToolkitIdLabelDecoratorRenderer.java
=====================================
@@ -32,6 +32,7 @@ import org.apache.logging.log4j.Logger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
+import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.Set;
@@ -71,6 +72,43 @@ public class ToolkitIdLabelDecoratorRenderer extends JavaBeanDecoratorRenderer<T
sortByCode(pos, dataList);
}
+ @Override
+ public Comparator<ToolkitIdLabel> getComparator(DecoratorDefinition<ToolkitIdLabel, ?> definition, Locale locale, int pos) {
+ String propertyName = definition.properties().get(pos);
+ if (isDate(propertyName)) {
+
+ // sort on date, can not use toString render to sort (wrong order when using date pattern dd/MM/yyyy)
+ SimpleDateFormat dateFormat = I18nDecoratorHelper.newDateFormat(locale);
+ return Comparator.comparingLong(d -> {
+ String o = d.getText(pos);
+ try {
+ return dateFormat.parse(o).getTime();
+ } catch (ParseException e) {
+ return 0;
+ }
+
+ });
+ }
+ if (isTimestamp(propertyName)) {
+ // sort on timestamp, can not use toString render to sort (wrong order when using date pattern dd/MM/yyyy HH:mm)
+ SimpleDateFormat dateFormat = I18nDecoratorHelper.newTimestampFormat(locale);
+ return Comparator.comparingLong(d -> {
+ String o = d.getText(pos);
+ try {
+ return dateFormat.parse(o).getTime();
+ } catch (ParseException e) {
+ return 0;
+ }
+
+ });
+ }
+ return Comparator.comparing(d -> {
+ String o = d.getText(pos);
+ return sortByCodeFunction(o);
+
+ });
+ }
+
protected void sortByDate(int pos, SimpleDateFormat dateFormat, List<ToolkitIdLabel> dataList) {
Multimap<Long, ToolkitIdLabel> dataToDate = ArrayListMultimap.create();
for (ToolkitIdLabel data : dataList) {
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/f518f0e1541d1ce0fa340e81…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/f518f0e1541d1ce0fa340e81…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe] Pushed new branch feature/issue_1203
by Tony CHEMIT (@tchemit) 06 Sep '24
by Tony CHEMIT (@tchemit) 06 Sep '24
06 Sep '24
Tony CHEMIT pushed new branch feature/issue_1203 at ultreiaio / ird-observe
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/tree/feature/issue_1203
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 4 commits: update decorator and pom
by Tony CHEMIT (@tchemit) 06 Sep '24
by Tony CHEMIT (@tchemit) 06 Sep '24
06 Sep '24
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
d16efe06 by Tony Chemit at 2024-09-06T12:42:50+02:00
update decorator and pom
- - - - -
9daea82d by Tony Chemit at 2024-09-06T12:52:39+02:00
override DecoratorSorted.getComparator
- - - - -
62e6eeaf by Tony Chemit at 2024-09-06T12:52:39+02:00
use Decorator comparator in RowSorter
- - - - -
e78ff0dd by Tony Chemit at 2024-09-06T12:53:14+02:00
Merge branch 'feature/issue_1203' into develop
Tableaux de saisie (captures, échantillons, équipements...) - Classement en cliquant sur les en-têtes de colonnes
- Closes #1203
- - - - -
5 changed files:
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/table/ContentTableUITableModel.java
- pom.xml
- toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/DefaultDecoratorRenderer.java
- toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/JavaBeanDecoratorRenderer.java
- toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/ToolkitIdLabelDecoratorRenderer.java
Changes:
=====================================
client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/table/ContentTableUITableModel.java
=====================================
@@ -26,11 +26,16 @@ import fr.ird.observe.client.datasource.editor.api.content.data.table.actions.en
import fr.ird.observe.client.datasource.editor.api.content.ui.table.EditableTable;
import fr.ird.observe.client.util.UIHelper;
import fr.ird.observe.client.util.table.EditableTableModelWithCache;
+import fr.ird.observe.decoration.DecoratorService;
import fr.ird.observe.dto.IdDto;
import fr.ird.observe.dto.data.ContainerChildDto;
import fr.ird.observe.dto.data.DataDto;
import fr.ird.observe.dto.data.WithIndex;
import io.ultreia.java4all.bean.JavaBean;
+import io.ultreia.java4all.decoration.Decorated;
+import io.ultreia.java4all.decoration.DecoratedSorter;
+import io.ultreia.java4all.decoration.Decorator;
+import io.ultreia.java4all.decoration.DecoratorDefinition;
import io.ultreia.java4all.i18n.I18n;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -189,6 +194,20 @@ public abstract class ContentTableUITableModel<D extends DataDto, C extends Cont
if (getColumnMeta(0).getType().equals(int.class)) {
sorter.setComparator(0, Comparator.comparingInt(v -> (int) v));
}
+ int index=-1;
+ for (ContentTableMeta<C> meta : metas) {
+ index++;
+ Class<?> type = meta.getType();
+ if (Decorated.class.isAssignableFrom(type)) {
+ DecoratorService decoratorService = getContext().getModel().getDecoratorService();
+ Decorator decorator = decoratorService.getDecoratorByType(type);
+ int decoratorIndex = decorator.configuration().getIndex();
+ DecoratedSorter<?> decoratedSorter = decorator.definition().sorter();
+ Comparator<?> comparator = decoratedSorter.getComparator((DecoratorDefinition) decorator.definition(), decoratorService.getReferentialLocale().getLocale(), decoratorIndex);
+ sorter.setComparator(index, comparator);
+ }
+ }
+
table.setSortable(true);
}
=====================================
pom.xml
=====================================
@@ -23,7 +23,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2024.34</version>
+ <version>2024.36-SNAPSHOT</version>
</parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
=====================================
toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/DefaultDecoratorRenderer.java
=====================================
@@ -144,4 +144,8 @@ public class DefaultDecoratorRenderer<O> extends DecoratorRenderer<O> {
return propertyName.toLowerCase().contains("timestamp");
}
+ protected boolean isTemporal(String propertyName) {
+ return isDate(propertyName) || isTimestamp(propertyName) || propertyName.toLowerCase().contains("time");
+ }
+
}
=====================================
toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/JavaBeanDecoratorRenderer.java
=====================================
@@ -34,6 +34,7 @@ import io.ultreia.java4all.lang.Strings;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Locale;
@@ -96,6 +97,36 @@ public class JavaBeanDecoratorRenderer<O extends JavaBean> extends DefaultDecora
defaultSort(propertyName, definition, locale, pos, dataList);
}
+ @Override
+ public Comparator<O> getComparator(DecoratorDefinition<O, ?> definition, Locale locale, int pos) {
+ String propertyName = definition.properties().get(pos);
+ if (getCodeProperties().contains(propertyName)) {
+ return Comparator.comparing(d -> {
+ Object context = d.get(propertyName);
+ if (context == null) {
+ return null;
+ }
+ String text = String.valueOf(context);
+ return sortByCodeFunction(text);
+ });
+ }
+ if (isTemporal(propertyName)) {
+ // sort on date, can not use toString render to sort (wrong order when using date pattern dd/MM/yyyy)
+ return Comparator.comparing(d -> ((Date) d.get(propertyName)).getTime());
+ }
+ JavaBeanPropertyDefinition<JavaBean, Object> propertyDefinition = getJavaBeanDefinition().readProperty(propertyName);
+ if (Number.class.isAssignableFrom(propertyDefinition.type()) ||
+ int.class.isAssignableFrom(propertyDefinition.type()) ||
+ float.class.isAssignableFrom(propertyDefinition.type()) ||
+ long.class.isAssignableFrom(propertyDefinition.type())) {
+ return Comparator.comparing(d -> d.get(propertyName));
+ }
+ if (StatisticValue.class.isAssignableFrom(propertyDefinition.type())) {
+ return Comparator.comparingLong(d -> ((StatisticValue) d.get(propertyName)).getValue());
+ }
+ return Comparator.comparing(d -> definition.decorate(locale, d, pos));
+ }
+
protected void defaultSort(String propertyName, DecoratorDefinition<O, ?> definition, Locale locale, int pos, List<O> dataList) {
super.sort(definition, locale, pos, dataList);
}
=====================================
toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/ToolkitIdLabelDecoratorRenderer.java
=====================================
@@ -32,6 +32,7 @@ import org.apache.logging.log4j.Logger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
+import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.Set;
@@ -71,6 +72,43 @@ public class ToolkitIdLabelDecoratorRenderer extends JavaBeanDecoratorRenderer<T
sortByCode(pos, dataList);
}
+ @Override
+ public Comparator<ToolkitIdLabel> getComparator(DecoratorDefinition<ToolkitIdLabel, ?> definition, Locale locale, int pos) {
+ String propertyName = definition.properties().get(pos);
+ if (isDate(propertyName)) {
+
+ // sort on date, can not use toString render to sort (wrong order when using date pattern dd/MM/yyyy)
+ SimpleDateFormat dateFormat = I18nDecoratorHelper.newDateFormat(locale);
+ return Comparator.comparingLong(d -> {
+ String o = d.getText(pos);
+ try {
+ return dateFormat.parse(o).getTime();
+ } catch (ParseException e) {
+ return 0;
+ }
+
+ });
+ }
+ if (isTimestamp(propertyName)) {
+ // sort on timestamp, can not use toString render to sort (wrong order when using date pattern dd/MM/yyyy HH:mm)
+ SimpleDateFormat dateFormat = I18nDecoratorHelper.newTimestampFormat(locale);
+ return Comparator.comparingLong(d -> {
+ String o = d.getText(pos);
+ try {
+ return dateFormat.parse(o).getTime();
+ } catch (ParseException e) {
+ return 0;
+ }
+
+ });
+ }
+ return Comparator.comparing(d -> {
+ String o = d.getText(pos);
+ return sortByCodeFunction(o);
+
+ });
+ }
+
protected void sortByDate(int pos, SimpleDateFormat dateFormat, List<ToolkitIdLabel> dataList) {
Multimap<Long, ToolkitIdLabel> dataToDate = ArrayListMultimap.create();
for (ToolkitIdLabel data : dataList) {
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/f518f0e1541d1ce0fa340e81…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/f518f0e1541d1ce0fa340e81…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 6 commits: fix license header
by Tony CHEMIT (@tchemit) 05 Sep '24
by Tony CHEMIT (@tchemit) 05 Sep '24
05 Sep '24
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
093c30be by Tony Chemit at 2024-09-05T13:50:20+02:00
fix license header
- - - - -
79bfcae5 by Tony Chemit at 2024-09-05T13:54:44+02:00
Hide species ids option (Will be re-add in #2931) - Closes #2929
- - - - -
0749d0a9 by Tony Chemit at 2024-09-05T13:54:56+02:00
Remove FloatingObjectPresetsManager and use now only a FloatingObjectPresetsStorage
- - - - -
6aadd14d by Tony Chemit at 2024-09-05T13:54:56+02:00
Use now only one client configuration option and simplify dcp-presets directory layout
- - - - -
88dde538 by Tony Chemit at 2024-09-05T13:54:56+02:00
Review FloatingObjectPresetsUI (remove tabs and rename FloatingObjectPresetsTabUI to FloatingObjectPresetsEditorUI)
- - - - -
f518f0e1 by Tony Chemit at 2024-09-05T13:55:03+02:00
Merge branch 'feature/issue-2826' into develop
Permettre le renommage, la suppression, éventuellement l'édition des présélections de FOB
- Closes #2826
- - - - -
30 changed files:
- client/configuration/src/main/config/Client.ini
- client/configuration/src/main/dcp-presets/ps/common/01-standard-fad-deployment-preset.yml → client/configuration/src/main/dcp-presets/01-standard-fad-deployment-preset.yml
- client/configuration/src/main/dcp-presets/ps/common/02-standard-fad-removal-preset.yml → client/configuration/src/main/dcp-presets/02-standard-fad-removal-preset.yml
- client/configuration/src/main/dcp-presets/ps/common/03-standard-fad-update-preset.yml → client/configuration/src/main/dcp-presets/03-standard-fad-update-preset.yml
- client/configuration/src/main/dcp-presets/ps/common/04-standard-fad-abandonned-preset.yml → client/configuration/src/main/dcp-presets/04-standard-fad-abandonned-preset.yml
- client/configuration/src/main/dcp-presets/ps/common/05-standard-fad-endOfUse-preset.yml → client/configuration/src/main/dcp-presets/05-standard-fad-endOfUse-preset.yml
- client/configuration/src/main/dcp-presets/ps/common/README.TXT → client/configuration/src/main/dcp-presets/README.TXT
- − client/configuration/src/main/dcp-presets/ps/logbook/README.TXT
- − client/configuration/src/main/dcp-presets/ps/observation/README.TXT
- client/configuration/src/main/i18n/getters/config.getter
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
- client/configuration/src/test/java/fr/ird/observe/client/configuration/ClientConfigTest.java
- client/core/src/main/java/fr/ird/observe/client/ClientUIContext.java
- client/core/src/main/java/fr/ird/observe/client/ClientUIContextApi.java
- client/core/src/main/java/fr/ird/observe/client/WithClientUIContextApi.java
- client/core/src/main/java/fr/ird/observe/client/datasource/api/ObserveSwingDataSource.java
- client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/loading/LoadingDataSourceContext.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/loading/open/OpenDataSourceActionStep.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/DcpUIModelStates.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/actions/AddFloatingObjectPreset.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/FloatingObjectPresetsTabUI.jaxx → client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/FloatingObjectPresetsEditorUI.jaxx
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/FloatingObjectPresetsTabUI.jcss → client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/FloatingObjectPresetsEditorUI.jcss
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/FloatingObjectPresetsTabUIHandler.java → client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/FloatingObjectPresetsEditorUIHandler.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/FloatingObjectPresetsTabUIModel.java → client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/FloatingObjectPresetsEditorUIModel.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/FloatingObjectPresetsUI.jaxx
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/FloatingObjectPresetsUIHandler.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/FloatingObjectPresetsUIModel.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/actions/CancelEdit.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/presets/actions/Delete.java
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/c9a055b71968ccb9cce25e1e…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/c9a055b71968ccb9cce25e1e…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 4 commits: Remove ObserveSwingSession (use directly SwingSession)
by Tony CHEMIT (@tchemit) 05 Sep '24
by Tony CHEMIT (@tchemit) 05 Sep '24
05 Sep '24
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
eab2fdac by Tony Chemit at 2024-09-05T12:48:01+02:00
Remove ObserveSwingSession (use directly SwingSession)
- - - - -
efb846a1 by Tony Chemit at 2024-09-05T12:48:28+02:00
Remove ObServeSwingSessionConfig
- - - - -
0c970bb0 by Tony Chemit at 2024-09-05T12:48:59+02:00
do not use any longer ObserveSwingSessionHelper in ContentUIInitializer (everything is managed now by SwingSession)
- - - - -
c9a055b7 by Tony Chemit at 2024-09-05T12:49:04+02:00
Merge branch 'feature/issue-2834' into develop
Suppression du système de préférences d'ui codé en dure - Closes #2834
- - - - -
15 changed files:
- client/configuration/src/main/config/Client.ini
- client/configuration/src/main/i18n/getters/config.getter
- client/configuration/src/main/i18n/getters/java.getter
- − client/configuration/src/main/java/fr/ird/observe/client/ObServeSwingSessionConfig.java
- − client/configuration/src/main/java/fr/ird/observe/client/ObserveSwingSession.java
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientResources.java
- client/core/src/main/java/fr/ird/observe/client/ClientUIContext.java
- client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java
- client/core/src/main/java/fr/ird/observe/client/util/session/ObserveSwingSessionHelper.java
- − client/core/src/main/resources/observe-swing-preferences.properties
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/ContentUIInitializer.java
- client/runner/src/main/i18n/translations/client-runner_en_GB.properties
- client/runner/src/main/i18n/translations/client-runner_es_ES.properties
- client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
Changes:
=====================================
client/configuration/src/main/config/Client.ini
=====================================
@@ -395,14 +395,6 @@ defaultValue = ${instance.resources.directory}/config/ObserveSwingSession.ui.xml
final = true
transient = true
-[option swingPreferencesFile]
-description = observe.config.swingPreferencesFile.description
-key = instance.swingPreferencesFile
-type = file
-defaultValue = ${instance.resources.directory}/config/observe-swing-preferences.properties
-final = true
-transient = true
-
[option temporaryDirectory]
description = observe.config.temporaryDirectory.description
key = instance.temporary.directory
=====================================
client/configuration/src/main/i18n/getters/config.getter
=====================================
@@ -118,7 +118,6 @@ observe.config.speciesList.seine.observation.objectObservedSpecies
observe.config.speciesList.seine.observation.objectSchoolEstimate
observe.config.speciesList.seine.observation.schoolEstimate
observe.config.speciesList.seine.sample
-observe.config.swingPreferencesFile.description
observe.config.swingSessionFile.description
observe.config.temperature.format
observe.config.temporaryDirectory.description
=====================================
client/configuration/src/main/i18n/getters/java.getter
=====================================
@@ -3,7 +3,6 @@ observe.init.no.local.db.detected
observe.runner.copy.default.dcp.file
observe.runner.copy.default.map.file
observe.runner.copy.default.report.file
-observe.runner.copy.default.swing.preferences.file
observe.runner.copy.default.ui.file
observe.runner.copy.embedded.keystore.file
observe.runner.loading.ui.configuration
=====================================
client/configuration/src/main/java/fr/ird/observe/client/ObServeSwingSessionConfig.java deleted
=====================================
@@ -1,31 +0,0 @@
-package fr.ird.observe.client;
-
-/*-
- * #%L
- * ObServe Client :: Configuration
- * %%
- * Copyright (C) 2008 - 2023 IRD, 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 java.io.File;
-
-public interface ObServeSwingSessionConfig {
-
- File getSwingSessionFile();
- File getSwingPreferencesFile();
-}
=====================================
client/configuration/src/main/java/fr/ird/observe/client/ObserveSwingSession.java deleted
=====================================
@@ -1,100 +0,0 @@
-package fr.ird.observe.client;
-
-/*-
- * #%L
- * ObServe Client :: Configuration
- * %%
- * Copyright (C) 2008 - 2023 IRD, 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 io.ultreia.java4all.jaxx.widgets.combobox.FilterableComboBox;
-import io.ultreia.java4all.jaxx.widgets.combobox.session.FilterableComboBoxState;
-import io.ultreia.java4all.jaxx.widgets.length.nautical.NauticalLengthEditor;
-import io.ultreia.java4all.jaxx.widgets.length.nautical.session.NauticalLengthEditorState;
-import io.ultreia.java4all.jaxx.widgets.list.DoubleList;
-import io.ultreia.java4all.jaxx.widgets.list.ListHeader;
-import io.ultreia.java4all.jaxx.widgets.list.session.DoubleListState;
-import io.ultreia.java4all.jaxx.widgets.list.session.ListHeaderState;
-import io.ultreia.java4all.util.SortedProperties;
-import org.nuiton.jaxx.runtime.swing.session.State;
-import org.nuiton.jaxx.runtime.swing.session.SwingSession;
-import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditor;
-import org.nuiton.jaxx.widgets.gis.absolute.session.CoordinatesEditorState;
-import org.nuiton.jaxx.widgets.temperature.TemperatureEditor;
-import org.nuiton.jaxx.widgets.temperature.session.TemperatureEditorState;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Extends SwingSession with
- * Created on 07/07/2022.
- *
- * @author Tony Chemit - dev(a)tchemit.fr
- * @since 9.0.7
- */
-public class ObserveSwingSession extends SwingSession {
-
- private final File preferencesFile;
-
- private final Properties preferences;
-
- public ObserveSwingSession(File file, boolean autoSave, File preferencesFile) {
- super(file, autoSave, Map.of(FilterableComboBox.class, new FilterableComboBoxState(),
- DoubleList.class, new DoubleListState(),
- ListHeader.class, new ListHeaderState(),
- TemperatureEditor.class, new TemperatureEditorState(),
- NauticalLengthEditor.class, new NauticalLengthEditorState(),
- CoordinatesEditor.class, new CoordinatesEditorState()
- ));
- this.preferencesFile = preferencesFile;
- this.preferences = new SortedProperties();
- loadPreferences(preferencesFile);
- }
-
- public ObserveSwingSession(File file, boolean autoSave, Map<Class, State> additionalStates, File preferencesFile) {
- super(file, autoSave, additionalStates);
- this.preferencesFile = preferencesFile;
- this.preferences = new SortedProperties();
- loadPreferences(preferencesFile);
- }
-
- public File getPreferencesFile() {
- return preferencesFile;
- }
-
- public Properties getPreferences() {
- return preferences;
- }
-
- private void loadPreferences(File preferencesFile) {
- if (preferencesFile.exists()) {
- try (BufferedReader reader = Files.newBufferedReader(preferencesFile.toPath(), StandardCharsets.UTF_8)) {
- preferences.load(reader);
- } catch (IOException e) {
- throw new RuntimeException(String.format("Could not load preferences file at %s", preferencesFile), e);
- }
- }
- }
-
-}
=====================================
client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
=====================================
@@ -24,7 +24,6 @@ package fr.ird.observe.client.configuration;
import com.google.common.io.MoreFiles;
import com.google.common.io.RecursiveDeleteOption;
import com.google.gson.Gson;
-import fr.ird.observe.client.ObServeSwingSessionConfig;
import fr.ird.observe.consolidation.data.ps.dcp.SimplifiedObjectTypeSpecializedRules;
import fr.ird.observe.datasource.configuration.DataSourceConnectMode;
import fr.ird.observe.datasource.configuration.DataSourceCreateMode;
@@ -121,10 +120,10 @@ import static org.nuiton.jaxx.runtime.swing.SwingUtil.ICON_PREFIX;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 1.0
*/
-@GenerateApplicationComponent(name = "ObServe client config", hints = {TripMapConfig.class, TemplateGeneratorConfig.class, ObServeSwingSessionConfig.class, CleanTemporaryFilesTaskConfiguration.class}, instantiateStrategy = ApplicationComponentInstantiateStrategy.SUPPLIER, instantiateSupplier = ClientConfigFinder.class)
+@GenerateApplicationComponent(name = "ObServe client config", hints = {TripMapConfig.class, TemplateGeneratorConfig.class, CleanTemporaryFilesTaskConfiguration.class}, instantiateStrategy = ApplicationComponentInstantiateStrategy.SUPPLIER, instantiateSupplier = ClientConfigFinder.class)
@GenerateTemplate(template = "about.ftl")
@GenerateJavaBeanDefinition
-public class ClientConfig extends GeneratedClientConfig implements TripMapConfig, TemplateGeneratorConfig, JavaBean, ObServeSwingSessionConfig, CleanTemporaryFilesTaskConfiguration {
+public class ClientConfig extends GeneratedClientConfig implements TripMapConfig, TemplateGeneratorConfig, JavaBean, CleanTemporaryFilesTaskConfiguration {
public static final String DB_NAME = "obstuna";
public static final List<ClientConfigOption> MAP_LAYERS = List.of(ClientConfigOption.MAP_LAYER1, ClientConfigOption.MAP_LAYER2, ClientConfigOption.MAP_LAYER3, ClientConfigOption.MAP_LAYER4, ClientConfigOption.MAP_LAYER5, ClientConfigOption.MAP_LAYER6, ClientConfigOption.MAP_LAYER7, ClientConfigOption.MAP_LAYER8, ClientConfigOption.MAP_LAYER9, ClientConfigOption.MAP_LAYER10);
@@ -392,7 +391,6 @@ public class ClientConfig extends GeneratedClientConfig implements TripMapConfig
File resourcesDirectory = createDirectory(ClientConfigOption.RESOURCES_DIRECTORY);
log.debug("user resource data directory : {}", resourcesDirectory);
- createParentDirectory(ClientConfigOption.SWING_PREFERENCES_FILE);
// 5 - resources report
@@ -452,18 +450,10 @@ public class ClientConfig extends GeneratedClientConfig implements TripMapConfig
ClientResources.dcp.copyResource(dcpFile);
}
- // 10 - swing preferences
- File preferencesFile = getSwingPreferencesFile();
- if (versionSnapshot || !preferencesFile.exists()) {
- String message = t("observe.runner.copy.default.swing.preferences.file", preferencesFile);
- log.info(message);
- ClientResources.ObserveSwingPreferences.copyResource(preferencesFile);
- }
-
- // 11 - export directory
+ // 10 - export directory
createDirectory(ClientConfigOption.EXPORT_DIRECTORY);
- // 12 - Add custom keystore (See https://gitlab.com/ultreiaio/ird-observe/-/issues/2791)
+ // 11 - Add custom keystore (See https://gitlab.com/ultreiaio/ird-observe/-/issues/2791)
Path keystore = resourcesDirectory.toPath().resolve("observe.jks");
if (Files.notExists(keystore)) {
=====================================
client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientResources.java
=====================================
@@ -33,7 +33,6 @@ import io.ultreia.java4all.config.ConfigResource;
*/
public final class ClientResources {
public static final ConfigResource CONFIG = new ConfigResource("/META-INF/configuration/observe-client.conf");
- public static final ConfigResource ObserveSwingPreferences = new ConfigResource("/observe-swing-preferences.properties");
public static final ConfigResource ui = new ConfigResource("/observe-ui.properties");
public static final ConfigResource ui_navigation_common = new ConfigResource("/observe-ui-navigation-common.properties");
public static final ConfigResource ui_navigation_ps = new ConfigResource("/observe-ui-navigation-ps.properties");
=====================================
client/core/src/main/java/fr/ird/observe/client/ClientUIContext.java
=====================================
@@ -85,7 +85,7 @@ public class ClientUIContext implements Closeable, ClientUIContextApi {
public ClientUIContext(ClientConfig clientConfig) {
ClientConfig.initDecoratorService(clientConfig.getReferentialLocale());
this.clientConfig = clientConfig;
- this.observeSwingSessionHelper = new ObserveSwingSessionHelper(clientConfig);
+ this.observeSwingSessionHelper = new ObserveSwingSessionHelper(clientConfig.getSwingSessionFile());
this.floatingObjectPresetsManager = clientConfig.newFloatingObjectPresetsManager();
this.serviceFactory = new ObserveServiceMainFactory();
this.editModel = new Project();
=====================================
client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java
=====================================
@@ -431,7 +431,6 @@ public class ClientConfigUI extends JXTitledPanel implements WithClientUIContext
helper.addOption(ClientConfigOption.RESOURCES_DIRECTORY);
helper.addOption(ClientConfigOption.AVDTH_DIRECTORY);
helper.addOption(ClientConfigOption.SWING_SESSION_FILE);
- helper.addOption(ClientConfigOption.SWING_PREFERENCES_FILE);
helper.addOption(ClientConfigOption.SIMPLIFIED_OBJECT_TYPE_SPECIALIZED_RULES_FILE);
helper.addOption(ClientConfigOption.H2_LOGIN);
=====================================
client/core/src/main/java/fr/ird/observe/client/util/session/ObserveSwingSessionHelper.java
=====================================
@@ -22,21 +22,28 @@ package fr.ird.observe.client.util.session;
* #L%
*/
-import fr.ird.observe.client.ObServeSwingSessionConfig;
-import fr.ird.observe.client.ObserveSwingSession;
import io.ultreia.java4all.jaxx.widgets.combobox.FilterableComboBox;
+import io.ultreia.java4all.jaxx.widgets.combobox.session.FilterableComboBoxState;
+import io.ultreia.java4all.jaxx.widgets.length.nautical.NauticalLengthEditor;
+import io.ultreia.java4all.jaxx.widgets.length.nautical.session.NauticalLengthEditorState;
import io.ultreia.java4all.jaxx.widgets.list.DoubleList;
import io.ultreia.java4all.jaxx.widgets.list.ListHeader;
+import io.ultreia.java4all.jaxx.widgets.list.session.DoubleListState;
+import io.ultreia.java4all.jaxx.widgets.list.session.ListHeaderState;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import org.nuiton.jaxx.runtime.JAXXObject;
+import org.nuiton.jaxx.runtime.swing.session.SwingSession;
+import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditor;
+import org.nuiton.jaxx.widgets.gis.absolute.session.CoordinatesEditorState;
+import org.nuiton.jaxx.widgets.temperature.TemperatureEditor;
+import org.nuiton.jaxx.widgets.temperature.session.TemperatureEditorState;
-import javax.swing.JComponent;
import java.awt.Component;
import java.io.Closeable;
+import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
-import java.util.function.Consumer;
+import java.util.Map;
/**
* Created on 07/11/16.
@@ -48,16 +55,21 @@ public class ObserveSwingSessionHelper implements Closeable {
private static final Logger log = LogManager.getLogger(ObserveSwingSessionHelper.class);
- private final ObserveSwingSession session;
+ private final SwingSession session;
- public ObserveSwingSessionHelper(ObServeSwingSessionConfig file) {
+ public ObserveSwingSessionHelper(File file) {
//FIXME Add additional states (auto detect from JaxxUIResourcesProvider ?)
- session = new ObserveSwingSession(file.getSwingSessionFile(), false, file.getSwingPreferencesFile());/*, Map.of(
- FilterableComboBox.class, new FilterableComboBoxState()
- ));*/
+ session = new SwingSession(file,
+ false,
+ Map.of(FilterableComboBox.class, new FilterableComboBoxState(),
+ DoubleList.class, new DoubleListState(),
+ ListHeader.class, new ListHeaderState(),
+ TemperatureEditor.class, new TemperatureEditorState(),
+ NauticalLengthEditor.class, new NauticalLengthEditorState(),
+ CoordinatesEditor.class, new CoordinatesEditorState()));
}
- public ObserveSwingSession getSession() {
+ public SwingSession getSession() {
return session;
}
@@ -65,10 +77,6 @@ public class ObserveSwingSessionHelper implements Closeable {
session.add(c, replace);
}
- public void removeComponent(Component c) {
- session.remove(c);
- }
-
public void save() {
try {
if (Files.notExists(session.getFile().toPath())) {
@@ -80,33 +88,8 @@ public class ObserveSwingSessionHelper implements Closeable {
}
}
- public void initComboBox(JAXXObject ui, FilterableComboBox<?> editor) {
- initDecorator(ui, editor, editor::setIndex, editor.getModel()::setReverseSort);
- }
-
- public void initListHeader(JAXXObject ui, ListHeader<?> editor) {
- initDecorator(ui, editor, editor::setIndex, editor::setReverseSort);
- }
-
- public void initDoubleList(JAXXObject ui, DoubleList<?> editor) {
- initDecorator(ui, editor, editor::setIndex, editor::setReverseSort);
- }
-
@Override
public void close() {
save();
}
-
-
- private void initDecorator(JAXXObject ui, JComponent editor, Consumer<Integer> indexSetter, Consumer<Boolean> orderSetter) {
- String key = ui.getClass().getName() + "." + editor.getName() + ".sort.";
- int index = Integer.parseInt(session.getPreferences().getProperty(key + "index", "0"));
- boolean reverseOrder = Boolean.parseBoolean(session.getPreferences().getProperty(key + "order", "false"));
- if (index != 0) {
- indexSetter.accept(index);
- }
- if (reverseOrder) {
- orderSetter.accept(true);
- }
- }
}
=====================================
client/core/src/main/resources/observe-swing-preferences.properties deleted
=====================================
@@ -1,33 +0,0 @@
-###
-# #%L
-# ObServe Client :: Core
-# %%
-# Copyright (C) 2008 - 2023 IRD, 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%
-###
-fr.ird.observe.client.datasource.editor.ll.data.observation.SetCatchUI.section.sort.index=1
-fr.ird.observe.client.datasource.editor.ll.data.observation.SetCatchUI.basket.sort.index=1
-fr.ird.observe.client.datasource.editor.ll.data.observation.SetCatchUI.branchline.sort.index=1
-fr.ird.observe.client.datasource.editor.ps.data.logbook.FloatingObjectUI.vessel1.sort.index=1
-fr.ird.observe.client.datasource.editor.ps.data.logbook.FloatingObjectUI.vessel2.sort.index=1
-fr.ird.observe.client.datasource.editor.ps.data.logbook.FloatingObjectUI.country1.sort.index=1
-fr.ird.observe.client.datasource.editor.ps.data.logbook.FloatingObjectUI.country2.sort.index=1
-fr.ird.observe.client.datasource.editor.ps.data.observation.FloatingObjectUI.vessel1.sort.index=1
-fr.ird.observe.client.datasource.editor.ps.data.observation.FloatingObjectUI.vessel2.sort.index=1
-fr.ird.observe.client.datasource.editor.ps.data.observation.FloatingObjectUI.country1.sort.index=1
-fr.ird.observe.client.datasource.editor.ps.data.observation.FloatingObjectUI.country2.sort.index=1
-
=====================================
client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/ContentUIInitializer.java
=====================================
@@ -329,7 +329,6 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup
} else {
prepareDataFilterableComboBox(referenceType, editor);
}
- getObserveSwingSessionHelper().initComboBox(ui, editor);
}
@SuppressWarnings({"unchecked", "rawtypes"})
@@ -343,7 +342,6 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup
} else {
prepareDataEntityList(referenceType, (ListHeader) editor);
}
- getObserveSwingSessionHelper().initListHeader(ui, editor);
}
public void addDecoratorClassifier(ListHeader<?> editor) {
@@ -363,7 +361,6 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup
} else {
prepareDataDoubleList(referenceType, editor);
}
- getObserveSwingSessionHelper().initDoubleList(ui, editor);
}
protected void init(TimeEditor editor) {
=====================================
client/runner/src/main/i18n/translations/client-runner_en_GB.properties
=====================================
@@ -135,7 +135,6 @@ observe.config.speciesList.seine.observation.objectObservedSpecies=Species for o
observe.config.speciesList.seine.observation.objectSchoolEstimate=Species for object school estimates
observe.config.speciesList.seine.observation.schoolEstimate=Species for school estimates
observe.config.speciesList.seine.sample=Species for sample
-observe.config.swingPreferencesFile.description=Swing preferences file.
observe.config.swingSessionFile.description=Swing session file.
observe.config.temperature.format=Default temperature unit
observe.config.temporaryDirectory.description=Default temporary directory used by application and clean at each launch.
=====================================
client/runner/src/main/i18n/translations/client-runner_es_ES.properties
=====================================
@@ -135,7 +135,6 @@ observe.config.speciesList.seine.observation.objectObservedSpecies=Especies que
observe.config.speciesList.seine.observation.objectSchoolEstimate=Especies para las estimaciones de banco objeto
observe.config.speciesList.seine.observation.schoolEstimate=Especies para las estimaciones
observe.config.speciesList.seine.sample=Species for sample \#TODO
-observe.config.swingPreferencesFile.description=Swing preferences file.
observe.config.swingSessionFile.description=Copia de seguridad del estado del UI.
observe.config.temperature.format=Unidad de temperatura
observe.config.temporaryDirectory.description=Directorio temporal por defecto
=====================================
client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
=====================================
@@ -135,7 +135,6 @@ observe.config.speciesList.seine.observation.objectObservedSpecies=Espèces pour
observe.config.speciesList.seine.observation.objectSchoolEstimate=Espèces pour les estimations banc objet
observe.config.speciesList.seine.observation.schoolEstimate=Espèces pour les estimations
observe.config.speciesList.seine.sample=Espèces pour l'échantillonnage au port
-observe.config.swingPreferencesFile.description=Fichier de sauvegarde des préférences des UI.
observe.config.swingSessionFile.description=Fichier de sauvegarde des états des UI.
observe.config.temperature.format=Unité de température
observe.config.temporaryDirectory.description=Le répertoire temporaire par défaut
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/1995338fe84cd9ca0ee12fdc…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/1995338fe84cd9ca0ee12fdc…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 3 commits: Add new client configuration option showSensibleCriteriaInTripBulkChanges
by Tony CHEMIT (@tchemit) 05 Sep '24
by Tony CHEMIT (@tchemit) 05 Sep '24
05 Sep '24
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
de95fb1f by Tony Chemit at 2024-09-05T12:26:25+02:00
Add new client configuration option showSensibleCriteriaInTripBulkChanges
- - - - -
b7bc8cf9 by Tony Chemit at 2024-09-05T12:26:53+02:00
use new client configuration option showSensibleCriteriaInTripBulkChanges in BulkModify ui
- - - - -
1995338f by Tony Chemit at 2024-09-05T12:26:58+02:00
Merge branch 'feature/issue-2816' into develop
Fonction de changement de programme en masse - Closes #2816
- - - - -
8 changed files:
- client/configuration/src/main/config/Client.ini
- client/configuration/src/main/i18n/getters/config.getter
- client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/rlist/actions/BulkModify.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/rlist/bulk/BulkModifyUIModel.java
- client/runner/src/main/i18n/translations/client-runner_en_GB.properties
- client/runner/src/main/i18n/translations/client-runner_es_ES.properties
- client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
Changes:
=====================================
client/configuration/src/main/config/Client.ini
=====================================
@@ -955,6 +955,12 @@ key = ui.nauticalLength.format
type = io.ultreia.java4all.jaxx.widgets.length.nautical.NauticalLengthFormat
defaultValue = M
+[option showSensibleCriteriaInTripBulkChanges]
+description = observe.config.showSensibleCriteriaInTripBulkChanges
+key = ui.showSensibleCriteriaInTripBulkChanges
+type = Boolean
+defaultValue = false
+
[option treeGroupByName]
description = observe.config.ui.tree.groupByName
key = ui.tree.config.groupByName
=====================================
client/configuration/src/main/i18n/getters/config.getter
=====================================
@@ -96,6 +96,7 @@ observe.config.navigationIconsPath.description
observe.config.pg.can.migrate.description
observe.config.remoteDataSourceConfigurations.description
observe.config.serverDataSourceConfigurations.description
+observe.config.showSensibleCriteriaInTripBulkChanges
observe.config.showSql
observe.config.simplifiedObjectTypeSpecializedRules.description
observe.config.sizeMeasureType.seine.localmarket.sample
=====================================
client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java
=====================================
@@ -386,32 +386,32 @@ public class ClientConfigUI extends JXTitledPanel implements WithClientUIContext
private void addExpertOptions(ObserveConfigUIBuilder helper) {
helper.addCategory(n("observe.config.category.expert"),
- n("observe.config.category.expert.description"),
- "application");
+ n("observe.config.category.expert.description"));
- helper.addOption(ClientConfigOption.LOAD_LOCAL_STORAGE);
+ helper.addOption(ClientConfigOption.LOAD_LOCAL_STORAGE).setOptionCallBack("application");
- helper.addOption(ClientConfigOption.BACKUP_USE);
- helper.addOption(ClientConfigOption.BACKUP_DELAY);
- helper.addOption(ClientConfigOption.BACKUP_AT_CLOSE);
+ helper.addOption(ClientConfigOption.BACKUP_USE).setOptionCallBack("application");
+ helper.addOption(ClientConfigOption.BACKUP_DELAY).setOptionCallBack("application");
+ helper.addOption(ClientConfigOption.BACKUP_AT_CLOSE).setOptionCallBack("application");
- helper.addOption(ClientConfigOption.REPORT_DIRECTORY);
+ helper.addOption(ClientConfigOption.REPORT_DIRECTORY).setOptionCallBack("application");
- helper.addOption(ClientConfigOption.TEMPORARY_FILES_TIMEOUT);
- helper.addOption(ClientConfigOption.LOG_FILES_TIMEOUT);
- helper.addOption(ClientConfigOption.FEEDBACK_FILES_TIMEOUT);
- helper.addOption(ClientConfigOption.BACKUP_FILES_TIMEOUT);
+ helper.addOption(ClientConfigOption.TEMPORARY_FILES_TIMEOUT).setOptionCallBack("application");
+ helper.addOption(ClientConfigOption.LOG_FILES_TIMEOUT).setOptionCallBack("application");
+ helper.addOption(ClientConfigOption.FEEDBACK_FILES_TIMEOUT).setOptionCallBack("application");
+ helper.addOption(ClientConfigOption.BACKUP_FILES_TIMEOUT).setOptionCallBack("application");
- helper.addOption(ClientConfigOption.CHANGE_SYNCHRO_SRC);
- helper.addOption(ClientConfigOption.H2_CAN_MIGRATE);
- helper.addOption(ClientConfigOption.OBSTUNA_CAN_MIGRATE);
- helper.addOption(ClientConfigOption.H2_SERVER_PORT);
- helper.addOption(ClientConfigOption.H2_CAN_EDIT_REFERENTIAL);
- helper.addOption(ClientConfigOption.AVDTH_FORCE_IMPORT);
+ helper.addOption(ClientConfigOption.CHANGE_SYNCHRO_SRC).setOptionCallBack("application");
+ helper.addOption(ClientConfigOption.H2_CAN_MIGRATE).setOptionCallBack("application");
+ helper.addOption(ClientConfigOption.OBSTUNA_CAN_MIGRATE).setOptionCallBack("application");
+ helper.addOption(ClientConfigOption.H2_SERVER_PORT).setOptionCallBack("application");
+ helper.addOption(ClientConfigOption.H2_CAN_EDIT_REFERENTIAL).setOptionCallBack("ui");
+ helper.addOption(ClientConfigOption.AVDTH_FORCE_IMPORT).setOptionCallBack("ui");
helper.addOption(ClientConfigOption.SHOW_SQL);
helper.addOption(ClientConfigOption.USE_JVM_KEY_STORE);
- helper.addOption(ClientConfigOption.SKIP_CONSOLIDATE_STEP_FOR_REPORT);
+ helper.addOption(ClientConfigOption.SKIP_CONSOLIDATE_STEP_FOR_REPORT).setOptionCallBack("ui");
+ helper.addOption(ClientConfigOption.SHOW_SENSIBLE_CRITERIA_IN_TRIP_BULK_CHANGES).setOptionCallBack("ui");
}
=====================================
client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/rlist/actions/BulkModify.java
=====================================
@@ -71,6 +71,7 @@ public class BulkModify<D extends RootOpenableDto, R extends DataDtoReference, U
String moduleName = navigationTreeConfig.getModuleName();
BusinessModule businessModule = ObserveBusinessProject.get().getBusinessModuleByName(moduleName);
BulkModifyUIModel<R> model = new BulkModifyUIModel<>(navigationTreeConfig,
+ getClientConfig().isShowSensibleCriteriaInTripBulkChanges(),
new ModuleGroupByHelper(businessModule),
getMainUI().getBusyModel(),
ui.getModel().getStates().createReferenceCache(!navigationTreeConfig.isLoadDisabledGroupBy()),
=====================================
client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/rlist/bulk/BulkModifyUIModel.java
=====================================
@@ -22,6 +22,7 @@ package fr.ird.observe.client.datasource.editor.api.content.data.rlist.bulk;
* #L%
*/
+import fr.ird.observe.client.configuration.ClientConfig;
import fr.ird.observe.client.datasource.api.cache.ReferencesCache;
import fr.ird.observe.dto.data.DataGroupByDtoDefinition;
import fr.ird.observe.dto.reference.DataDtoReference;
@@ -36,6 +37,7 @@ import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import java.util.List;
import java.util.Objects;
+import java.util.Set;
import java.util.stream.Collectors;
/**
@@ -50,6 +52,16 @@ public class BulkModifyUIModel<R extends DataDtoReference> extends AbstractJavaB
public static final String PROPERTY_SELECTED_CRITERIA = "selectedCriteria";
public static final String PROPERTY_SELECTED_VALUE = "selectedValue";
public static final String PROPERTY_CAN_APPLY = "canApply";
+ /**
+ * Sensible criteria to hide if client configuration option is off.
+ * <p>
+ * See {@link ClientConfig#isShowSensibleCriteriaInTripBulkChanges()}
+ */
+ private static final Set<String> SENSIBLE_CRITERIA = Set.of(
+ "dataLlCommonTripGroupByOcean",
+ "dataPsCommonTripGroupByOcean",
+ "dataPsCommonTripGroupByLandingHarbour"
+ );
/**
* Module groupBy helper.
*/
@@ -88,6 +100,7 @@ public class BulkModifyUIModel<R extends DataDtoReference> extends AbstractJavaB
private ReferentialDtoReference selectedValue;
public BulkModifyUIModel(NavigationTreeConfig navigationTreeConfig,
+ boolean showSensibleCriteriaInTripBulkChanges,
ModuleGroupByHelper moduleGroupByHelper,
BusyModel busyModel,
ReferencesCache referencesCache,
@@ -96,18 +109,24 @@ public class BulkModifyUIModel<R extends DataDtoReference> extends AbstractJavaB
this.navigationTreeConfig = Objects.requireNonNull(navigationTreeConfig);
this.moduleGroupByHelper = Objects.requireNonNull(moduleGroupByHelper);
this.busyModel = Objects.requireNonNull(busyModel);
- this.availableCriteria.addAll(moduleGroupByHelper.getGroupByDefinitions().stream().filter(BulkModifyUIModel::acceptCriteria).collect(Collectors.toList()));
+ this.availableCriteria.addAll(moduleGroupByHelper.getGroupByDefinitions().stream().filter(c -> acceptCriteria(c, showSensibleCriteriaInTripBulkChanges)).collect(Collectors.toList()));
this.referencesCache = Objects.requireNonNull(referencesCache);
this.data = Objects.requireNonNull(data);
this.navigationCriteriaDefinition = getModuleGroupByHelper().getDefinition(navigationTreeConfig.getGroupByName());
// Using the navigation tree config criteria (if possible)
- if (BulkModifyUIModel.acceptCriteria(navigationCriteriaDefinition)) {
+ if (BulkModifyUIModel.acceptCriteria(navigationCriteriaDefinition, showSensibleCriteriaInTripBulkChanges)) {
setSelectedCriteria(navigationCriteriaDefinition);
+ } else {
+ // otherwise use the first available criteria
+ setSelectedCriteria(availableCriteria.getElementAt(0));
}
}
- public static boolean acceptCriteria(DataGroupByDtoDefinition<?, ?> d) {
- return d.isQualitative() && !d.isQualitativeWithSecondLevel();
+ public static boolean acceptCriteria(DataGroupByDtoDefinition<?, ?> d, boolean showSensibleCriteriaInTripBulkChanges) {
+ if (!d.isQualitative() || d.isQualitativeWithSecondLevel()) {
+ return false;
+ }
+ return showSensibleCriteriaInTripBulkChanges || !SENSIBLE_CRITERIA.contains(d.getName());
}
public DataGroupByDtoDefinition<?, ?> getNavigationCriteriaDefinition() {
=====================================
client/runner/src/main/i18n/translations/client-runner_en_GB.properties
=====================================
@@ -113,6 +113,7 @@ observe.config.navigationIconsPath.description=Default navigation icons path.
observe.config.pg.can.migrate.description=Flat sets to true when you can migrate remote data sources
observe.config.remoteDataSourceConfigurations.description=Remote data source configurations
observe.config.serverDataSourceConfigurations.description=Server data source configurations
+observe.config.showSensibleCriteriaInTripBulkChanges=Show sensible criteria (ocean, landing harbour, ...) in Trip bulk changes
observe.config.showSql=Show sql
observe.config.simplifiedObjectTypeSpecializedRules.description=simplified object type specialized rules
observe.config.sizeMeasureType.seine.localmarket.sample=Authorized size measure type on local market
=====================================
client/runner/src/main/i18n/translations/client-runner_es_ES.properties
=====================================
@@ -113,6 +113,7 @@ observe.config.navigationIconsPath.description=Default navigation icons path. \#
observe.config.pg.can.migrate.description=Autorizar la actualización de las bases remotas (debe ser el propietario de la base)
observe.config.remoteDataSourceConfigurations.description=Conexiónes a fuentes remotas
observe.config.serverDataSourceConfigurations.description=Conexiones a servidores remotos
+observe.config.showSensibleCriteriaInTripBulkChanges=Show sensible criteria (ocean, landing harbour, ...) in Trip bulk changes \#TODO
observe.config.showSql=Mostrar en todas las consultas sql ejecutadas
observe.config.simplifiedObjectTypeSpecializedRules.description=simplified object type specialized rules \#TODO
observe.config.sizeMeasureType.seine.localmarket.sample=Authorized size measure type on local market
=====================================
client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
=====================================
@@ -113,6 +113,7 @@ observe.config.navigationIconsPath.description=Chemin vers les icônes de naviga
observe.config.pg.can.migrate.description=Autoriser la mise à jour des bases distantes (il faut être propriétaire de la base)
observe.config.remoteDataSourceConfigurations.description=connexions à des sources distantes
observe.config.serverDataSourceConfigurations.description=connexions à des serveurs distantes
+observe.config.showSensibleCriteriaInTripBulkChanges=Pour autoriser la modification en masse de marées sur des criètres dit « sensibles »
observe.config.showSql=Afficher dans les logs toutes les requêtes sql exécutées
observe.config.simplifiedObjectTypeSpecializedRules.description=Liste des règles supplémentaires pour la détermination du type simplifié d'un DCP
observe.config.sizeMeasureType.seine.localmarket.sample=Type de mesure autorisées pour les échantillons du marché local
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/77540b5fdeace22ff6b2e168…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/77540b5fdeace22ff6b2e168…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe] Pushed new branch feature/issue-2907
by Tony CHEMIT (@tchemit) 02 Sep '24
by Tony CHEMIT (@tchemit) 02 Sep '24
02 Sep '24
Tony CHEMIT pushed new branch feature/issue-2907 at ultreiaio / ird-observe
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/tree/feature/issue-2907
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 4 commits: Add new ClientConfig option to store the speciesList and fill from the...
by Tony CHEMIT (@tchemit) 02 Sep '24
by Tony CHEMIT (@tchemit) 02 Sep '24
02 Sep '24
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
f238bf01 by Tony Chemit at 2024-09-02T11:41:44+02:00
Add new ClientConfig option to store the speciesList and fill from the hardcoded list in consolidate action
- - - - -
c4d28d74 by Tony Chemit at 2024-09-02T12:03:44+02:00
Add the species list in consolidation request, then use it in consolidation code instead of the hardcoded list
- - - - -
4d45c7fb by Tony Chemit at 2024-09-02T12:03:44+02:00
Use the species list in Consolidation action in GUI (and for this time add a TODO to configure this list in config UI)
- - - - -
77540b5f by Tony Chemit at 2024-09-02T12:04:14+02:00
Merge branch 'feature/issue-2929' into develop
Rendre configurable la liste des espèces à inclure dans la consolidation du sampleActivity.wieghtedWeight - Closes #2929
- - - - -
17 changed files:
- client/configuration/src/main/config/Client.ini
- client/configuration/src/main/i18n/getters/config.getter
- client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/ConsolidateConfigUI.jaxx
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/ConsolidateModel.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/ConsolidateUIHandler.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/actions/Start.java
- client/runner/src/main/i18n/translations/client-runner_en_GB.properties
- client/runner/src/main/i18n/translations/client-runner_es_ES.properties
- client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
- core/api/dto-consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/common/TripConsolidateRequest.java
- core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/common/TripConsolidateEngine.java
- core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/SampleActivityConsolidateActions.java
- core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/SampleActivityConsolidateContext.java
- core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/SampleActivityConsolidateEngine.java
- core/services/test/src/main/java/fr/ird/observe/services/service/data/ps/ConsolidateDataServiceFixtures.java
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/data/ps/ConsolidateDataService.properties
Changes:
=====================================
client/configuration/src/main/config/Client.ini
=====================================
@@ -476,6 +476,12 @@ key = instance.consolidation.failIfLengthLengthParameterNotFound
type = Boolean
defaultValue = false
+[option consolidationSpeciesListForLogbookSampleActivityWeightedWeight]
+description = observe.config.consolidation.speciesListForLogbookSampleActivityWeightedWeight
+key = instance.consolidation.speciesListForLogbookSampleActivityWeightedWeight
+type = String[]
+defaultValue = fr.ird.referential.common.Species#1239832685474#0.8943253454598569,fr.ird.referential.common.Species#1239832685474#0.975344121171992,fr.ird.referential.common.Species#1239832685475#0.13349466123905152,fr.ird.referential.common.Species#1239832685476#0.5618871286604711,fr.ird.referential.common.Species#1239832685477#0.8024257002747615,fr.ird.referential.common.Species#1239832685477#0.3846921632590058,fr.ird.referential.common.Species#1441287921299#0.016754076421811148,fr.ird.referential.common.Species#1433499265113#0.891799515346065,fr.ird.referential.common.Species#1239832685477#0.2673009297087321,fr.ird.referential.common.Species#1239832685478#0.7676744877900202,fr.ird.referential.common.Species#1239832685477#0.5989181185528589,fr.ird.referential.common.Species#1239832685476#0.36339915670317835
+
[option sizeMeasureTypeSeineObservationTargetSampleId]
description = observe.config.sizeMeasureType.seine.observation.targetSample
key = referential.sizeMeasureType.seine.observation.targetSample
=====================================
client/configuration/src/main/i18n/getters/config.getter
=====================================
@@ -22,6 +22,7 @@ observe.config.client.logFiles.timeout.description
observe.config.client.temporaryFiles.timeout.description
observe.config.consolidation.failIfLengthLengthParameterNotFound
observe.config.consolidation.failIfLengthWeightParameterNotFound
+observe.config.consolidation.speciesListForLogbookSampleActivityWeightedWeight
observe.config.coordinate.format
observe.config.db.locale
observe.config.dcpPresetsDirectory.description
=====================================
client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java
=====================================
@@ -251,7 +251,7 @@ public class ClientConfigUI extends JXTitledPanel implements WithClientUIContext
// helper.setCloseAction(((DataSourceEditor)currentBody.get()).getContentUIManager()::restartEdit);
// }
- addApplicationOptions(helper);
+ addApplicationOptions(helper, dataSource);
addUiOptions(helper);
addNavigationOptions(helper);
addMapOptions(helper);
@@ -261,7 +261,7 @@ public class ClientConfigUI extends JXTitledPanel implements WithClientUIContext
return helper;
}
- private void addApplicationOptions(ObserveConfigUIBuilder helper) {
+ private void addApplicationOptions(ObserveConfigUIBuilder helper, ObserveSwingDataSource dataSource) {
helper.addCategory(n("observe.config.category.application"),
n("observe.config.category.application.description"),
@@ -273,6 +273,9 @@ public class ClientConfigUI extends JXTitledPanel implements WithClientUIContext
helper.addOption(ClientConfigOption.VALIDATION_USE_DISABLED_REFERENTIAL);
helper.addOption(ClientConfigOption.CONSOLIDATION_FAIL_IF_LENGTH_WEIGHT_PARAMETER_NOT_FOUND);
helper.addOption(ClientConfigOption.CONSOLIDATION_FAIL_IF_LENGTH_LENGTH_PARAMETER_NOT_FOUND);
+ if (dataSource != null && dataSource.isOpen()) {
+ helper.addOption(ClientConfigOption.CONSOLIDATION_SPECIES_LIST_FOR_LOGBOOK_SAMPLE_ACTIVITY_WEIGHTED_WEIGHT);
+ }
}
=====================================
client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/ConsolidateConfigUI.jaxx
=====================================
@@ -60,6 +60,14 @@ public void destroy() {
<JCheckBox id='consolidationFailIfLengthLengthParameterNotFound' styleClass="skipI18n"/>
</cell>
</row>
+ <row>
+ <cell anchor="west">
+ <JLabel id='consolidationSpeciesListForLogbookSampleActivityWeightedWeightLabel' styleClass="skipI18n"/>
+ </cell>
+ <cell weightx='1' fill="horizontal">
+ <JLabel id='consolidationSpeciesListForLogbookSampleActivityWeightedWeight' styleClass="skipI18n"/>
+ </cell>
+ </row>
</Table>
<!--Table id='consolidationReportConfig' fill='both' constraints='BorderLayout.CENTER'>
<row>
=====================================
client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/ConsolidateModel.java
=====================================
@@ -30,6 +30,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState;
+import java.util.List;
import java.util.Set;
import java.util.TreeSet;
@@ -42,19 +43,18 @@ import java.util.TreeSet;
public class ConsolidateModel extends AdminActionModel {
private static final Logger log = LogManager.getLogger(ConsolidateModel.class);
- /**
- * Data source to use for operation.
- */
- private ObserveSwingDataSource source;
/**
* To track trip that has already been consolidated (they won't be again processed).
*/
private final Set<String> alreadyDoneTripIds;
-
+ /**
+ * Data source to use for operation.
+ */
+ private ObserveSwingDataSource source;
private boolean consolidationFailIfLengthWeightParameterNotFound;
private boolean consolidationFailIfLengthLengthParameterNotFound;
+ private List<String> consolidationSpeciesListForLogbookSampleActivityWeightedWeight;
private boolean skipForReport;
-
public ConsolidateModel() {
super(AdminStep.CONSOLIDATE);
this.alreadyDoneTripIds = new TreeSet<>();
@@ -88,6 +88,7 @@ public class ConsolidateModel extends AdminActionModel {
setConsolidationFailIfLengthWeightParameterNotFound(getClientConfig().isConsolidationFailIfLengthWeightParameterNotFound());
setConsolidationFailIfLengthLengthParameterNotFound(getClientConfig().isConsolidationFailIfLengthLengthParameterNotFound());
+ setConsolidationSpeciesListForLogbookSampleActivityWeightedWeight(getClientConfig().getConsolidationSpeciesListForLogbookSampleActivityWeightedWeightList());
}
@Override
@@ -123,6 +124,16 @@ public class ConsolidateModel extends AdminActionModel {
firePropertyChange("consolidationFailIfLengthLengthParameterNotFound", oldValue, consolidationFailIfLengthLengthParameterNotFound);
}
+ public List<String> getConsolidationSpeciesListForLogbookSampleActivityWeightedWeight() {
+ return consolidationSpeciesListForLogbookSampleActivityWeightedWeight;
+ }
+
+ public void setConsolidationSpeciesListForLogbookSampleActivityWeightedWeight(List<String> consolidationSpeciesListForLogbookSampleActivityWeightedWeight) {
+ List<String> oldValue = this.consolidationSpeciesListForLogbookSampleActivityWeightedWeight;
+ this.consolidationSpeciesListForLogbookSampleActivityWeightedWeight = consolidationSpeciesListForLogbookSampleActivityWeightedWeight;
+ firePropertyChange("consolidationSpeciesListForLogbookSampleActivityWeightedWeight", oldValue, consolidationSpeciesListForLogbookSampleActivityWeightedWeight);
+ }
+
public boolean isSkipForReport() {
return skipForReport;
}
=====================================
client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/ConsolidateUIHandler.java
=====================================
@@ -49,6 +49,7 @@ public class ConsolidateUIHandler extends AdminTabUIHandler<ConsolidateUI> imple
ConsolidateConfigUI extraConfig = new ConsolidateConfigUI(UIHelper.initialContext(configUI, this));
SelectConsolidationConfigFlag.init(extraConfig, extraConfig.getConsolidationFailIfLengthWeightParameterNotFound(), new SelectConsolidationConfigFlag("consolidationFailIfLengthWeightParameterNotFound", ConsolidateModel::isConsolidationFailIfLengthWeightParameterNotFound, ConsolidateModel::setConsolidationFailIfLengthWeightParameterNotFound, 5));
SelectConsolidationConfigFlag.init(extraConfig, extraConfig.getConsolidationFailIfLengthLengthParameterNotFound(), new SelectConsolidationConfigFlag("consolidationFailIfLengthLengthParameterNotFound", ConsolidateModel::isConsolidationFailIfLengthLengthParameterNotFound, ConsolidateModel::setConsolidationFailIfLengthLengthParameterNotFound, 6));
+ extraConfig.getConsolidationSpeciesListForLogbookSampleActivityWeightedWeight().setText("<html><body><b>TODO</b></body></html>");
configUI.getExtraConfig().add(extraConfig);
}
}
=====================================
client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/actions/Start.java
=====================================
@@ -168,6 +168,7 @@ public class Start extends AdminTabUIActionSupport<ConsolidateUI> {
request.setTripId(tripId);
request.setFailIfLengthWeightParameterNotFound(stepModel.isConsolidationFailIfLengthWeightParameterNotFound());
request.setFailIfLengthLengthParameterNotFound(stepModel.isConsolidationFailIfLengthLengthParameterNotFound());
+ request.setSpeciesListForLogbookSampleActivityWeightedWeight(Set.copyOf(stepModel.getConsolidationSpeciesListForLogbookSampleActivityWeightedWeight()));
TripConsolidateResult result = consolidateDataService.consolidateTrip(simplifiedObjectTypeSpecializedRules, request);
if (result != null) {
=====================================
client/runner/src/main/i18n/translations/client-runner_en_GB.properties
=====================================
@@ -39,6 +39,7 @@ observe.config.client.logFiles.timeout.description=Log files delete (in hours)
observe.config.client.temporaryFiles.timeout.description=Temporary files delete (in hours)
observe.config.consolidation.failIfLengthLengthParameterNotFound=In consolidate action, raise an error if a lengthLengthParameter is not found, otherwise add an warning in action
observe.config.consolidation.failIfLengthWeightParameterNotFound=In consolidate action, raise an error if a lengthWeightParameter is not found, otherwise add an warning in action
+observe.config.consolidation.speciesListForLogbookSampleActivityWeightedWeight=Species list to use in consolidation of field weighted weight (Seine / Logbook SampleActivity)
observe.config.coordinate.format=Position format (DMD, DD, DMS)
observe.config.db.locale=Language of data source (fr_FR, en_GB or es_ES)
observe.config.dcpPresetsDirectory.description=Dcp presets directory
=====================================
client/runner/src/main/i18n/translations/client-runner_es_ES.properties
=====================================
@@ -39,6 +39,7 @@ observe.config.client.logFiles.timeout.description=Log files delete (in hours) \
observe.config.client.temporaryFiles.timeout.description=Temporary files delete (in hours) \#TODO
observe.config.consolidation.failIfLengthLengthParameterNotFound=In consolidate action, raise an error if a lengthLengthParameter is not found, otherwise add an warning in action \#TODO
observe.config.consolidation.failIfLengthWeightParameterNotFound=In consolidate action, raise an error if a lengthWeightParameter is not found, otherwise add an warning in action \#TODO
+observe.config.consolidation.speciesListForLogbookSampleActivityWeightedWeight=Species list to use in consolidation of field weighted weight (Seine / Logbook SampleActivity) \#TODO
observe.config.coordinate.format=Formato de posición (DMD, DD, DMS)
observe.config.db.locale=Idioma del referencial (fr_FR, en_GB o es_ES)
observe.config.dcpPresetsDirectory.description=Dcp presets directory \#TODO
=====================================
client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
=====================================
@@ -39,6 +39,7 @@ observe.config.client.logFiles.timeout.description=Nettoyage des fichiers de log
observe.config.client.temporaryFiles.timeout.description=Nettoyage des fichiers temporaires (en heures)
observe.config.consolidation.failIfLengthLengthParameterNotFound=Dans l'action de consolidation, déclencher une erreur si une relation taille-taille n'est pas trouvée, sinon consigner cela en avertissement de l'action
observe.config.consolidation.failIfLengthWeightParameterNotFound=Dans l'action de consolidation, déclencher une erreur si une relation taille-poids n'est pas trouvée, sinon consigner cela en avertissement de l'action
+observe.config.consolidation.speciesListForLogbookSampleActivityWeightedWeight=Liste des espèces à utiliser dans l'action de consolidation du champs Poids pondéré des échantillons calée (Senne / Livre de bord)
observe.config.coordinate.format=Format des positions (DMD, DD, DMS)
observe.config.db.locale=La langue du référentiel (fr_FR, en_GB ou es_ES)
observe.config.dcpPresetsDirectory.description=Répertoire des pré-configurations de DCP
=====================================
core/api/dto-consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/common/TripConsolidateRequest.java
=====================================
@@ -25,6 +25,8 @@ package fr.ird.observe.consolidation.data.ps.common;
import io.ultreia.java4all.util.json.JsonAware;
+import java.util.Set;
+
/**
* Request to consolidate a trip.
* <p>
@@ -47,6 +49,8 @@ public class TripConsolidateRequest implements JsonAware {
*/
private boolean failIfLengthLengthParameterNotFound;
+ private Set<String> speciesListForLogbookSampleActivityWeightedWeight;
+
public boolean isFailIfLengthWeightParameterNotFound() {
return failIfLengthWeightParameterNotFound;
}
@@ -70,4 +74,12 @@ public class TripConsolidateRequest implements JsonAware {
public void setFailIfLengthLengthParameterNotFound(boolean failIfLengthLengthParameterNotFound) {
this.failIfLengthLengthParameterNotFound = failIfLengthLengthParameterNotFound;
}
+
+ public Set<String> getSpeciesListForLogbookSampleActivityWeightedWeight() {
+ return speciesListForLogbookSampleActivityWeightedWeight;
+ }
+
+ public void setSpeciesListForLogbookSampleActivityWeightedWeight(Set<String> speciesListForLogbookSampleActivityWeightedWeight) {
+ this.speciesListForLogbookSampleActivityWeightedWeight = speciesListForLogbookSampleActivityWeightedWeight;
+ }
}
=====================================
core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/common/TripConsolidateEngine.java
=====================================
@@ -88,7 +88,7 @@ public class TripConsolidateEngine {
Trip trip = Trip.loadEntity(context, tripId);
- Set<ToolkitIdModifications> logbookSampleActivityResults = consolidateLogbookSampleActivities(trip);
+ Set<ToolkitIdModifications> logbookSampleActivityResults = consolidateLogbookSampleActivities(trip, request.getSpeciesListForLogbookSampleActivityWeightedWeight());
Set<ToolkitIdModifications> localmarketBatchResults = consolidateLocalmarketBatches(trip, failIfLengthWeightParameterNotFound);
Set<fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult> observationActivityConsolidateResults = consolidateObservationActivities(trip, failIfLengthWeightParameterNotFound, failIfLengthLengthParameterNotFound);
@@ -133,12 +133,12 @@ public class TripConsolidateEngine {
}
}
- private Set<ToolkitIdModifications> consolidateLogbookSampleActivities(Trip trip) {
+ private Set<ToolkitIdModifications> consolidateLogbookSampleActivities(Trip trip, Set<String> speciesListForLogbookSampleActivityWeightedWeight) {
Set<ToolkitIdModifications> result = new LinkedHashSet<>();
if (trip.isWellEmpty() || trip.isSampleEmpty()) {
return result;
}
- logbookSampleActivityConsolidateEngine.consolidateTrip(trip, result);
+ logbookSampleActivityConsolidateEngine.consolidateTrip(trip,speciesListForLogbookSampleActivityWeightedWeight, result);
return result;
}
=====================================
core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/SampleActivityConsolidateActions.java
=====================================
@@ -43,24 +43,6 @@ public enum SampleActivityConsolidateActions implements AtomicConsolidateAction<
*/
ComputeWeightedWeight() {
- /**
- * Filter on these species to compute any weight on SampleActivitySpecies
- */
- public final Set<String> SPECIES_IDS = Set.of(
- "fr.ird.referential.common.Species#1239832685474#0.8943253454598569", // YFT
- "fr.ird.referential.common.Species#1239832685474#0.975344121171992", // SKJ
- "fr.ird.referential.common.Species#1239832685475#0.13349466123905152", // BET
- "fr.ird.referential.common.Species#1239832685476#0.5618871286604711", // ALB
- "fr.ird.referential.common.Species#1239832685477#0.8024257002747615", // LTA
- "fr.ird.referential.common.Species#1239832685477#0.3846921632590058", // FRI
- "fr.ird.referential.common.Species#1441287921299#0.016754076421811148", // TUN
- "fr.ird.referential.common.Species#1433499265113#0.891799515346065", // TUS
- "fr.ird.referential.common.Species#1239832685477#0.2673009297087321", // KAW
- "fr.ird.referential.common.Species#1239832685478#0.7676744877900202", // LOT
- "fr.ird.referential.common.Species#1239832685477#0.5989181185528589", // FRZ
- "fr.ird.referential.common.Species#1239832685476#0.36339915670317835" // BLT
- );
-
@Override
public List<String> fieldNames() {
return List.of(SampleActivity.PROPERTY_WEIGHTED_WEIGHT, SampleActivity.PROPERTY_WEIGHTED_WEIGHT_COMPUTED);
@@ -74,13 +56,13 @@ public enum SampleActivityConsolidateActions implements AtomicConsolidateAction<
@Override
public void accept(SampleActivityConsolidateContext context, SampleActivity datum) {
String wellId = context.getSampleWell();
-
+ Set<String> speciesList = context.getSpeciesListForLogbookSampleActivityWeightedWeight();
Activity activity = datum.getActivity();
// See https://gitlab.com/ultreiaio/ird-observe/-/issues/2053
// Get total weight of the set which is this well
- double w1 = context.sumOnTripWell(w -> w.getTotalWeight(activity, SPECIES_IDS, Set.of(wellId)));
+ double w1 = context.sumOnTripWell(w -> w.getTotalWeight(activity, speciesList, Set.of(wellId)));
if (w1 == 0) {
// limit case if the well was not found in trip well plan
log.warn("Well {} not found for activity {} in trip well plan.", wellId, activity.getTopiaId());
@@ -89,9 +71,9 @@ public enum SampleActivityConsolidateActions implements AtomicConsolidateAction<
return;
}
// Get total weight of the set which are in well that has been sampled
- double w2 = context.sumOnTripWell(w -> w.getTotalWeight(activity, SPECIES_IDS, context.getSampledWellIds()));
+ double w2 = context.sumOnTripWell(w -> w.getTotalWeight(activity, speciesList, context.getSampledWellIds()));
// Get total weight of the set in any well
- double wT = context.sumOnTripWell(w -> w.getTotalWeight(activity, SPECIES_IDS));
+ double wT = context.sumOnTripWell(w -> w.getTotalWeight(activity, speciesList));
// the weighted weight is the formula: weightedWeight = (w1/w2)*wT
float weightedWeight = (float) ((w1 / w2) * wT);
Float oldWeightedWeight = datum.getWeightedWeight();
=====================================
core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/SampleActivityConsolidateContext.java
=====================================
@@ -47,17 +47,19 @@ public class SampleActivityConsolidateContext implements ConsolidateContext<Samp
private final JavaBeanMonitor monitor;
private final Decorator decorator;
private final Set<Well> tripWell;
+ private final Set<String> speciesListForLogbookSampleActivityWeightedWeight;
private final Set<ToolkitIdModifications> resultBuilder;
private final java.util.Set<String> warnings = new LinkedHashSet<>();
private final Set<String> sampledWellIds;
private Sample sample;
private SampleActivity datum;
- public SampleActivityConsolidateContext(JavaBeanMonitor monitor, Decorator decorator, Trip trip, Set<ToolkitIdModifications> resultBuilder) {
+ public SampleActivityConsolidateContext(JavaBeanMonitor monitor, Decorator decorator, Trip trip, Set<String> speciesListForLogbookSampleActivityWeightedWeight, Set<ToolkitIdModifications> resultBuilder) {
this.monitor = monitor;
this.decorator = decorator;
this.tripWell = trip.getWell();
this.sampledWellIds = trip.getSample().stream().map(Sample::getWell).collect(Collectors.toSet());
+ this.speciesListForLogbookSampleActivityWeightedWeight = speciesListForLogbookSampleActivityWeightedWeight;
this.resultBuilder = resultBuilder;
}
@@ -65,6 +67,10 @@ public class SampleActivityConsolidateContext implements ConsolidateContext<Samp
return sampledWellIds;
}
+ public Set<String> getSpeciesListForLogbookSampleActivityWeightedWeight() {
+ return speciesListForLogbookSampleActivityWeightedWeight;
+ }
+
public void watch(Sample sample, SampleActivity datum) {
this.sample = Objects.requireNonNull(sample);
this.datum = Objects.requireNonNull(datum);
=====================================
core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/SampleActivityConsolidateEngine.java
=====================================
@@ -47,8 +47,8 @@ public class SampleActivityConsolidateEngine {
this.decorator = decoratorService.getDecoratorByType(SampleActivity.class);
}
- public void consolidateTrip(Trip trip, Set<ToolkitIdModifications> resultBuilder) {
- SampleActivityConsolidateContext context = new SampleActivityConsolidateContext(monitor, decorator, trip, resultBuilder);
+ public void consolidateTrip(Trip trip, Set<String> speciesListForLogbookSampleActivityWeightedWeight, Set<ToolkitIdModifications> resultBuilder) {
+ SampleActivityConsolidateContext context = new SampleActivityConsolidateContext(monitor, decorator, trip, speciesListForLogbookSampleActivityWeightedWeight,resultBuilder);
for (Sample sample : trip.getSample()) {
if (sample.isSampleActivityEmpty()) {
continue;
=====================================
core/services/test/src/main/java/fr/ird/observe/services/service/data/ps/ConsolidateDataServiceFixtures.java
=====================================
@@ -42,6 +42,7 @@ import io.ultreia.java4all.util.Dates;
import org.junit.Assert;
import java.net.URL;
+import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Set;
@@ -205,6 +206,7 @@ public class ConsolidateDataServiceFixtures extends GeneratedConsolidateDataServ
TripConsolidateRequest request = new TripConsolidateRequest();
request.setTripId(getProperty("consolidateTrip.id"));
request.setFailIfLengthWeightParameterNotFound(false);
+ request.setSpeciesListForLogbookSampleActivityWeightedWeight(Set.copyOf(Arrays.asList(getArrayProperty("consolidateTrip.speciesListForLogbookSampleActivityWeightedWeight"))));
TripConsolidateResult actual = service.consolidateTrip(simplifiedObjectTypeSpecializedRules, request);
Assert.assertNotNull(actual);
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/data/ps/ConsolidateDataService.properties
=====================================
@@ -2,20 +2,20 @@
# #%L
# ObServe Core :: Services :: Test
# %%
-# Copyright (C) 2008 - 2024 IRD, Ultreia.io
+# Copyright (C) 2008 - 2024 IRD^ 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.
+# 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,
+# 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
+# License along with this program. If not^ see
# <http://www.gnu.org/licenses/gpl-3.0.html>.
# #L%
###
@@ -29,3 +29,4 @@ consolidateTrip.logbookSampleActivity.count=1
consolidateTrip.observationsActivityResult.count=4
consolidateTrip.observationsActivityResult.withModifications.count=4
consolidateTrip.observationsActivityResult.withWarnings.count=4
+consolidateTrip.speciesListForLogbookSampleActivityWeightedWeight=fr.ird.referential.common.Species#1239832685474#0.8943253454598569^fr.ird.referential.common.Species#1239832685474#0.975344121171992^fr.ird.referential.common.Species#1239832685475#0.13349466123905152^fr.ird.referential.common.Species#1239832685476#0.5618871286604711^fr.ird.referential.common.Species#1239832685477#0.8024257002747615^fr.ird.referential.common.Species#1239832685477#0.3846921632590058^fr.ird.referential.common.Species#1441287921299#0.016754076421811148^fr.ird.referential.common.Species#1433499265113#0.891799515346065^fr.ird.referential.common.Species#1239832685477#0.2673009297087321^fr.ird.referential.common.Species#1239832685478#0.7676744877900202^fr.ird.referential.common.Species#1239832685477#0.5989181185528589^fr.ird.referential.common.Species#1239832685476#0.36339915670317835
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/64f014211e783793d2faa393…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/64f014211e783793d2faa393…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 8 commits: Add new queries in TripDao
by Tony CHEMIT (@tchemit) 02 Sep '24
by Tony CHEMIT (@tchemit) 02 Sep '24
02 Sep '24
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
92243249 by Tony Chemit at 2024-09-02T11:14:36+02:00
Add new queries in TripDao
- - - - -
8b5e5e8d by Tony Chemit at 2024-09-02T11:14:36+02:00
Add new methods in TripService
- - - - -
090661ff by Tony Chemit at 2024-09-02T11:14:36+02:00
Add new labels (will be used for ui for new actions)
- - - - -
1c2c4ae4 by Tony Chemit at 2024-09-02T11:14:36+02:00
Open API (to hack to order of configuration actions)
- - - - -
29a53618 by Tony Chemit at 2024-09-02T11:14:36+02:00
Add ContentTableUITableModel.addNewEntry(bean) method to be able to create a new row from a given bean
- - - - -
76e86dd5 by Tony Chemit at 2024-09-02T11:14:36+02:00
Implements action AddActivitiesFromSample on Well form
- - - - -
cebcab9b by Tony Chemit at 2024-09-02T11:14:36+02:00
Implements action AddActivitiesFromSample on Sample form
- - - - -
64f01421 by Tony Chemit at 2024-09-02T11:15:24+02:00
Merge branch 'feature/issue-2734' into develop
La liste des activités associées à un échantillon pourrait être déduite du plan de cuves, et inversément - Closes #2734
- - - - -
27 changed files:
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/actions/open/ContentOpen.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/table/ContentTableUITableModel.java
- client/datasource/editor/ps/src/main/i18n/getters/java.getter
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/SampleActivityTableModel.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/SampleUI.jaxx
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/SampleUIHandler.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/SampleUIModelStates.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/WellActivityUITableModel.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/WellUI.jaxx
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/WellUIHandler.java
- + client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/actions/AddActivitiesFromSample.java
- + client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/actions/AddActivitiesFromWell.java
- core/api/dto-decoration/src/main/i18n/getters/labels.getter
- core/api/services/src/main/java/fr/ird/observe/services/service/data/ps/common/TripService.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/common/TripSpi.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/common/TripTopiaDao.java
- core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ps/common/TripImpl.hbm.xml
- core/persistence/test/src/test/java/fr/ird/observe/entities/data/ps/common/TripTopiaDaoTest.java
- core/services/i18n/src/main/i18n/translations/services_en_GB.properties
- core/services/i18n/src/main/i18n/translations/services_es_ES.properties
- core/services/i18n/src/main/i18n/translations/services_fr_FR.properties
- core/services/local/src/main/java/fr/ird/observe/services/local/service/data/ps/common/TripServiceLocalSupport.java
- core/services/test/src/main/java/fr/ird/observe/services/service/data/ps/common/TripServiceFixtures.java
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/data/ps/common/TripService.properties
- model/src/main/models/Observe/dto/class/i18nLabels.properties
- model/src/main/resources/META-INF/persistence/fr/ird/observe/entities/data/ps/common/Trip-sql-queries.properties
- server/core/src/main/filtered-resources/META-INF/mapping-api-client.wm
Changes:
=====================================
client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/actions/open/ContentOpen.java
=====================================
@@ -484,6 +484,10 @@ public class ContentOpen<U extends ContentUI> {
}
}
+ public ArrayListMultimap<ContentUI, JComponent> getConfigureActions() {
+ return configureActions;
+ }
+
public final <D extends DataDto, C extends ContainerChildDto, SubUi extends ContentTableUI<D, C, SubUi>> void initTabUI(SubUi subUi, JPanel subUiPane, int tabIndex, Consumer<D> dataConsumer) {
subUiMap.put(subUi, subUiPane);
subUiPane.remove(subUi);
=====================================
client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/table/ContentTableUITableModel.java
=====================================
@@ -376,6 +376,48 @@ public abstract class ContentTableUITableModel<D extends DataDto, C extends Cont
changeSelectedRow(viewRow);
}
+ public final void addNewEntry(C bean) {
+ ensureEditable();
+
+ int selectedRow = getSelectedRow();
+ if (selectedRow > -1) {
+ // il y avait une ligne précédemment sélectionnée,
+ // on doit verifier que l'on peut changer d'entrée
+ if (!isCanQuitEditingRow()) {
+ // on ne peut pas quitter la ligne en cours d'édition
+ // on annule donc l'opération
+ return;
+ }
+ }
+ // on est autorise a ajouter une nouvelle entrée
+ // hook before changing row
+ // FIXME I am not quite sure of this flow, should not it be managed another way, somewhere else?
+ onBeforeAddNewEntry(selectedRow);
+
+ int row = getRowCount();
+
+ data.add(bean);
+ if (getModel().getStates().isWithIndex()) {
+ ((WithIndex) bean).setIndex(getRowCount());
+ }
+
+ updateBeanList(false);
+
+ this.create = true;
+ fireTableRowsInserted(row, row);
+ this.create = false;
+
+ int viewRow = getContext().getTable().convertRowIndexToView(row);
+
+ updateEmpty();
+
+ // on est en mode creation
+ setCreate(true);
+
+ // la nouvelle ligne est celle en cours d'édition
+ changeSelectedRow(viewRow);
+ }
+
protected String getDeleteExtraMessage(C bean) {
return null;
}
=====================================
client/datasource/editor/ps/src/main/i18n/getters/java.getter
=====================================
@@ -21,10 +21,14 @@ observe.data.ps.dcp.FloatingObjectPreset.reloadDefaultConfiguration.title
observe.data.ps.localmarket.Batch.weight.computed.tip
observe.data.ps.localmarket.Batch.weight.observed.tip
observe.data.ps.logbook.Activity.create.title
+observe.data.ps.logbook.Sample.action.addActivitiesFromWell
+observe.data.ps.logbook.Sample.action.addActivitiesFromWell.tip
observe.data.ps.logbook.Sample.notSuperSample.with.moreThanOne.sampleSpecies.message
observe.data.ps.logbook.Sample.notSuperSample.with.moreThanOne.sampleSpecies.title
observe.data.ps.logbook.SampleActivity.weightedWeightComputed.computed.tip
observe.data.ps.logbook.SampleActivity.weightedWeightComputed.observed.tip
+observe.data.ps.logbook.Well.action.addActivitiesFromSample
+observe.data.ps.logbook.Well.action.addActivitiesFromSample.tip
observe.data.ps.logbook.WellPlan.create.activity.tip
observe.data.ps.observation.Catch.catchWeightComputed.computed.tip
observe.data.ps.observation.Catch.catchWeightComputed.observed.tip
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/SampleActivityTableModel.java
=====================================
@@ -189,7 +189,7 @@ public class SampleActivityTableModel extends EditableTableModel<SampleActivityD
}
@Override
- protected SampleActivityDto createNewRow() {
+ public SampleActivityDto createNewRow() {
return SampleActivityDto.newDto(new Date());
}
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/SampleUI.jaxx
=====================================
@@ -167,4 +167,5 @@
</JTabbedPane>
</JPanel>
<JMenuItem id='addSampleSpecies'/>
+ <JMenuItem id='fillActivitiesFromWell'/>
</fr.ird.observe.client.datasource.editor.api.content.data.open.ContentOpenableUI>
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/SampleUIHandler.java
=====================================
@@ -23,8 +23,10 @@ package fr.ird.observe.client.datasource.editor.ps.data.logbook;
*/
+import fr.ird.observe.client.datasource.editor.ps.data.logbook.actions.AddActivitiesFromWell;
import fr.ird.observe.client.util.UIHelper;
import fr.ird.observe.dto.data.ps.logbook.SampleDto;
+import fr.ird.observe.dto.form.Form;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyVetoException;
@@ -59,6 +61,13 @@ public class SampleUIHandler extends GeneratedSampleUIHandler {
super.startEditUI();
}
+ @Override
+ protected void installMoveAction() {
+ super.installMoveAction();
+ // We install the action here to be at proper order in configure menu
+ AddActivitiesFromWell.installAction(ui);
+ }
+
private void onSuperSampleChanged(PropertyChangeEvent event) throws PropertyVetoException {
boolean oldValue = (boolean) event.getOldValue();
boolean newValue = (boolean) event.getNewValue();
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/SampleUIModelStates.java
=====================================
@@ -36,21 +36,29 @@ import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition;
import java.beans.PropertyVetoException;
import java.util.List;
+import java.util.Set;
@GenerateJavaBeanDefinition
public class SampleUIModelStates extends GeneratedSampleUIModelStates {
private final SampleActivityTableModel sampleActivityTableModel;
+ private final Set<String> availableWellInTrip;
public SampleUIModelStates(GeneratedSampleUIModel model) {
super(model);
this.sampleActivityTableModel = new SampleActivityTableModel(this);
+ String tripId = getClientValidationContext().getSelectModel().getPs().getCommonTrip().getId();
+ this.availableWellInTrip = getReferenceCache().getDataSource().getPsCommonTripService().getLogbookWellIdsFromWellPlan(tripId);
}
public SampleActivityTableModel getSampleActivityTableModel() {
return sampleActivityTableModel;
}
+ public boolean isWellInTrip(String well) {
+ return availableWellInTrip.contains(well);
+ }
+
public boolean isSuperSample() {
return getBean().isSuperSample();
}
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/WellActivityUITableModel.java
=====================================
@@ -103,4 +103,5 @@ public class WellActivityUITableModel extends GeneratedWellActivityUITableModel
values.removeAll(columnValues);
editor.setData(values);
}
+
}
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/WellUI.jaxx
=====================================
@@ -115,4 +115,5 @@
<Object id="delegateContentUI" initializer="mainTabbedPane"/>
<WellActivityUIModelStates id='wellActivityStates' initializer="wellActivityUI.getModel().getStates()"/>
<JButton id='save'/>
+ <JMenuItem id='fillActivitiesFromSample'/>
</fr.ird.observe.client.datasource.editor.api.content.data.open.ContentOpenableUI>
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/WellUIHandler.java
=====================================
@@ -33,6 +33,7 @@ import fr.ird.observe.client.datasource.editor.api.content.data.open.actions.Sav
import fr.ird.observe.client.datasource.editor.api.navigation.NavigationTree;
import fr.ird.observe.client.datasource.editor.ps.data.common.TripLogbookUINavigationNode;
import fr.ird.observe.client.datasource.editor.ps.data.common.TripUINavigationNode;
+import fr.ird.observe.client.datasource.editor.ps.data.logbook.actions.AddActivitiesFromSample;
import fr.ird.observe.client.datasource.validation.ClientValidationContext;
import fr.ird.observe.client.util.init.DefaultUIInitializerResult;
import fr.ird.observe.datasource.security.ConcurrentModificationException;
@@ -80,14 +81,21 @@ public class WellUIHandler extends GeneratedWellUIHandler {
InputMap inputMap = ui.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
ActionMap actionMap = ui.getActionMap();
+ AddActivitiesFromSample.installAction(ui);
prefixAction(ui.getWellActivityUI().getDeleteEntry(), type);
prefixAction(ui.getWellActivityUI().getShowTechnicalInformations(), type);
+ prefixAction(ui.getFillActivitiesFromSample(), type);
registerInnerAction(ui.getWellActivityUI().getResetEntry(), inputMap, actionMap);
registerInnerAction(ui.getWellActivityUI().getSaveEntry(), inputMap, actionMap);
registerInnerAction(ui.getWellActivityUI().getSaveAndNewEntry(), inputMap, actionMap);
addConfigureActions(ui, false);
initTabUI(ui.getWellActivityUI(), ui.getWellActivityPanel(), 1, d -> ui.getModel().getStates().getBean().setWellActivity(d.getWellActivity()));
+ getConfigureActions().remove(ui, ui.getFillActivitiesFromSample());
+ // Big hack to put at the good place the ui.getFillActivitiesFromSample() action in the menu
+ getConfigureActions().get(ui.getWellActivityUI()).remove(ui.getWellActivityUI().getShowTechnicalInformations());
+ getConfigureActions().put(ui.getWellActivityUI(), ui.getFillActivitiesFromSample());
+ getConfigureActions().put(ui.getWellActivityUI(), ui.getWellActivityUI().getShowTechnicalInformations());
return result;
}
};
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/actions/AddActivitiesFromSample.java
=====================================
@@ -0,0 +1,106 @@
+package fr.ird.observe.client.datasource.editor.ps.data.logbook.actions;
+
+/*-
+ * #%L
+ * ObServe Client :: DataSource :: Editor :: PS
+ * %%
+ * Copyright (C) 2008 - 2024 IRD, 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 com.google.common.collect.Maps;
+import fr.ird.observe.client.datasource.editor.api.ObserveKeyStrokesEditorApi;
+import fr.ird.observe.client.datasource.editor.api.content.actions.ConfigureMenuAction;
+import fr.ird.observe.client.datasource.editor.api.content.data.open.ContentOpenableUIModelStates;
+import fr.ird.observe.client.datasource.editor.api.content.data.open.actions.ContentOpenableUIActionSupport;
+import fr.ird.observe.client.datasource.editor.ps.data.logbook.WellActivityUI;
+import fr.ird.observe.client.datasource.editor.ps.data.logbook.WellActivityUIModel;
+import fr.ird.observe.client.datasource.editor.ps.data.logbook.WellActivityUITableModel;
+import fr.ird.observe.client.datasource.editor.ps.data.logbook.WellUI;
+import fr.ird.observe.client.datasource.editor.ps.data.logbook.WellUIModelStates;
+import fr.ird.observe.dto.data.ps.logbook.ActivityStubDto;
+import fr.ird.observe.dto.data.ps.logbook.WellActivityDto;
+import fr.ird.observe.dto.data.ps.logbook.WellDto;
+import io.ultreia.java4all.i18n.I18n;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeEvent;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+/**
+ * Created at 01/09/2024.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 9.3.7
+ */
+public class AddActivitiesFromSample extends ContentOpenableUIActionSupport<WellDto, WellUI> implements ConfigureMenuAction<WellUI> {
+
+ private static final Logger log = LogManager.getLogger(AddActivitiesFromSample.class);
+
+ public AddActivitiesFromSample() {
+ super(WellDto.class, I18n.n("observe.data.ps.logbook.Well.action.addActivitiesFromSample"), I18n.n("observe.data.ps.logbook.Well.action.addActivitiesFromSample.tip"), "generate", ObserveKeyStrokesEditorApi.KEY_STROKE_GENERATE);
+ }
+
+ public static void installAction(WellUI ui) {
+ AddActivitiesFromSample action = new AddActivitiesFromSample();
+ ui.getModel().getStates().addPropertyChangeListener(ContentOpenableUIModelStates.PROPERTY_MODE, action::updateEnableState);
+ ui.getModel().getStates().getBean().addPropertyChangeListener(WellDto.PROPERTY_WELL, action::updateEnableState);
+ ui.getModel().getStates().getBean().addPropertyChangeListener(WellDto.PROPERTY_WELL_ACTIVITY, action::updateEnableState);
+ AddActivitiesFromSample.init(ui, ui.getFillActivitiesFromSample(), action);
+ }
+
+ @Override
+ protected void doActionPerformed(ActionEvent e, WellUI ui) {
+ WellUIModelStates states = ui.getModel().getStates();
+ WellDto bean = states.getBean();
+ String well = bean.getWell();
+ log.info("Will seek from activities for sample: {}", well);
+ WellActivityUI wellActivityUI = ui.getWellActivityUI();
+ WellActivityUITableModel tableModel = wellActivityUI.getTableModel();
+ WellActivityUIModel model = wellActivityUI.getModel();
+ List<ActivityStubDto> availableActivities = wellActivityUI.getModel().getStates().getActivity();
+ Map<String, ActivityStubDto> activitiesCache = new TreeMap<>(Maps.uniqueIndex(availableActivities, ActivityStubDto::getTopiaId));
+ String tripId = getClientValidationContext().getSelectModel().getPs().getCommonTrip().getId();
+ Set<String> logbookWellActivityFromSample = getServicesProvider().getPsCommonTripService().createLogbookWellActivityFromSample(tripId, well);
+ for (String activityId : logbookWellActivityFromSample) {
+ log.info("Create Well activity for activity: {}", activityId);
+ ActivityStubDto activity = activitiesCache.get(activityId);
+ WellActivityDto wellActivityDto = model.newTableEditBean();
+ wellActivityDto.setActivity(activity);
+ tableModel.addNewEntry(wellActivityDto);
+ wellActivityUI.getSaveEntry().setEnabled(true);
+ try {
+ wellActivityUI.getSaveEntry().doClick();
+ } finally {
+ wellActivityUI.getSaveEntry().setEnabled(false);
+ }
+ }
+ }
+
+ private void updateEnableState(PropertyChangeEvent evt) {
+ WellUIModelStates states = ui.getModel().getStates();
+ boolean readingMode = states.isReadingMode();
+ String well = states.getBean().getWell();
+ List<WellActivityDto> wellActivity = states.getBean().getWellActivity();
+ setEnabled(!readingMode && well != null && !well.isEmpty() && wellActivity.isEmpty());
+ }
+}
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/actions/AddActivitiesFromWell.java
=====================================
@@ -0,0 +1,102 @@
+package fr.ird.observe.client.datasource.editor.ps.data.logbook.actions;
+
+/*-
+ * #%L
+ * ObServe Client :: DataSource :: Editor :: PS
+ * %%
+ * Copyright (C) 2008 - 2024 IRD, 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 com.google.common.collect.Maps;
+import fr.ird.observe.client.datasource.editor.api.ObserveKeyStrokesEditorApi;
+import fr.ird.observe.client.datasource.editor.api.content.actions.ConfigureMenuAction;
+import fr.ird.observe.client.datasource.editor.api.content.data.open.ContentOpenableUIModelStates;
+import fr.ird.observe.client.datasource.editor.api.content.data.open.actions.ContentOpenableUIActionSupport;
+import fr.ird.observe.client.datasource.editor.ps.data.logbook.SampleActivityTableModel;
+import fr.ird.observe.client.datasource.editor.ps.data.logbook.SampleUI;
+import fr.ird.observe.client.datasource.editor.ps.data.logbook.SampleUIModelStates;
+import fr.ird.observe.dto.data.ps.logbook.ActivityStubDto;
+import fr.ird.observe.dto.data.ps.logbook.SampleActivityDto;
+import fr.ird.observe.dto.data.ps.logbook.SampleDto;
+import io.ultreia.java4all.i18n.I18n;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeEvent;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+/**
+ * Created at 01/09/2024.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 9.3.7
+ */
+public class AddActivitiesFromWell extends ContentOpenableUIActionSupport<SampleDto, SampleUI> implements ConfigureMenuAction<SampleUI> {
+
+ private static final Logger log = LogManager.getLogger(AddActivitiesFromWell.class);
+
+ public AddActivitiesFromWell() {
+ super(SampleDto.class, I18n.n("observe.data.ps.logbook.Sample.action.addActivitiesFromWell"), I18n.n("observe.data.ps.logbook.Sample.action.addActivitiesFromWell.tip"), "generate", ObserveKeyStrokesEditorApi.KEY_STROKE_GENERATE);
+ }
+
+ public static void installAction(SampleUI ui) {
+ AddActivitiesFromWell action = new AddActivitiesFromWell();
+ ui.getModel().getStates().addPropertyChangeListener(ContentOpenableUIModelStates.PROPERTY_MODE, action::updateEnableState);
+ ui.getModel().getStates().getBean().addPropertyChangeListener(SampleDto.PROPERTY_WELL, action::updateEnableState);
+ ui.getModel().getStates().getBean().addPropertyChangeListener(SampleDto.PROPERTY_SAMPLE_ACTIVITY, action::updateEnableState);
+ AddActivitiesFromWell.init(ui, ui.getFillActivitiesFromWell(), action);
+ }
+
+ @Override
+ protected void doActionPerformed(ActionEvent e, SampleUI ui) {
+ SampleUIModelStates states = ui.getModel().getStates();
+ SampleDto bean = states.getBean();
+ String well = bean.getWell();
+ log.info("Will seek from activities from well: {}", well);
+ SampleActivityTableModel tableModel = states.getSampleActivityTableModel();
+ List<ActivityStubDto> availableActivities = tableModel.getActivities();
+ Map<String, ActivityStubDto> activitiesCache = new TreeMap<>(Maps.uniqueIndex(availableActivities, ActivityStubDto::getTopiaId));
+ String tripId = getClientValidationContext().getSelectModel().getPs().getCommonTrip().getId();
+ Set<String> logbookSampleActivityFromWellPlan = getServicesProvider().getPsCommonTripService().createLogbookSampleActivityFromWellPlan(tripId, well);
+ List<SampleActivityDto> sampleActivities = new LinkedList<>();
+ for (String activityId : logbookSampleActivityFromWellPlan) {
+ log.info("Create Sample activity for activity: {}", activityId);
+ ActivityStubDto activity = activitiesCache.get(activityId);
+ SampleActivityDto sampleActivityDto = tableModel.createNewRow();
+ sampleActivityDto.setActivity(activity);
+ sampleActivityDto.setWeightedWeight(null);
+ sampleActivityDto.setWeightedWeightComputed(false);
+ sampleActivities.add(sampleActivityDto);
+ }
+ bean.setSampleActivity(sampleActivities);
+ tableModel.setData(sampleActivities);
+ }
+
+ private void updateEnableState(PropertyChangeEvent evt) {
+ SampleUIModelStates states = ui.getModel().getStates();
+ boolean readingMode = states.isReadingMode();
+ String well = states.getBean().getWell();
+ List<SampleActivityDto> sampleActivity = states.getBean().getSampleActivity();
+ setEnabled(!readingMode && well != null && !well.isEmpty() && states.isWellInTrip(well.trim()) && sampleActivity.isEmpty());
+ }
+}
=====================================
core/api/dto-decoration/src/main/i18n/getters/labels.getter
=====================================
@@ -977,6 +977,8 @@ observe.data.ps.logbook.Route.navigation.unsaved
observe.data.ps.logbook.Route.timeAtSea
observe.data.ps.logbook.Route.title
observe.data.ps.logbook.Route.type
+observe.data.ps.logbook.Sample.action.addActivitiesFromWell
+observe.data.ps.logbook.Sample.action.addActivitiesFromWell.tip
observe.data.ps.logbook.Sample.action.create
observe.data.ps.logbook.Sample.action.move
observe.data.ps.logbook.Sample.action.move.choose.parent.message
@@ -1026,6 +1028,8 @@ observe.data.ps.logbook.SampleSpeciesMeasure.type
observe.data.ps.logbook.TransmittingBuoy.code
observe.data.ps.logbook.TransmittingBuoy.country
observe.data.ps.logbook.TransmittingBuoy.type
+observe.data.ps.logbook.Well.action.addActivitiesFromSample
+observe.data.ps.logbook.Well.action.addActivitiesFromSample.tip
observe.data.ps.logbook.Well.action.create
observe.data.ps.logbook.Well.action.move
observe.data.ps.logbook.Well.action.move.choose.parent.message
=====================================
core/api/services/src/main/java/fr/ird/observe/services/service/data/ps/common/TripService.java
=====================================
@@ -32,9 +32,11 @@ import fr.ird.observe.services.service.MethodCredential;
import fr.ird.observe.services.service.data.TripAwareService;
import io.ultreia.java4all.http.spi.Get;
import io.ultreia.java4all.http.spi.Nullable;
+import io.ultreia.java4all.http.spi.Post;
import io.ultreia.java4all.http.spi.Service;
import java.util.List;
+import java.util.Set;
/**
* Created on 26/07/2021.
@@ -57,6 +59,40 @@ public interface TripService extends TripAwareService {
@MethodCredential(Permission.READ_DATA)
List<ActivityStubDto> getLogbookWellPlanActivities(String tripId);
+ /**
+ * @param tripId selected trip id
+ * @return the set of {@code Well#well} used in the well plan of selected trip
+ */
+ @Get
+ @MethodCredential(Permission.READ_DATA)
+ Set<String> getLogbookWellIdsFromWellPlan(String tripId);
+
+ /**
+ * @param tripId selected trip id
+ * @param wellId selected well id
+ * @return the set of activity ids found in well plan for selected trip and well
+ */
+ @Post
+ @MethodCredential(Permission.READ_DATA)
+ Set<String> createLogbookSampleActivityFromWellPlan(String tripId, String wellId);
+
+ /**
+ * @param tripId selected trip id
+ * @return the set of {@code Well#well} used in the sample of the selected trip
+ */
+ @Get
+ @MethodCredential(Permission.READ_DATA)
+ Set<String> getLogbookWellIdsFromSample(String tripId);
+
+ /**
+ * @param tripId selected trip id
+ * @param wellId selected well id
+ * @return the set of activity ids found in sample for selected trip and well
+ */
+ @Post
+ @MethodCredential(Permission.READ_DATA)
+ Set<String> createLogbookWellActivityFromSample(String tripId, String wellId);
+
@Get
@MethodCredential(Permission.READ_DATA)
boolean isActivityEndOfSearchFound(String routeId);
=====================================
core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/common/TripSpi.java
=====================================
@@ -42,6 +42,10 @@ import fr.ird.observe.entities.data.DataEntity;
import fr.ird.observe.entities.data.ps.landing.Landing;
import fr.ird.observe.entities.data.ps.logbook.Activity;
import fr.ird.observe.entities.data.ps.logbook.Route;
+import fr.ird.observe.entities.data.ps.logbook.Sample;
+import fr.ird.observe.entities.data.ps.logbook.SampleActivity;
+import fr.ird.observe.entities.data.ps.logbook.Well;
+import fr.ird.observe.entities.data.ps.logbook.WellActivity;
import fr.ird.observe.entities.referential.common.DataQuality;
import fr.ird.observe.entities.referential.common.Ocean;
import fr.ird.observe.entities.referential.common.Species;
@@ -62,6 +66,7 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
+import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Stream;
@@ -380,4 +385,41 @@ public class TripSpi extends GeneratedTripSpi {
lastUpdateDates.add(fr.ird.observe.entities.data.ps.localmarket.SurveyPart.class);
}
+ public Set<String> getLogbookWellIdsFromWellPlan(ServiceContext context, String tripId) {
+ return Trip.getDao(context).getLogbookWellIdsFromWellPlan(tripId);
+ }
+
+ public Set<String> getLogbookWellIdsFromSample(ServiceContext context, String tripId) {
+ return Trip.getDao(context).getLogbookWellIdsFromSample(tripId);
+ }
+
+ public Set<String> createLogbookSampleActivityFromWellPlan(ServiceContext context, String tripId, String wellId) {
+ Trip trip = loadEntity(context, tripId);
+ Set<String> result = new LinkedHashSet<>();
+ for (Well well : trip.getWell()) {
+ if (!well.getWell().equals(wellId)) {
+ continue;
+ }
+ for (WellActivity wellActivity : well.getWellActivity()) {
+ Activity activity = wellActivity.getActivity();
+ result.add(activity.getId());
+ }
+ }
+ return result;
+ }
+
+ public Set<String> createLogbookWellActivityFromSample(ServiceContext context, String tripId, String wellId) {
+ Set<String> result = new LinkedHashSet<>();
+ Trip trip = loadEntity(context, tripId);
+ for (Sample sample : trip.getSample()) {
+ if (!sample.getWell().equals(wellId)) {
+ continue;
+ }
+ for (SampleActivity sampleActivity : sample.getSampleActivity()) {
+ result.add(sampleActivity.getActivity().getId());
+ }
+ }
+
+ return result;
+ }
}
=====================================
core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/common/TripTopiaDao.java
=====================================
@@ -44,6 +44,7 @@ import java.sql.Timestamp;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;
@@ -68,6 +69,22 @@ public class TripTopiaDao extends AbstractTripTopiaDao<Trip> {
return findMultipleResultBySqlQuery(queryLogbookWellPlanActivities(tripId), s -> toActivityStubDto(s, vesselActivities));
}
+ public Set<String> getLogbookWellIdsFromWellPlan(String tripId) {
+ return Set.copyOf(findMultipleResultBySqlQuery(queryLogbookWellIdsFromWellPlan(tripId)));
+ }
+
+ public Set<String> getLogbookActivityIdsFromWellPlan(String tripId, String wellId) {
+ return new LinkedHashSet<>(findMultipleResultBySqlQuery(queryLogbookActivityIdsFromWellPlan(tripId, wellId)));
+ }
+
+ public Set<String> getLogbookWellIdsFromSample(String tripId) {
+ return Set.copyOf(findMultipleResultBySqlQuery(queryLogbookWellIdsFromSample(tripId)));
+ }
+
+ public Set<String> getLogbookActivityIdsFromSample(String tripId, String wellId) {
+ return new LinkedHashSet<>(findMultipleResultBySqlQuery(queryLogbookActivityIdsFromSample(tripId, wellId)));
+ }
+
public boolean isActivitiesAcquisitionModeByTimeEnabled(String tripId) {
return this.<Number>findSingleResultBySqlQuery(queryIsActivitiesAcquisitionModeByTimeEnabled(tripId)).intValue() == 0;
}
=====================================
core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ps/common/TripImpl.hbm.xml
=====================================
@@ -228,6 +228,26 @@
FROM ps_logbook.Route r
INNER JOIN ps_logbook.Activity a ON a.route = r.topiaId
WHERE r.trip = ? AND a.time IS NULL
+]]></sql-query>
+ <sql-query name="fr.ird.observe.entities.data.ps.common.Trip::LogbookActivityIdsFromSample" read-only="true"
+ comment="Get all logbook activity ids from samples filtered on a Sample.well">
+ <query-param name="tripId" type="java.lang.String"/>
+ <query-param name="wellId" type="java.lang.String"/><![CDATA[
+ SELECT
+ DISTINCT(sa.activity)
+ FROM ps_logbook.Sample s
+ INNER JOIN ps_logbook.sampleActivity sa ON sa.sample = s.topiaId
+ WHERE s.trip = ? AND s.well = ?
+]]></sql-query>
+ <sql-query name="fr.ird.observe.entities.data.ps.common.Trip::LogbookActivityIdsFromWellPlan" read-only="true"
+ comment="Get all logbook activity ids from well plan filtered on a trip and a Well.well">
+ <query-param name="tripId" type="java.lang.String"/>
+ <query-param name="wellId" type="java.lang.String"/><![CDATA[
+ SELECT
+ DISTINCT(wa.activity)
+ FROM ps_logbook.well w
+ INNER JOIN ps_logbook.wellActivity wa ON wa.well = w.topiaId
+ WHERE w.trip = ? AND w.well = ?
]]></sql-query>
<sql-query name="fr.ird.observe.entities.data.ps.common.Trip::LogbookActivityPoint" read-only="true"
comment="Get logbook activity points">
@@ -274,6 +294,22 @@
INNER JOIN ps_logbook.transmittingBuoy t ON t.floatingObject = f.topiaId
WHERE r.trip = ? AND t.latitude IS NOT NULL AND t.longitude IS NOT NULL
ORDER BY r.date, a.time
+]]></sql-query>
+ <sql-query name="fr.ird.observe.entities.data.ps.common.Trip::LogbookWellIdsFromSample" read-only="true"
+ comment="Get all logbook well ids from samples">
+ <query-param name="tripId" type="java.lang.String"/><![CDATA[
+ SELECT
+ DISTINCT(s.well)
+ FROM ps_logbook.Sample s
+ WHERE s.trip = ?
+]]></sql-query>
+ <sql-query name="fr.ird.observe.entities.data.ps.common.Trip::LogbookWellIdsFromWellPlan" read-only="true"
+ comment="Get all logbook well ids from well plan">
+ <query-param name="tripId" type="java.lang.String"/><![CDATA[
+ SELECT
+ DISTINCT(w.well)
+ FROM ps_logbook.well w
+ WHERE w.trip = ?
]]></sql-query>
<sql-query name="fr.ird.observe.entities.data.ps.common.Trip::LogbookWellPlanActivities" read-only="true"
comment="Get all logbook well plan activities for the given trip">
=====================================
core/persistence/test/src/test/java/fr/ird/observe/entities/data/ps/common/TripTopiaDaoTest.java
=====================================
@@ -42,6 +42,7 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -64,7 +65,7 @@ public class TripTopiaDaoTest extends PersistenceTestSupportRead {
@Test
public void loadSqlQueries() {
- ObservePersistenceFixtures.assertSqlQueries(Trip.class, 19);
+ ObservePersistenceFixtures.assertSqlQueries(Trip.class, 23);
}
@Test
@@ -122,6 +123,42 @@ public class TripTopiaDaoTest extends PersistenceTestSupportRead {
}
}
+ @Test
+ public void getLogbookWellIdsFromSample() {
+ try (ObserveTopiaPersistenceContext persistenceContext = localTestMethodResource.newPersistenceContext()) {
+ Set<String> actual = Trip.SPI.getDao(persistenceContext).getLogbookWellIdsFromSample(tripId);
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(1, actual.size());
+ }
+ }
+
+ @Test
+ public void getLogbookWellIdsFromWellPlan() {
+ try (ObserveTopiaPersistenceContext persistenceContext = localTestMethodResource.newPersistenceContext()) {
+ Set<String> actual = Trip.SPI.getDao(persistenceContext).getLogbookWellIdsFromWellPlan(tripId);
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(1, actual.size());
+ }
+ }
+
+ @Test
+ public void getLogbookActivityIdsFromWellPlan() {
+ try (ObserveTopiaPersistenceContext persistenceContext = localTestMethodResource.newPersistenceContext()) {
+ Set<String> actual = Trip.SPI.getDao(persistenceContext).getLogbookActivityIdsFromWellPlan(tripId, "3T");
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(1, actual.size());
+ }
+ }
+
+ @Test
+ public void getLogbookActivityIdsFromSample() {
+ try (ObserveTopiaPersistenceContext persistenceContext = localTestMethodResource.newPersistenceContext()) {
+ Set<String> actual = Trip.SPI.getDao(persistenceContext).getLogbookActivityIdsFromSample(tripId, "3T");
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(1, actual.size());
+ }
+ }
+
@Test
public void buildMap() {
try (ObserveTopiaPersistenceContext persistenceContext = localTestMethodResource.newPersistenceContext()) {
=====================================
core/services/i18n/src/main/i18n/translations/services_en_GB.properties
=====================================
@@ -1205,6 +1205,8 @@ observe.data.ps.logbook.Route.title=Route
observe.data.ps.logbook.Route.type=Route
observe.data.ps.logbook.Route.validation.date.after.currentPsCommonTrip.startDate=Date (%2$s) must be after trip start date (%1$s).
observe.data.ps.logbook.Route.validation.date.before.currentPsCommonTrip.endDate=Date (%1$s) must be before trip end date (%2$s).
+observe.data.ps.logbook.Sample.action.addActivitiesFromWell=Add activities from well
+observe.data.ps.logbook.Sample.action.addActivitiesFromWell.tip=Add activities from well
observe.data.ps.logbook.Sample.action.create=Next sample
observe.data.ps.logbook.Sample.action.move=Change trip
observe.data.ps.logbook.Sample.action.move.choose.parent.message=Select target trip
@@ -1263,6 +1265,8 @@ observe.data.ps.logbook.SampleSpeciesMeasure.type=Sample species measure
observe.data.ps.logbook.TransmittingBuoy.code=Code
observe.data.ps.logbook.TransmittingBuoy.country=Flag country
observe.data.ps.logbook.TransmittingBuoy.type=Transmitting buoy
+observe.data.ps.logbook.Well.action.addActivitiesFromSample=Add activities from samples
+observe.data.ps.logbook.Well.action.addActivitiesFromSample.tip=Add activities from samples
observe.data.ps.logbook.Well.action.create=Next well
observe.data.ps.logbook.Well.action.move=Change trip
observe.data.ps.logbook.Well.action.move.choose.parent.message=Select target trip
=====================================
core/services/i18n/src/main/i18n/translations/services_es_ES.properties
=====================================
@@ -1205,6 +1205,8 @@ observe.data.ps.logbook.Route.title=Ruta
observe.data.ps.logbook.Route.type=Ruta
observe.data.ps.logbook.Route.validation.date.after.currentPsCommonTrip.startDate=El día de observación (%2$s) debe ser superior o igual a la fecha de comienzo de marea (%1$s).
observe.data.ps.logbook.Route.validation.date.before.currentPsCommonTrip.endDate=Date (%1$s) must be before trip end date (%2$s).
+observe.data.ps.logbook.Sample.action.addActivitiesFromWell=Add activities from well \#TODO
+observe.data.ps.logbook.Sample.action.addActivitiesFromWell.tip=Add activities from well \#TODO
observe.data.ps.logbook.Sample.action.create=Next sample \#TODO
observe.data.ps.logbook.Sample.action.move=Change trip
observe.data.ps.logbook.Sample.action.move.choose.parent.message=Select target trip
@@ -1263,6 +1265,8 @@ observe.data.ps.logbook.SampleSpeciesMeasure.type=Sample species measure
observe.data.ps.logbook.TransmittingBuoy.code=Identificación
observe.data.ps.logbook.TransmittingBuoy.country=Bandera
observe.data.ps.logbook.TransmittingBuoy.type=TransmittingBuoy
+observe.data.ps.logbook.Well.action.addActivitiesFromSample=Add activities from samples \#TODO
+observe.data.ps.logbook.Well.action.addActivitiesFromSample.tip=Add activities from samples \#TODO
observe.data.ps.logbook.Well.action.create=Next well
observe.data.ps.logbook.Well.action.move=Change trip
observe.data.ps.logbook.Well.action.move.choose.parent.message=Select target trip
=====================================
core/services/i18n/src/main/i18n/translations/services_fr_FR.properties
=====================================
@@ -1205,6 +1205,8 @@ observe.data.ps.logbook.Route.title=Route
observe.data.ps.logbook.Route.type=Route
observe.data.ps.logbook.Route.validation.date.after.currentPsCommonTrip.startDate=Le jour d'observation (%2$s) doit être supérieure ou égale à la date de début de la marée (%1$s).
observe.data.ps.logbook.Route.validation.date.before.currentPsCommonTrip.endDate=La date (%1$s) doit être inférieure ou égale à la date de fin de marée (%2$s).
+observe.data.ps.logbook.Sample.action.addActivitiesFromWell=Récupérer les activités
+observe.data.ps.logbook.Sample.action.addActivitiesFromWell.tip=Récupérer les activités depuis le plan de cuve
observe.data.ps.logbook.Sample.action.create=Échantillon suivant
observe.data.ps.logbook.Sample.action.move=Changer de marée
observe.data.ps.logbook.Sample.action.move.choose.parent.message=À quelle marée voulez-vous associer les échantillons sélectionnés ?
@@ -1263,6 +1265,8 @@ observe.data.ps.logbook.SampleSpeciesMeasure.type=Mesure d'un échantillon espè
observe.data.ps.logbook.TransmittingBuoy.code=Identifiant
observe.data.ps.logbook.TransmittingBuoy.country=Pavillon
observe.data.ps.logbook.TransmittingBuoy.type=Balise émettrice
+observe.data.ps.logbook.Well.action.addActivitiesFromSample=Déduire les activités
+observe.data.ps.logbook.Well.action.addActivitiesFromSample.tip=Déduire les activités depuis les échantillons
observe.data.ps.logbook.Well.action.create=Cuve suivante
observe.data.ps.logbook.Well.action.move=Changer de marée
observe.data.ps.logbook.Well.action.move.choose.parent.message=À quelle marée voulez-vous associer les cuves sélectionnées ?
=====================================
core/services/local/src/main/java/fr/ird/observe/services/local/service/data/ps/common/TripServiceLocalSupport.java
=====================================
@@ -38,6 +38,7 @@ import fr.ird.observe.services.service.data.ps.common.TripService;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Set;
/**
* Created on 26/07/2021.
@@ -82,6 +83,26 @@ public abstract class TripServiceLocalSupport extends ObserveServiceLocal implem
return Trip.SPI.getLogbookWellPlanActivities(this, tripId);
}
+ @Override
+ public Set<String> getLogbookWellIdsFromWellPlan(String tripId) {
+ return Trip.SPI.getLogbookWellIdsFromWellPlan(this, tripId);
+ }
+
+ @Override
+ public Set<String> createLogbookSampleActivityFromWellPlan(String tripId, String wellId) {
+ return Trip.SPI.createLogbookSampleActivityFromWellPlan(this, tripId, wellId);
+ }
+
+ @Override
+ public Set<String> createLogbookWellActivityFromSample(String tripId, String wellId) {
+ return Trip.SPI.createLogbookWellActivityFromSample(this, tripId, wellId);
+ }
+
+ @Override
+ public Set<String> getLogbookWellIdsFromSample(String tripId) {
+ return Trip.SPI.getLogbookWellIdsFromSample(this, tripId);
+ }
+
@Override
public boolean isActivityEndOfSearchFound(String routeId) {
return Trip.SPI.isActivityEndOfSearchFound(this, routeId);
=====================================
core/services/test/src/main/java/fr/ird/observe/services/service/data/ps/common/TripServiceFixtures.java
=====================================
@@ -41,6 +41,7 @@ import fr.ird.observe.services.service.data.RootOpenableServiceFixtures;
import org.junit.Assert;
import java.util.List;
+import java.util.Map;
import java.util.Set;
public class TripServiceFixtures extends GeneratedTripServiceFixtures {
@@ -170,4 +171,38 @@ public class TripServiceFixtures extends GeneratedTripServiceFixtures {
Assert.assertNotNull(actual.getObject().getId());
Assert.assertEquals(tripId, actual.getObject().getId());
}
+
+ @Override
+ public void getLogbookWellIdsFromSample(ObserveServicesProvider servicesProvider, TripService service) {
+ String tripId = getProperty("getLogbookWellIdsFromSample.tripId");
+ Set<String> actual = service.getLogbookWellIdsFromSample(tripId);
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(getIntegerProperty("getLogbookWellIdsFromSample.count"), actual.size());
+ }
+
+ @Override
+ public void getLogbookWellIdsFromWellPlan(ObserveServicesProvider servicesProvider, TripService service) {
+ String tripId = getProperty("getLogbookWellIdsFromWellPlan.tripId");
+ Set<String> actual = service.getLogbookWellIdsFromWellPlan(tripId);
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(getIntegerProperty("getLogbookWellIdsFromWellPlan.count"), actual.size());
+ }
+
+ @Override
+ public void createLogbookSampleActivityFromWellPlan(ObserveServicesProvider servicesProvider, TripService service) {
+ String tripId = getProperty("createLogbookSampleActivityFromWellPlan.tripId");
+ String wellId = getProperty("createLogbookSampleActivityFromWellPlan.wellId");
+ Set<String> actual = service.createLogbookSampleActivityFromWellPlan(tripId, wellId);
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(getIntegerProperty("createLogbookSampleActivityFromWellPlan.count"), actual.size());
+ }
+
+ @Override
+ public void createLogbookWellActivityFromSample(ObserveServicesProvider servicesProvider, TripService service) {
+ String tripId = getProperty("createLogbookWellActivityFromSample.tripId");
+ String wellId = getProperty("createLogbookWellActivityFromSample.wellId");
+ Set<String> actual = service.createLogbookWellActivityFromSample(tripId, wellId);
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(getIntegerProperty("createLogbookWellActivityFromSample.count"), actual.size());
+ }
}
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/data/ps/common/TripService.properties
=====================================
@@ -19,6 +19,12 @@
# <http://www.gnu.org/licenses/gpl-3.0.html>.
# #L%
###
+createLogbookSampleActivityFromWellPlan.count=1
+createLogbookSampleActivityFromWellPlan.tripId=${defaultTripId}
+createLogbookSampleActivityFromWellPlan.wellId=${defaultWellId}
+createLogbookWellActivityFromSample.count=1
+createLogbookWellActivityFromSample.tripId=${defaultTripId}
+createLogbookWellActivityFromSample.wellId=${defaultWellId}
defaultActivityId=FIXME
defaultId=${PS_COMMON_TRIP}
defaultNewParentId=${REFERENTIAL_PS_COMMON_PROGRAM_MOVE}
@@ -28,6 +34,7 @@ defaultRouteId=FIXME
defaultSpeciesListId=fr.ird.referential.common.SpeciesList#1239832675370#0.1
defaultTripId=${PS_COMMON_TRIP}
defaultVesselId=fr.ird.referential.common.Vessel#1239832679425#0.9136908731720471
+defaultWellId=3T
delete.id=${defaultId}
exists.id=${defaultId}
getAllTrip.count=4
@@ -36,6 +43,10 @@ getChildren.count=1
getChildren.parentId=${defaultParentId}
getChildrenUpdate.count=1
getChildrenUpdate.parentId=${defaultParentId}
+getLogbookWellIdsFromSample.count=1
+getLogbookWellIdsFromSample.tripId=${defaultTripId}
+getLogbookWellIdsFromWellPlan.count=1
+getLogbookWellIdsFromWellPlan.tripId=${defaultTripId}
getLogbookWellPlanActivities.count=3
getLogbookWellPlanActivities.tripId=${defaultTripId}
getMatchingTripsVesselWithinDateRange.count=0
=====================================
model/src/main/models/Observe/dto/class/i18nLabels.properties
=====================================
@@ -75,13 +75,13 @@ data.ps.logbook.Catch=comment,species,speciesFate,weight,weightCategory,weightMe
data.ps.logbook.FloatingObject=materialsValid,objectOperation,quadrant,supportVesselName,country,vessel,computedBiodegradable,computedNonEntangling,computedSimplifiedObjectType,computedValues,generalTab,buoysTab,materialsTab,notComputed,type.short,computedWhenArrivingBiodegradable,computedWhenLeavingBiodegradable,computedWhenArrivingNonEntangling,computedWhenLeavingNonEntangling,computedWhenArrivingSimplifiedObjectType,computedWhenLeavingSimplifiedObjectType
data.ps.logbook.FloatingObjectPart=whenArriving,whenLeaving
data.ps.logbook.Route=activity,comment,date,fishingTime,timeAtSea
-data.ps.logbook.Sample=number,activity,bigsWeight,comment,person,sampleQuality,sampleType,smallsWeight,superSample,totalWeight,well,generalTab,activityTab,notSuperSample.with.moreThanOne.sampleSpecies.message,notSuperSample.with.moreThanOne.sampleSpecies.title,personTab,psSampler.available,psSampler.selected
+data.ps.logbook.Sample=number,activity,bigsWeight,comment,person,sampleQuality,sampleType,smallsWeight,superSample,totalWeight,well,generalTab,activityTab,notSuperSample.with.moreThanOne.sampleSpecies.message,notSuperSample.with.moreThanOne.sampleSpecies.title,personTab,psSampler.available,psSampler.selected,action.addActivitiesFromWell,action.addActivitiesFromWell.tip
data.ps.logbook.SampleActivity=activity,weightedWeight,weightedWeightComputed,weightedWeightComputed.short,weightedWeightComputed.computed.tip,weightedWeightComputed.observed.tip
data.ps.logbook.SampleSampleSpecies=superSample,sampleSpecies,species
data.ps.logbook.SampleSpecies=comment,measuredCount,sampleSpeciesMeasure,sizeMeasureType,species,subSampleNumber,totalCount,startTime,endTime,startTime.short,endTime.short,generalTab
data.ps.logbook.SampleSpeciesMeasure=count,sizeClass
data.ps.logbook.TransmittingBuoy=comment,code,transmittingBuoyOwnership,transmittingBuoyType,transmittingBuoyOperation,country,vessel,latitude,longitude,quadrant
-data.ps.logbook.Well=well,wellVessel,wellFactory,wellSamplingConformity,wellSamplingStatus,generalTab,wellActivityTab,action.save,action.save.tip,wellVessel.short,wellFactory.short,wellAlternativeNumbering
+data.ps.logbook.Well=well,wellVessel,wellFactory,wellSamplingConformity,wellSamplingStatus,generalTab,wellActivityTab,action.save,action.save.tip,wellVessel.short,wellFactory.short,wellAlternativeNumbering,action.addActivitiesFromSample,action.addActivitiesFromSample.tip
data.ps.logbook.WellActivity=activity,wellActivitySpecies,computedTotalWeight,computedTotalWeight.short
data.ps.logbook.WellActivitySpecies=species,weight,weightCategory,count,setSpeciesNumber
data.ps.observation.Activity=date,coordinate,observedSystem.available,observedSystem.selected,comment,currentFpaZone,dataQuality,detectionMode,ersId,floatingObjectEmpty,latitude,longitude,nextFpaZone,nonTargetCatchSpecies,observedSystem,observedSystemDistance,previousFpaZone,quadrant,reasonForNoFishing,seaSurfaceTemperature,surroundingActivity,time,vesselActivity,vesselSpeed,wind,generalTab,error.no.activity.6,measurementsTab,observedSystemTab
=====================================
model/src/main/resources/META-INF/persistence/fr/ird/observe/entities/data/ps/common/Trip-sql-queries.properties
=====================================
@@ -93,6 +93,34 @@ INNER JOIN ps_logbook.activity a ON a.route = r.topiaId\
INNER JOIN ps_common.vesselActivity va ON a.vesselActivity = va.topiaId\
WHERE r.trip = ? AND va.allowSet = TRUE OR va.topiaId = 'fr.ird.referential.ps.common.VesselActivity#1464000000000#32'\
ORDER BY r.date,a.time
+LogbookWellIdsFromWellPlan.comment=Get all logbook well ids from well plan
+LogbookWellIdsFromWellPlan.parameter.1=tripId|java.lang.String
+LogbookWellIdsFromWellPlan=SELECT\
+DISTINCT(w.well)\
+FROM ps_logbook.well w\
+WHERE w.trip = ?
+LogbookActivityIdsFromWellPlan.comment=Get all logbook activity ids from well plan filtered on a trip and a Well.well
+LogbookActivityIdsFromWellPlan.parameter.1=tripId|java.lang.String
+LogbookActivityIdsFromWellPlan.parameter.2=wellId|java.lang.String
+LogbookActivityIdsFromWellPlan=SELECT\
+DISTINCT(wa.activity)\
+FROM ps_logbook.well w\
+INNER JOIN ps_logbook.wellActivity wa ON wa.well = w.topiaId\
+WHERE w.trip = ? AND w.well = ?
+LogbookWellIdsFromSample.comment=Get all logbook well ids from samples
+LogbookWellIdsFromSample.parameter.1=tripId|java.lang.String
+LogbookWellIdsFromSample=SELECT\
+DISTINCT(s.well)\
+FROM ps_logbook.Sample s\
+WHERE s.trip = ?
+LogbookActivityIdsFromSample.comment=Get all logbook activity ids from samples filtered on a Sample.well
+LogbookActivityIdsFromSample.parameter.1=tripId|java.lang.String
+LogbookActivityIdsFromSample.parameter.2=wellId|java.lang.String
+LogbookActivityIdsFromSample=SELECT\
+DISTINCT(sa.activity)\
+FROM ps_logbook.Sample s\
+INNER JOIN ps_logbook.sampleActivity sa ON sa.sample = s.topiaId\
+WHERE s.trip = ? AND s.well = ?
UpdateVersion.comment=Update trip version
UpdateVersion.parameter.1=lastUpdateDate|java.sql.Timestamp
UpdateVersion.parameter.2=tripId|java.lang.String
=====================================
server/core/src/main/filtered-resources/META-INF/mapping-api-client.wm
=====================================
@@ -141,7 +141,11 @@ GET /data/ps/AvdthService/importData data
POST /data/ps/ConsolidateDataService/consolidateLocalmarketBatch data.ps.ConsolidateDataServiceRestApi.consolidateLocalmarketBatch
POST /data/ps/ConsolidateDataService/consolidateTrip data.ps.ConsolidateDataServiceRestApi.consolidateTrip
GET /data/ps/ConsolidateDataService/newSimplifiedObjectTypeManager data.ps.ConsolidateDataServiceRestApi.newSimplifiedObjectTypeManager
+POST /data/ps/common/TripService/createLogbookSampleActivityFromWellPlan data.ps.common.TripServiceRestApi.createLogbookSampleActivityFromWellPlan
+POST /data/ps/common/TripService/createLogbookWellActivityFromSample data.ps.common.TripServiceRestApi.createLogbookWellActivityFromSample
GET /data/ps/common/TripService/getAllTripIds data.ps.common.TripServiceRestApi.getAllTripIds
+GET /data/ps/common/TripService/getLogbookWellIdsFromSample data.ps.common.TripServiceRestApi.getLogbookWellIdsFromSample
+GET /data/ps/common/TripService/getLogbookWellIdsFromWellPlan data.ps.common.TripServiceRestApi.getLogbookWellIdsFromWellPlan
GET /data/ps/common/TripService/getLogbookWellPlanActivities data.ps.common.TripServiceRestApi.getLogbookWellPlanActivities
GET /data/ps/common/TripService/getMatchingTripsVesselWithinDateRange data.ps.common.TripServiceRestApi.getMatchingTripsVesselWithinDateRange
GET /data/ps/common/TripService/getSpeciesByListAndTrip data.ps.common.TripServiceRestApi.getSpeciesByListAndTrip
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/fb92220ff621d9321d0e50c0…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/fb92220ff621d9321d0e50c0…
You're receiving this email because of your account on gitlab.com.
1
0