Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

29 changed files:

Changes:

  • client/core/src/main/java/fr/ird/observe/client/util/init/DefaultUIInitializer.java
    ... ... @@ -46,6 +46,7 @@ import org.nuiton.jaxx.widgets.text.BigTextEditor;
    46 46
     import javax.swing.AbstractButton;
    
    47 47
     import javax.swing.JComponent;
    
    48 48
     import javax.swing.JLabel;
    
    49
    +import javax.swing.JSplitPane;
    
    49 50
     import javax.swing.JTree;
    
    50 51
     import javax.swing.KeyStroke;
    
    51 52
     import java.awt.Component;
    
    ... ... @@ -55,7 +56,6 @@ import java.util.Objects;
    55 56
     
    
    56 57
     public class DefaultUIInitializer<UI extends JComponent & JAXXObject> extends UIInitializerSupport<UI, DefaultUIInitializerContext<UI>> implements WithClientConfig, WithClientUIContext {
    
    57 58
     
    
    58
    -    public static final String OBSERVE_ACTION = "observeAction";
    
    59 59
         public static final String CLIENT_PROPERTY_FORCE_LOAD = "forceLoad";
    
    60 60
         public static final String CLIENT_PROPERTY_LIST_NO_LOAD = "listNoLoad";
    
    61 61
         //    public static final String DELEGATE_CONTENT_UI = "delegateContentUI";
    
    ... ... @@ -113,6 +113,7 @@ public class DefaultUIInitializer<UI extends JComponent & JAXXObject> extends UI
    113 113
                     .onComponents(CoordinatesEditor.class, this::init)
    
    114 114
                     .onComponents(BeanEnumEditor.class, this::init)
    
    115 115
                     .onComponents(JLabel.class, this::init)
    
    116
    +                .onComponents(JSplitPane.class, this::init)
    
    116 117
                     .onComponents(JTree.class, this::init)
    
    117 118
                     .startSecondPass();
    
    118 119
         }
    
    ... ... @@ -131,12 +132,13 @@ public class DefaultUIInitializer<UI extends JComponent & JAXXObject> extends UI
    131 132
             }
    
    132 133
         }
    
    133 134
     
    
    135
    +    private void init(JSplitPane editor) {
    
    136
    +        initializerContext.checkFirstPass();
    
    137
    +        UIInitHelper.init(editor);
    
    138
    +    }
    
    139
    +
    
    134 140
         protected void init(AbstractButton editor) {
    
    135 141
             initializerContext.checkFirstPass();
    
    136
    -        String actionId = (String) editor.getClientProperty(OBSERVE_ACTION);
    
    137
    -        if (actionId != null) {
    
    138
    -            throw new IllegalStateException(String.format("Can't use observeAction... on ui:%s - %s", ui.getClass().getName(), actionId));
    
    139
    -        }
    
    140 142
         }
    
    141 143
     
    
    142 144
         protected void init(BeanCheckBox editor) {
    

  • client/datasource/actions/src/main/i18n/getters/java.getter
    ... ... @@ -143,7 +143,9 @@ observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromLeft
    143 143
     observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromRight
    
    144 144
     observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromRightWithReplacement
    
    145 145
     observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromLeft
    
    146
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromLeftWithReplacement
    
    146 147
     observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromRight
    
    148
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromRightWithReplacement
    
    147 149
     observe.ui.datasource.editor.actions.synchro.referential.task.include.properties
    
    148 150
     observe.ui.datasource.editor.actions.synchro.referential.task.prepare
    
    149 151
     observe.ui.datasource.editor.actions.synchro.referential.task.revertFromLeft
    

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/ReferentialSynchroModel.java
    ... ... @@ -45,6 +45,8 @@ import fr.ird.observe.services.service.actions.synchro.referential.ng.Referentia
    45 45
     import fr.ird.observe.services.service.actions.synchro.referential.ng.ReferentialSynchronizeServiceEngine;
    
    46 46
     import fr.ird.observe.services.service.actions.synchro.referential.ng.task.ReferentialSynchronizeTaskType;
    
    47 47
     import fr.ird.observe.services.service.referential.differential.DifferentialEngine;
    
    48
    +import fr.ird.observe.services.service.usage.DtoUsageCountRequest;
    
    49
    +import fr.ird.observe.services.service.usage.DtoUsageCountResult;
    
    48 50
     import org.apache.logging.log4j.LogManager;
    
    49 51
     import org.apache.logging.log4j.Logger;
    
    50 52
     import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState;
    
    ... ... @@ -422,4 +424,8 @@ public class ReferentialSynchroModel extends AdminActionModel implements WithDec
    422 424
             }
    
    423 425
             return ImmutableList.copyOf(references.values());
    
    424 426
         }
    
    427
    +
    
    428
    +    public <R extends ReferentialDtoReference> DtoUsageCountResult<?> getUsageCount(boolean left, R reference) {
    
    429
    +        return (left ? getLeftSource() : getRightSource()).getUsageService().count(new DtoUsageCountRequest<>(reference.getDtoType(), reference.getId()));
    
    430
    +    }
    
    425 431
     }

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/ReferentialSynchronizeResources.java
    ... ... @@ -22,15 +22,8 @@ package fr.ird.observe.client.datasource.actions.synchronize.referential.ng;
    22 22
      * #L%
    
    23 23
      */
    
    24 24
     
    
    25
    -import com.google.common.collect.ImmutableSet;
    
    26
    -import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.task.SwingReferentialSynchronizeTask;
    
    27
    -import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.task.SwingWithIncludedPropertyNamesTask;
    
    28
    -import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.task.SwingWithReplaceDataTask;
    
    29 25
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.node.ReferentialSynchroNodeSupport;
    
    30 26
     import fr.ird.observe.client.util.UIHelper;
    
    31
    -import fr.ird.observe.dto.reference.ReferentialDtoReference;
    
    32
    -import fr.ird.observe.dto.referential.differential.Differential;
    
    33
    -import fr.ird.observe.dto.referential.differential.DifferentialPropertyList;
    
    34 27
     import fr.ird.observe.services.service.actions.synchro.referential.ng.task.ReferentialSynchronizeTaskType;
    
    35 28
     
    
    36 29
     import javax.swing.Icon;
    
    ... ... @@ -72,10 +65,6 @@ public enum ReferentialSynchronizeResources {
    72 65
                 null,
    
    73 66
                 ReferentialSynchronizeTaskType.UPDATE,
    
    74 67
                 ReferentialSynchroNodeSupport::isCanUpdate) {
    
    75
    -        @Override
    
    76
    -        public SwingReferentialSynchronizeTask createTask(boolean left, Differential differential, ReferentialDtoReference replaceReference, ImmutableSet<String> includedPropertyNames, DifferentialPropertyList includedProperties) {
    
    77
    -            return new SwingWithIncludedPropertyNamesTask(this, left, differential, includedPropertyNames, includedProperties);
    
    78
    -        }
    
    79 68
         },
    
    80 69
         COPY(
    
    81 70
                 "copyToRight",
    
    ... ... @@ -99,13 +88,16 @@ public enum ReferentialSynchronizeResources {
    99 88
                 n("observe.ui.datasource.editor.actions.synchro.referential.action.deleteFromRight.tip"),
    
    100 89
                 ReferentialSynchroModel.DELETE_LEFT_PROPERTY_NAME,
    
    101 90
                 ReferentialSynchroModel.DELETE_RIGHT_PROPERTY_NAME,
    
    102
    -            KeyStroke.getKeyStroke("pressed F6"),
    
    103
    -            KeyStroke.getKeyStroke("shift pressed F6"),
    
    91
    +            KeyStroke.getKeyStroke("pressed F5"),
    
    92
    +            KeyStroke.getKeyStroke("shift pressed F5"),
    
    104 93
                 ReferentialSynchronizeTaskType.DELETE,
    
    105 94
                 ReferentialSynchroNodeSupport::isCanDelete) {
    
    106 95
             @Override
    
    107
    -        public SwingReferentialSynchronizeTask createTask(boolean left, Differential differential, ReferentialDtoReference replaceReference, ImmutableSet<String> includedPropertyNames, DifferentialPropertyList includedProperties) {
    
    108
    -            return new SwingWithReplaceDataTask(this, left, differential, replaceReference);
    
    96
    +        public String getTaskReplaceLabel(boolean left) {
    
    97
    +            if (left) {
    
    98
    +                return n("observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromLeftWithReplacement");
    
    99
    +            }
    
    100
    +            return n("observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromRightWithReplacement");
    
    109 101
             }
    
    110 102
         },
    
    111 103
         REVERT(
    
    ... ... @@ -120,12 +112,7 @@ public enum ReferentialSynchronizeResources {
    120 112
                 KeyStroke.getKeyStroke("pressed F2"),
    
    121 113
                 KeyStroke.getKeyStroke("shift pressed F2"),
    
    122 114
                 ReferentialSynchronizeTaskType.REVERT,
    
    123
    -            ReferentialSynchroNodeSupport::isCanRevert) {
    
    124
    -        @Override
    
    125
    -        public SwingReferentialSynchronizeTask createTask(boolean left, Differential differential, ReferentialDtoReference replaceReference, ImmutableSet<String> includedPropertyNames, DifferentialPropertyList includedProperties) {
    
    126
    -            return new SwingWithIncludedPropertyNamesTask(this, left, differential, includedPropertyNames, includedProperties);
    
    127
    -        }
    
    128
    -    },
    
    115
    +            ReferentialSynchroNodeSupport::isCanRevert),
    
    129 116
         DEACTIVATE(
    
    130 117
                 "deactivateFromLeft",
    
    131 118
                 "deactivateFromRight",
    
    ... ... @@ -151,12 +138,7 @@ public enum ReferentialSynchronizeResources {
    151 138
                 KeyStroke.getKeyStroke("pressed F4"),
    
    152 139
                 KeyStroke.getKeyStroke("shift pressed F4"),
    
    153 140
                 ReferentialSynchronizeTaskType.DEACTIVATE_WITH_REPLACEMENT,
    
    154
    -            ReferentialSynchroNodeSupport::isCanDelete) {
    
    155
    -        @Override
    
    156
    -        public SwingReferentialSynchronizeTask createTask(boolean left, Differential differential, ReferentialDtoReference replaceReference, ImmutableSet<String> includedPropertyNames, DifferentialPropertyList includedProperties) {
    
    157
    -            return new SwingWithReplaceDataTask(this, left, differential, replaceReference);
    
    158
    -        }
    
    159
    -    };
    
    141
    +            ReferentialSynchroNodeSupport::isCanDelete);
    
    160 142
     
    
    161 143
         private final String leftActionName;
    
    162 144
         private final String leftTaskI18nKey;
    
    ... ... @@ -215,6 +197,10 @@ public enum ReferentialSynchronizeResources {
    215 197
             return left ? leftTaskI18nKey : rightTaskI18nKey;
    
    216 198
         }
    
    217 199
     
    
    200
    +    public String getTaskReplaceLabel(boolean left) {
    
    201
    +        return getTaskLabel(left);
    
    202
    +    }
    
    203
    +
    
    218 204
         public String getActionTip(boolean left) {
    
    219 205
             return left ? leftActionTipI18nKey : rightActionTipI18nKey;
    
    220 206
         }
    
    ... ... @@ -235,14 +221,6 @@ public enum ReferentialSynchronizeResources {
    235 221
             return taskType != null && taskType.withProperties();
    
    236 222
         }
    
    237 223
     
    
    238
    -    public boolean withReplace() {
    
    239
    -        return taskType != null && taskType.withReplace();
    
    240
    -    }
    
    241
    -
    
    242
    -    public SwingReferentialSynchronizeTask createTask(boolean left, Differential differential, ReferentialDtoReference replaceReference, ImmutableSet<String> includedPropertyNames, DifferentialPropertyList includedProperties) {
    
    243
    -        return new SwingReferentialSynchronizeTask(this, left, differential);
    
    244
    -    }
    
    245
    -
    
    246 224
         public KeyStroke getKeyStroke(boolean left) {
    
    247 225
             return left ? leftKeyStroke : rightKeyStroke;
    
    248 226
         }
    

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/actions/ReferentialSynchroUIActionSupport.java
    ... ... @@ -23,56 +23,12 @@ package fr.ird.observe.client.datasource.actions.synchronize.referential.ng.acti
    23 23
      */
    
    24 24
     
    
    25 25
     import fr.ird.observe.client.datasource.actions.actions.AdminTabUIActionSupport;
    
    26
    -import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialSynchroModel;
    
    27 26
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialSynchroUI;
    
    28
    -import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.ReferentialSynchronizeTreeModel;
    
    29
    -
    
    30
    -import javax.swing.KeyStroke;
    
    31 27
     
    
    32 28
     abstract class ReferentialSynchroUIActionSupport extends AdminTabUIActionSupport<ReferentialSynchroUI> {
    
    33 29
     
    
    34
    -    ReferentialSynchroUIActionSupport(String label, String shortDescription, String actionIcon, KeyStroke acceleratorKey) {
    
    35
    -        super(label, shortDescription, actionIcon, acceleratorKey);
    
    36
    -    }
    
    37
    -
    
    38 30
         ReferentialSynchroUIActionSupport(String label, String shortDescription, String actionIcon, char acceleratorKey) {
    
    39 31
             super(label, shortDescription, actionIcon, acceleratorKey);
    
    40 32
         }
    
    41 33
     
    
    42
    -
    
    43
    -    protected void updateLeftEnableActions(ReferentialSynchronizeTreeModel treeModel) {
    
    44
    -
    
    45
    -        ReferentialSynchroModel stepModel = ui.getStepModel();
    
    46
    -
    
    47
    -        treeModel.updateSelectedActions();
    
    48
    -        stepModel.setCopyLeft(treeModel.isCanAdd() || treeModel.isCanUpdate());
    
    49
    -        stepModel.setDeleteLeft(treeModel.isCanDelete());
    
    50
    -        stepModel.setDeactivateLeft(treeModel.isCanDelete());
    
    51
    -        stepModel.setDeactivateWithReplaceLeft(treeModel.isCanDelete());
    
    52
    -        stepModel.setRevertLeft(treeModel.isCanRevert());
    
    53
    -        stepModel.setSkipLeft(treeModel.isCanSkip());
    
    54
    -    }
    
    55
    -
    
    56
    -    protected void updateRightEnableActions(ReferentialSynchronizeTreeModel treeModel) {
    
    57
    -
    
    58
    -        ReferentialSynchroModel stepModel = ui.getStepModel();
    
    59
    -
    
    60
    -        treeModel.updateSelectedActions();
    
    61
    -        stepModel.setCopyRight(treeModel.isCanAdd() || treeModel.isCanUpdate());
    
    62
    -        stepModel.setDeleteRight(treeModel.isCanDelete());
    
    63
    -        stepModel.setDeactivateRight(treeModel.isCanDelete());
    
    64
    -        stepModel.setDeactivateWithReplaceRight(treeModel.isCanDelete());
    
    65
    -        stepModel.setRevertRight(treeModel.isCanRevert());
    
    66
    -        stepModel.setSkipRight(treeModel.isCanSkip());
    
    67
    -    }
    
    68
    -
    
    69
    -
    
    70
    -    protected void updateActions(ReferentialSynchronizeTreeModel treeModel) {
    
    71
    -        if (treeModel.isLeft()) {
    
    72
    -            updateLeftEnableActions(treeModel);
    
    73
    -        } else {
    
    74
    -            updateRightEnableActions(treeModel);
    
    75
    -        }
    
    76
    -    }
    
    77
    -
    
    78 34
     }

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/actions/Start.java
    ... ... @@ -30,6 +30,7 @@ import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.
    30 30
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.ReferentialSelectionTreePane;
    
    31 31
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.ReferentialSynchronizeTreeModel;
    
    32 32
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.ReferentialSynchronizeTreeModelsBuilder;
    
    33
    +import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.actions.RegisterTaskActionSupport;
    
    33 34
     import fr.ird.observe.client.datasource.api.ObserveSwingDataSource;
    
    34 35
     import fr.ird.observe.client.datasource.editor.api.wizard.connexion.DataSourceSelectorModel;
    
    35 36
     import fr.ird.observe.dto.ProgressionModel;
    
    ... ... @@ -93,13 +94,13 @@ public class Start extends ReferentialSynchroUIActionSupport {
    93 94
                      stepModel.getLeftTreeModel(),
    
    94 95
                      model.getConfigModel().getLeftSourceModel(),
    
    95 96
                      t("observe.ui.datasource.editor.actions.synchro.referential.message.referential.leftData.loaded"),
    
    96
    -                 evt -> updateLeftEnableActions(stepModel.getLeftTreeModel()));
    
    97
    +                 evt -> RegisterTaskActionSupport.updateActions(stepModel, stepModel.getLeftTreeModel()));
    
    97 98
     
    
    98 99
             initTree(ui.getRightTreePane(),
    
    99 100
                      stepModel.getRightTreeModel(),
    
    100 101
                      model.getConfigModel().getRightSourceModel(),
    
    101 102
                      t("observe.ui.datasource.editor.actions.synchro.referential.message.referential.rightData.loaded"),
    
    102
    -                 evt -> updateRightEnableActions(stepModel.getRightTreeModel()));
    
    103
    +                 evt -> RegisterTaskActionSupport.updateActions(stepModel, stepModel.getRightTreeModel()));
    
    103 104
     
    
    104 105
             return WizardState.NEED_FIX;
    
    105 106
         }
    

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/task/SwingReferentialSynchronizeTask.java
    ... ... @@ -49,21 +49,23 @@ public class SwingReferentialSynchronizeTask implements WithDecoratorService {
    49 49
         private final String i18nKey;
    
    50 50
         private final Differential differential;
    
    51 51
         private final Icon icon;
    
    52
    -    //    private final ReferentialSynchronizeResources resource;
    
    53 52
         private final boolean left;
    
    54 53
         private final ReferentialSynchronizeTaskType taskType;
    
    55 54
     
    
    56
    -    public SwingReferentialSynchronizeTask(ReferentialSynchronizeResources resource, boolean left, Differential differential) {
    
    57
    -//        this.resource = resource;
    
    58
    -        this.left = left;
    
    55
    +    public SwingReferentialSynchronizeTask(String i18nKey, Differential differential, Icon icon, boolean left, ReferentialSynchronizeTaskType taskType) {
    
    56
    +        this.i18nKey = i18nKey;
    
    59 57
             this.differential = differential;
    
    60
    -        this.icon = resource.getIcon(left);
    
    61
    -        this.i18nKey = resource.getTaskLabel(left);
    
    62
    -        this.taskType = resource.getTaskType();
    
    58
    +        this.icon = icon;
    
    59
    +        this.left = left;
    
    60
    +        this.taskType = taskType;
    
    63 61
             this.dataStr = differential.getLabel(getDecoratorService());
    
    64 62
             this.typeStr = t(ContentReferentialUII18nHelper.getType(differential.getDtoType()));
    
    65 63
         }
    
    66 64
     
    
    65
    +    public SwingReferentialSynchronizeTask(ReferentialSynchronizeResources resource, boolean left, Differential differential) {
    
    66
    +        this(resource.getTaskLabel(left), differential, resource.getIcon(left), left, resource.getTaskType());
    
    67
    +    }
    
    68
    +
    
    67 69
         public final Differential getDifferential() {
    
    68 70
             return differential;
    
    69 71
         }
    

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/task/SwingWithReplaceDataTask.java
    ... ... @@ -28,7 +28,6 @@ import fr.ird.observe.dto.referential.differential.Differential;
    28 28
     import fr.ird.observe.services.service.actions.synchro.referential.ng.task.ReferentialSynchronizeTask;
    
    29 29
     
    
    30 30
     import java.util.Date;
    
    31
    -import java.util.Objects;
    
    32 31
     
    
    33 32
     import static io.ultreia.java4all.i18n.I18n.t;
    
    34 33
     
    
    ... ... @@ -42,8 +41,8 @@ public class SwingWithReplaceDataTask extends SwingReferentialSynchronizeTask {
    42 41
         private final String replaceDataStr;
    
    43 42
     
    
    44 43
         public SwingWithReplaceDataTask(ReferentialSynchronizeResources resource, boolean left, Differential differential, ReferentialDtoReference replaceData) {
    
    45
    -        super(resource, left, differential);
    
    46
    -        this.replaceData = Objects.requireNonNull(replaceData);
    
    44
    +        super(resource.getTaskReplaceLabel(left), differential, resource.getIcon(left), left, resource.getTaskType());
    
    45
    +        this.replaceData = replaceData;
    
    47 46
             this.replaceDataStr = getDecoratorService().getReferentialReferenceDecorator(replaceData.getClass()).toString(replaceData);
    
    48 47
         }
    
    49 48
     
    

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/tree/ReferentialSelectionTreePaneHandler.java
    ... ... @@ -32,6 +32,7 @@ import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.
    32 32
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.actions.RegisterDelete;
    
    33 33
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.actions.RegisterRevert;
    
    34 34
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.actions.SelectUnselect;
    
    35
    +import fr.ird.observe.client.util.init.DefaultUIInitializer;
    
    35 36
     import org.nuiton.jaxx.runtime.spi.UIHandler;
    
    36 37
     
    
    37 38
     import java.awt.BorderLayout;
    
    ... ... @@ -42,6 +43,11 @@ import java.awt.BorderLayout;
    42 43
      */
    
    43 44
     public class ReferentialSelectionTreePaneHandler implements UIHandler<ReferentialSelectionTreePane> {
    
    44 45
     
    
    46
    +    @Override
    
    47
    +    public void afterInit(ReferentialSelectionTreePane ui) {
    
    48
    +        DefaultUIInitializer.doInit(ui);
    
    49
    +    }
    
    50
    +
    
    45 51
         void init(ReferentialSelectionTreePane ui) {
    
    46 52
             ReferentialSynchroUI parent = ui.getContextValue(ReferentialSynchroUI.class, ReferentialSynchroUIHandler.ADMIN_TAB_UI);
    
    47 53
             ReferentialSynchroModel stepModel = parent.getStepModel();
    

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/tree/ReferentialSynchronizeTreeModel.java
    ... ... @@ -33,7 +33,6 @@ import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.
    33 33
     import fr.ird.observe.dto.referential.ReferentialDto;
    
    34 34
     
    
    35 35
     import javax.swing.tree.DefaultTreeModel;
    
    36
    -import javax.swing.tree.TreeNode;
    
    37 36
     import java.beans.PropertyChangeListener;
    
    38 37
     import java.beans.PropertyChangeSupport;
    
    39 38
     import java.util.Collection;
    
    ... ... @@ -87,7 +86,7 @@ public class ReferentialSynchronizeTreeModel extends DefaultTreeModel {
    87 86
                 if (node instanceof ReferentialTypeSynchroNode) {
    
    88 87
                     ReferentialTypeSynchroNode node1 = (ReferentialTypeSynchroNode) node;
    
    89 88
                     node1.updateSelect(value);
    
    90
    -                Enumeration<? extends TreeNode> children = node1.children();
    
    89
    +                Enumeration<?> children = node1.children();
    
    91 90
                     while (children.hasMoreElements()) {
    
    92 91
                         ReferentialSynchroNodeSupport childNode = (ReferentialSynchroNodeSupport) children.nextElement();
    
    93 92
                         updateSelected(value, childNode);
    

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/tree/actions/RegisterDeactivateWithReplacement.java
    ... ... @@ -37,6 +37,11 @@ public class RegisterDeactivateWithReplacement extends RegisterTaskActionSupport
    37 37
             super(ui, ReferentialSynchronizeResources.DEACTIVATE_WITH_REPLACEMENT, left);
    
    38 38
         }
    
    39 39
     
    
    40
    +    protected <R extends ReferentialDtoReference> boolean shouldReplace(R reference) {
    
    41
    +        // always ask a replacement for this task
    
    42
    +        return true;
    
    43
    +    }
    
    44
    +
    
    40 45
         @Override
    
    41 46
         protected String getReplaceTitle(ReferentialDtoReference reference) {
    
    42 47
             return t("observe.ui.datasource.editor.actions.synchro.referential.replaceBeforeDeactivate.title", typeStr, referenceStr);
    

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/tree/actions/RegisterDelete.java
    ... ... @@ -22,9 +22,11 @@ package fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree
    22 22
      * #L%
    
    23 23
      */
    
    24 24
     
    
    25
    +import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialSynchroModel;
    
    25 26
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialSynchronizeResources;
    
    26 27
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.ReferentialSelectionTreePane;
    
    27 28
     import fr.ird.observe.dto.reference.ReferentialDtoReference;
    
    29
    +import fr.ird.observe.services.service.usage.DtoUsageCountResult;
    
    28 30
     
    
    29 31
     import static io.ultreia.java4all.i18n.I18n.t;
    
    30 32
     
    
    ... ... @@ -42,4 +44,11 @@ public class RegisterDelete extends RegisterTaskActionSupport {
    42 44
             return t("observe.ui.datasource.editor.actions.synchro.referential.replaceBeforeDelete.title", typeStr, referenceStr);
    
    43 45
         }
    
    44 46
     
    
    47
    +    @Override
    
    48
    +    protected <R extends ReferentialDtoReference> boolean shouldReplace(R reference) {
    
    49
    +        // check if there is some data using it
    
    50
    +        ReferentialSynchroModel stepModel = parentUI.getStepModel();
    
    51
    +        DtoUsageCountResult<?> usages = stepModel.getUsageCount(isLeft(), reference);
    
    52
    +        return !usages.isEmpty();
    
    53
    +    }
    
    45 54
     }

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/tree/actions/RegisterTaskActionSupport.java
    ... ... @@ -24,9 +24,6 @@ package fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree
    24 24
     
    
    25 25
     import com.google.common.collect.ImmutableList;
    
    26 26
     import com.google.common.collect.ImmutableSet;
    
    27
    -import fr.ird.observe.client.datasource.actions.AdminStep;
    
    28
    -import fr.ird.observe.client.datasource.actions.AdminTabUI;
    
    29
    -import fr.ird.observe.client.datasource.actions.AdminUI;
    
    30 27
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialReplaceUI;
    
    31 28
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialReplaceUIHandler;
    
    32 29
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialSynchroModel;
    
    ... ... @@ -34,6 +31,7 @@ import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.Refer
    34 31
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialSynchronizeResources;
    
    35 32
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.task.SwingReferentialSynchronizeTask;
    
    36 33
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.task.SwingWithIncludedPropertyNamesTask;
    
    34
    +import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.task.SwingWithReplaceDataTask;
    
    37 35
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.ReferentialSelectionTree;
    
    38 36
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.ReferentialSelectionTreePane;
    
    39 37
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.ReferentialSynchronizeTreeModel;
    
    ... ... @@ -80,16 +78,32 @@ import static io.ultreia.java4all.i18n.I18n.t;
    80 78
     public abstract class RegisterTaskActionSupport extends ReferentialSelectionTreePaneActionSupport implements WithDecoratorService {
    
    81 79
     
    
    82 80
         private static final Logger log = LogManager.getLogger(RegisterTaskActionSupport.class);
    
    81
    +    protected final ReferentialSynchroUI parentUI;
    
    83 82
         final Predicate<ReferentialSynchroNodeSupport> predicate;
    
    84 83
         final ReferentialSelectionTreePane ui;
    
    85 84
         private final boolean left;
    
    86
    -    private final boolean needReplace;
    
    87 85
         private final ReferentialSynchronizeTaskType taskType;
    
    88 86
         private final ReferentialSynchronizeResources resource;
    
    89
    -    private final ReferentialSynchroUI parentUI;
    
    90 87
         String typeStr;
    
    91 88
         String referenceStr;
    
    92 89
     
    
    90
    +    public static void updateActions(ReferentialSynchroModel stepModel, ReferentialSynchronizeTreeModel treeModel) {
    
    91
    +        treeModel.updateSelectedActions();
    
    92
    +        if (treeModel.isLeft()) {
    
    93
    +            stepModel.setCopyLeft(treeModel.isCanAdd() || treeModel.isCanUpdate());
    
    94
    +            stepModel.setDeleteLeft(treeModel.isCanDelete());
    
    95
    +            stepModel.setDeactivateLeft(treeModel.isCanDelete());
    
    96
    +            stepModel.setDeactivateWithReplaceLeft(treeModel.isCanDelete());
    
    97
    +            stepModel.setRevertLeft(treeModel.isCanRevert());
    
    98
    +        } else {
    
    99
    +            stepModel.setCopyRight(treeModel.isCanAdd() || treeModel.isCanUpdate());
    
    100
    +            stepModel.setDeleteRight(treeModel.isCanDelete());
    
    101
    +            stepModel.setDeactivateRight(treeModel.isCanDelete());
    
    102
    +            stepModel.setDeactivateWithReplaceRight(treeModel.isCanDelete());
    
    103
    +            stepModel.setRevertRight(treeModel.isCanRevert());
    
    104
    +        }
    
    105
    +    }
    
    106
    +
    
    93 107
         RegisterTaskActionSupport(ReferentialSelectionTreePane ui, ReferentialSynchronizeResources resource, boolean left) {
    
    94 108
             super("", null, null, Objects.requireNonNull(resource).getKeyStroke(left));
    
    95 109
             this.resource = resource;
    
    ... ... @@ -104,7 +118,7 @@ public abstract class RegisterTaskActionSupport extends ReferentialSelectionTree
    104 118
             this.ui = ui;
    
    105 119
             this.left = left;
    
    106 120
             this.taskType = resource.getTaskType();
    
    107
    -        this.needReplace = resource.withReplace();
    
    121
    +//        this.needReplace = resource.withReplace();
    
    108 122
             parentUI = ui.getContextValue(ReferentialSynchroUI.class, "synchroParent");
    
    109 123
     
    
    110 124
             Predicate<ReferentialSynchroNodeSupport> predicate = resource.getPredicate();
    
    ... ... @@ -127,7 +141,15 @@ public abstract class RegisterTaskActionSupport extends ReferentialSelectionTree
    127 141
         }
    
    128 142
     
    
    129 143
         protected final SwingReferentialSynchronizeTask createTask(boolean left, Differential differential, ReferentialDtoReference replaceReference, ImmutableSet<String> includedPropertyNames, DifferentialPropertyList includedModifiedProperties) {
    
    130
    -        return getResource().createTask(left, differential, replaceReference, includedPropertyNames, includedModifiedProperties);
    
    144
    +        ReferentialSynchronizeResources resource = getResource();
    
    145
    +        if (replaceReference != null) {
    
    146
    +            return new SwingWithReplaceDataTask(resource, left, differential, replaceReference);
    
    147
    +        }
    
    148
    +        if (resource.withProperties()) {
    
    149
    +            return new SwingWithIncludedPropertyNamesTask(resource, left, differential, includedPropertyNames, includedModifiedProperties);
    
    150
    +
    
    151
    +        }
    
    152
    +        return new SwingReferentialSynchronizeTask(resource, left, differential);
    
    131 153
         }
    
    132 154
     
    
    133 155
         public ReferentialSynchronizeResources getResource() {
    
    ... ... @@ -147,7 +169,7 @@ public abstract class RegisterTaskActionSupport extends ReferentialSelectionTree
    147 169
             ReferentialSynchronizeTreeModel treeModel = getTreeModel();
    
    148 170
             createTasks();
    
    149 171
             treeModel.clearSelection();
    
    150
    -        updateActions(treeModel);
    
    172
    +        updateActions(parentUI.getStepModel(), treeModel);
    
    151 173
             SwingUtilities.invokeLater(getTree()::repaint);
    
    152 174
         }
    
    153 175
     
    
    ... ... @@ -189,6 +211,11 @@ public abstract class RegisterTaskActionSupport extends ReferentialSelectionTree
    189 211
             }
    
    190 212
         }
    
    191 213
     
    
    214
    +    protected <R extends ReferentialDtoReference> boolean shouldReplace(R reference) {
    
    215
    +        // by default never ask for a replacement
    
    216
    +        return false;
    
    217
    +    }
    
    218
    +
    
    192 219
         @SuppressWarnings("unchecked")
    
    193 220
         public <R extends ReferentialDtoReference> void process(ReferentialSynchroNodeSupport node,
    
    194 221
                                                                 Collection<SwingReferentialSynchronizeTask> addedTasks,
    
    ... ... @@ -198,7 +225,7 @@ public abstract class RegisterTaskActionSupport extends ReferentialSelectionTree
    198 225
             R reference = (R) node.getReferentialReference();
    
    199 226
             R replaceReference = null;
    
    200 227
     
    
    201
    -        if (needReplace) {
    
    228
    +        if (shouldReplace(reference)) {
    
    202 229
     
    
    203 230
                 Class<R> type = (Class<R>) reference.getReferenceType();
    
    204 231
                 List<R> references = new LinkedList<>(parentUI.getStepModel().getPossibleReplaceUniverse(left, reference));
    
    ... ... @@ -301,63 +328,14 @@ public abstract class RegisterTaskActionSupport extends ReferentialSelectionTree
    301 328
         }
    
    302 329
     
    
    303 330
         public String sendMessage(String message) {
    
    304
    -        AdminStep step = parentUI.getStep();
    
    305
    -        addMessage(step, message);
    
    331
    +        addMessage(message);
    
    306 332
             return message;
    
    307 333
         }
    
    308 334
     
    
    309
    -
    
    310
    -    public void addMessage(AdminStep step, String text) {
    
    335
    +    public void addMessage(String text) {
    
    311 336
             JTextArea progression = parentUI.getProgression();
    
    312 337
             progression.append(text + "\n");
    
    313 338
             progression.setCaretPosition(progression.getDocument().getLength());
    
    314 339
         }
    
    315 340
     
    
    316
    -    public void addMessage(AdminTabUI ui, AdminStep step, String text) {
    
    317
    -        JTextArea progression = ui.getProgression();
    
    318
    -        progression.append(text + "\n");
    
    319
    -        progression.setCaretPosition(progression.getDocument().getLength());
    
    320
    -    }
    
    321
    -
    
    322
    -
    
    323
    -    protected AdminUI getParentUI() {
    
    324
    -        return parentUI.getContextValue(AdminUI.class, "parent");
    
    325
    -    }
    
    326
    -
    
    327
    -
    
    328
    -    protected void updateLeftEnableActions(ReferentialSynchronizeTreeModel treeModel) {
    
    329
    -
    
    330
    -        ReferentialSynchroModel stepModel = parentUI.getStepModel();
    
    331
    -
    
    332
    -        treeModel.updateSelectedActions();
    
    333
    -        stepModel.setCopyLeft(treeModel.isCanAdd() || treeModel.isCanUpdate());
    
    334
    -        stepModel.setDeleteLeft(treeModel.isCanDelete());
    
    335
    -        stepModel.setDeactivateLeft(treeModel.isCanDelete());
    
    336
    -        stepModel.setDeactivateWithReplaceLeft(treeModel.isCanDelete());
    
    337
    -        stepModel.setRevertLeft(treeModel.isCanRevert());
    
    338
    -        stepModel.setSkipLeft(treeModel.isCanSkip());
    
    339
    -    }
    
    340
    -
    
    341
    -    protected void updateRightEnableActions(ReferentialSynchronizeTreeModel treeModel) {
    
    342
    -
    
    343
    -        ReferentialSynchroModel stepModel = parentUI.getStepModel();
    
    344
    -
    
    345
    -        treeModel.updateSelectedActions();
    
    346
    -        stepModel.setCopyRight(treeModel.isCanAdd() || treeModel.isCanUpdate());
    
    347
    -        stepModel.setDeleteRight(treeModel.isCanDelete());
    
    348
    -        stepModel.setDeactivateRight(treeModel.isCanDelete());
    
    349
    -        stepModel.setDeactivateWithReplaceRight(treeModel.isCanDelete());
    
    350
    -        stepModel.setRevertRight(treeModel.isCanRevert());
    
    351
    -        stepModel.setSkipRight(treeModel.isCanSkip());
    
    352
    -    }
    
    353
    -
    
    354
    -
    
    355
    -    protected void updateActions(ReferentialSynchronizeTreeModel treeModel) {
    
    356
    -        if (treeModel.isLeft()) {
    
    357
    -            updateLeftEnableActions(treeModel);
    
    358
    -        } else {
    
    359
    -            updateRightEnableActions(treeModel);
    
    360
    -        }
    
    361
    -    }
    
    362
    -
    
    363 341
     }

  • client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/ContentUIInitializer.java
    ... ... @@ -74,6 +74,7 @@ import javax.swing.JComponent;
    74 74
     import javax.swing.JLabel;
    
    75 75
     import javax.swing.JList;
    
    76 76
     import javax.swing.JScrollBar;
    
    77
    +import javax.swing.JSplitPane;
    
    77 78
     import javax.swing.JTabbedPane;
    
    78 79
     import javax.swing.JToolBar;
    
    79 80
     import javax.swing.KeyStroke;
    
    ... ... @@ -193,6 +194,7 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup
    193 194
                     .onComponents(BeanEnumEditor.class, this::init)
    
    194 195
                     .onComponents(ObserveSwingValidator.class, this::init)
    
    195 196
                     .onComponents(JLabel.class, this::init)
    
    197
    +                .onComponents(JSplitPane.class, this::init)
    
    196 198
                     .onComponents(BigTextEditor.class, this::init)
    
    197 199
                     .onComponents(UrlEditor.class, this::init)
    
    198 200
                     .onComponents(NormalTextEditor.class, this::init)
    

  • client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/list/actions/GotoSelectedData.java
    ... ... @@ -44,7 +44,7 @@ public final class GotoSelectedData<D extends DataDto, R extends DataDtoReferenc
    44 44
     
    
    45 45
         public GotoSelectedData(Class<D> dataType) {
    
    46 46
             super(dataType, null, null, "go-down", ObserveKeyStrokesEditorApi.KEY_STROKE_ALT_ENTER);
    
    47
    -        setText(ContentListUII18nHelper.getListActionGoToSelected(getDataType()));
    
    47
    +        setText(ContentListUII18nHelper.getActionGoToSelected(getDataType()));
    
    48 48
         }
    
    49 49
     
    
    50 50
         @Override
    

  • client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/navigation/NavigationUIHandler.java
    ... ... @@ -93,7 +93,7 @@ public class NavigationUIHandler implements UIHandler<NavigationUI> {
    93 93
         @Override
    
    94 94
         public void afterInit(NavigationUI ui) {
    
    95 95
             UIInitializerResult initializerResult = new Init(ui).initUI();
    
    96
    -        actionsToReload = ReloadAction.collect(initializerResult.getComponents(AbstractButton.class));
    
    96
    +        actionsToReload = ReloadAction.collect(initializerResult.getSubComponents(AbstractButton.class));
    
    97 97
         }
    
    98 98
     
    
    99 99
         public void updateActions(NavigationNode selectedNode) {
    

  • client/datasource/editor/api/src/main/resources/fr/ird/observe/client/datasource/editor/api/content/data/list/ContentListUI.keys
    1 1
     type
    
    2 2
     list.title
    
    3 3
     list.message.none
    
    4
    -list.action.goToSelected
    
    5 4
     list.navigation.node
    
    6 5
     action.create
    
    7 6
     action.create.tip
    
    8 7
     action.goToOpen
    
    9 8
     action.goToOpen.short
    
    9
    +action.goToSelected
    
    10 10
     action.move.tip
    
    11 11
     action.move
    
    12 12
     action.move.choose.parent.title
    

  • client/i18n/src/main/i18n/translations/observe_en_GB.properties
    ... ... @@ -1405,8 +1405,10 @@ observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromLeft
    1405 1405
     observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromLeftWithReplacement=Disable in left database\: <i>%s</i> - «<b>%s</b>» to replace by «<b>%s</b>»
    
    1406 1406
     observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromRight=Disable in right database\: <i>%s</i> - «<b>%s</b>»
    
    1407 1407
     observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromRightWithReplacement=Disable in right database\: <i>%s</i> - «<b>%s</b>» to replace by «<b>%s</b>»
    
    1408
    -observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromLeft=Delete in left database\: <i>%s</i> - «<b>%s</b>» to replace by «<b>%s</b>»
    
    1409
    -observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromRight=Delete in right database\: <i>%s</i> - «<b>%s</b>» to replace by «<b>%s</b>»
    
    1408
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromLeft=Delete in left database\: <i>%s</i> - «<b>%s</b>» with no replacement
    
    1409
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromLeftWithReplacement=Delete in left database\: <i>%s</i> - «<b>%s</b>» to replace by «<b>%s</b>»
    
    1410
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromRight=Delete in right database\: <i>%s</i> - «<b>%s</b>» with no replacement
    
    1411
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromRightWithReplacement=Delete in right database\: <i>%s</i> - «<b>%s</b>» to replace by «<b>%s</b>»
    
    1410 1412
     observe.ui.datasource.editor.actions.synchro.referential.task.include.properties=Included properties\: %s
    
    1411 1413
     observe.ui.datasource.editor.actions.synchro.referential.task.prepare=Register action %s\n  * old left last update date \: %s\n  * old right last update date \: %s\n  * new last update date \: %s
    
    1412 1414
     observe.ui.datasource.editor.actions.synchro.referential.task.revertFromLeft=Revert in left database\: <i>%s</i> - «<b>%s</b>»
    

  • client/i18n/src/main/i18n/translations/observe_es_ES.properties
    ... ... @@ -1405,8 +1405,10 @@ observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromLeft
    1405 1405
     observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromLeftWithReplacement=Desactivar en la base de la iquierda \: <i>%s</i> - «<b>%s</b>» debe ser reemplazado por «<b>%s</b>»
    
    1406 1406
     observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromRight=Desactivar en la base de la derecha \: <i>%s</i> - «<b>%s</b>»
    
    1407 1407
     observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromRightWithReplacement=Desactivar en la base de la derecha \: <i>%s</i> - «<b>%s</b>» debe ser reemplazado por «<b>%s</b>»
    
    1408
    -observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromLeft=Eliminar en la base de la izquierda\: <i>%s</i> - «<b>%s</b>» debe ser reemplazado por «<b>%s</b>»
    
    1409
    -observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromRight=Eliminar en la base de la izquierda \: <i>%s</i> - «<b>%s</b>» debe ser reemplazado por «<b>%s</b>»
    
    1408
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromLeft=Eliminar en la base de la izquierda\: <i>%s</i> - «<b>%s</b>»
    
    1409
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromLeftWithReplacement=Eliminar en la base de la izquierda\: <i>%s</i> - «<b>%s</b>» debe ser reemplazado por «<b>%s</b>»
    
    1410
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromRight=Eliminar en la base de la izquierda \: <i>%s</i> - «<b>%s</b>»
    
    1411
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromRightWithReplacement=Eliminar en la base de la izquierda \: <i>%s</i> - «<b>%s</b>» debe ser reemplazado por «<b>%s</b>»
    
    1410 1412
     observe.ui.datasource.editor.actions.synchro.referential.task.include.properties=Included properties\: %s \#TODO
    
    1411 1413
     observe.ui.datasource.editor.actions.synchro.referential.task.prepare=Registro de la acción %s\n  * old left last update date \: %s\n  * old right last update date \: %s\n  * new last update date \: %s \#TODO
    
    1412 1414
     observe.ui.datasource.editor.actions.synchro.referential.task.revertFromLeft=Volver atrás en la base de la izquierda \: <i>%s</i> - «<b>%s</b>»
    

  • client/i18n/src/main/i18n/translations/observe_fr_FR.properties
    ... ... @@ -1405,8 +1405,10 @@ observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromLeft
    1405 1405
     observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromLeftWithReplacement=Désactiver dans la base de gauche \: <i>%s</i> - «<b>%s</b>» à remplacer par «<b>%s</b>»
    
    1406 1406
     observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromRight=Désactiver dans la base de droite \: <i>%s</i> - «<b>%s</b>»
    
    1407 1407
     observe.ui.datasource.editor.actions.synchro.referential.task.deactivateFromRightWithReplacement=Désactiver dans la base de droite \: <i>%s</i> - «<b>%s</b>» à remplacer par «<b>%s</b>»
    
    1408
    -observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromLeft=Supprimer dans la base de gauche \: <i>%s</i> - «<b>%s</b>» à remplacer par «<b>%s</b>»
    
    1409
    -observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromRight=Supprimer dans la base de droite \: <i>%s</i> - «<b>%s</b>» à remplacer par «<b>%s</b>»
    
    1408
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromLeft=Supprimer dans la base de gauche \: <i>%s</i> - «<b>%s</b>» sans remplacement
    
    1409
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromLeftWithReplacement=Supprimer dans la base de gauche \: <i>%s</i> - «<b>%s</b>» à remplacer par «<b>%s</b>»
    
    1410
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromRight=Supprimer dans la base de droite \: <i>%s</i> - «<b>%s</b>» sans remplacement
    
    1411
    +observe.ui.datasource.editor.actions.synchro.referential.task.deleteFromRightWithReplacement=Supprimer dans la base de droite \: <i>%s</i> - «<b>%s</b>» à remplacer par «<b>%s</b>»
    
    1410 1412
     observe.ui.datasource.editor.actions.synchro.referential.task.include.properties=Propriétés incluses \: %s
    
    1411 1413
     observe.ui.datasource.editor.actions.synchro.referential.task.prepare=Enregistrement de l'action %s\n  * ancienne date de mise à jour à gauche \: %s\n  * ancienne date de mise à jourà droite \: %s\n  * nouvelle date de mise à jour \: %s
    
    1412 1414
     observe.ui.datasource.editor.actions.synchro.referential.task.revertFromLeft=Revenir en arrière dans la base de gauche \: <i>%s</i> - «<b>%s</b>»
    

  • models/persistence/src/main/java/fr/ird/observe/entities/data/ps/observation/SetImpl.java
    ... ... @@ -22,7 +22,6 @@
    22 22
     package fr.ird.observe.entities.data.ps.observation;
    
    23 23
     
    
    24 24
     import com.google.common.collect.ImmutableSet;
    
    25
    -import fr.ird.observe.dto.IdDto;
    
    26 25
     import fr.ird.observe.dto.ProtectedIdsPs;
    
    27 26
     import fr.ird.observe.dto.data.DataDto;
    
    28 27
     import fr.ird.observe.dto.data.ps.observation.DiscardedTargetCatchDto;
    
    ... ... @@ -44,7 +43,6 @@ import fr.ird.observe.entities.referential.ps.common.SpeciesFate;
    44 43
     import org.nuiton.util.DateUtil;
    
    45 44
     import org.nuiton.util.NumberUtil;
    
    46 45
     
    
    47
    -import java.util.Collection;
    
    48 46
     import java.util.Date;
    
    49 47
     import java.util.List;
    
    50 48
     import java.util.Objects;
    
    ... ... @@ -185,11 +183,11 @@ public class SetImpl extends SetAbstract {
    185 183
         @Override
    
    186 184
         public <D extends DataDto> void toDto(ReferentialLocale referentialLocale, D dto) {
    
    187 185
             if (dto instanceof SetDiscardedTargetCatchDto) {
    
    188
    -            toSetTargetCatchDto(true, referentialLocale, dto, DiscardedTargetCatchDto.class);
    
    186
    +            toSetDiscardedTargetCatchDto(referentialLocale, (SetDiscardedTargetCatchDto) dto);
    
    189 187
                 return;
    
    190 188
             }
    
    191 189
             if (dto instanceof SetKeptTargetCatchDto) {
    
    192
    -            toSetTargetCatchDto(false, referentialLocale, dto, KeptTargetCatchDto.class);
    
    190
    +            toSetKeptTargetCatchDto(referentialLocale, (SetKeptTargetCatchDto) dto);
    
    193 191
                 return;
    
    194 192
             }
    
    195 193
             if (dto instanceof SetNonTargetCatchDto) {
    
    ... ... @@ -221,11 +219,11 @@ public class SetImpl extends SetAbstract {
    221 219
         @Override
    
    222 220
         public <D extends DataDto> void fromDto(ReferentialLocale referentialLocale, D dto) {
    
    223 221
             if (dto instanceof SetDiscardedTargetCatchDto) {
    
    224
    -            fromSetTargetCatchDto(true, referentialLocale, dto);
    
    222
    +            fromSetDiscardedTargetCatchDto(referentialLocale, (SetDiscardedTargetCatchDto) dto);
    
    225 223
                 return;
    
    226 224
             }
    
    227 225
             if (dto instanceof SetKeptTargetCatchDto) {
    
    228
    -            fromSetTargetCatchDto(false, referentialLocale, dto);
    
    226
    +            fromSetKeptTargetCatchDto(referentialLocale, (SetKeptTargetCatchDto) dto);
    
    229 227
                 return;
    
    230 228
             }
    
    231 229
             if (dto instanceof SetNonTargetCatchDto) {
    
    ... ... @@ -253,18 +251,36 @@ public class SetImpl extends SetAbstract {
    253 251
             }
    
    254 252
         }
    
    255 253
     
    
    256
    -    private <D extends DataDto, C extends DataDto> void toSetTargetCatchDto(boolean discarded, ReferentialLocale referentialLocale, D dto, Class<C> dtoCatchType) {
    
    254
    +    private void toSetKeptTargetCatchDto(ReferentialLocale referentialLocale, SetKeptTargetCatchDto dto) {
    
    257 255
             super.toDto(referentialLocale, dto);
    
    258
    -        List<C> dtoList = EntityHelper.toDataDtoList(referentialLocale, getTargetCatch(discarded), dtoCatchType);
    
    259
    -        dto.set(SetKeptTargetCatchDto.PROPERTY_TARGET_CATCH, dtoList);
    
    256
    +        List<KeptTargetCatchDto> dtoList = EntityHelper.toDataDtoList(referentialLocale, getTargetCatch(false), KeptTargetCatchDto.class);
    
    257
    +        dto.setTargetCatch(dtoList);
    
    260 258
             // is there some sample?
    
    261
    -        TargetSample targetSample = getTargetSample(discarded);
    
    259
    +        TargetSample targetSample = getTargetSample(false);
    
    262 260
             if (targetSample != null) {
    
    263 261
                 // get usable species ids
    
    264 262
                 java.util.Set<String> speciesId = DtoReferenceAware.ids(targetSample.getTargetLength().stream().map(TargetLength::getSpecies));
    
    265 263
                 // mark catch if there is associated samples to it
    
    266 264
                 dtoList.forEach(catchDto -> {
    
    267
    -                SpeciesReference species = catchDto.get(KeptTargetCatchDto.PROPERTY_SPECIES);
    
    265
    +                SpeciesReference species = catchDto.getSpecies();
    
    266
    +                boolean hasSample = speciesId.contains(species.getId());
    
    267
    +                catchDto.set(KeptTargetCatchDto.PROPERTY_HAS_SAMPLE, hasSample);
    
    268
    +            });
    
    269
    +        }
    
    270
    +    }
    
    271
    +
    
    272
    +    private void toSetDiscardedTargetCatchDto(ReferentialLocale referentialLocale, SetDiscardedTargetCatchDto dto) {
    
    273
    +        super.toDto(referentialLocale, dto);
    
    274
    +        List<DiscardedTargetCatchDto> dtoList = EntityHelper.toDataDtoList(referentialLocale, getTargetCatch(true), DiscardedTargetCatchDto.class);
    
    275
    +        dto.setTargetCatch(dtoList);
    
    276
    +        // is there some sample?
    
    277
    +        TargetSample targetSample = getTargetSample(true);
    
    278
    +        if (targetSample != null) {
    
    279
    +            // get usable species ids
    
    280
    +            java.util.Set<String> speciesId = DtoReferenceAware.ids(targetSample.getTargetLength().stream().map(TargetLength::getSpecies));
    
    281
    +            // mark catch if there is associated samples to it
    
    282
    +            dtoList.forEach(catchDto -> {
    
    283
    +                SpeciesReference species = catchDto.getSpecies();
    
    268 284
                     boolean hasSample = speciesId.contains(species.getId());
    
    269 285
                     catchDto.set(KeptTargetCatchDto.PROPERTY_HAS_SAMPLE, hasSample);
    
    270 286
                 });
    
    ... ... @@ -297,19 +313,33 @@ public class SetImpl extends SetAbstract {
    297 313
             }
    
    298 314
         }
    
    299 315
     
    
    300
    -    private <D extends DataDto> void fromSetTargetCatchDto(boolean discarded, ReferentialLocale referentialLocale, D dto) {
    
    316
    +    private void fromSetKeptTargetCatchDto(ReferentialLocale referentialLocale, SetKeptTargetCatchDto dto) {
    
    317
    +        // keep other catches
    
    318
    +        List<TargetCatch> otherTargetCatches = getTargetCatch(true);
    
    319
    +        // do normal copy
    
    320
    +        super.fromDto(referentialLocale, dto);
    
    321
    +        // delete any sample which not using the given species ids
    
    322
    +        TargetSample targetSample = getTargetSample(false);
    
    323
    +        if (targetSample != null) {
    
    324
    +            List<KeptTargetCatchDto> targetCatch = dto.getTargetCatch();
    
    325
    +            Set<String> speciesIds = DtoReferenceAware.ids(targetCatch.stream().map(KeptTargetCatchDto::getSpecies));
    
    326
    +            // remove sample from species ids
    
    327
    +            targetSample.getTargetLength().removeIf(targetLength -> !speciesIds.contains(targetLength.getSpecies().getTopiaId()));
    
    328
    +        }
    
    329
    +        // push back other catches
    
    330
    +        otherTargetCatches.forEach(this::addTargetCatch);
    
    331
    +    }
    
    332
    +
    
    333
    +    private void fromSetDiscardedTargetCatchDto(ReferentialLocale referentialLocale, SetDiscardedTargetCatchDto dto) {
    
    301 334
             // keep other catches
    
    302
    -        List<TargetCatch> otherTargetCatches = getTargetCatch(!discarded);
    
    335
    +        List<TargetCatch> otherTargetCatches = getTargetCatch(false);
    
    303 336
             // do normal copy
    
    304 337
             super.fromDto(referentialLocale, dto);
    
    305
    -        List<TargetCatch> newCatches = getTargetCatch(discarded);
    
    306
    -        // set back set in any catches
    
    307
    -        newCatches.forEach(t -> t.setSet(this));
    
    308 338
             // delete any sample which not using the given species ids
    
    309
    -        TargetSample targetSample = getTargetSample(discarded);
    
    339
    +        TargetSample targetSample = getTargetSample(true);
    
    310 340
             if (targetSample != null) {
    
    311
    -            Collection<? extends IdDto> targetCatch = dto.get("targetCatch");
    
    312
    -            Set<String> speciesIds = DtoReferenceAware.ids(targetCatch.stream().map(t -> t.get("species")));
    
    341
    +            List<DiscardedTargetCatchDto> targetCatch = dto.getTargetCatch();
    
    342
    +            Set<String> speciesIds = DtoReferenceAware.ids(targetCatch.stream().map(DiscardedTargetCatchDto::getSpecies));
    
    313 343
                 // remove sample from species ids
    
    314 344
                 targetSample.getTargetLength().removeIf(targetLength -> !speciesIds.contains(targetLength.getSpecies().getTopiaId()));
    
    315 345
             }
    

  • models/persistence/src/main/models/Observe-20-data-ps-observation.model
    ... ... @@ -181,22 +181,20 @@ setEndSetTime(endSetTime Date)
    181 181
     getEndPursingTime() Date
    
    182 182
     setEndPursingTime(endPursingTime Date)
    
    183 183
     
    
    184
    -data.ps.observation.TargetCatch > data.DataEntity | naturalIdMutable entity
    
    184
    +data.ps.observation.TargetCatch > data.DataEntity | entity
    
    185 185
     comment + {*:1} String | hibernateAttributeType=text
    
    186 186
     catchWeight + {*:1} Float | sqlType=numeric
    
    187
    -well + {*:1} String | naturalId notNull=false
    
    187
    +well + {*:1} String
    
    188 188
     broughtOnDeck + {*:1} Boolean
    
    189
    -discarded + {*:1} boolean | naturalId
    
    190
    -set {*:1} data.ps.observation.Set | naturalId inverse skipModelNavigation
    
    191
    -weightCategory {*:1} referential.ps.observation.WeightCategory | naturalId
    
    192
    -reasonForDiscard {*:0..1} referential.ps.observation.ReasonForDiscard | naturalId notNull=false
    
    189
    +discarded + {*:1} boolean
    
    190
    +weightCategory {*:1} referential.ps.observation.WeightCategory
    
    191
    +reasonForDiscard {*:0..1} referential.ps.observation.ReasonForDiscard
    
    193 192
     weightMeasureMethod {*:0..1} referential.common.WeightMeasureMethod
    
    194 193
     getSpecies() referential.common.Species
    
    195 194
     setSpecies(species referential.common.Species)
    
    196 195
     isKept() boolean
    
    197 196
     isUsableForSample() boolean
    
    198 197
     
    
    199
    -
    
    200 198
     data.ps.observation.TargetLength > data.DataEntity >> data.ps.observation.LengthWeightComputableAware | entity constants=totalWeight
    
    201 199
     length + {*:1} Float | sqlType=numeric
    
    202 200
     isLengthComputed + {*:1} boolean
    

  • models/persistence/src/main/resources/db/migration/8.0/50_ps_observation_create-common.sql
    ... ... @@ -33,7 +33,7 @@ CREATE TABLE ps_observation.reasonfornullset(topiaId VARCHAR(255) NOT NULL CONST
    33 33
     CREATE TABLE ps_observation.set(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_set PRIMARY KEY, topiaVersion BIGINT NOT NULL, topiaCreateDate TIMESTAMP NOT NULL, starttime TIME, endpursingtimestamp TIMESTAMP, endsettimestamp TIMESTAMP, maxgeardepth INTEGER, currentspeed NUMERIC, currentdirection INTEGER, schooltopdepth INTEGER, schoolmeandepth INTEGER, schoolthickness INTEGER, supportvesselname VARCHAR(255), comment VARCHAR(1025), schooltype VARCHAR(255), currentmeasuredepth INTEGER, reasonfornullset VARCHAR(255), lastUpdateDate TIMESTAMP DEFAULT now() NOT NULL, targetcatchcompositionestimatedbyobserver BOOLEAN DEFAULT FALSE, targetdiscardcatchcompositionestimatedbyobserver BOOLEAN DEFAULT FALSE, homeId VARCHAR(255));
    
    34 34
     CREATE TABLE ps_observation.nontargetcatchrelease(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_non_target_catch_release PRIMARY KEY, topiaVersion BIGINT NOT NULL, topiaCreateDate TIMESTAMP NOT NULL, lastUpdateDate TIMESTAMP NOT NULL, length NUMERIC, count INTEGER, acquisitionmode INTEGER, comment VARCHAR(1025), species VARCHAR(255), sex VARCHAR(255), speciesgroupreleasemode VARCHAR(255), set VARCHAR(255), set_idx INTEGER, status VARCHAR(255) NOT NULL, conformity VARCHAR(255), releasingtime VARCHAR(255), lengthmeasuremethod VARCHAR(255), homeId VARCHAR(255));
    
    35 35
     CREATE TABLE ps_observation.nontargetsample(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_nontargetsample PRIMARY KEY, topiaVersion BIGINT NOT NULL, topiaCreateDate TIMESTAMP NOT NULL, comment VARCHAR(1025), set VARCHAR(255), lastUpdateDate TIMESTAMP DEFAULT now() NOT NULL, homeId VARCHAR(255));
    
    36
    -CREATE TABLE ps_observation.schoolestimate(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_schoolestimate PRIMARY KEY, topiaVersion BIGINT NOT NULL, set VARCHAR(255) NOT NULL, species VARCHAR(255) NOT NULL, topiaCreateDate TIMESTAMP NOT NULL, totalweight INTEGER, meanweight INTEGER, lastUpdateDate TIMESTAMP DEFAULT now() NOT NULL, weightmeasuremethod VARCHAR(255), CONSTRAINT uk_schoolestimate_species_set unique(species, set), homeId VARCHAR(255));
    
    36
    +CREATE TABLE ps_observation.schoolestimate(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_schoolestimate PRIMARY KEY, topiaVersion BIGINT NOT NULL, set VARCHAR(255), species VARCHAR(255) NOT NULL, topiaCreateDate TIMESTAMP NOT NULL, totalweight INTEGER, meanweight INTEGER, lastUpdateDate TIMESTAMP DEFAULT now() NOT NULL, weightmeasuremethod VARCHAR(255), CONSTRAINT uk_schoolestimate_species_set unique(species, set), homeId VARCHAR(255));
    
    37 37
     CREATE TABLE ps_observation.nontargetcatch(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_nontargetcatch PRIMARY KEY, topiaVersion BIGINT NOT NULL, topiaCreateDate TIMESTAMP NOT NULL, catchweight NUMERIC, catchweightcomputedsource INTEGER, meanweight NUMERIC, meanweightcomputedsource INTEGER, meanlength NUMERIC, meanlengthcomputedsource INTEGER, totalcount INTEGER, totalcountcomputedsource INTEGER, comment VARCHAR(1025), reasonfordiscard VARCHAR(255), species VARCHAR(255), speciesfate VARCHAR(255), set VARCHAR(255), lastUpdateDate TIMESTAMP DEFAULT now() NOT NULL, well VARCHAR(255), set_idx INTEGER, lengthmeasuremethod VARCHAR(255), weightmeasuremethod VARCHAR(255), homeId VARCHAR(255));
    
    38 38
     CREATE TABLE ps_observation.nontargetlength(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_nontargetlength PRIMARY KEY, topiaVersion BIGINT NOT NULL, topiaCreateDate TIMESTAMP NOT NULL, length NUMERIC, islengthcomputed BOOLEAN, picturesreferences VARCHAR(255), weight NUMERIC, isweightcomputed BOOLEAN, count INTEGER, acquisitionmode INTEGER, species VARCHAR(255), nontargetsample VARCHAR(255), sex VARCHAR(255), lastUpdateDate TIMESTAMP DEFAULT now() NOT NULL, sizemeasuretype VARCHAR(255), weightmeasuretype VARCHAR(255), tagnumber VARCHAR(255), speciesfate VARCHAR(255), nontargetsample_idx INTEGER, lengthmeasuremethod VARCHAR(255), weightmeasuremethod VARCHAR(255), homeId VARCHAR(255));
    
    39 39
     CREATE TABLE ps_observation.speciesstatus(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_speciesstatus PRIMARY KEY, topiaVersion BIGINT NOT NULL, topiaCreateDate TIMESTAMP NOT NULL, code VARCHAR(255), uri VARCHAR(255), status INTEGER DEFAULT 1, label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255), needComment BOOLEAN DEFAULT FALSE, lastUpdateDate TIMESTAMP DEFAULT now() NOT NULL, homeId VARCHAR(255));
    
    ... ... @@ -48,5 +48,5 @@ CREATE TABLE ps_observation.objectobservedspecies(topiaId VARCHAR(255) NOT NULL
    48 48
     CREATE TABLE ps_observation.objectschoolestimate(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_objectschoolestimate PRIMARY KEY, topiaVersion BIGINT NOT NULL, topiaCreateDate TIMESTAMP NOT NULL, totalweight INTEGER, species VARCHAR(255), floatingobject VARCHAR(255), lastUpdateDate TIMESTAMP DEFAULT now() NOT NULL, weightmeasuremethod VARCHAR(255), homeId VARCHAR(255));
    
    49 49
     CREATE TABLE ps_observation.transmittingbuoy(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_transmittingbuoy PRIMARY KEY, topiaVersion BIGINT NOT NULL, topiaCreateDate TIMESTAMP NOT NULL, code VARCHAR(255), comment VARCHAR(1024), transmittingBuoyOwnership VARCHAR(255), transmittingbuoytype VARCHAR(255), transmittingbuoyoperation VARCHAR(255), floatingobject VARCHAR(255), country VARCHAR(255), vessel VARCHAR(255), lastUpdateDate TIMESTAMP DEFAULT now() NOT NULL, homeId VARCHAR(255));
    
    50 50
     CREATE TABLE ps_observation.weightcategory(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_weightcategory PRIMARY KEY, topiaVersion BIGINT NOT NULL, topiaCreateDate TIMESTAMP NOT NULL, code VARCHAR(255), uri VARCHAR(255), status INTEGER DEFAULT 1, label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255), species VARCHAR(255), needComment BOOLEAN DEFAULT FALSE, lastUpdateDate TIMESTAMP DEFAULT now() NOT NULL, homeId VARCHAR(255));
    
    51
    -CREATE TABLE ps_observation.targetcatch(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_targetcatch PRIMARY KEY, topiaVersion BIGINT NOT NULL, well VARCHAR(255), discarded BOOLEAN NOT NULL, set VARCHAR(255) NOT NULL, weightcategory VARCHAR(255) NOT NULL, reasonfordiscard VARCHAR(255), topiaCreateDate TIMESTAMP NOT NULL, catchweight NUMERIC, broughtondeck BOOLEAN, comment VARCHAR(1025), lastUpdateDate TIMESTAMP DEFAULT now() NOT NULL, set_idx INTEGER, weightmeasuremethod VARCHAR(255), CONSTRAINT uk_targetcatch_well_reasonfordiscard_weightcategory_discarded_s unique(well, reasonfordiscard, weightcategory, discarded, set), homeId VARCHAR(255));
    
    51
    +CREATE TABLE ps_observation.targetcatch(topiaId VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_targetcatch PRIMARY KEY, topiaVersion BIGINT NOT NULL, well VARCHAR(255), discarded BOOLEAN NOT NULL, set VARCHAR(255), weightcategory VARCHAR(255) NOT NULL, reasonfordiscard VARCHAR(255), topiaCreateDate TIMESTAMP NOT NULL, catchweight NUMERIC, broughtondeck BOOLEAN, comment VARCHAR(1025), lastUpdateDate TIMESTAMP DEFAULT now() NOT NULL, set_idx INTEGER, weightmeasuremethod VARCHAR(255), CONSTRAINT uk_targetcatch_well_reasonfordiscard_weightcategory_discarded_s unique(well, reasonfordiscard, weightcategory, discarded, set), homeId VARCHAR(255));
    
    52 52
     CREATE TABLE ps_observation.activity_observedsystem(activity VARCHAR(255) NOT NULL, observedsystem VARCHAR(255) NOT NULL, CONSTRAINT pk_ps_observation_activity_observedsystem PRIMARY KEY(activity, observedsystem));

  • services/api/src/main/java/fr/ird/observe/services/service/actions/synchro/referential/ng/task/ReferentialSynchronizeTaskType.java
    ... ... @@ -30,27 +30,21 @@ package fr.ird.observe.services.service.actions.synchro.referential.ng.task;
    30 30
      */
    
    31 31
     public enum ReferentialSynchronizeTaskType {
    
    32 32
     
    
    33
    -    ADD(false, false, true),
    
    34
    -    UPDATE(false, true, true),
    
    35
    -    REVERT(false, true, false),
    
    36
    -    DELETE(true, false, false),
    
    37
    -    DEACTIVATE(false, false, false),
    
    38
    -    DEACTIVATE_WITH_REPLACEMENT(true, false, false);
    
    33
    +    ADD(false, true),
    
    34
    +    UPDATE(true, true),
    
    35
    +    REVERT(true, false),
    
    36
    +    DELETE(false, false),
    
    37
    +    DEACTIVATE(false, false),
    
    38
    +    DEACTIVATE_WITH_REPLACEMENT(false, false);
    
    39 39
     
    
    40
    -    private final boolean withReplace;
    
    41 40
         private final boolean withProperties;
    
    42 41
         private final boolean toOtherSide;
    
    43 42
     
    
    44
    -    ReferentialSynchronizeTaskType(boolean withReplace, boolean withProperties, boolean toOtherSide) {
    
    45
    -        this.withReplace = withReplace;
    
    43
    +    ReferentialSynchronizeTaskType(boolean withProperties, boolean toOtherSide) {
    
    46 44
             this.withProperties = withProperties;
    
    47 45
             this.toOtherSide = toOtherSide;
    
    48 46
         }
    
    49 47
     
    
    50
    -    public boolean withReplace() {
    
    51
    -        return withReplace;
    
    52
    -    }
    
    53
    -
    
    54 48
         public boolean withProperties() {
    
    55 49
             return withProperties;
    
    56 50
         }
    

  • tests/test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
    No preview for this file type
  • tests/test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
    No preview for this file type
  • tests/test/src/main/resources/db/8.0/empty_h2.sql.gz
    No preview for this file type
  • tests/test/src/main/resources/db/8.0/empty_pg.sql.gz
    No preview for this file type
  • tests/test/src/main/resources/db/8.0/referentiel.sql.gz
    No preview for this file type