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
July 2019
- 1 participants
- 106 discussions
[Git][ultreiaio/ird-observe][develop-9] 9 commits: update changelog [skip ci]
by Tony CHEMIT 04 Jul '19
by Tony CHEMIT 04 Jul '19
04 Jul '19
Tony CHEMIT pushed to branch develop-9 at ultreiaio / ird-observe
Commits:
48360a56 by tchemit at 2019-07-04T11:47:23Z
update changelog [skip ci]
- - - - -
99130ed8 by tchemit at 2019-07-04T11:47:36Z
Réorganisation des données d’observation PS - Réorganisation des captures et échantillons de cible et bycatch observés - See #1254
- - - - -
460f45b4 by tchemit at 2019-07-04T11:47:36Z
Move to new version 9.0-alpha-1
- - - - -
b37b3480 by tchemit at 2019-07-04T11:47:36Z
Réorganisation des données d’observation PS - Re localisation dans la hiérarchie - Closes #1252
- - - - -
f5459f56 by tchemit at 2019-07-04T11:47:36Z
Module 2 (first flush)
- - - - -
c3d51d7c by tchemit at 2019-07-04T11:47:37Z
[PS] Contenu des onglets spécifiques observations et logbooks et le formulaire marée - See #1300
- - - - -
acae5eac by tchemit at 2019-07-04T11:47:37Z
Module 2 - second flush
- - - - -
b1c0b1ab by tchemit at 2019-07-04T11:47:37Z
Report from v8 for ps logbook model
- - - - -
68507a16 by tchemit at 2019-07-04T11:47:37Z
Choix de nouvelles couleurs pour les symboles de la carte LL - Closes #1293
- - - - -
30 changed files:
- .mvn/gitlab-cache/milestones/898778-issues.json
- .mvn/gitlab-cache/milestones/916804-issues.json
- .mvn/gitlab-cache/milestones/916804.json
- .mvn/pom.gitflow.develop
- .mvn/pom.gitflow.master
- CHANGELOG.md
- client-configuration/.mvn/pom.gitflow.develop
- client-configuration/.mvn/pom.gitflow.master
- client-configuration/pom.xml
- client-configuration/src/main/config/Client.ini
- client-configuration/src/main/i18n/getters/config.getter
- client-configuration/src/main/i18n/getters/java-enumeration.getter
- client-configuration/src/main/i18n/getters/java.getter
- client-core/.mvn/pom.gitflow.develop
- client-core/.mvn/pom.gitflow.master
- client-core/pom.xml
- client-core/src/main/dcp-presets/ps/logbook/01-deployment-preset.yml
- client-core/src/main/dcp-presets/ps/logbook/02-removal-preset.yml
- client-core/src/main/dcp-presets/ps/logbook/03-update-preset.yml
- client-core/src/main/dcp-presets/ps/logbook/04-abandonned-preset.yml
- client-core/src/main/dcp-presets/ps/observation/01-deployment-preset.yml
- client-core/src/main/dcp-presets/ps/observation/02-removal-preset.yml
- client-core/src/main/dcp-presets/ps/observation/03-update-preset.yml
- client-core/src/main/i18n/getters/java.getter
- client-core/src/main/i18n/getters/jaxx.getter
- client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java
- client-core/src/main/java/fr/ird/observe/client/navigation/RouteCloseCallback.java
- client-core/src/main/java/fr/ird/observe/client/ui/ObserveMainUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/ObserveMainUI.jcss
- + client-core/src/main/java/fr/ird/observe/client/ui/actions/content/data/ps/ChooseRelatedObservedActivityUIAction.java
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/0f863f8be9b81ad615655b5aa0…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/0f863f8be9b81ad615655b5aa0…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] [PS][FAD] Gestion visuelle de la hiérarchie des matériaux sélectionnée - Closes #1323
by Tony CHEMIT 04 Jul '19
by Tony CHEMIT 04 Jul '19
04 Jul '19
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
34e5df83 by tchemit at 2019-07-04T11:26:30Z
[PS][FAD] Gestion visuelle de la hiérarchie des matériaux sélectionnée - Closes #1323
- - - - -
9 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/ui/content/data/ps/observation/dcp/FloatingObjectPartsTableCellRenderer.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/dcp/FloatingObjectPartsTreeNode.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/dcp/FloatingObjectPartsTreeTable.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/dcp/FloatingObjectPartsTreeTableModel.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
Changes:
=====================================
client-configuration/src/main/config/Client.ini
=====================================
@@ -608,6 +608,12 @@ key = ui.dcp.error.color
type = color
defaultValue = java.awt.Color[r=255,g=100,b=100]
+[option floatingObjectMaterialNotEditableColor]
+description = observe.config.ui.dcp.not.editable.color
+key = ui.dcp.not.editable.color
+type = color
+defaultValue = java.awt.Color[r=193,g=250,b=250]
+
[option showMnemonic]
description = observe.config.ui.showMnemonic
key = ui.showMnemonic
=====================================
client-configuration/src/main/i18n/getters/config.getter
=====================================
@@ -91,6 +91,7 @@ observe.config.temperature.format
observe.config.ui.autoPopupNumberEditor
observe.config.ui.changeSynchroSrc
observe.config.ui.dcp.error.color
+observe.config.ui.dcp.not.editable.color
observe.config.ui.focusBorderColor
observe.config.ui.fullscreen
observe.config.ui.loadLocalStorage
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/dcp/FloatingObjectPartsTableCellRenderer.java
=====================================
@@ -60,7 +60,7 @@ public class FloatingObjectPartsTableCellRenderer implements TableCellRenderer {
Objects.requireNonNull(node);
TableCellRenderer renderer = objectRenderer;
Object newValue = value;
- boolean enabled = node.isEditable() && table.isCellEditable(row, column) && node.isEnabled();
+ boolean enabled = node.isEditable() && table.isCellEditable(row, column) && node.isEnabled(column);
if (node.isBoolean()) {
if (node.isColumnEditable(column)) {
newValue = value == null ? null : Boolean.valueOf(String.valueOf(value));
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/dcp/FloatingObjectPartsTreeNode.java
=====================================
@@ -98,10 +98,10 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
@Override
public boolean isEditable(int column) {
- return column > 0 && getUserObject().enabled && getUserObject().editable && isColumnEditable(column);
+ return column > 0 && isEnabled(column) && getUserObject().editable && isColumnEditable(column);
}
- public boolean isColumnEditable(int column) {
+ boolean isColumnEditable(int column) {
return getUserObject().isColumnEditable(column);
}
@@ -132,6 +132,17 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
public boolean isEnabled() {
return getUserObject().enabled;
}
+ public boolean isEnabled(int column) {
+ boolean result = getUserObject().enabled;
+ if (result) {
+ if (column==1) {
+ result = isRealEnabledOnArriving();
+ } else if (column==2) {
+ result = isRealEnabledOnLeaving();
+ }
+ }
+ return result;
+ }
public String getId() {
return getUserObject().dto.getId();
@@ -178,6 +189,38 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
return (FloatingObjectPartsTreeNode) super.getParent();
}
+ boolean isRealEnabledOnArriving() {
+ return getUserObject().isRealEnabledOnArriving();
+ }
+
+ boolean isRealEnabledOnLeaving() {
+ return getUserObject().isRealEnabledOnLeaving();
+ }
+
+ void setRealEnabledOnArriving(boolean realEnabled) {
+ FloatingObjectPartsTreeNode parent = getParent();
+ if (parent != null) {
+ if (realEnabled) {
+ parent.getUserObject().decSelectedChildCountOnArriving();
+ } else {
+ parent.getUserObject().incSelectedChildCountOnArriving();
+ }
+ parent.setRealEnabledOnArriving(realEnabled);
+ }
+ }
+
+ void setRealEnabledOnLeaving(boolean realEnabled) {
+ FloatingObjectPartsTreeNode parent = getParent();
+ if (parent != null) {
+ if (realEnabled) {
+ parent.getUserObject().decSelectedChildCountOnLeaving();
+ } else {
+ parent.getUserObject().incSelectedChildCountOnLeaving();
+ }
+ parent.setRealEnabledOnLeaving(realEnabled);
+ }
+ }
+
ImmutableSet<FloatingObjectPartsTreeNode> getShell() {
ImmutableSet.Builder<FloatingObjectPartsTreeNode> allNodesBuilder = ImmutableSet.builder();
@@ -192,7 +235,7 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
}
}
- boolean withMandatoryConstraintsOnChildren() {
+ public boolean withMandatoryConstraintsOnChildren() {
ObjectMaterialHierarchyDto userObject = getUserObject().dto;
return userObject == null || userObject.isChildSelectionMandatory();
}
@@ -212,18 +255,6 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
}
- private FloatingObjectPartsTreeNode getFirstAncestorNeedOneSelection(int column) {
- if (withMandatoryConstraintsOnChildren()) {
- if (parent == null) {
- return this;
- }
- if (withValue(column)) {
- return this;
- }
- }
- return getParent().getFirstAncestorNeedOneSelection(column);
- }
-
void computeMandatoryValidState(boolean whenArriving, boolean whenLeaving) {
FloatingObjectPartsTreeNodeContext userObject = getUserObject();
FloatingObjectPartsTreeNode parent = getParent();
@@ -247,19 +278,26 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
}
}
-// void computeFormulaValidState(boolean whenArriving, boolean whenLeaving) {
-// FloatingObjectPartsTreeNodeContext userObject = getUserObject();
-// ObjectMaterialHierarchyDto dto = Objects.requireNonNull(userObject.dto);
-// if (whenArriving && userObject.validWhenArriving) {
-// Object value = userObject.getValueAt(1);
-// userObject.validWhenArriving = dto.isValid(value);
-// }
-// if (whenLeaving && userObject.validWhenLeaving) {
-// Object value = userObject.getValueAt(2);
-// userObject.validWhenLeaving = dto.isValid(value);
-// }
-//
-// }
+ void computeValidationValidState() {
+ getUserObject().computeValidationValidState();
+ }
+
+ void resetRealEnabled() {
+ getUserObject().selectedChildCountOnArriving = 0;
+ getUserObject().selectedChildCountOnLeaving = 0;
+ }
+
+ private FloatingObjectPartsTreeNode getFirstAncestorNeedOneSelection(int column) {
+ if (withMandatoryConstraintsOnChildren()) {
+ if (parent == null) {
+ return this;
+ }
+ if (withValue(column)) {
+ return this;
+ }
+ }
+ return getParent().getFirstAncestorNeedOneSelection(column);
+ }
private void setCompanions(ImmutableSet.Builder<FloatingObjectPartsTreeNode> companionsBuilder) {
if (companionsBuilder != null) {
@@ -308,10 +346,6 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
return dto != null && !dto.isChildrenMultiSelectable() && !isLeaf();
}
- public void computeValidationValidState() {
- getUserObject().computeValidationValidState();
- }
-
//TODO Improve the design, we should not store anything in uiModel and separate leaving and arriving data
private static class FloatingObjectPartsTreeNodeContext {
@@ -319,7 +353,7 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
private final FloatingObjectUIModel uiModel;
// dto (null for root)
private final ObjectMaterialHierarchyDto dto;
- // Is the node is enabled (hierarchic value) ?
+ // Is the node is enabled (from hierarchic value) ?
private final boolean enabled;
// Is this node editable ?
private final boolean editable;
@@ -327,6 +361,7 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
private final boolean exclusive;
// Is the node use validation on his value ?
private final boolean useValidation;
+ // Referential locale to decorate
private final ReferentialLocale referentialLocale;
// Is this node (on arriving) need at least one child selected ? (if editable then node must be selected)
private boolean needOneSelectionOnLeaving;
@@ -344,6 +379,9 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
private ImmutableSet<FloatingObjectPartsTreeNode> companions;
// Internal to store debug node text
private String text;
+ // Count of children selected (if none is selected then the node can be edited (from GUI if a child is selected then any parent node is not enabled) ?
+ private int selectedChildCountOnArriving = 0;
+ private int selectedChildCountOnLeaving = 0;
FloatingObjectPartsTreeNodeContext(FloatingObjectUIModel uiModel) {
this.uiModel = Objects.requireNonNull(uiModel);
@@ -431,7 +469,7 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
return text;
}
- public void computeValidationValidState() {
+ void computeValidationValidState() {
if (uiModel.isArriving()) {
Object value = uiModel.getWhenArriving(dto.getId());
valueValidOnArriving = dto.isValid(value);
@@ -441,5 +479,29 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
valueValidOnLeaving = dto.isValid(value);
}
}
+
+ boolean isRealEnabledOnArriving() {
+ return selectedChildCountOnArriving == 0;
+ }
+
+ void incSelectedChildCountOnArriving() {
+ this.selectedChildCountOnArriving++;
+ }
+
+ void decSelectedChildCountOnArriving() {
+ this.selectedChildCountOnArriving--;
+ }
+
+ boolean isRealEnabledOnLeaving() {
+ return selectedChildCountOnLeaving == 0;
+ }
+
+ void incSelectedChildCountOnLeaving() {
+ this.selectedChildCountOnLeaving++;
+ }
+
+ void decSelectedChildCountOnLeaving() {
+ this.selectedChildCountOnLeaving--;
+ }
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/dcp/FloatingObjectPartsTreeTable.java
=====================================
@@ -83,6 +83,7 @@ public class FloatingObjectPartsTreeTable extends JXTreeTable {
FloatingObjectPartsTreeTableModel treeTableModel = getTreeTableModel();
treeTableModel.reset(true);
+ treeTableModel.computeRealEnabledState();
if (expandTree) {
expandAll();
@@ -172,6 +173,24 @@ public class FloatingObjectPartsTreeTable extends JXTreeTable {
return true;
}, ObserveSwingApplicationContext.get().getConfig().getFloatingObjectMaterialErrorColor(), Color.WHITE));
+ addHighlighter(new ColorHighlighter((renderer, adapter) -> {
+ JXTreeTable component = (JXTreeTable) adapter.getComponent();
+ int row = adapter.convertRowIndexToModel(adapter.row);
+ FloatingObjectPartsTreeNode node = (FloatingObjectPartsTreeNode) component.getPathForRow(row).getLastPathComponent();
+ boolean realEnabled1 = node.isRealEnabledOnArriving();
+ boolean realEnabled2 = node.isRealEnabledOnLeaving();
+ boolean nodeEditable = node.isEditable();
+ switch (adapter.convertRowIndexToModel(adapter.column)) {
+ case 0:
+ return false;
+ case 1:
+ return model.isArriving() && nodeEditable && !realEnabled1;
+ case 2:
+ return model.isLeaving() && nodeEditable && !realEnabled2;
+ }
+ return true;
+ }, ObserveSwingApplicationContext.get().getConfig().getFloatingObjectMaterialNotEditableColor(), Color.BLACK));
+
InputMap inputMap = getInputMap(WHEN_IN_FOCUSED_WINDOW);
ActionMap actionMap = getActionMap();
inputMap.put(ObserveKeyStrokes.KEY_STROKE_EXPAND_TREE_TABLE_NODE,"expandNode");
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/dcp/FloatingObjectPartsTreeTableModel.java
=====================================
@@ -24,6 +24,7 @@ package fr.ird.observe.client.ui.content.data.ps.observation.dcp;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.client.ui.content.data.ps.observation.FloatingObjectUIModel;
+import fr.ird.observe.dto.IdDto;
import fr.ird.observe.dto.data.ps.observation.ObjectMaterialHierarchyDto;
import io.ultreia.java4all.i18n.I18n;
import org.apache.logging.log4j.LogManager;
@@ -33,6 +34,8 @@ import org.jdesktop.swingx.treetable.TreeTableNode;
import java.util.Arrays;
import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
/**
* Created by tchemit on 05/08/17.
@@ -81,7 +84,6 @@ public class FloatingObjectPartsTreeTableModel extends DefaultTreeTableModel {
continue;
}
mandatoryNodesBuilder.add(node);
-
if (node.withMandatoryConstraintsOnChildren()) {
needOneSelectionNodesBuilder.add(node);
}
@@ -123,6 +125,13 @@ public class FloatingObjectPartsTreeTableModel extends DefaultTreeTableModel {
previousNode.ifPresent(p -> log.info("Previous selected node: " + p));
super.setValueAt(value, node, column);
previousNode.ifPresent(t -> super.setValueAt(null, t, column));
+ boolean realEnabled = !"true".equals(value);
+ log.info(String.format("Real enabled? %s", realEnabled));
+ if (column == 1) {
+ treeNode.setRealEnabledOnArriving(realEnabled);
+ } else if (column == 2) {
+ treeNode.setRealEnabledOnLeaving(realEnabled);
+ }
if (adjusting) {
return;
}
@@ -146,6 +155,20 @@ public class FloatingObjectPartsTreeTableModel extends DefaultTreeTableModel {
uiModel.getBean().setMaterialsValid(!notValid);
}
+ public void computeRealEnabledState() {
+ Set<String> whenArriving = uiModel.getWhenArriving().keySet().stream().map(IdDto::getId).collect(Collectors.toSet());
+ Set<String> whenLeaving = uiModel.getWhenLeaving().keySet().stream().map(IdDto::getId).collect(Collectors.toSet());
+ allNodes.forEach(FloatingObjectPartsTreeNode::resetRealEnabled);
+ for (FloatingObjectPartsTreeNode node : allNodes) {
+ if (whenArriving.contains(node.getId())) {
+ node.setRealEnabledOnArriving(false);
+ }
+ if (whenLeaving.contains(node.getId())) {
+ node.setRealEnabledOnLeaving(false);
+ }
+ }
+ }
+
public boolean isAdjusting() {
return adjusting;
}
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -2706,6 +2706,7 @@ observe.config.temperature.format=Default temperature format
observe.config.ui.autoPopupNumberEditor=Flag sets to true when number editor show automaticly popup
observe.config.ui.changeSynchroSrc=Flag sets to true if you can change local source in admin tasks
observe.config.ui.dcp.error.color=Color to notify errors while validating floating object materials.
+observe.config.ui.dcp.not.editable.color=Color to notify not editable floating object material nodes.
observe.config.ui.focusBorderColor=Color of the focus container border
observe.config.ui.fullscreen=Flag sets to true to lauch application in full screen mode
observe.config.ui.loadLocalStorage=Flag sets to true to load local data source when application starts
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -2706,6 +2706,7 @@ observe.config.temperature.format=Unidad de temperatura
observe.config.ui.autoPopupNumberEditor=Para mostrar automáticamente el editor numérico durante la edición de un número
observe.config.ui.changeSynchroSrc=Para autorizar la seleción de la base fuente durante las operaciones sobre la base
observe.config.ui.dcp.error.color=Color para notificar los errores sobre la composición de dcps
+observe.config.ui.dcp.not.editable.color=Color to notify not editable floating object material nodes \#TODO
observe.config.ui.focusBorderColor=Color del borde de la zona que tiene el foco
observe.config.ui.fullscreen=Para mostrar la aplicación en modo pantalla completa
observe.config.ui.loadLocalStorage=Cargar la base local al iniciar la aplicación
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -2706,6 +2706,7 @@ observe.config.temperature.format=Unité de température
observe.config.ui.autoPopupNumberEditor=Pour afficher automatiquement l'éditeur numérique lors de l'édition d'un nombre
observe.config.ui.changeSynchroSrc=Pour autoriser la sélection de la base source dans les opérations sur base
observe.config.ui.dcp.error.color=Couleur pour notifier les erreurs sur la composition des dcps
+observe.config.ui.dcp.not.editable.color=Couleur pour notifier les nœuds non éditables dans l'arbre des matériaux de dcp.
observe.config.ui.focusBorderColor=Couleur de la bordure de la zone qui a le focus
observe.config.ui.fullscreen=Pour afficher l'application en mode pleine écran
observe.config.ui.loadLocalStorage=Charger la base locale au démarrage de l'application
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/34e5df832d773ea7a01a426ca1f…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/34e5df832d773ea7a01a426ca1f…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-9] 15 commits: update changelog [skip ci]
by Tony CHEMIT 04 Jul '19
by Tony CHEMIT 04 Jul '19
04 Jul '19
Tony CHEMIT pushed to branch develop-9 at ultreiaio / ird-observe
Commits:
ee1758ad by tchemit at 2019-07-02T07:53:18Z
update changelog [skip ci]
- - - - -
c5872151 by tchemit at 2019-07-02T08:14:45Z
update libs before release
- - - - -
21b7dfb2 by tchemit at 2019-07-02T09:18:12Z
N° de versions mentionnés par l'assistant migration - Closes #1330
- - - - -
86710b87 by tchemit at 2019-07-02T09:51:53Z
On ne peut pas sauvegarder une configuration d'un serveur distant en mode admin - Closes #1340
- - - - -
60687e47 by tchemit at 2019-07-03T15:52:36Z
update changelog [skip ci]
- - - - -
7c5335b3 by tchemit at 2019-07-03T16:07:57Z
[REFERENTIEL] La validation sur les Objets flottant matériaux ne fonctionnent plus :( - Closes #1339
- - - - -
34e5df83 by tchemit at 2019-07-04T11:26:30Z
[PS][FAD] Gestion visuelle de la hiérarchie des matériaux sélectionnée - Closes #1323
- - - - -
e2b61ac5 by tchemit at 2019-07-04T11:26:44Z
Réorganisation des données d’observation PS - Réorganisation des captures et échantillons de cible et bycatch observés - See #1254
- - - - -
78e72436 by tchemit at 2019-07-04T11:26:44Z
Move to new version 9.0-alpha-1
- - - - -
5384c8b5 by tchemit at 2019-07-04T11:26:44Z
Réorganisation des données d’observation PS - Re localisation dans la hiérarchie - Closes #1252
- - - - -
53ab9209 by tchemit at 2019-07-04T11:26:45Z
Module 2 (first flush)
- - - - -
7f7a7398 by tchemit at 2019-07-04T11:26:45Z
[PS] Contenu des onglets spécifiques observations et logbooks et le formulaire marée - See #1300
- - - - -
9b4eb1cd by tchemit at 2019-07-04T11:42:22Z
Module 2 - second flush
- - - - -
c8824c59 by tchemit at 2019-07-04T11:42:24Z
Report from v8 for ps logbook model
- - - - -
0f863f8b by tchemit at 2019-07-04T11:42:24Z
Choix de nouvelles couleurs pour les symboles de la carte LL - Closes #1293
- - - - -
30 changed files:
- + .mvn/gitlab-cache/milestones/898778-artifacts.json
- .mvn/gitlab-cache/milestones/898778-issues.json
- .mvn/gitlab-cache/milestones/898778.json
- + .mvn/gitlab-cache/milestones/921497-issues.json
- + .mvn/gitlab-cache/milestones/921497.json
- .mvn/pom.gitflow.develop
- .mvn/pom.gitflow.master
- CHANGELOG.md
- client-configuration/.mvn/pom.gitflow.develop
- client-configuration/.mvn/pom.gitflow.master
- client-configuration/pom.xml
- client-configuration/src/main/config/Client.ini
- client-configuration/src/main/i18n/getters/config.getter
- client-configuration/src/main/i18n/getters/java-enumeration.getter
- client-configuration/src/main/i18n/getters/java.getter
- client-core/.mvn/pom.gitflow.develop
- client-core/.mvn/pom.gitflow.master
- client-core/pom.xml
- client-core/src/main/dcp-presets/ps/logbook/01-deployment-preset.yml
- client-core/src/main/dcp-presets/ps/logbook/02-removal-preset.yml
- client-core/src/main/dcp-presets/ps/logbook/03-update-preset.yml
- client-core/src/main/dcp-presets/ps/logbook/04-abandonned-preset.yml
- client-core/src/main/dcp-presets/ps/observation/01-deployment-preset.yml
- client-core/src/main/dcp-presets/ps/observation/02-removal-preset.yml
- client-core/src/main/dcp-presets/ps/observation/03-update-preset.yml
- client-core/src/main/i18n/getters/java.getter
- client-core/src/main/i18n/getters/jaxx.getter
- client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java
- client-core/src/main/java/fr/ird/observe/client/navigation/RouteCloseCallback.java
- client-core/src/main/java/fr/ird/observe/client/ui/ObserveMainUI.jaxx
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/b3b511a6264dbcedfca3bba562…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/b3b511a6264dbcedfca3bba562…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 2 commits: update changelog [skip ci]
by Tony CHEMIT 04 Jul '19
by Tony CHEMIT 04 Jul '19
04 Jul '19
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
60687e47 by tchemit at 2019-07-03T15:52:36Z
update changelog [skip ci]
- - - - -
7c5335b3 by tchemit at 2019-07-03T16:07:57Z
[REFERENTIEL] La validation sur les Objets flottant matériaux ne fonctionnent plus :( - Closes #1339
- - - - -
5 changed files:
- .mvn/gitlab-cache/milestones/898778-issues.json
- CHANGELOG.md
- dto/src/main/java/fr/ird/observe/dto/referential/ps/observation/ObjectMaterialDto.java
- pom.xml
- test/src/main/resources/fixtures/validate-service-referential.properties
Changes:
=====================================
.mvn/gitlab-cache/milestones/898778-issues.json
=====================================
@@ -55,7 +55,7 @@
"totalTimeSpent": 0
},
"state": "closed",
- "updatedAt": "Jul 2, 2019 9:38:33 AM",
+ "updatedAt": "Jul 2, 2019 11:19:47 AM",
"createdAt": "May 22, 2019 11:52:43 AM",
"closedAt": "Jun 29, 2019 9:14:19 PM",
"webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1293"
@@ -170,7 +170,7 @@
"_external": false,
"_avatarUrl": "https://secure.gravatar.com/avatar/b4ae117bd93e10d96298fa4d885208ea?s\u003d…"
},
- "userNotesCount": 3,
+ "userNotesCount": 4,
"upVotes": 0,
"downVotes": 0,
"confidential": false,
@@ -179,7 +179,7 @@
"totalTimeSpent": 0
},
"state": "closed",
- "updatedAt": "Jun 12, 2019 1:00:39 PM",
+ "updatedAt": "Jul 2, 2019 11:19:45 AM",
"createdAt": "Jun 12, 2019 12:54:12 PM",
"closedAt": "Jun 12, 2019 12:59:20 PM",
"webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1330"
@@ -245,6 +245,66 @@
"closedAt": "Jun 28, 2019 5:52:13 PM",
"webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1145"
},
+ {
+ "id": 22439064,
+ "iid": 1340,
+ "projectId": 2722779,
+ "title": "On ne peut pas sauvegarder une configuration d\u0027un serveur distant en mode admin",
+ "description": "## Quelle est la cause de bogue ?\n\nLancer une opération d\u0027administration d\u0027un serveur et essayer d\u0027enregistrer une nouvelle configuration.\n\n## Logs\n\n```\nINFO 2019-07-02T11:42:49,449 [AWT-EventQueue-0] SaveCurrentServerConfigurationUIAction : 110 - Will add server configuration: demo-9\nException in thread \"AWT-EventQueue-0\" java.lang.NullPointerException\n\tat fr.ird.observe.client.ui.actions.storage.SaveCurrentServerConfigurationUIAction.doActionPerformed(SaveCurrentServerConfigurationUIAction.java:119)\n\tat fr.ird.observe.client.ui.actions.main.menu.MenuActionSupport.actionPerformed(MenuActionSupport.java:62)\n\tat javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)\n\tat javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)\n\tat javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)\n\tat javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)\n\tat javax.swing.AbstractButton.doClick(AbstractButton.java:376)\n\tat javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842)\n\tat javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886)\n\tat java.awt.Component.processMouseEvent(Component.java:6539)\n\tat javax.swing.JComponent.processMouseEvent(JComponent.java:3324)\n\tat java.awt.Component.processEvent(Component.java:6304)\n\tat java.awt.Container.processEvent(Container.java:2239)\n\tat java.awt.Component.dispatchEventImpl(Component.java:4889)\n\tat java.awt.Container.dispatchEventImpl(Container.java:2297)\n\tat java.awt.Component.dispatchEvent(Component.java:4711)\n\tat java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)\n\tat java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)\n\tat java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)\n\tat java.awt.Container.dispatchEventImpl(Container.java:2283)\n\tat java.awt.Window.dispatchEventImpl(Window.java:2746)\n\tat java.awt.Component.dispatchEvent(Component.java:4711)\n\tat java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)\n\tat java.awt.EventQueue.access$500(EventQueue.java:97)\n\tat java.awt.EventQueue$3.run(EventQueue.java:709)\n\tat java.awt.EventQueue$3.run(EventQueue.java:703)\n\tat java.security.AccessController.doPrivileged(Native Method)\n\tat java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)\n\tat java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)\n\tat java.awt.EventQueue$4.run(EventQueue.java:733)\n\tat java.awt.EventQueue$4.run(EventQueue.java:731)\n\tat java.security.AccessController.doPrivileged(Native Method)\n\tat java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)\n\tat java.awt.EventQueue.dispatchEvent(EventQueue.java:730)\n\tat java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)\n\tat java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)\n\tat java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)\n\tat java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)\n\tat java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)\n\tat java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)\n\tat java.awt.EventQueue.access$500(EventQueue.java:97)\n\tat java.awt.EventQueue$3.run(EventQueue.java:709)\n\tat java.awt.EventQueue$3.run(EventQueue.java:703)\n\tat java.security.AccessController.doPrivileged(Native Method)\n\tat java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)\n\tat java.awt.EventQueue.dispatchEvent(EventQueue.java:728)\n\tat java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)\n\tat java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)\n\tat java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)\n\tat java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)\n\tat java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)\n\tat java.awt.EventDispatchThread.run(EventDispatchThread.java:82)\n\n```",
+ "labels": [
+ "Anomalie",
+ "IRD-2018-01-V8"
+ ],
+ "milestone": {
+ "id": 898778,
+ "iid": 143,
+ "projectId": 2722779,
+ "groupId": 0,
+ "title": "8.0-RC-3",
+ "description": "",
+ "dueDate": "Jul 2, 2019 2:00:00 AM",
+ "state": "closed"
+ },
+ "assignees": [
+ {
+ "_id": 166231,
+ "_username": "tchemit",
+ "_name": "Tony CHEMIT",
+ "_state": "active",
+ "_external": false,
+ "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…"
+ }
+ ],
+ "assignee": {
+ "_id": 166231,
+ "_username": "tchemit",
+ "_name": "Tony CHEMIT",
+ "_state": "active",
+ "_external": false,
+ "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…"
+ },
+ "author": {
+ "_id": 166231,
+ "_username": "tchemit",
+ "_name": "Tony CHEMIT",
+ "_state": "active",
+ "_external": false,
+ "_avatarUrl": "https://secure.gravatar.com/avatar/2a915aa9a1df35c8b609ff2f750d5dac?s\u003d…"
+ },
+ "userNotesCount": 0,
+ "upVotes": 0,
+ "downVotes": 0,
+ "confidential": true,
+ "timeStats": {
+ "timeEstimate": 0,
+ "totalTimeSpent": 0
+ },
+ "state": "closed",
+ "updatedAt": "Jul 2, 2019 11:52:36 AM",
+ "createdAt": "Jul 2, 2019 11:45:16 AM",
+ "closedAt": "Jul 2, 2019 11:52:36 AM",
+ "webUrl": "https://gitlab.com/ultreiaio/ird-observe/issues/1340"
+ },
{
"id": 21873545,
"iid": 1333,
=====================================
CHANGELOG.md
=====================================
@@ -1,7 +1,7 @@
# ObServe changelog
* Author [Tony Chemit](mailto:dev@tchemit.fr)
- * Last generated at 2019-07-02 09:52.
+ * Last generated at 2019-07-02 11:53.
## Version [8.0-RC-3](https://gitlab.com/ultreiaio/ird-observe/milestones/143)
@@ -15,6 +15,7 @@
* [[Anomalie 1326]](https://gitlab.com/ultreiaio/ird-observe/issues/1326) **[PS FOB Buoys] Revoir cet écran** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT)
* [[Anomalie 1330]](https://gitlab.com/ultreiaio/ird-observe/issues/1330) **N° de versions mentionnés par l'assistant migration** (Thanks to Tony CHEMIT) (Reported by Pascal Cauquil)
* [[Anomalie 1331]](https://gitlab.com/ultreiaio/ird-observe/issues/1331) **Assistant création de base PG échoue** (Thanks to Tony CHEMIT) (Reported by Pascal Cauquil)
+ * [[Anomalie 1340]](https://gitlab.com/ultreiaio/ird-observe/issues/1340) **On ne peut pas sauvegarder une configuration d'un serveur distant en mode admin** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT)
* [[Evolution 1145]](https://gitlab.com/ultreiaio/ird-observe/issues/1145) **L'assistant migration via serveur pourrait refuser de continuer si l'utilisateur n'est pas assez acrédité** (Thanks to Tony CHEMIT) (Reported by Pascal Cauquil)
* [[Evolution 1293]](https://gitlab.com/ultreiaio/ird-observe/issues/1293) **Choix de nouvelles couleurs pour les symboles de la carte LL** (Thanks to Pascal Cauquil) (Reported by Pascal Cauquil)
* [[Evolution 1321]](https://gitlab.com/ultreiaio/ird-observe/issues/1321) **[PS FOB] Mise en place des nouvelles templates de FOB** (Thanks to Tony CHEMIT) (Reported by Tony CHEMIT)
=====================================
dto/src/main/java/fr/ird/observe/dto/referential/ps/observation/ObjectMaterialDto.java
=====================================
@@ -48,7 +48,15 @@ public class ObjectMaterialDto extends GeneratedObjectMaterialDto {
@Override
public void setValidation(String validation) {
super.setValidation(validation);
- boolean result = FormulaHelper.validateObjectMaterialValidation(validation, 10);
+ Object value = "10";
+ if (isBoolean()) {
+ value = Boolean.TRUE;
+ } else if (isInteger()) {
+ value = 10;
+ }else if (isFloat()) {
+ value = 10f;
+ }
+ boolean result = FormulaHelper.validateObjectMaterialValidationSyntax(validation, value);
setValidationValid(result);
}
=====================================
pom.xml
=====================================
@@ -156,7 +156,7 @@
<maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
<buildDate>${maven.build.timestamp}</buildDate>
- <observeToolkitVersion>4.14</observeToolkitVersion>
+ <observeToolkitVersion>4.15-SNAPSHOT</observeToolkitVersion>
<lib.version.nuiton.validation>3.1</lib.version.nuiton.validation>
<!--can't use 1.4.197 (date has changed + blob also)-->
<lib.version.h2>1.4.196</lib.version.h2>
=====================================
test/src/main/resources/fixtures/validate-service-referential.properties
=====================================
@@ -80,7 +80,7 @@ SpeciesFateDto=3
WindDto=1
SpeciesStatusDto=3
VesselActivityLonglineDto=2
-ObjectMaterialDto=10
+ObjectMaterialDto=9
LineTypeDto=3
ProgramDto=9
BaitTypeDto=3
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/86710b87afec9625c78bb52433…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/86710b87afec9625c78bb52433…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [PS][FAD] Gestion visuelle de la hiérarchie des matériaux sélectionnée - Closes #1323
by Tony CHEMIT 04 Jul '19
by Tony CHEMIT 04 Jul '19
04 Jul '19
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
18b5e375 by tchemit at 2019-07-04T11:08:01Z
[PS][FAD] Gestion visuelle de la hiérarchie des matériaux sélectionnée - Closes #1323
- - - - -
9 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/ui/content/data/seine/dcp/FloatingObjectPartsTableCellRenderer.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/seine/dcp/FloatingObjectPartsTreeNode.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/seine/dcp/FloatingObjectPartsTreeTable.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/seine/dcp/FloatingObjectPartsTreeTableModel.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
Changes:
=====================================
client-configuration/src/main/config/Client.ini
=====================================
@@ -537,6 +537,12 @@ key = ui.dcp.error.color
type = color
defaultValue = java.awt.Color[r=255,g=100,b=100]
+[option floatingObjectMaterialNotEditableColor]
+description = observe.config.ui.dcp.not.editable.color
+key = ui.dcp.not.editable.color
+type = color
+defaultValue = java.awt.Color[r=193,g=250,b=250]
+
[option showMnemonic]
description = observe.config.ui.showMnemonic
key = ui.showMnemonic
=====================================
client-configuration/src/main/i18n/getters/config.getter
=====================================
@@ -80,6 +80,7 @@ observe.config.temperature.format
observe.config.ui.autoPopupNumberEditor
observe.config.ui.changeSynchroSrc
observe.config.ui.dcp.error.color
+observe.config.ui.dcp.not.editable.color
observe.config.ui.focusBorderColor
observe.config.ui.fullscreen
observe.config.ui.loadLocalStorage
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/data/seine/dcp/FloatingObjectPartsTableCellRenderer.java
=====================================
@@ -60,7 +60,7 @@ public class FloatingObjectPartsTableCellRenderer implements TableCellRenderer {
Objects.requireNonNull(node);
TableCellRenderer renderer = objectRenderer;
Object newValue = value;
- boolean enabled = node.isEditable() && table.isCellEditable(row, column) && node.isEnabled();
+ boolean enabled = node.isEditable() && table.isCellEditable(row, column) && node.isEnabled(column);
if (node.isBoolean()) {
if (node.isColumnEditable(column)) {
newValue = value == null ? null : Boolean.valueOf(String.valueOf(value));
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/data/seine/dcp/FloatingObjectPartsTreeNode.java
=====================================
@@ -28,8 +28,8 @@ import fr.ird.observe.client.ui.content.data.seine.FloatingObjectUIModel;
import fr.ird.observe.dto.data.seine.ObjectMaterialHierarchyDto;
import fr.ird.observe.dto.referential.ReferentialLocale;
import fr.ird.observe.dto.referential.seine.ObjectMaterialTypeReference;
-import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.jdesktop.swingx.treetable.AbstractMutableTreeTableNode;
import org.jetbrains.annotations.NotNull;
@@ -98,10 +98,10 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
@Override
public boolean isEditable(int column) {
- return column > 0 && getUserObject().enabled && getUserObject().editable && isColumnEditable(column);
+ return column > 0 && isEnabled(column) && getUserObject().editable && isColumnEditable(column);
}
- public boolean isColumnEditable(int column) {
+ boolean isColumnEditable(int column) {
return getUserObject().isColumnEditable(column);
}
@@ -132,6 +132,17 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
public boolean isEnabled() {
return getUserObject().enabled;
}
+ public boolean isEnabled(int column) {
+ boolean result = getUserObject().enabled;
+ if (result) {
+ if (column==1) {
+ result = isRealEnabledOnArriving();
+ } else if (column==2) {
+ result = isRealEnabledOnLeaving();
+ }
+ }
+ return result;
+ }
public String getId() {
return getUserObject().dto.getId();
@@ -153,7 +164,7 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
return getUserObject().dto.isFloat();
}
- public boolean withValidation() {
+ boolean withValidation() {
return getUserObject().dto.withValidation();
}
@@ -178,6 +189,38 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
return (FloatingObjectPartsTreeNode) super.getParent();
}
+ boolean isRealEnabledOnArriving() {
+ return getUserObject().isRealEnabledOnArriving();
+ }
+
+ boolean isRealEnabledOnLeaving() {
+ return getUserObject().isRealEnabledOnLeaving();
+ }
+
+ void setRealEnabledOnArriving(boolean realEnabled) {
+ FloatingObjectPartsTreeNode parent = getParent();
+ if (parent != null) {
+ if (realEnabled) {
+ parent.getUserObject().decSelectedChildCountOnArriving();
+ } else {
+ parent.getUserObject().incSelectedChildCountOnArriving();
+ }
+ parent.setRealEnabledOnArriving(realEnabled);
+ }
+ }
+
+ void setRealEnabledOnLeaving(boolean realEnabled) {
+ FloatingObjectPartsTreeNode parent = getParent();
+ if (parent != null) {
+ if (realEnabled) {
+ parent.getUserObject().decSelectedChildCountOnLeaving();
+ } else {
+ parent.getUserObject().incSelectedChildCountOnLeaving();
+ }
+ parent.setRealEnabledOnLeaving(realEnabled);
+ }
+ }
+
ImmutableSet<FloatingObjectPartsTreeNode> getShell() {
ImmutableSet.Builder<FloatingObjectPartsTreeNode> allNodesBuilder = ImmutableSet.builder();
@@ -212,18 +255,6 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
}
- private FloatingObjectPartsTreeNode getFirstAncestorNeedOneSelection(int column) {
- if (withMandatoryConstraintsOnChildren()) {
- if (parent == null) {
- return this;
- }
- if (withValue(column)) {
- return this;
- }
- }
- return getParent().getFirstAncestorNeedOneSelection(column);
- }
-
void computeMandatoryValidState(boolean whenArriving, boolean whenLeaving) {
FloatingObjectPartsTreeNodeContext userObject = getUserObject();
FloatingObjectPartsTreeNode parent = getParent();
@@ -247,19 +278,26 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
}
}
-// void computeFormulaValidState(boolean whenArriving, boolean whenLeaving) {
-// FloatingObjectPartsTreeNodeContext userObject = getUserObject();
-// ObjectMaterialHierarchyDto dto = Objects.requireNonNull(userObject.dto);
-// if (whenArriving && userObject.validWhenArriving) {
-// Object value = userObject.getValueAt(1);
-// userObject.validWhenArriving = dto.isValid(value);
-// }
-// if (whenLeaving && userObject.validWhenLeaving) {
-// Object value = userObject.getValueAt(2);
-// userObject.validWhenLeaving = dto.isValid(value);
-// }
-//
-// }
+ void computeValidationValidState() {
+ getUserObject().computeValidationValidState();
+ }
+
+ void resetRealEnabled() {
+ getUserObject().selectedChildCountOnArriving = 0;
+ getUserObject().selectedChildCountOnLeaving = 0;
+ }
+
+ private FloatingObjectPartsTreeNode getFirstAncestorNeedOneSelection(int column) {
+ if (withMandatoryConstraintsOnChildren()) {
+ if (parent == null) {
+ return this;
+ }
+ if (withValue(column)) {
+ return this;
+ }
+ }
+ return getParent().getFirstAncestorNeedOneSelection(column);
+ }
private void setCompanions(ImmutableSet.Builder<FloatingObjectPartsTreeNode> companionsBuilder) {
if (companionsBuilder != null) {
@@ -303,16 +341,11 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
setCompanions(childCompanionsBuilder);
}
-
private boolean needCompanions() {
ObjectMaterialHierarchyDto dto = getUserObject().dto;
return dto != null && !dto.isChildrenMultiSelectable() && !isLeaf();
}
- public void computeValidationValidState() {
- getUserObject().computeValidationValidState();
- }
-
//TODO Improve the design, we should not store anything in uiModel and separate leaving and arriving data
private static class FloatingObjectPartsTreeNodeContext {
@@ -320,7 +353,7 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
private final FloatingObjectUIModel uiModel;
// dto (null for root)
private final ObjectMaterialHierarchyDto dto;
- // Is the node is enabled (hierarchic value) ?
+ // Is the node is enabled (from hierarchic value) ?
private final boolean enabled;
// Is this node editable ?
private final boolean editable;
@@ -328,6 +361,7 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
private final boolean exclusive;
// Is the node use validation on his value ?
private final boolean useValidation;
+ // Referential locale to decorate
private final ReferentialLocale referentialLocale;
// Is this node (on arriving) need at least one child selected ? (if editable then node must be selected)
private boolean needOneSelectionOnLeaving;
@@ -345,6 +379,9 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
private ImmutableSet<FloatingObjectPartsTreeNode> companions;
// Internal to store debug node text
private String text;
+ // Count of children selected (if none is selected then the node can be edited (from GUI if a child is selected then any parent node is not enabled) ?
+ private int selectedChildCountOnArriving = 0;
+ private int selectedChildCountOnLeaving = 0;
FloatingObjectPartsTreeNodeContext(FloatingObjectUIModel uiModel) {
this.uiModel = Objects.requireNonNull(uiModel);
@@ -432,7 +469,7 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
return text;
}
- public void computeValidationValidState() {
+ void computeValidationValidState() {
if (uiModel.isArriving()) {
Object value = uiModel.getWhenArriving(dto.getId());
valueValidOnArriving = dto.isValid(value);
@@ -442,5 +479,29 @@ public class FloatingObjectPartsTreeNode extends AbstractMutableTreeTableNode im
valueValidOnLeaving = dto.isValid(value);
}
}
+
+ boolean isRealEnabledOnArriving() {
+ return selectedChildCountOnArriving == 0;
+ }
+
+ void incSelectedChildCountOnArriving() {
+ this.selectedChildCountOnArriving++;
+ }
+
+ void decSelectedChildCountOnArriving() {
+ this.selectedChildCountOnArriving--;
+ }
+
+ boolean isRealEnabledOnLeaving() {
+ return selectedChildCountOnLeaving == 0;
+ }
+
+ void incSelectedChildCountOnLeaving() {
+ this.selectedChildCountOnLeaving++;
+ }
+
+ void decSelectedChildCountOnLeaving() {
+ this.selectedChildCountOnLeaving--;
+ }
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/data/seine/dcp/FloatingObjectPartsTreeTable.java
=====================================
@@ -84,6 +84,7 @@ public class FloatingObjectPartsTreeTable extends JXTreeTable {
FloatingObjectPartsTreeTableModel treeTableModel = getTreeTableModel();
treeTableModel.reset(true);
+ treeTableModel.computeRealEnabledState();
if (expandTree) {
expandAll();
@@ -173,6 +174,24 @@ public class FloatingObjectPartsTreeTable extends JXTreeTable {
return true;
}, ObserveSwingApplicationContext.get().getConfig().getFloatingObjectMaterialErrorColor(), Color.WHITE));
+ addHighlighter(new ColorHighlighter((renderer, adapter) -> {
+ JXTreeTable component = (JXTreeTable) adapter.getComponent();
+ int row = adapter.convertRowIndexToModel(adapter.row);
+ FloatingObjectPartsTreeNode node = (FloatingObjectPartsTreeNode) component.getPathForRow(row).getLastPathComponent();
+ boolean realEnabled1 = node.isRealEnabledOnArriving();
+ boolean realEnabled2 = node.isRealEnabledOnLeaving();
+ boolean nodeEditable = node.isEditable();
+ switch (adapter.convertRowIndexToModel(adapter.column)) {
+ case 0:
+ return false;
+ case 1:
+ return model.isArriving() && nodeEditable && !realEnabled1;
+ case 2:
+ return model.isLeaving() && nodeEditable && !realEnabled2;
+ }
+ return true;
+ }, ObserveSwingApplicationContext.get().getConfig().getFloatingObjectMaterialNotEditableColor(), Color.BLACK));
+
InputMap inputMap = getInputMap(WHEN_IN_FOCUSED_WINDOW);
ActionMap actionMap = getActionMap();
inputMap.put(ObserveKeyStrokes.KEY_STROKE_EXPAND_TREE_TABLE_NODE,"expandNode");
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/content/data/seine/dcp/FloatingObjectPartsTreeTableModel.java
=====================================
@@ -24,15 +24,18 @@ package fr.ird.observe.client.ui.content.data.seine.dcp;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.client.ui.content.data.seine.FloatingObjectUIModel;
+import fr.ird.observe.dto.IdDto;
import fr.ird.observe.dto.data.seine.ObjectMaterialHierarchyDto;
-import org.apache.logging.log4j.Logger;
+import io.ultreia.java4all.i18n.I18n;
import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
import org.jdesktop.swingx.treetable.TreeTableNode;
-import io.ultreia.java4all.i18n.I18n;
import java.util.Arrays;
import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
/**
* Created by tchemit on 05/08/17.
@@ -115,6 +118,11 @@ public class FloatingObjectPartsTreeTableModel extends DefaultTreeTableModel {
throw new IllegalStateException();
}
+ @Override
+ public boolean isCellEditable(Object node, int column) {
+ return super.isCellEditable(node, column);
+ }
+
@Override
public void setValueAt(Object value, Object node, int column) {
FloatingObjectPartsTreeNode treeNode = (FloatingObjectPartsTreeNode) node;
@@ -122,6 +130,13 @@ public class FloatingObjectPartsTreeTableModel extends DefaultTreeTableModel {
previousNode.ifPresent(p -> log.info("Previous selected node: " + p));
super.setValueAt(value, node, column);
previousNode.ifPresent(t -> super.setValueAt(null, t, column));
+ boolean realEnabled = !"true".equals(value);
+ log.info(String.format("Real enabled? %s", realEnabled));
+ if (column == 1) {
+ treeNode.setRealEnabledOnArriving(realEnabled);
+ } else if (column == 2) {
+ treeNode.setRealEnabledOnLeaving(realEnabled);
+ }
if (adjusting) {
return;
}
@@ -145,6 +160,20 @@ public class FloatingObjectPartsTreeTableModel extends DefaultTreeTableModel {
uiModel.getBean().setMaterialsValid(!notValid);
}
+ public void computeRealEnabledState() {
+ Set<String> whenArriving = uiModel.getWhenArriving().keySet().stream().map(IdDto::getId).collect(Collectors.toSet());
+ Set<String> whenLeaving = uiModel.getWhenLeaving().keySet().stream().map(IdDto::getId).collect(Collectors.toSet());
+ allNodes.forEach(FloatingObjectPartsTreeNode::resetRealEnabled);
+ for (FloatingObjectPartsTreeNode node : allNodes) {
+ if (whenArriving.contains(node.getId())) {
+ node.setRealEnabledOnArriving(false);
+ }
+ if (whenLeaving.contains(node.getId())) {
+ node.setRealEnabledOnLeaving(false);
+ }
+ }
+ }
+
public boolean isAdjusting() {
return adjusting;
}
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -1753,6 +1753,7 @@ observe.config.temperature.format=Default temperature format
observe.config.ui.autoPopupNumberEditor=Flag sets to true when number editor show automaticly popup
observe.config.ui.changeSynchroSrc=Flag sets to true if you can change local source in admin tasks
observe.config.ui.dcp.error.color=Color to notify errors while validating floating object materials.
+observe.config.ui.dcp.not.editable.color=Color to notify not editable floating object material nodes.
observe.config.ui.focusBorderColor=Color of the focus container border
observe.config.ui.fullscreen=Flag sets to true to lauch application in full screen mode
observe.config.ui.loadLocalStorage=Flag sets to true to load local data source when application starts
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -1753,6 +1753,7 @@ observe.config.temperature.format=Unidad de temperatura
observe.config.ui.autoPopupNumberEditor=Para mostrar automáticamente el editor numérico durante la edición de un número
observe.config.ui.changeSynchroSrc=Para autorizar la seleción de la base fuente durante las operaciones sobre la base
observe.config.ui.dcp.error.color=Color para notificar los errores sobre la composición de dcps
+observe.config.ui.dcp.not.editable.color=Color to notify not editable floating object material nodes \#TODO
observe.config.ui.focusBorderColor=Color del borde de la zona que tiene el foco
observe.config.ui.fullscreen=Para mostrar la aplicación en modo pantalla completa
observe.config.ui.loadLocalStorage=Cargar la base local al iniciar la aplicación
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -1753,6 +1753,7 @@ observe.config.temperature.format=Unité de température
observe.config.ui.autoPopupNumberEditor=Pour afficher automatiquement l'éditeur numérique lors de l'édition d'un nombre
observe.config.ui.changeSynchroSrc=Pour autoriser la sélection de la base source dans les opérations sur base
observe.config.ui.dcp.error.color=Couleur pour notifier les erreurs sur la composition des dcps
+observe.config.ui.dcp.not.editable.color=Couleur pour notifier les nœuds non éditables dans l'arbre des matériaux de dcp.
observe.config.ui.focusBorderColor=Couleur de la bordure de la zone qui a le focus
observe.config.ui.fullscreen=Pour afficher l'application en mode pleine écran
observe.config.ui.loadLocalStorage=Charger la base locale au démarrage de l'application
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/18b5e375d6ba6167763c581c7d7…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/18b5e375d6ba6167763c581c7d7…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [REFERENTIEL] La validation sur les Objets flottant matériaux ne fonctionnent...
by Tony CHEMIT 03 Jul '19
by Tony CHEMIT 03 Jul '19
03 Jul '19
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
9f2ad3db by tchemit at 2019-07-03T15:50:34Z
[REFERENTIEL] La validation sur les Objets flottant matériaux ne fonctionnent plus :( - Closes #1339
- - - - -
2 changed files:
- dto/src/main/java/fr/ird/observe/dto/referential/seine/ObjectMaterialDto.java
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
Changes:
=====================================
dto/src/main/java/fr/ird/observe/dto/referential/seine/ObjectMaterialDto.java
=====================================
@@ -22,9 +22,13 @@ package fr.ird.observe.dto.referential.seine;
* #L%
*/
-import fr.ird.observe.dto.referential.FormulaHelper;
import org.apache.commons.lang3.StringUtils;
+import javax.script.Bindings;
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+
public class ObjectMaterialDto extends GeneratedObjectMaterialDto {
private static final long serialVersionUID = 1L;
@@ -48,7 +52,15 @@ public class ObjectMaterialDto extends GeneratedObjectMaterialDto {
@Override
public void setValidation(String validation) {
super.setValidation(validation);
- boolean result = FormulaHelper.validateObjectMaterialValidation(validation, 10);
+ Object value = "10";
+ if (isBoolean()) {
+ value = Boolean.TRUE;
+ } else if (isInteger()) {
+ value = 10;
+ }else if (isFloat()) {
+ value = 10f;
+ }
+ boolean result = validateObjectMaterialValidation(validation, value);
setValidationValid(result);
}
@@ -64,4 +76,34 @@ public class ObjectMaterialDto extends GeneratedObjectMaterialDto {
return parent != null && parent.getParentId() != null;
}
+ /** moteur d'évaluation d'expression */
+ private static ScriptEngine scriptEngine;
+
+
+ private static ScriptEngine getScriptEngine() {
+ if (scriptEngine == null) {
+ ScriptEngineManager factory = new ScriptEngineManager();
+
+ scriptEngine = factory.getEngineByExtension("js");
+ }
+ return scriptEngine;
+ }
+
+ public static boolean validateObjectMaterialValidation(String relation, Object value) {
+ if (!StringUtils.isEmpty(relation)) {
+
+ ScriptEngine engine = getScriptEngine();
+ Bindings bindings = engine.createBindings();
+ bindings.put("x", value);
+
+ try {
+ engine.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
+ Boolean o = (Boolean) engine.eval(relation);
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+ return false;
+ }
}
=====================================
services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
=====================================
@@ -183,7 +183,7 @@ public class ValidateServiceLocalTest extends ServiceLocalTestSupport {
assertValidateResult(result, GearCaracteristicTypeDto.class, 2);
assertValidateResult(result, ObjectOperationDto.class, 2);
assertValidateResult(result, SpeciesListDto.class, 2);
- assertValidateResult(result, ObjectMaterialDto.class, 10);
+ assertValidateResult(result, ObjectMaterialDto.class, 9);
assertValidateResult(result, TransmittingBuoyOperationDto.class, 3);
assertValidateResult(result, HookPositionDto.class, 1);
assertValidateResult(result, FpaZoneDto.class, 5);
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/9f2ad3dbea960391b123dbbc658…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/9f2ad3dbea960391b123dbbc658…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [REFERENTIEL] La validation sur les Objets flottant matériaux ne fonctionnent...
by Tony CHEMIT 03 Jul '19
by Tony CHEMIT 03 Jul '19
03 Jul '19
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
db31fe17 by tchemit at 2019-07-03T15:39:45Z
[REFERENTIEL] La validation sur les Objets flottant matériaux ne fonctionnent plus :( - Closes #1339
- - - - -
1 changed file:
- dto/src/main/java/fr/ird/observe/dto/referential/seine/ObjectMaterialDto.java
Changes:
=====================================
dto/src/main/java/fr/ird/observe/dto/referential/seine/ObjectMaterialDto.java
=====================================
@@ -22,9 +22,13 @@ package fr.ird.observe.dto.referential.seine;
* #L%
*/
-import fr.ird.observe.dto.referential.FormulaHelper;
import org.apache.commons.lang3.StringUtils;
+import javax.script.Bindings;
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+
public class ObjectMaterialDto extends GeneratedObjectMaterialDto {
private static final long serialVersionUID = 1L;
@@ -48,7 +52,15 @@ public class ObjectMaterialDto extends GeneratedObjectMaterialDto {
@Override
public void setValidation(String validation) {
super.setValidation(validation);
- boolean result = FormulaHelper.validateObjectMaterialValidation(validation, 10);
+ Object value = "10";
+ if (isBoolean()) {
+ value = Boolean.TRUE;
+ } else if (isInteger()) {
+ value = 10;
+ }else if (isFloat()) {
+ value = 10f;
+ }
+ boolean result = validateObjectMaterialValidation(validation, value);
setValidationValid(result);
}
@@ -64,4 +76,34 @@ public class ObjectMaterialDto extends GeneratedObjectMaterialDto {
return parent != null && parent.getParentId() != null;
}
+ /** moteur d'évaluation d'expression */
+ private static ScriptEngine scriptEngine;
+
+
+ private static ScriptEngine getScriptEngine() {
+ if (scriptEngine == null) {
+ ScriptEngineManager factory = new ScriptEngineManager();
+
+ scriptEngine = factory.getEngineByExtension("js");
+ }
+ return scriptEngine;
+ }
+
+ public static boolean validateObjectMaterialValidation(String relation, Object value) {
+ if (!StringUtils.isEmpty(relation)) {
+
+ ScriptEngine engine = getScriptEngine();
+ Bindings bindings = engine.createBindings();
+ bindings.put("x", value);
+
+ try {
+ engine.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
+ Boolean o = (Boolean) engine.eval(relation);
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+ return false;
+ }
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/db31fe17f54df0f5c7678242cda…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/db31fe17f54df0f5c7678242cda…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [FOB] Découpler la gestion de la hiérarchie FOB des codes métier - Closes #1342
by Tony CHEMIT 03 Jul '19
by Tony CHEMIT 03 Jul '19
03 Jul '19
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
04fde970 by tchemit at 2019-07-03T15:14:29Z
[FOB] Découpler la gestion de la hiérarchie FOB des codes métier - Closes #1342
- - - - -
1 changed file:
- pom.xml
Changes:
=====================================
pom.xml
=====================================
@@ -155,7 +155,7 @@
<maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
<buildDate>${maven.build.timestamp}</buildDate>
- <observeToolkitVersion>3.7.19-SNAPSHOT</observeToolkitVersion>
+ <observeToolkitVersion>3.7.19</observeToolkitVersion>
<!--<lib.version.java4all.http>1.0.13</lib.version.java4all.http>-->
<lib.version.nuiton.validation>3.1</lib.version.nuiton.validation>
<!--<lib.version.java4all.config>1.0.3</lib.version.java4all.config>-->
@@ -165,7 +165,7 @@
<lib.version.java4all.eugene>3.0-alpha-26</lib.version.java4all.eugene>
<!--lib.version.java4all.jaxx>3.0-alpha-50</lib.version.java4all.jaxx-->
<!--<lib.version.java4all.i18n>4.0-beta-8-SNAPSHOT</lib.version.java4all.i18n>-->
- <lib.version.java4all.topia>1.1.15-SNAPSHOT</lib.version.java4all.topia>
+ <lib.version.java4all.topia>1.1.15</lib.version.java4all.topia>
<!--<lib.version.nuiton.topia>3.6-SNAPSHOT</lib.version.nuiton.topia>-->
<!--<lib.version.java4all.eugene>3.0-alpha-21</lib.version.java4all.eugene>-->
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/04fde970f33e186165c05e92e81…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/04fde970f33e186165c05e92e81…
You're receiving this email because of your account on gitlab.com.
1
0
03 Jul '19
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
603c4e88 by tchemit at 2019-07-03T12:56:02Z
update pom
- - - - -
4d449fa3 by tchemit at 2019-07-03T13:26:13Z
On ne peut pas sauvegarder une configuration d'un serveur distant en mode admin - Closes #1340
- - - - -
5f9d6431 by tchemit at 2019-07-03T14:02:14Z
L'assistant migration via serveur pourrait refuser de continuer si l'utilisateur n'est pas assez acrédité - Closes #1145
Assistant création de base PG échoue - Closes #1331
- - - - -
16 changed files:
- client-core/src/main/i18n/getters/java.getter
- client-core/src/main/java/fr/ird/observe/client/db/ObserveDataSourcesManager.java
- client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/SaveCurrentServerConfigurationUIAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/TestRemoteUIAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/TestServerUIAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/admin/config/ConfigModel.java
- client-core/src/main/java/fr/ird/observe/client/ui/storage/StorageUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/storage/StorageUIModel.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
- pom.xml
- server-core/src/main/filtered-resources/mapping
- services-local/src/main/java/fr/ird/observe/services/local/service/DataSourceServiceLocal.java
- services/src/main/java/fr/ird/observe/services/service/DataSourceService.java
Changes:
=====================================
client-core/src/main/i18n/getters/java.getter
=====================================
@@ -800,6 +800,7 @@ observe.storage.error.rest.user.required
observe.storage.error.rest.user.unknown
observe.storage.error.serverVersionMismatch
observe.storage.error.serverVersionModelMismatch
+observe.storage.error.user.not.owner
observe.storage.internalDump.last.modified
observe.storage.internalDump.not.exist
observe.storage.label.data.import.db
=====================================
client-core/src/main/java/fr/ird/observe/client/db/ObserveDataSourcesManager.java
=====================================
@@ -37,7 +37,6 @@ import fr.ird.observe.client.ui.ObserveUIMode;
import fr.ird.observe.client.ui.actions.main.menu.storage.ChangeStorageAction;
import fr.ird.observe.client.ui.storage.StorageUIModel;
import fr.ird.observe.client.ui.util.ProgressModel;
-import org.nuiton.topia.persistence.script.TopiaSqlScript;
import fr.ird.observe.services.ObserveDataSourceConfigurationMainFactory;
import fr.ird.observe.services.configuration.DataSourceCreateConfigurationDto;
import fr.ird.observe.services.configuration.ObserveDataSourceConfiguration;
@@ -48,6 +47,7 @@ import fr.ird.observe.services.configuration.topia.ObserveDataSourceConfiguratio
import fr.ird.observe.services.service.BabModelVersionException;
import fr.ird.observe.services.service.DatabaseConnexionNotAuthorizedException;
import fr.ird.observe.services.service.DatabaseNotFoundException;
+import org.nuiton.topia.persistence.script.TopiaSqlScript;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
@@ -123,7 +123,9 @@ public class ObserveDataSourcesManager implements Closeable {
dataSource = newDataSource(configuration);
break;
}
-
+ if (model.getDataSourceInformation() != null) {
+ dataSource.setOwner(model.getDataSourceInformation().isOwner());
+ }
return dataSource;
}
@@ -291,8 +293,8 @@ public class ObserveDataSourcesManager implements Closeable {
try {
- ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect();
-
+ ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(false);
+ dataSource.setOwner(dataSourceInformation.isOwner());
dataSource.migrateDataIfPossible(dataSourceInformation, config.getModelVersion());
// la source sera utilisée dans les ui
@@ -358,7 +360,8 @@ public class ObserveDataSourcesManager implements Closeable {
try {
- ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect();
+ ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(false);
+ dataSource.setOwner(dataSourceInformation.isOwner());
dataSource.migrateData(dataSourceInformation, config.getModelVersion());
@@ -704,6 +707,7 @@ public class ObserveDataSourcesManager implements Closeable {
}
}
+ @SuppressWarnings({"unused", "WeakerAccess"})
public static class InitStorageModel {
private final File localDb;
private final BackupStorage lastAutomaticBackup;
@@ -724,7 +728,7 @@ public class ObserveDataSourcesManager implements Closeable {
return lastAutomaticBackup != null;
}
- String getBackupDate() {
+ public String getBackupDate() {
return Optional.ofNullable(lastAutomaticBackup).map(l -> simpleDateFormat.format(l.getDate())).orElse("");
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java
=====================================
@@ -10,12 +10,12 @@ package fr.ird.observe.client.db;
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
@@ -120,12 +120,9 @@ import static io.ultreia.java4all.i18n.I18n.t;
*/
public class ObserveSwingDataSource extends AbstractSerializableBean implements Closeable, ObserveServicesProvider {
+ public static final ObserveServicesProvider MAIN = new ObserveMainDataSourceServicesProvider();
private static final long serialVersionUID = 1L;
-
private static final Logger log = LogManager.getLogger(ObserveSwingDataSource.class);
-
- public static final ObserveServicesProvider MAIN = new ObserveMainDataSourceServicesProvider();
-
private final EventListenerList listenerList;
private final ObserveDataSourceConfiguration configuration;
@@ -143,6 +140,7 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements
// indique si une modification a été effectuéé sur la base depuis son ouverture
private boolean modified;
+ private boolean owner;
public ObserveSwingDataSource(ObserveDataSourceConfiguration configuration) {
this.configuration = configuration;
@@ -208,6 +206,7 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements
canWriteReferential(),
canReadData(),
canWriteData(),
+ isOwner(),
getVersion(),
getVersion(),
ImmutableList.of());
@@ -249,7 +248,7 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements
@Override
public void close() {
- if (connection==null) {
+ if (connection == null) {
return;
}
checkIsOpen();
@@ -368,6 +367,10 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements
}
+ public boolean isOwner() {
+ return owner;
+ }
+
void migrateDataIfPossible(ObserveDataSourceInformation dataSourceInformation, Version targetVersion) {
checkIsNotOpen();
@@ -398,39 +401,30 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements
}
public <D extends IdDto> ImmutableDtoMap<ReferentialDtoReferenceSet<?>> updateReferentialReferenceSetsCache(Class<D> dtoType) {
-
ReferentialService referentialService = servicesProvider.getReferentialService();
return referentialCache.loadReferenceSets(referentialService, dtoType);
-
}
- private <R extends ReferentialDtoReference> ReferentialDtoReferenceSet<R> getReferentialReferenceSet(Class<R> type) {
-
+ @SuppressWarnings("unchecked")
+ public <R extends ReferentialDtoReference> ReferentialDtoReferenceSet<R> getReferentialReferenceSet(Class<R> type) {
checkIsOpen();
-
ReferentialService referentialService = servicesProvider.getReferentialService();
return referentialCache.getReferentialReferenceSet(referentialService, type);
}
public <R extends ReferentialDtoReference> Set<R> getReferentialReferences(Class<R> type) {
-
ReferentialDtoReferenceSet<R> referentialReferenceSet = getReferentialReferenceSet(type);
return referentialReferenceSet.toSet();
-
}
public boolean isOpen() {
return connection != null;
}
- public ObserveDataSourceInformation checkCanConnect() throws DatabaseConnexionNotAuthorizedException, DatabaseNotFoundException {
-
+ public ObserveDataSourceInformation checkCanConnect(boolean canBeEmpty) throws DatabaseConnexionNotAuthorizedException, DatabaseNotFoundException {
checkIsNotAlreadyOpen();
-
DataSourceService dataSourceService = servicesProvider.getDataSourceService();
-
- return dataSourceService.checkCanConnect(configuration);
-
+ return canBeEmpty ? dataSourceService.checkCanConnectOrBeEmpty(configuration) : dataSourceService.checkCanConnect(configuration);
}
public boolean isLocal() {
@@ -454,9 +448,7 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements
}
public void removeObserveSwingDataSourceListener(ObserveSwingDataSourceListener listener) {
- if (log.isInfoEnabled()) {
- log.info("removing listener " + listener);
- }
+ log.info("removing listener " + listener);
listenerList.remove(ObserveSwingDataSourceListener.class, listener);
}
@@ -782,4 +774,8 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements
public void setProgressModel(ProgressModel progressModel) {
this.progressModel = progressModel;
}
+
+ public void setOwner(boolean owner) {
+ this.owner = owner;
+ }
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/SaveCurrentServerConfigurationUIAction.java
=====================================
@@ -22,6 +22,7 @@ package fr.ird.observe.client.ui.actions.storage;
* #L%
*/
+import fr.ird.observe.client.ObserveSwingApplicationContext;
import fr.ird.observe.client.ui.ObserveMainUI;
import fr.ird.observe.client.ui.actions.main.menu.MenuActionSupport;
import fr.ird.observe.client.ui.storage.StorageUIModel;
@@ -116,8 +117,7 @@ public class SaveCurrentServerConfigurationUIAction extends MenuActionSupport {
configuration.setLogin(model.getRemoteLogin());
configuration.setPassword(new String(model.getRemotePassword()));
configuration.setDatabaseName(model.getServerDatabase());
- getMainUI().getConfig().addServerDataSourceConfiguration(configuration);
-
+ ObserveSwingApplicationContext.get().getConfig().addServerDataSourceConfiguration(configuration);
configUI.getHandler().addServerConfiguration(getMainUI(), configuration, configUI.getServerMenu().getComponentCount() - 2);
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/TestRemoteUIAction.java
=====================================
@@ -67,7 +67,8 @@ public class TestRemoteUIAction extends PresetsUIActionSupport {
ObserveSwingDataSource dataSource = ObserveSwingApplicationContext.get().getDataSourcesManager().newDataSource(config);
try {
- ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect();
+ ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(false);
+ dataSource.setOwner(dataSourceInformation.isOwner());
Version versionDataSource = dataSourceInformation.getVersion();
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/TestServerUIAction.java
=====================================
@@ -102,7 +102,7 @@ public class TestServerUIAction extends PresetsUIActionSupport {
}
if (connexionStatusError == null) {
- ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect();
+ ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(false);
Version versionDataSource = dataSourceInformation.getVersion();
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/admin/config/ConfigModel.java
=====================================
@@ -642,7 +642,7 @@ public class ConfigModel extends AdminActionModel {
try {
- localSourceInformation = localSource.checkCanConnect();
+ localSourceInformation = localSource.checkCanConnect(false);
} catch (Exception e) {
//FIXME ! il faut faire quelque chose dans ce cas précis, au moins avertir l'utilisateur
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/storage/StorageUIHandler.java
=====================================
@@ -554,8 +554,8 @@ public class StorageUIHandler implements UIHandler<StorageUI> {
// si on utilise la base local on lance une migration de la base si necessaire
if (DbMode.USE_LOCAL.equals((model.getDbMode()))) {
- ObserveDataSourceInformation dataSourceInformation = currentDataSource.checkCanConnect();
-
+ ObserveDataSourceInformation dataSourceInformation = currentDataSource.checkCanConnect(false);
+ currentDataSource.setOwner(dataSourceInformation.isOwner());
progressModel.incrementsCurrentStep();
currentDataSource.migrateData(dataSourceInformation, config.getModelVersion());
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/storage/StorageUIModel.java
=====================================
@@ -1665,12 +1665,14 @@ public class StorageUIModel extends WizardModel<StorageStep> {
if (!error) {
- dataSourceInformation = dataSource.checkCanConnect();
+ boolean createAction = ObstunaAdminAction.CREATE.equals(adminAction);
+ dataSourceInformation = dataSource.checkCanConnect(createAction);
+ dataSource.setOwner(dataSourceInformation.isOwner());
Version versionDataSource = dataSourceInformation.getVersion();
// en mise a jour de la base on ne test pas la version
- if (getModelVersion().equals(versionDataSource) || isCanMigrate() || ObstunaAdminAction.CREATE.equals(adminAction)) {
+ if (isCanMigrate() || createAction || getModelVersion().equals(versionDataSource)) {
setConnexionStatus(ConnexionStatus.SUCCESS);
@@ -1738,6 +1740,16 @@ public class StorageUIModel extends WizardModel<StorageStep> {
setBusy(false);
}
+ if (result && dataSourceInformation != null && adminAction != null) {
+
+ // must be owner of database to perform a such action
+ if (!dataSourceInformation.isOwner()) {
+ connexionStatusError = t("observe.storage.error.user.not.owner");
+ log.error(connexionStatusError);
+ setConnexionStatus(ConnexionStatus.FAILED);
+ result = false;
+ }
+ }
return result;
}
@@ -1949,7 +1961,7 @@ public class StorageUIModel extends WizardModel<StorageStep> {
if (h2DataSourceInformation == null && localStorageExist) {
ObserveSwingDataSource dataSource = ObserveSwingApplicationContext.get().getDataSourcesManager().newDataSource(h2Config);
try {
- h2DataSourceInformation = dataSource.checkCanConnect();
+ h2DataSourceInformation = dataSource.checkCanConnect(false);
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug("error on load data source information for local storage", e);
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -2043,6 +2043,7 @@ observe.storage.error.rest.user.required=User login is mandatory
observe.storage.error.rest.user.unknown=User "%s" is not defined on server
observe.storage.error.serverVersionMismatch=Remote server version (%s) is not compliant with the client version (%s)
observe.storage.error.serverVersionModelMismatch=Remote server model version (%s) is not compliant with the client model version (%s)
+observe.storage.error.user.not.owner=User must be owner of database to perform this action\!
observe.storage.import.data.fromBackup=Import data from a backup of a local database (*.sql.gz)
observe.storage.import.data.fromRemoteStorage=Import data from a remote database
observe.storage.import.data.fromServerStorage=Import data from a remove server
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -2043,6 +2043,7 @@ observe.storage.error.rest.user.required=El usuario es obligatorio
observe.storage.error.rest.user.unknown=El usuario "%s" no es conocido por el servidor
observe.storage.error.serverVersionMismatch=La versión del servidor remoto (%s) no es compatible con la versión del modelo (%s)
observe.storage.error.serverVersionModelMismatch=La versión del modelo del servidor remoto (%s) no es compatible con la versión del modelo (%s)
+observe.storage.error.user.not.owner=User must be owner of database to perform this action\! \#TODO
observe.storage.import.data.fromBackup=Importar los datos de una copia de seguridad de la base local (*.sql.gz)
observe.storage.import.data.fromRemoteStorage=Importar los datos de una base remota
observe.storage.import.data.fromServerStorage=Importar los datos de un servidor remoto
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -2043,6 +2043,7 @@ observe.storage.error.rest.user.required=L'utilisateur est obligatoire
observe.storage.error.rest.user.unknown=L'utilisateur "%s" est inconnu sur le serveur
observe.storage.error.serverVersionMismatch=La version du serveur distant (%s) n'est pas compatible avec la version du client (%s)
observe.storage.error.serverVersionModelMismatch=La version du modèle du serveur distant (%s) n'est pas compatible avec la version du modèle du client (%s)
+observe.storage.error.user.not.owner=L'utilisateur doit être le propriétaire de la base pour effectuer cette opération \!
observe.storage.import.data.fromBackup=Importer les données depuis une sauvegarde de base locale (*.sql.gz)
observe.storage.import.data.fromRemoteStorage=Importer les données depuis une base distante
observe.storage.import.data.fromServerStorage=Importer les données depuis un serveur distant
=====================================
pom.xml
=====================================
@@ -26,7 +26,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2019.8.22</version>
+ <version>2019.8.23</version>
</parent>
<groupId>fr.ird.observe</groupId>
@@ -155,7 +155,7 @@
<maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
<buildDate>${maven.build.timestamp}</buildDate>
- <observeToolkitVersion>3.7.17</observeToolkitVersion>
+ <observeToolkitVersion>3.7.19-SNAPSHOT</observeToolkitVersion>
<!--<lib.version.java4all.http>1.0.13</lib.version.java4all.http>-->
<lib.version.nuiton.validation>3.1</lib.version.nuiton.validation>
<!--<lib.version.java4all.config>1.0.3</lib.version.java4all.config>-->
@@ -165,7 +165,7 @@
<lib.version.java4all.eugene>3.0-alpha-26</lib.version.java4all.eugene>
<!--lib.version.java4all.jaxx>3.0-alpha-50</lib.version.java4all.jaxx-->
<!--<lib.version.java4all.i18n>4.0-beta-8-SNAPSHOT</lib.version.java4all.i18n>-->
- <lib.version.java4all.topia>1.1.14</lib.version.java4all.topia>
+ <lib.version.java4all.topia>1.1.15-SNAPSHOT</lib.version.java4all.topia>
<!--<lib.version.nuiton.topia>3.6-SNAPSHOT</lib.version.nuiton.topia>-->
<!--<lib.version.java4all.eugene>3.0-alpha-21</lib.version.java4all.eugene>-->
=====================================
server-core/src/main/filtered-resources/mapping
=====================================
@@ -56,6 +56,7 @@ GET /admin/configuration/resetAuthenticationTokens ConfigurationCo
GET /api/v1/DataSourceService/applySecurity v1.DataSourceServiceRestApi.applySecurity
GET /api/v1/DataSourceService/backup v1.DataSourceServiceRestApi.backup
GET /api/v1/DataSourceService/checkCanConnect v1.DataSourceServiceRestApi.checkCanConnect
+GET /api/v1/DataSourceService/checkCanConnectOrBeEmpty v1.DataSourceServiceRestApi.checkCanConnectOrBeEmpty
GET /api/v1/DataSourceService/close v1.DataSourceServiceRestApi.close
GET /api/v1/DataSourceService/create v1.DataSourceServiceRestApi.create
GET /api/v1/DataSourceService/destroy v1.DataSourceServiceRestApi.destroy
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/DataSourceServiceLocal.java
=====================================
@@ -98,6 +98,95 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS
return privileges != null && !privileges.isEmpty();
}
+ private static boolean isOwner(ObserveDataSourceConfigurationTopiaSupport dataSourceConfiguration, JdbcPostgresHelper jdbcHelper) {
+ if (dataSourceConfiguration.isH2Database()) {
+ return true;
+ }
+ return jdbcHelper.isOwner();
+ }
+
+ @Override
+ public ObserveDataSourceInformation checkCanConnectOrBeEmpty(ObserveDataSourceConfiguration dataSourceConfiguration) throws DatabaseNotFoundException, DatabaseConnexionNotAuthorizedException {
+ Preconditions.checkState(dataSourceConfiguration instanceof ObserveDataSourceConfigurationTopiaSupport);
+ ObserveDataSourceConfigurationTopiaSupport dataSourceConfigurationTopiaSupport = (ObserveDataSourceConfigurationTopiaSupport) dataSourceConfiguration;
+
+ ObserveDataSourceInformation dataSourceInformation;
+
+ if (dataSourceConfigurationTopiaSupport.isH2Database()) {
+
+ ObserveDataSourceConfigurationTopiaH2 h2DataSourceConfiguration = (ObserveDataSourceConfigurationTopiaH2) dataSourceConfigurationTopiaSupport;
+
+ // On vérifie que le fichier de la base existe
+ File databaseFile = h2DataSourceConfiguration.getDatabaseFile();
+
+ if (!databaseFile.exists()) {
+
+ String message = l(getApplicationLocale(), "observe.services.topia.error.h2.database.notFound");
+ throw new DatabaseNotFoundException(message, dataSourceConfiguration);
+
+ }
+
+ // On vérifier que la base n'est pas déjà en cours d'utilisation
+ File databaseLockFile = h2DataSourceConfiguration.getLockFile();
+ if (databaseLockFile.exists()) {
+
+ String message = l(getApplicationLocale(), "observe.services.topia.error.h2.database.locked");
+ if (log.isWarnEnabled()) {
+ log.warn(message);
+ }
+ // FIXME even if file is lock we still authorize to connect,
+ //throw new DatabaseConnexionNotAuthorizedException(message, dataSourceConfiguration);
+ }
+
+ // On tente une connection à la base
+ ObserveTopiaConfiguration topiaConfiguration = ObserveTopiaConfigurationFactory.forH2Database(h2DataSourceConfiguration.getDirectory(),
+ h2DataSourceConfiguration.getDbName(),
+ h2DataSourceConfiguration.getUsername(),
+ new String(h2DataSourceConfiguration.getPassword()),
+ false,
+ false);
+
+
+ try {
+ new JdbcHelper(topiaConfiguration).runSelectOnString("SELECT 1;");
+ } catch (Exception e) {
+
+ // Authentification refusée
+ String message = l(getApplicationLocale(), "observe.services.topia.error.h2.database.badAuthentication");
+ throw new DatabaseConnexionNotAuthorizedException(message, e, dataSourceConfiguration);
+
+ }
+
+ dataSourceInformation = getDataSourceInformation(h2DataSourceConfiguration, topiaConfiguration, false);
+
+
+ } else {
+
+ ObserveDataSourceConfigurationTopiaPG pgDataSourceConfiguration = (ObserveDataSourceConfigurationTopiaPG) dataSourceConfigurationTopiaSupport;
+ // On tente une connexion au serveur
+ ObserveTopiaConfiguration topiaConfiguration = ObserveTopiaConfigurationFactory.forPostgresqlDatabase(pgDataSourceConfiguration.getJdbcUrl(),
+ pgDataSourceConfiguration.getUsername(),
+ new String(pgDataSourceConfiguration.getPassword()),
+ false,
+ false);
+
+ try {
+ new JdbcHelper(topiaConfiguration).runSelectOnString("SELECT 1;");
+ } catch (Exception e) {
+
+ throw new DatabaseConnexionNotAuthorizedException(e.getMessage(), e, dataSourceConfiguration);
+
+ }
+
+ dataSourceInformation = getDataSourceInformation(pgDataSourceConfiguration, topiaConfiguration, true);
+
+ }
+
+ return dataSourceInformation;
+
+ }
+
+
@Override
public ObserveDataSourceInformation checkCanConnect(ObserveDataSourceConfiguration dataSourceConfiguration) throws DatabaseNotFoundException, DatabaseConnexionNotAuthorizedException {
@@ -134,11 +223,11 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS
// On tente une connection à la base
ObserveTopiaConfiguration topiaConfiguration = ObserveTopiaConfigurationFactory.forH2Database(h2DataSourceConfiguration.getDirectory(),
- h2DataSourceConfiguration.getDbName(),
- h2DataSourceConfiguration.getUsername(),
- new String(h2DataSourceConfiguration.getPassword()),
- false,
- false);
+ h2DataSourceConfiguration.getDbName(),
+ h2DataSourceConfiguration.getUsername(),
+ new String(h2DataSourceConfiguration.getPassword()),
+ false,
+ false);
try {
@@ -151,7 +240,7 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS
}
- dataSourceInformation = getDataSourceInformation(h2DataSourceConfiguration, topiaConfiguration);
+ dataSourceInformation = getDataSourceInformation(h2DataSourceConfiguration, topiaConfiguration, false);
} else {
@@ -159,10 +248,10 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS
ObserveDataSourceConfigurationTopiaPG pgDataSourceConfiguration = (ObserveDataSourceConfigurationTopiaPG) dataSourceConfigurationTopiaSupport;
// On tente une connexion au serveur
ObserveTopiaConfiguration topiaConfiguration = ObserveTopiaConfigurationFactory.forPostgresqlDatabase(pgDataSourceConfiguration.getJdbcUrl(),
- pgDataSourceConfiguration.getUsername(),
- new String(pgDataSourceConfiguration.getPassword()),
- false,
- false);
+ pgDataSourceConfiguration.getUsername(),
+ new String(pgDataSourceConfiguration.getPassword()),
+ false,
+ false);
try {
new JdbcHelper(topiaConfiguration).runSelectOnString("SELECT 1;");
@@ -172,7 +261,7 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS
}
- dataSourceInformation = getDataSourceInformation(pgDataSourceConfiguration, topiaConfiguration);
+ dataSourceInformation = getDataSourceInformation(pgDataSourceConfiguration, topiaConfiguration, false);
}
@@ -359,7 +448,7 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS
}
- ObserveDataSourceInformation dataSourceInformation = getDataSourceInformation((ObserveDataSourceConfigurationTopiaSupport) dataSourceConfiguration, topiaApplicationContext.getConfiguration());
+ ObserveDataSourceInformation dataSourceInformation = getDataSourceInformation((ObserveDataSourceConfigurationTopiaSupport) dataSourceConfiguration, topiaApplicationContext.getConfiguration(), false);
return createDataSourceConnection(dataSourceInformation, topiaApplicationContext.getAuthenticationToken());
@@ -529,7 +618,7 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS
dataSourceInformation.getVersion());
}
- private ObserveDataSourceInformation getDataSourceInformation(ObserveDataSourceConfigurationTopiaSupport dataSourceConfiguration, ObserveTopiaConfiguration topiaConfiguration) {
+ private ObserveDataSourceInformation getDataSourceInformation(ObserveDataSourceConfigurationTopiaSupport dataSourceConfiguration, ObserveTopiaConfiguration topiaConfiguration, boolean canBeEmpty) {
boolean writeReferential;
boolean readData;
@@ -538,8 +627,37 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS
Version version;
JdbcPostgresHelper jdbcHelper = new JdbcPostgresHelper(topiaConfiguration);
+ boolean owner = isOwner(dataSourceConfiguration, jdbcHelper);
- version = TMSVersionHibernateDao.getVersion(jdbcHelper, "tms_version").map(TMSVersion::toVersion).orElse(Version.VZERO);
+ try {
+ version = TMSVersionHibernateDao.getVersion(jdbcHelper, "tms_version").map(TMSVersion::toVersion).orElse(Version.VZERO);
+ } catch (Exception e) {
+ if (!canBeEmpty) {
+ throw e;
+ }
+ if (dataSourceConfiguration.isH2Database()) {
+
+ // Sur une base H2, on a le droit de tout lire, mais uniquement d'écrire les données
+ writeReferential = false;
+ readData = true;
+ writeData = true;
+ owner = true;
+
+ } else {
+ writeReferential = true;
+ readData = true;
+ writeData = true;
+ }
+ return new ObserveDataSourceInformation(
+ true,
+ writeReferential,
+ readData,
+ writeData,
+ owner,
+ ObserveTopiaMigrationServiceAskUserToMigrate.getMinimumVersion(),
+ null,
+ null);
+ }
if (dataSourceConfiguration.isH2Database()) {
@@ -591,6 +709,7 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS
writeReferential,
readData,
writeData,
+ owner,
ObserveTopiaMigrationServiceAskUserToMigrate.getMinimumVersion(),
version,
observeMigrationConfigurationProvider.getVersionsAfter(version));
=====================================
services/src/main/java/fr/ird/observe/services/service/DataSourceService.java
=====================================
@@ -47,6 +47,9 @@ public interface DataSourceService extends ObserveService, Closeable {
@Get(addAuthtoken = false)
ObserveDataSourceInformation checkCanConnect(ObserveDataSourceConfiguration dataSourceConfiguration) throws DatabaseNotFoundException, DatabaseConnexionNotAuthorizedException;
+ @Get(addAuthtoken = false)
+ ObserveDataSourceInformation checkCanConnectOrBeEmpty(ObserveDataSourceConfiguration dataSourceConfiguration) throws DatabaseNotFoundException, DatabaseConnexionNotAuthorizedException;
+
@Get(addAuthtoken = false)
ObserveDataSourceConnection create(ObserveDataSourceConfiguration dataSourceConfiguration, DataSourceCreateConfigurationDto dataSourceCreateConfiguration)
throws IncompatibleDataSourceCreateConfigurationException, DataSourceCreateWithNoReferentialImportException,
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/e7cdd45e47c72f98550065e0db…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/e7cdd45e47c72f98550065e0db…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-9] 12 commits: update changelog [skip ci]
by Tony CHEMIT 02 Jul '19
by Tony CHEMIT 02 Jul '19
02 Jul '19
Tony CHEMIT pushed to branch develop-9 at ultreiaio / ird-observe
Commits:
84159b31 by tchemit at 2019-07-02T09:54:27Z
update changelog [skip ci]
- - - - -
e0071322 by tchemit at 2019-07-02T09:54:28Z
update libs before release
- - - - -
9db5a5ca by tchemit at 2019-07-02T09:54:28Z
N° de versions mentionnés par l'assistant migration - Closes #1330
- - - - -
305da5ac by tchemit at 2019-07-02T09:54:28Z
On ne peut pas sauvegarder une configuration d'un serveur distant en mode admin - Closes #1340
- - - - -
3fc72f6b by tchemit at 2019-07-02T14:39:38Z
Réorganisation des données d’observation PS - Réorganisation des captures et échantillons de cible et bycatch observés - See #1254
- - - - -
317b912e by tchemit at 2019-07-02T14:39:38Z
Move to new version 9.0-alpha-1
- - - - -
6be9f395 by tchemit at 2019-07-02T14:39:38Z
Réorganisation des données d’observation PS - Re localisation dans la hiérarchie - Closes #1252
- - - - -
c3d8c823 by tchemit at 2019-07-02T14:39:39Z
Module 2 (first flush)
- - - - -
f2588846 by tchemit at 2019-07-02T14:39:39Z
[PS] Contenu des onglets spécifiques observations et logbooks et le formulaire marée - See #1300
- - - - -
109aba73 by tchemit at 2019-07-02T14:39:40Z
Module 2 - second flush
- - - - -
25ba1c27 by tchemit at 2019-07-02T14:39:40Z
Report from v8 for ps logbook model
- - - - -
b3b511a6 by tchemit at 2019-07-02T14:39:40Z
Choix de nouvelles couleurs pour les symboles de la carte LL - Closes #1293
- - - - -
30 changed files:
- + .mvn/gitlab-cache/milestones/898778-artifacts.json
- .mvn/gitlab-cache/milestones/898778-issues.json
- .mvn/gitlab-cache/milestones/898778.json
- + .mvn/gitlab-cache/milestones/921497-issues.json
- + .mvn/gitlab-cache/milestones/921497.json
- .mvn/pom.gitflow.develop
- .mvn/pom.gitflow.master
- CHANGELOG.md
- client-configuration/.mvn/pom.gitflow.develop
- client-configuration/.mvn/pom.gitflow.master
- client-configuration/pom.xml
- client-configuration/src/main/config/Client.ini
- client-configuration/src/main/i18n/getters/config.getter
- client-configuration/src/main/i18n/getters/java-enumeration.getter
- client-configuration/src/main/i18n/getters/java.getter
- client-core/.mvn/pom.gitflow.develop
- client-core/.mvn/pom.gitflow.master
- client-core/pom.xml
- client-core/src/main/dcp-presets/ps/logbook/01-deployment-preset.yml
- client-core/src/main/dcp-presets/ps/logbook/02-removal-preset.yml
- client-core/src/main/dcp-presets/ps/logbook/03-update-preset.yml
- client-core/src/main/dcp-presets/ps/logbook/04-abandonned-preset.yml
- client-core/src/main/dcp-presets/ps/observation/01-deployment-preset.yml
- client-core/src/main/dcp-presets/ps/observation/02-removal-preset.yml
- client-core/src/main/dcp-presets/ps/observation/03-update-preset.yml
- client-core/src/main/i18n/getters/java.getter
- client-core/src/main/i18n/getters/jaxx.getter
- client-core/src/main/java/fr/ird/observe/client/db/ObserveSwingDataSource.java
- client-core/src/main/java/fr/ird/observe/client/navigation/RouteCloseCallback.java
- client-core/src/main/java/fr/ird/observe/client/ui/ObserveMainUI.jaxx
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/3b10df048c7299681493d74712…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/3b10df048c7299681493d74712…
You're receiving this email because of your account on gitlab.com.
1
0