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

Commits:

28 changed files:

Changes:

  • client-configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
    ... ... @@ -115,7 +115,7 @@ public class ClientConfig extends GeneratedClientConfig implements TemplateGener
    115 115
                 ClientConfigOption.MAP_LAYER10);
    
    116 116
         private static final Logger log = LogManager.getLogger(ClientConfig.class);
    
    117 117
         /** le pattern du fichier de sauvegarde d'une base locale */
    
    118
    -    private static final String BACKUP_DB_PATTERN = "obstuna-local-%1$tF--%1$tk-%1$tM-%1$tS.sql.gz";
    
    118
    +    private static final String BACKUP_DB_PATTERN = "observe-v%1$s-%2$tF--%2$tk-%2$tM-%2$tS.sql.gz";
    
    119 119
         private static final String APPLICATION_VERSION = "application.version";
    
    120 120
         private static final String VERSION = "version";
    
    121 121
     
    
    ... ... @@ -537,7 +537,7 @@ public class ClientConfig extends GeneratedClientConfig implements TemplateGener
    537 537
         }
    
    538 538
     
    
    539 539
         public File newBackupDataFile() {
    
    540
    -        return new File(getBackupDirectory(), String.format(BACKUP_DB_PATTERN, new Date()));
    
    540
    +        return new File(getBackupDirectory(), String.format(BACKUP_DB_PATTERN, getBuildVersion().toString().replaceAll("\\.","_"), new Date()));
    
    541 541
         }
    
    542 542
     
    
    543 543
         public void saveForUser() {
    

  • client-core/src/main/java/fr/ird/observe/client/datasource/h2/backup/BackupsManager.java
    ... ... @@ -74,7 +74,7 @@ public class BackupsManager implements Closeable {
    74 74
     
    
    75 75
         private static final Logger log = LogManager.getLogger(BackupsManager.class);
    
    76 76
     
    
    77
    -    private static final Pattern AUTOMATIC_BACKUP_FILENAME_PATTERN = Pattern.compile("obstuna-local-([0-9-]+)\\.sql\\.gz");
    
    77
    +    private static final Pattern AUTOMATIC_BACKUP_FILENAME_PATTERN = Pattern.compile("obs.+-([0-9-]+)\\.sql\\.gz");
    
    78 78
     
    
    79 79
         private final Path backupsPath;
    
    80 80
         private final ObserveDataSourcesManager dataSourcesManager;
    

  • client-datasource-actions/src/main/i18n/getters/java-enumeration.getter
    ... ... @@ -16,8 +16,6 @@ observe.constant.AdminStep.SAVE_LOCAL
    16 16
     observe.constant.AdminStep.SAVE_LOCAL.description
    
    17 17
     observe.constant.AdminStep.SELECT_DATA
    
    18 18
     observe.constant.AdminStep.SELECT_DATA.description
    
    19
    -observe.constant.AdminStep.SHOW_RESUME
    
    20
    -observe.constant.AdminStep.SHOW_RESUME.description
    
    21 19
     observe.constant.AdminStep.SYNCHRONIZE
    
    22 20
     observe.constant.AdminStep.SYNCHRONIZE.description
    
    23 21
     observe.constant.AdminStep.VALIDATE
    

  • client-datasource-actions/src/main/i18n/getters/java.getter
    ... ... @@ -170,13 +170,6 @@ observe.admin.report.no.report.found
    170 170
     observe.admin.report.report.count.found
    
    171 171
     observe.admin.report.title
    
    172 172
     observe.admin.report.title.tip
    
    173
    -observe.admin.resume.no.operation.done
    
    174
    -observe.admin.resume.operation.canceled
    
    175
    -observe.admin.resume.operation.done
    
    176
    -observe.admin.resume.operation.failed
    
    177
    -observe.admin.resume.operation.need.fix
    
    178
    -observe.admin.resume.operation.not.started
    
    179
    -observe.admin.resume.operation.running
    
    180 173
     observe.choice.cancel
    
    181 174
     observe.choice.confirm.insert
    
    182 175
     observe.choice.replace
    

  • client-datasource-actions/src/main/i18n/getters/jaxx.getter
    ... ... @@ -34,7 +34,6 @@ observe.admin.report.variables
    34 34
     observe.common.directory
    
    35 35
     observe.common.file
    
    36 36
     observe.common.global.progression.description
    
    37
    -observe.common.operation.resume
    
    38 37
     observe.common.step.description
    
    39 38
     observe.info.selected.validators
    
    40 39
     observe.info.validation.credentials
    

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminStep.java
    ... ... @@ -32,7 +32,6 @@ import fr.ird.observe.client.datasource.actions.longline.pairing.ActivityLonglin
    32 32
     import fr.ird.observe.client.datasource.actions.longline.pairing.ActivityLonglinePairingUI;
    
    33 33
     import fr.ird.observe.client.datasource.actions.report.ReportModel;
    
    34 34
     import fr.ird.observe.client.datasource.actions.report.ReportUI;
    
    35
    -import fr.ird.observe.client.datasource.actions.resume.ShowResumeUI;
    
    36 35
     import fr.ird.observe.client.datasource.actions.save.SaveLocalModel;
    
    37 36
     import fr.ird.observe.client.datasource.actions.save.SaveLocalUI;
    
    38 37
     import fr.ird.observe.client.datasource.actions.synchronize.data.DataSynchroModel;
    
    ... ... @@ -247,13 +246,6 @@ public enum AdminStep implements WizardExtStep {
    247 246
                 DbMode.USE_LOCAL,
    
    248 247
                 DbMode.USE_REMOTE,
    
    249 248
                 DbMode.USE_SERVER
    
    250
    -    ),
    
    251
    -
    
    252
    -    /** pour afficher après les opération un ecran de résumé */
    
    253
    -    SHOW_RESUME(
    
    254
    -            null,
    
    255
    -            ShowResumeUI.class,
    
    256
    -            false
    
    257 249
         );
    
    258 250
     
    
    259 251
         private final String iconName;
    

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminUIHandler.java
    ... ... @@ -27,7 +27,6 @@ import fr.ird.observe.client.datasource.actions.config.SelectDataUI;
    27 27
     import fr.ird.observe.client.datasource.actions.consolidate.ConsolidateUI;
    
    28 28
     import fr.ird.observe.client.datasource.actions.export.ExportUI;
    
    29 29
     import fr.ird.observe.client.datasource.actions.longline.pairing.ActivityLonglinePairingUI;
    
    30
    -import fr.ird.observe.client.datasource.actions.resume.ShowResumeUI;
    
    31 30
     import fr.ird.observe.client.datasource.actions.save.SaveLocalUI;
    
    32 31
     import fr.ird.observe.client.datasource.actions.synchronize.data.DataSynchroUI;
    
    33 32
     import fr.ird.observe.client.datasource.actions.synchronize.referential.legacy.SynchronizeUI;
    
    ... ... @@ -297,12 +296,6 @@ public class AdminUIHandler implements UIHandler<AdminUI>, WithClientUIContext {
    297 296
                 SaveLocalUI tabUI = (SaveLocalUI) ui.getStepUI(AdminStep.SAVE_LOCAL);
    
    298 297
                 tabUI.getHandler().updateText();
    
    299 298
             }
    
    300
    -        if (c != null && c.getStep() == AdminStep.SHOW_RESUME) {
    
    301
    -
    
    302
    -            // on met a jour le resumé des opérations
    
    303
    -            ShowResumeUI showResumeUI = (ShowResumeUI) ui.getStepUI(AdminStep.SHOW_RESUME);
    
    304
    -            showResumeUI.getHandler().updateText();
    
    305
    -        }
    
    306 299
     
    
    307 300
             // selection du nouvel onglet
    
    308 301
             int index = ui.tabs.indexOfComponent(c);
    
    ... ... @@ -371,12 +364,6 @@ public class AdminUIHandler implements UIHandler<AdminUI>, WithClientUIContext {
    371 364
                 itr = UIHelper.newTabbedPaneIterator(ui.getTabs());
    
    372 365
             }
    
    373 366
     
    
    374
    -        if (selected != null && selected.getStep() == AdminStep.SHOW_RESUME) {
    
    375
    -
    
    376
    -            // rien a faire sur le dernier onglet
    
    377
    -            log.debug("We are on last step (resume), nothing to do.");
    
    378
    -            return;
    
    379
    -        }
    
    380 367
             boolean[] accessibleSteps = ui.getModel().getAccessibleSteps();
    
    381 368
             log.debug("Accessibles step : " + Arrays.toString(accessibleSteps));
    
    382 369
             for (; itr.hasNext(); itr.next()) {
    

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminUIModel.java
    ... ... @@ -28,7 +28,6 @@ import fr.ird.observe.client.datasource.actions.consolidate.ConsolidateModel;
    28 28
     import fr.ird.observe.client.datasource.actions.export.ExportModel;
    
    29 29
     import fr.ird.observe.client.datasource.actions.longline.pairing.ActivityLonglinePairingModel;
    
    30 30
     import fr.ird.observe.client.datasource.actions.report.ReportModel;
    
    31
    -import fr.ird.observe.client.datasource.actions.resume.ShowResumeModel;
    
    32 31
     import fr.ird.observe.client.datasource.actions.save.SaveLocalModel;
    
    33 32
     import fr.ird.observe.client.datasource.actions.synchronize.data.DataSynchroModel;
    
    34 33
     import fr.ird.observe.client.datasource.actions.synchronize.referential.legacy.SynchronizeModel;
    
    ... ... @@ -64,8 +63,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> {
    64 63
     
    
    65 64
         private final SelectDataModel selectDataModel = new SelectDataModel();
    
    66 65
     
    
    67
    -    private final ShowResumeModel showResumeModel = new ShowResumeModel();
    
    68
    -
    
    69 66
         private final AdminStep adminStep;
    
    70 67
     
    
    71 68
         private final EnumSet<DbMode> availableIncomingModes;
    
    ... ... @@ -152,10 +149,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> {
    152 149
             return configModel;
    
    153 150
         }
    
    154 151
     
    
    155
    -    public ShowResumeModel getShowResumeModel() {
    
    156
    -        return showResumeModel;
    
    157
    -    }
    
    158
    -
    
    159 152
         public SelectDataModel getSelectDataModel() {
    
    160 153
             return selectDataModel;
    
    161 154
         }
    
    ... ... @@ -397,8 +390,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> {
    397 390
                     return getSynchronizeReferentielModel().validate(this, step);
    
    398 391
                 case SAVE_LOCAL:
    
    399 392
                     return getSaveLocalModel().validate(this, step);
    
    400
    -            case SHOW_RESUME:
    
    401
    -                return getShowResumeModel().validate(this);
    
    402 393
             }
    
    403 394
             return true;
    
    404 395
         }
    
    ... ... @@ -411,8 +402,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> {
    411 402
             // toujours l'onglet de configuration des opérations
    
    412 403
             universe.add(AdminStep.CONFIG);
    
    413 404
     
    
    414
    -        // pour savoir si on doit ajouter l'onglet de résumé (cas par défaut)
    
    415
    -        boolean needResume = true;
    
    416 405
             if (!operations.isEmpty()) {
    
    417 406
     
    
    418 407
                 if (needSelect()) {
    
    ... ... @@ -458,9 +447,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> {
    458 447
                 if (containsOperation(AdminStep.REPORT)) {
    
    459 448
     
    
    460 449
                     universe.add(AdminStep.REPORT);
    
    461
    -
    
    462
    -                // pas de page de resume
    
    463
    -                needResume = false;
    
    464 450
                 }
    
    465 451
     
    
    466 452
                 updateSaveLocalOperation();
    
    ... ... @@ -476,12 +462,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> {
    476 462
                     // ajout de l'onglet de sauvegarde de la base distante
    
    477 463
                     universe.add(AdminStep.EXPORT_DATA);
    
    478 464
                 }
    
    479
    -
    
    480
    -            if (needResume) {
    
    481
    -
    
    482
    -                // ajout d'un onglet de resume
    
    483
    -                universe.add(AdminStep.SHOW_RESUME);
    
    484
    -            }
    
    485 465
             }
    
    486 466
             return universe.toArray(new AdminStep[0]);
    
    487 467
         }
    

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/actions/AdminTabUIActionSupport.java
    ... ... @@ -28,7 +28,6 @@ import fr.ird.observe.client.datasource.actions.AdminActionWorker;
    28 28
     import fr.ird.observe.client.datasource.actions.AdminStep;
    
    29 29
     import fr.ird.observe.client.datasource.actions.AdminTabUI;
    
    30 30
     import fr.ird.observe.client.datasource.actions.AdminUI;
    
    31
    -import fr.ird.observe.client.datasource.actions.resume.ShowResumeUI;
    
    32 31
     import fr.ird.observe.client.datasource.api.ObserveSwingDataSource;
    
    33 32
     import fr.ird.observe.client.datasource.editor.content.ref.usage.UsageForDisplayUI;
    
    34 33
     import fr.ird.observe.client.datasource.editor.content.ref.usage.UsageForDisplayUIHandler;
    
    ... ... @@ -98,14 +97,8 @@ public abstract class AdminTabUIActionSupport<U extends AdminTabUI> extends JCom
    98 97
     
    
    99 98
     
    
    100 99
         public String sendMessage(String message) {
    
    101
    -
    
    102 100
             AdminStep step = ui.getStep();
    
    103 101
             addMessage(step, message);
    
    104
    -        AdminUI parentUI = getParentUI();
    
    105
    -        ShowResumeUI resumeUI = (ShowResumeUI) parentUI.getStepUI(AdminStep.SHOW_RESUME);
    
    106
    -        if (resumeUI != null) {
    
    107
    -            addMessage(resumeUI, step, message);
    
    108
    -        }
    
    109 102
             return message;
    
    110 103
         }
    
    111 104
     
    

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/longline/pairing/tree/ActivityLonglinePairingTreeTable.java
    ... ... @@ -22,6 +22,7 @@ package fr.ird.observe.client.datasource.actions.longline.pairing.tree;
    22 22
      * #L%
    
    23 23
      */
    
    24 24
     
    
    25
    +import com.google.common.collect.ImmutableList;
    
    25 26
     import com.google.common.collect.ImmutableSet;
    
    26 27
     import fr.ird.observe.client.configuration.ClientConfig;
    
    27 28
     import fr.ird.observe.client.configuration.WithClientConfig;
    
    ... ... @@ -46,6 +47,8 @@ import fr.ird.observe.dto.referential.common.ProgramDto;
    46 47
     import fr.ird.observe.dto.referential.common.ProgramReference;
    
    47 48
     import fr.ird.observe.services.service.data.ll.pairing.ActivityLonglinePairingResultItem;
    
    48 49
     import fr.ird.observe.services.service.data.ll.pairing.ActivityLonglinePairingResultItemDecorator;
    
    50
    +import org.apache.logging.log4j.LogManager;
    
    51
    +import org.apache.logging.log4j.Logger;
    
    49 52
     import org.jdesktop.swingx.JXTable;
    
    50 53
     import org.jdesktop.swingx.JXTreeTable;
    
    51 54
     import org.jdesktop.swingx.table.ColumnFactory;
    
    ... ... @@ -76,6 +79,8 @@ import java.util.function.Supplier;
    76 79
      */
    
    77 80
     public class ActivityLonglinePairingTreeTable extends JXTreeTable implements WithDecoratorService, WithClientConfig {
    
    78 81
     
    
    82
    +    private static final Logger log = LogManager.getLogger(ActivityLonglinePairingTreeTable.class);
    
    83
    +
    
    79 84
         public ActivityLonglinePairingTreeTable(ActivityLonglinePairingTreeTableModel treeModel) {
    
    80 85
             super(treeModel);
    
    81 86
             setTreeCellRenderer(new ActivityLonglinePairingTreeTableTreeCellRenderer());
    
    ... ... @@ -162,7 +167,7 @@ public class ActivityLonglinePairingTreeTable extends JXTreeTable implements Wit
    162 167
     
    
    163 168
         }
    
    164 169
     
    
    165
    -    static class ActivityLonglinePairingTreeTableCellEditor implements TableCellEditor {
    
    170
    +    class ActivityLonglinePairingTreeTableCellEditor implements TableCellEditor {
    
    166 171
     
    
    167 172
             private final TableCellEditor booleanEditor;
    
    168 173
             private final BeanFilterableComboBoxCellEditor pairingEditor;
    
    ... ... @@ -187,9 +192,14 @@ public class ActivityLonglinePairingTreeTable extends JXTreeTable implements Wit
    187 192
                 Objects.requireNonNull(node);
    
    188 193
                 if (column == 1) {
    
    189 194
                     if (node instanceof ActivityLonglinePairingActivityNode) {
    
    190
    -                    BeanFilterableComboBox component = pairingEditor.getComponent();
    
    195
    +                    BeanFilterableComboBox<?> component = pairingEditor.getComponent();
    
    191 196
                         ActivityLonglinePairingActivityNode activityLonglinePairingActivityNode = (ActivityLonglinePairingActivityNode) node;
    
    192
    -                    UIHelper.fillComboBox(component.getCombobox(), activityLonglinePairingActivityNode.getUserObject().getItems(), activityLonglinePairingActivityNode.getSelectedValue());
    
    197
    +                    ImmutableList<ActivityLonglinePairingResultItem> availableActivities = getTreeTableModel().getAvailableActivities(activityLonglinePairingActivityNode);
    
    198
    +                    ActivityLonglinePairingResultItem selectedValue = activityLonglinePairingActivityNode.getSelectedValue();
    
    199
    +                    if (!availableActivities.contains(selectedValue)) {
    
    200
    +                        selectedValue = null;
    
    201
    +                    }
    
    202
    +                    UIHelper.fillComboBox(component.getCombobox(), availableActivities, selectedValue);
    
    193 203
                         editor = pairingEditor;
    
    194 204
                     }
    
    195 205
                 } else if (column == 2) {
    

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/longline/pairing/tree/ActivityLonglinePairingTreeTableModel.java
    ... ... @@ -22,14 +22,21 @@ package fr.ird.observe.client.datasource.actions.longline.pairing.tree;
    22 22
      * #L%
    
    23 23
      */
    
    24 24
     
    
    25
    +import com.google.common.collect.ImmutableList;
    
    25 26
     import fr.ird.observe.client.datasource.actions.longline.pairing.ActivityLonglinePairingModel;
    
    26 27
     import fr.ird.observe.client.datasource.actions.longline.pairing.tree.node.ActivityLonglinePairingActivityNode;
    
    27 28
     import fr.ird.observe.client.datasource.actions.longline.pairing.tree.node.ActivityLonglinePairingRootNode;
    
    29
    +import fr.ird.observe.services.service.data.ll.pairing.ActivityLonglinePairingResultItem;
    
    28 30
     import io.ultreia.java4all.i18n.I18n;
    
    29 31
     import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
    
    32
    +import sun.awt.image.ImageWatched;
    
    30 33
     
    
    31 34
     import java.util.Arrays;
    
    35
    +import java.util.LinkedList;
    
    36
    +import java.util.List;
    
    32 37
     import java.util.Objects;
    
    38
    +import java.util.Set;
    
    39
    +import java.util.stream.Collectors;
    
    33 40
     
    
    34 41
     /**
    
    35 42
      * Created by tchemit on 20/11/2018.
    
    ... ... @@ -79,4 +86,13 @@ public class ActivityLonglinePairingTreeTableModel extends DefaultTreeTableModel
    79 86
         public ActivityLonglinePairingModel getUiModel() {
    
    80 87
             return uiModel;
    
    81 88
         }
    
    89
    +
    
    90
    +    public ImmutableList<ActivityLonglinePairingResultItem> getAvailableActivities(ActivityLonglinePairingActivityNode selectedNode) {
    
    91
    +        List<ActivityLonglinePairingActivityNode> selectedNodes = new LinkedList<>(uiModel.getSelectedNodes());
    
    92
    +        selectedNodes.remove(selectedNode);
    
    93
    +        Set<ActivityLonglinePairingResultItem> usedActivities = selectedNodes.stream().map(ActivityLonglinePairingActivityNode::getSelectedValue).collect(Collectors.toSet());
    
    94
    +        List<ActivityLonglinePairingResultItem> availableActivities = new LinkedList<>(selectedNode.getUserObject().getItems());
    
    95
    +        availableActivities.removeAll(usedActivities);
    
    96
    +        return ImmutableList.copyOf(availableActivities);
    
    97
    +    }
    
    82 98
     }

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/resume/ShowResumeModel.java deleted
    1
    -package fr.ird.observe.client.datasource.actions.resume;
    
    2
    -
    
    3
    -/*-
    
    4
    - * #%L
    
    5
    - * ObServe :: Client DataSource actions
    
    6
    - * %%
    
    7
    - * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    8
    - * %%
    
    9
    - * This program is free software: you can redistribute it and/or modify
    
    10
    - * it under the terms of the GNU General Public License as
    
    11
    - * published by the Free Software Foundation, either version 3 of the
    
    12
    - * License, or (at your option) any later version.
    
    13
    - *
    
    14
    - * This program is distributed in the hope that it will be useful,
    
    15
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    - * GNU General Public License for more details.
    
    18
    - *
    
    19
    - * You should have received a copy of the GNU General Public
    
    20
    - * License along with this program.  If not, see
    
    21
    - * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    - * #L%
    
    23
    - */
    
    24
    -
    
    25
    -import fr.ird.observe.client.datasource.actions.AdminActionModel;
    
    26
    -import fr.ird.observe.client.datasource.actions.AdminStep;
    
    27
    -import fr.ird.observe.client.datasource.actions.AdminUIModel;
    
    28
    -
    
    29
    -/**
    
    30
    - * Created on 28/11/16.
    
    31
    - *
    
    32
    - * @author Tony Chemit - dev@tchemit.fr
    
    33
    - * @since 6.0
    
    34
    - */
    
    35
    -public class ShowResumeModel extends AdminActionModel {
    
    36
    -    public ShowResumeModel() {
    
    37
    -        super(AdminStep.SHOW_RESUME);
    
    38
    -    }
    
    39
    -
    
    40
    -    public boolean validate(AdminUIModel uiModel) {
    
    41
    -        return true;
    
    42
    -    }
    
    43
    -}

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/resume/ShowResumeUI.jaxx deleted
    1
    -<!--
    
    2
    -  #%L
    
    3
    -  ObServe :: Client DataSource actions
    
    4
    -  %%
    
    5
    -  Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    6
    -  %%
    
    7
    -  This program is free software: you can redistribute it and/or modify
    
    8
    -  it under the terms of the GNU General Public License as
    
    9
    -  published by the Free Software Foundation, either version 3 of the
    
    10
    -  License, or (at your option) any later version.
    
    11
    -  This program is distributed in the hope that it will be useful,
    
    12
    -  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    13
    -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    14
    -  GNU General Public License for more details.
    
    15
    -  You should have received a copy of the GNU General Public
    
    16
    -  License along with this program.  If not, see
    
    17
    -  <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    18
    -  #L%
    
    19
    -  -->
    
    20
    -
    
    21
    -<fr.ird.observe.client.datasource.actions.AdminTabUI>
    
    22
    -
    
    23
    -  <import>
    
    24
    -    fr.ird.observe.client.util.UIHelper
    
    25
    -    fr.ird.observe.client.datasource.actions.AdminUI
    
    26
    -    fr.ird.observe.client.datasource.actions.AdminTabUI
    
    27
    -
    
    28
    -    java.awt.Dimension
    
    29
    -  </import>
    
    30
    -
    
    31
    -  <ShowResumeModel id='stepModel' initializer='getModel().getShowResumeModel()'/>
    
    32
    -
    
    33
    -  <JPanel id='PENDING_content'>
    
    34
    -    <Table constraints='BorderLayout.CENTER' fill='both' weightx='1'
    
    35
    -           weighty='1'>
    
    36
    -      <row>
    
    37
    -        <cell>
    
    38
    -          <JScrollPane id='resumePane'>
    
    39
    -            <JTextArea id='resume'/>
    
    40
    -          </JScrollPane>
    
    41
    -        </cell>
    
    42
    -      </row>
    
    43
    -      <row>
    
    44
    -        <cell>
    
    45
    -          <JScrollPane id='globalProgressionPane' columnHeaderView='{globalProgressionTop}'>
    
    46
    -            <JTextArea id='globalProgression'/>
    
    47
    -            <JToolBar id='globalProgressionTop'>
    
    48
    -              <JLabel id='globalProgressionTopLabel'/>
    
    49
    -              <javax.swing.Box.Filler
    
    50
    -                  constructorParams='UIHelper.newMinDimension(), UIHelper.newMinDimension(), UIHelper.newMaxXDimension()'/>
    
    51
    -              <JButton id="copyToClipBoard"/>
    
    52
    -            </JToolBar>
    
    53
    -          </JScrollPane>
    
    54
    -        </cell>
    
    55
    -      </row>
    
    56
    -    </Table>
    
    57
    -  </JPanel>
    
    58
    -
    
    59
    -</fr.ird.observe.client.datasource.actions.AdminTabUI>

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/resume/ShowResumeUI.jcss deleted
    1
    -/*
    
    2
    - * #%L
    
    3
    - * ObServe :: Client DataSource actions
    
    4
    - * %%
    
    5
    - * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    6
    - * %%
    
    7
    - * This program is free software: you can redistribute it and/or modify
    
    8
    - * it under the terms of the GNU General Public License as
    
    9
    - * published by the Free Software Foundation, either version 3 of the
    
    10
    - * License, or (at your option) any later version.
    
    11
    - *
    
    12
    - * This program is distributed in the hope that it will be useful,
    
    13
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    - * GNU General Public License for more details.
    
    16
    - *
    
    17
    - * You should have received a copy of the GNU General Public
    
    18
    - * License along with this program.  If not, see
    
    19
    - * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    - * #L%
    
    21
    - */
    
    22
    -
    
    23
    -#PENDING_content {
    
    24
    -  layout:{new BorderLayout()};
    
    25
    -}
    
    26
    -
    
    27
    -#resumePane {
    
    28
    -  minimumSize:{new Dimension(0,0)};
    
    29
    -  horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED};
    
    30
    -  columnHeaderView:{UIHelper.newLabel(t("observe.common.operation.resume") ,"wizard-message", 10)};
    
    31
    -}
    
    32
    -
    
    33
    -#resume {
    
    34
    -  editable:false;
    
    35
    -  focusable:true;
    
    36
    -}
    
    37
    -
    
    38
    -#globalProgressionPane {
    
    39
    -  minimumSize:{new Dimension(0,0)};
    
    40
    -  horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED};
    
    41
    -}
    
    42
    -
    
    43
    -#globalProgression {
    
    44
    -  font-size:10;
    
    45
    -  focusable:true;
    
    46
    -  lineWrap:false;
    
    47
    -  editable:false;
    
    48
    -}
    
    49
    -
    
    50
    -#globalProgressionTop {
    
    51
    -  floatable:false;
    
    52
    -}
    
    53
    -
    
    54
    -#globalProgressionTopLabel {
    
    55
    -  text:"observe.common.global.progression.description";
    
    56
    -  actionIcon:"wizard-message";
    
    57
    -}
    
    58
    -
    
    59
    -

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/resume/ShowResumeUIHandler.java deleted
    1
    -/*
    
    2
    - * #%L
    
    3
    - * ObServe :: Client DataSource actions
    
    4
    - * %%
    
    5
    - * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    6
    - * %%
    
    7
    - * This program is free software: you can redistribute it and/or modify
    
    8
    - * it under the terms of the GNU General Public License as
    
    9
    - * published by the Free Software Foundation, either version 3 of the
    
    10
    - * License, or (at your option) any later version.
    
    11
    - *
    
    12
    - * This program is distributed in the hope that it will be useful,
    
    13
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    - * GNU General Public License for more details.
    
    16
    - *
    
    17
    - * You should have received a copy of the GNU General Public
    
    18
    - * License along with this program.  If not, see
    
    19
    - * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    - * #L%
    
    21
    - */
    
    22
    -package fr.ird.observe.client.datasource.actions.resume;
    
    23
    -
    
    24
    -import fr.ird.observe.client.datasource.actions.AdminStep;
    
    25
    -import fr.ird.observe.client.datasource.actions.AdminTabUIHandler;
    
    26
    -import fr.ird.observe.client.datasource.actions.AdminUIModel;
    
    27
    -import fr.ird.observe.client.util.UIHelper;
    
    28
    -import fr.ird.observe.dto.I18nEnumHelper;
    
    29
    -import org.nuiton.jaxx.runtime.spi.UIHandler;
    
    30
    -import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState;
    
    31
    -
    
    32
    -import static io.ultreia.java4all.i18n.I18n.t;
    
    33
    -
    
    34
    -/**
    
    35
    - * Le controleur des onglets.
    
    36
    - *
    
    37
    - * @author Tony Chemit - dev@tchemit.fr
    
    38
    - * @since 1.4
    
    39
    - */
    
    40
    -public class ShowResumeUIHandler extends AdminTabUIHandler<ShowResumeUI> implements UIHandler<ShowResumeUI> {
    
    41
    -
    
    42
    -    @Override
    
    43
    -    public void afterInit(ShowResumeUI ui) {
    
    44
    -        super.afterInit(ui);
    
    45
    -        UIHelper.setLayerUI(ui.getContent(), null);
    
    46
    -    }
    
    47
    -
    
    48
    -    public void updateText() {
    
    49
    -        AdminUIModel model = ui.getModel();
    
    50
    -        StringBuilder buffer = new StringBuilder();
    
    51
    -        if (!model.isWasStarted()) {
    
    52
    -            buffer.append(t("observe.admin.resume.no.operation.done"));
    
    53
    -        } else {
    
    54
    -            for (AdminStep s : model.getOperations()) {
    
    55
    -                WizardState state = model.getStepState(s);
    
    56
    -                String stateStr = "";
    
    57
    -                switch (state) {
    
    58
    -                    case CANCELED:
    
    59
    -                        stateStr = t("observe.admin.resume.operation.canceled");
    
    60
    -                        break;
    
    61
    -                    case FAILED:
    
    62
    -                        stateStr = t("observe.admin.resume.operation.failed");
    
    63
    -                        break;
    
    64
    -                    case NEED_FIX:
    
    65
    -                        stateStr = t("observe.admin.resume.operation.need.fix");
    
    66
    -                        break;
    
    67
    -                    case PENDING:
    
    68
    -                        stateStr = t("observe.admin.resume.operation.not.started");
    
    69
    -                        break;
    
    70
    -                    case RUNNING:
    
    71
    -                        stateStr = t("observe.admin.resume.operation.running");
    
    72
    -                        break;
    
    73
    -                    case SUCCESSED:
    
    74
    -                        stateStr = t("observe.admin.resume.operation.done");
    
    75
    -                        break;
    
    76
    -                }
    
    77
    -                buffer.append("\n\n");
    
    78
    -                buffer.append(I18nEnumHelper.getLabel(s));
    
    79
    -                buffer.append(" : ");
    
    80
    -                buffer.append(stateStr);
    
    81
    -                buffer.append(".");
    
    82
    -            }
    
    83
    -            buffer.append("\n\n");
    
    84
    -        }
    
    85
    -        getUi().getResume().setText(buffer.toString());
    
    86
    -    }
    
    87
    -
    
    88
    -    public void addMessage(AdminStep step, String text) {
    
    89
    -        getUi().getGlobalProgression().append(I18nEnumHelper.getLabel(step) + " - " + text + "\n");
    
    90
    -    }
    
    91
    -}

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/resume/actions/CopyResumeToClipBoard.java deleted
    1
    -package fr.ird.observe.client.datasource.actions.resume.actions;
    
    2
    -
    
    3
    -/*-
    
    4
    - * #%L
    
    5
    - * ObServe :: Client DataSource actions
    
    6
    - * %%
    
    7
    - * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    8
    - * %%
    
    9
    - * This program is free software: you can redistribute it and/or modify
    
    10
    - * it under the terms of the GNU General Public License as
    
    11
    - * published by the Free Software Foundation, either version 3 of the
    
    12
    - * License, or (at your option) any later version.
    
    13
    - *
    
    14
    - * This program is distributed in the hope that it will be useful,
    
    15
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    - * GNU General Public License for more details.
    
    18
    - *
    
    19
    - * You should have received a copy of the GNU General Public
    
    20
    - * License along with this program.  If not, see
    
    21
    - * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    - * #L%
    
    23
    - */
    
    24
    -
    
    25
    -import fr.ird.observe.client.datasource.actions.actions.AdminTabUIActionSupport;
    
    26
    -import fr.ird.observe.client.datasource.actions.resume.ShowResumeUI;
    
    27
    -import fr.ird.observe.client.util.ObserveKeyStrokesSupport;
    
    28
    -import fr.ird.observe.client.util.UIHelper;
    
    29
    -
    
    30
    -import java.awt.event.ActionEvent;
    
    31
    -
    
    32
    -import static io.ultreia.java4all.i18n.I18n.t;
    
    33
    -
    
    34
    -public class CopyResumeToClipBoard extends AdminTabUIActionSupport<ShowResumeUI> {
    
    35
    -
    
    36
    -    public CopyResumeToClipBoard() {
    
    37
    -        super(t("observe.action.copy.to.clipBoard"), t("observe.action.copy.to.clipBoard"), "report-copy", ObserveKeyStrokesSupport.KEY_STROKE_COPY_TO_CLIPBOARD);
    
    38
    -    }
    
    39
    -
    
    40
    -    @Override
    
    41
    -    protected void doActionPerformed(ActionEvent e, ShowResumeUI ui) {
    
    42
    -        UIHelper.copyToClipBoard(ui.getGlobalProgression().getText());
    
    43
    -    }
    
    44
    -
    
    45
    -}

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/tree/actions/RegisterTaskActionSupport.java
    ... ... @@ -27,7 +27,6 @@ import com.google.common.collect.ImmutableSet;
    27 27
     import fr.ird.observe.client.datasource.actions.AdminStep;
    
    28 28
     import fr.ird.observe.client.datasource.actions.AdminTabUI;
    
    29 29
     import fr.ird.observe.client.datasource.actions.AdminUI;
    
    30
    -import fr.ird.observe.client.datasource.actions.resume.ShowResumeUI;
    
    31 30
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialReplaceUI;
    
    32 31
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialReplaceUIHandler;
    
    33 32
     import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialSynchroModel;
    
    ... ... @@ -304,14 +303,8 @@ public abstract class RegisterTaskActionSupport extends ReferentialSelectionTree
    304 303
         }
    
    305 304
     
    
    306 305
         public String sendMessage(String message) {
    
    307
    -
    
    308 306
             AdminStep step = parentUI.getStep();
    
    309 307
             addMessage(step, message);
    
    310
    -        AdminUI parentUI = getParentUI();
    
    311
    -        ShowResumeUI resumeUI = (ShowResumeUI) parentUI.getStepUI(AdminStep.SHOW_RESUME);
    
    312
    -        if (resumeUI != null) {
    
    313
    -            addMessage(resumeUI, step, message);
    
    314
    -        }
    
    315 308
             return message;
    
    316 309
         }
    
    317 310
     
    

  • client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/actions/SaveReport.java
    ... ... @@ -83,7 +83,6 @@ public class SaveReport extends ValidateUIActionSupport {
    83 83
             String content = ValidateModelTemplate.generate(validationModel);
    
    84 84
     
    
    85 85
             log.debug(content);
    
    86
    -        addMessage(AdminStep.SHOW_RESUME, content);
    
    87 86
             FileUtils.write(reportFile, content, StandardCharsets.UTF_8.name());
    
    88 87
         }
    
    89 88
     
    

  • client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/ContentUIInitializer.java
    ... ... @@ -327,7 +327,7 @@ public class ContentUIInitializer<UI extends ContentUI> implements WithClientCon
    327 327
     
    
    328 328
             if (editor.getBean() != null) {
    
    329 329
                 if (UIHelper.isBindingFromBean(editor)) {
    
    330
    -                editor.getModel().addPropertyChangeListener(propertyName, e -> {
    
    330
    +                ((JavaBean)editor.getBean()).addPropertyChangeListener(propertyName, e -> {
    
    331 331
                         Float oldValue = editor.getModel().getTemperature();
    
    332 332
                         Float newValue = (Float) e.getNewValue();
    
    333 333
                         if (!Objects.equals(oldValue, newValue)) {
    
    ... ... @@ -342,17 +342,6 @@ public class ContentUIInitializer<UI extends ContentUI> implements WithClientCon
    342 342
             if (StringUtils.isEmpty(editor.getProperty())) {
    
    343 343
                 editor.setProperty(editor.getName());
    
    344 344
             }
    
    345
    -        if (editor.getBean() != null) {
    
    346
    -            if (UIHelper.isBindingFromBean(editor)) {
    
    347
    -                editor.getModel().addPropertyChangeListener(editor.getProperty(), e -> {
    
    348
    -                    String oldValue = editor.getText();
    
    349
    -                    String newValue = (String) e.getNewValue();
    
    350
    -                    if (!Objects.equals(oldValue, newValue)) {
    
    351
    -                        editor.setText(newValue);
    
    352
    -                    }
    
    353
    -                });
    
    354
    -            }
    
    355
    -        }
    
    356 345
             editor.setMinimumSize(new Dimension(50, 5 * 24));
    
    357 346
             editor.getTextEditor().setRows(4);
    
    358 347
         }
    
    ... ... @@ -361,36 +350,12 @@ public class ContentUIInitializer<UI extends ContentUI> implements WithClientCon
    361 350
             if (StringUtils.isEmpty(editor.getProperty())) {
    
    362 351
                 editor.setProperty(editor.getName());
    
    363 352
             }
    
    364
    -
    
    365
    -        if (editor.getBean() != null) {
    
    366
    -            if (UIHelper.isBindingFromBean(editor)) {
    
    367
    -                editor.getModel().addPropertyChangeListener(editor.getProperty(), e -> {
    
    368
    -                    String oldValue = editor.getText();
    
    369
    -                    String newValue = (String) e.getNewValue();
    
    370
    -                    if (!Objects.equals(oldValue, newValue)) {
    
    371
    -                        editor.setText(newValue);
    
    372
    -                    }
    
    373
    -                });
    
    374
    -            }
    
    375
    -        }
    
    376 353
         }
    
    377 354
     
    
    378 355
         protected void init(UrlEditor editor) {
    
    379 356
             if (StringUtils.isEmpty(editor.getProperty())) {
    
    380 357
                 editor.setProperty(editor.getName());
    
    381 358
             }
    
    382
    -
    
    383
    -        if (editor.getBean() != null) {
    
    384
    -            if (UIHelper.isBindingFromBean(editor)) {
    
    385
    -                editor.getModel().addPropertyChangeListener(editor.getProperty(), e -> {
    
    386
    -                    String oldValue = editor.getText();
    
    387
    -                    String newValue = (String) e.getNewValue();
    
    388
    -                    if (!Objects.equals(oldValue, newValue)) {
    
    389
    -                        editor.setText(newValue);
    
    390
    -                    }
    
    391
    -                });
    
    392
    -            }
    
    393
    -        }
    
    394 359
         }
    
    395 360
     
    
    396 361
         private void init(JLabel editor) {
    

  • observe-i18n/src/main/i18n/translations/observe_en_GB.properties
    ... ... @@ -374,13 +374,6 @@ observe.admin.report.select.file.tip=Choose file of reports definitions
    374 374
     observe.admin.report.title=Help to generat reports
    
    375 375
     observe.admin.report.title.tip=Help to generate reports
    
    376 376
     observe.admin.report.variables=Variables configuration
    
    377
    -observe.admin.resume.no.operation.done=No operation done.
    
    378
    -observe.admin.resume.operation.canceled=operation canceled
    
    379
    -observe.admin.resume.operation.done=operation done
    
    380
    -observe.admin.resume.operation.failed=operation failed
    
    381
    -observe.admin.resume.operation.need.fix=operation need fix
    
    382
    -observe.admin.resume.operation.not.started=operation not started
    
    383
    -observe.admin.resume.operation.running=operation is running...
    
    384 377
     observe.backup.done=[%s] Auto backup done (in %s)
    
    385 378
     observe.backup.start=[%s] Start auto backup
    
    386 379
     observe.choice.cancel=Cancel
    
    ... ... @@ -433,7 +426,6 @@ observe.common.gps.gpsPoint=Gps point
    433 426
     observe.common.label=Label
    
    434 427
     observe.common.lengthWeightFormula=Length weight formula
    
    435 428
     observe.common.no.unit=No unit
    
    436
    -observe.common.operation.resume=Summary of operations
    
    437 429
     observe.common.resume=Summary
    
    438 430
     observe.common.saveFile.overwrite=file alreayd exists, would you like to overwrite it?
    
    439 431
     observe.common.saveFile.overwrite.cancel=Cancel
    
    ... ... @@ -593,8 +585,6 @@ observe.constant.AdminStep.SAVE_LOCAL=Save local database
    593 585
     observe.constant.AdminStep.SAVE_LOCAL.description=Save modifcations on local database
    
    594 586
     observe.constant.AdminStep.SELECT_DATA=Select data
    
    595 587
     observe.constant.AdminStep.SELECT_DATA.description=Select data for operations
    
    596
    -observe.constant.AdminStep.SHOW_RESUME=Summary
    
    597
    -observe.constant.AdminStep.SHOW_RESUME.description=Summary of operations
    
    598 588
     observe.constant.AdminStep.SYNCHRONIZE=Update referential
    
    599 589
     observe.constant.AdminStep.SYNCHRONIZE.description=Update referential
    
    600 590
     observe.constant.AdminStep.VALIDATE=Validation
    

  • observe-i18n/src/main/i18n/translations/observe_es_ES.properties
    ... ... @@ -374,13 +374,6 @@ observe.admin.report.select.file.tip=Elegir el archivo de definición de informe
    374 374
     observe.admin.report.title=Ayuda a la generación de informes
    
    375 375
     observe.admin.report.title.tip=Ayuda a la generación del informe de fin del embarque
    
    376 376
     observe.admin.report.variables=Configuración de variables
    
    377
    -observe.admin.resume.no.operation.done=Ninguna operación realizada
    
    378
    -observe.admin.resume.operation.canceled=operación cancelada
    
    379
    -observe.admin.resume.operation.done=operacion realizada
    
    380
    -observe.admin.resume.operation.failed=operación no realizada
    
    381
    -observe.admin.resume.operation.need.fix=la operación necesita correcciones
    
    382
    -observe.admin.resume.operation.not.started=operación no empezada
    
    383
    -observe.admin.resume.operation.running=operación en curso...
    
    384 377
     observe.backup.done=[%s] Copia de seguridad automática realizada (en %s)
    
    385 378
     observe.backup.start=[%s] Inicio de copia de seguridad automática
    
    386 379
     observe.choice.cancel=Cancelar
    
    ... ... @@ -433,7 +426,6 @@ observe.common.gps.gpsPoint=Punto GPS
    433 426
     observe.common.label=Texto
    
    434 427
     observe.common.lengthWeightFormula=Relación de peso
    
    435 428
     observe.common.no.unit=No unit \#TODO
    
    436
    -observe.common.operation.resume=Resumen de operaciones
    
    437 429
     observe.common.resume=Resumen de la configuración
    
    438 430
     observe.common.saveFile.overwrite=El archivo ya existe. Quiere reemplazar lo ?
    
    439 431
     observe.common.saveFile.overwrite.cancel=Cancelar
    
    ... ... @@ -593,8 +585,6 @@ observe.constant.AdminStep.SAVE_LOCAL=Copia local de seguridad
    593 585
     observe.constant.AdminStep.SAVE_LOCAL.description=Guardar las modificaciones realizadas en la base original
    
    594 586
     observe.constant.AdminStep.SELECT_DATA=Selección de datos
    
    595 587
     observe.constant.AdminStep.SELECT_DATA.description=Selección de los datos para la realización de los operaciones
    
    596
    -observe.constant.AdminStep.SHOW_RESUME=Resumen
    
    597
    -observe.constant.AdminStep.SHOW_RESUME.description=Ver un resumen de los operaciones realizadas
    
    598 588
     observe.constant.AdminStep.SYNCHRONIZE=Actualización del referencial
    
    599 589
     observe.constant.AdminStep.SYNCHRONIZE.description=Actualizar el referencial con una base central
    
    600 590
     observe.constant.AdminStep.VALIDATE=Validación
    

  • observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
    ... ... @@ -374,13 +374,6 @@ observe.admin.report.select.file.tip=Choisir le fichier de définition des repor
    374 374
     observe.admin.report.title=Aide à la génération de rapport
    
    375 375
     observe.admin.report.title.tip=Aide à la génération du rapport de fin d'embarquement
    
    376 376
     observe.admin.report.variables=Configuration des variables
    
    377
    -observe.admin.resume.no.operation.done=Aucune opération réalisée.
    
    378
    -observe.admin.resume.operation.canceled=opération annulée
    
    379
    -observe.admin.resume.operation.done=opération réussie
    
    380
    -observe.admin.resume.operation.failed=opération échouée
    
    381
    -observe.admin.resume.operation.need.fix=opération nécessitant des corrections
    
    382
    -observe.admin.resume.operation.not.started=opération non démarrée
    
    383
    -observe.admin.resume.operation.running=opération en cours...
    
    384 377
     observe.backup.done=[%s] Fin de la sauvegarde automatique (en %s)
    
    385 378
     observe.backup.start=[%s] Début de la sauvegarde automatique
    
    386 379
     observe.choice.cancel=Annuler
    
    ... ... @@ -433,7 +426,6 @@ observe.common.gps.gpsPoint=Point GPS
    433 426
     observe.common.label=Libellé
    
    434 427
     observe.common.lengthWeightFormula=Relation Poids
    
    435 428
     observe.common.no.unit=Pas d'unité
    
    436
    -observe.common.operation.resume=Résumé des opérations
    
    437 429
     observe.common.resume=Résumé de la configuration
    
    438 430
     observe.common.saveFile.overwrite=Le fichier existe déjà. Voulez-vous le remplacer ?
    
    439 431
     observe.common.saveFile.overwrite.cancel=Annuler
    
    ... ... @@ -593,8 +585,6 @@ observe.constant.AdminStep.SAVE_LOCAL=Sauvegarde locale
    593 585
     observe.constant.AdminStep.SAVE_LOCAL.description=Sauver les modifications sur votre base source
    
    594 586
     observe.constant.AdminStep.SELECT_DATA=Sélection des données
    
    595 587
     observe.constant.AdminStep.SELECT_DATA.description=Sélection des données pour effectuer les opérations
    
    596
    -observe.constant.AdminStep.SHOW_RESUME=Résumé
    
    597
    -observe.constant.AdminStep.SHOW_RESUME.description=Voir un résumé des opérations effectuées
    
    598 588
     observe.constant.AdminStep.SYNCHRONIZE=Mise à jour du référentiel
    
    599 589
     observe.constant.AdminStep.SYNCHRONIZE.description=Mettre à jour le référentiel depuis une base centrale
    
    600 590
     observe.constant.AdminStep.VALIDATE=Validation
    

  • persistence/src/main/java/fr/ird/observe/entities/data/ps/observation/FloatingObjectTopiaDao.java deleted
    1
    -package fr.ird.observe.entities.data.ps.observation;
    
    2
    -
    
    3
    -/*
    
    4
    - * #%L
    
    5
    - * ObServe :: Persistence
    
    6
    - * %%
    
    7
    - * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    8
    - * %%
    
    9
    - * This program is free software: you can redistribute it and/or modify
    
    10
    - * it under the terms of the GNU General Public License as
    
    11
    - * published by the Free Software Foundation, either version 3 of the
    
    12
    - * License, or (at your option) any later version.
    
    13
    - *
    
    14
    - * This program is distributed in the hope that it will be useful,
    
    15
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    - * GNU General Public License for more details.
    
    18
    - *
    
    19
    - * You should have received a copy of the GNU General Public
    
    20
    - * License along with this program.  If not, see
    
    21
    - * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    - * #L%
    
    23
    - */
    
    24
    -
    
    25
    -import fr.ird.observe.dto.referential.I18nReferentialHelper;
    
    26
    -import fr.ird.observe.entities.referential.ps.common.ObjectOperation;
    
    27
    -import fr.ird.observe.entities.referential.ps.common.ObjectOperationImpl;
    
    28
    -import org.nuiton.topia.persistence.support.TopiaSqlQuery;
    
    29
    -import org.nuiton.topia.persistence.support.TopiaSqlSupport;
    
    30
    -
    
    31
    -import java.sql.Connection;
    
    32
    -import java.sql.PreparedStatement;
    
    33
    -import java.sql.ResultSet;
    
    34
    -import java.sql.SQLException;
    
    35
    -import java.util.List;
    
    36
    -
    
    37
    -public class FloatingObjectTopiaDao extends AbstractFloatingObjectTopiaDao<FloatingObject> {
    
    38
    -
    
    39
    -    public List<FloatingObject> findAllStubByActivityId(String activityId, int referenceLocale) {
    
    40
    -
    
    41
    -        return StubSqlQuery.findAll(topiaSqlSupport, activityId, referenceLocale);
    
    42
    -
    
    43
    -    }
    
    44
    -
    
    45
    -    private static class StubSqlQuery extends TopiaSqlQuery<FloatingObject> {
    
    46
    -
    
    47
    -        private final String sql;
    
    48
    -
    
    49
    -        private final String id;
    
    50
    -
    
    51
    -        private final int referenceLocale;
    
    52
    -
    
    53
    -        static List<FloatingObject> findAll(TopiaSqlSupport context, String activityId, int referenceLocale) {
    
    54
    -
    
    55
    -            String sql = "SELECT" +
    
    56
    -                    " fo.topiaId," +
    
    57
    -                    " ot." + I18nReferentialHelper.getPropertyName(referenceLocale) +
    
    58
    -                    " FROM ps_observation.floatingobject fo, ps_common.objectOperation ot" +
    
    59
    -                    " WHERE " +
    
    60
    -                    " fo.activity = ?" +
    
    61
    -                    " AND fo.objectOperation = ot.topiaid" +
    
    62
    -                    " ORDER BY ot." + I18nReferentialHelper.getPropertyName(referenceLocale);
    
    63
    -
    
    64
    -            StubSqlQuery request = new StubSqlQuery(sql, activityId, referenceLocale);
    
    65
    -            return context.findMultipleResult(request);
    
    66
    -
    
    67
    -        }
    
    68
    -
    
    69
    -        StubSqlQuery(String sql, String id, int referenceLocale) {
    
    70
    -            this.sql = sql;
    
    71
    -            this.id = id;
    
    72
    -            this.referenceLocale = referenceLocale;
    
    73
    -        }
    
    74
    -
    
    75
    -        @Override
    
    76
    -        public PreparedStatement prepareQuery(Connection connection) throws SQLException {
    
    77
    -            PreparedStatement preparedStatement = connection.prepareStatement(sql);
    
    78
    -            preparedStatement.setString(1, id);
    
    79
    -            return preparedStatement;
    
    80
    -        }
    
    81
    -
    
    82
    -        @Override
    
    83
    -        public FloatingObject prepareResult(ResultSet set) throws SQLException {
    
    84
    -
    
    85
    -            FloatingObject floatingObject = new FloatingObjectImpl();
    
    86
    -            floatingObject.setTopiaId(set.getString(1));
    
    87
    -
    
    88
    -            String objectTypeLabel = set.getString(2);
    
    89
    -            ObjectOperation objectType = new ObjectOperationImpl();
    
    90
    -            I18nReferentialHelper.setLabel(referenceLocale, objectType, objectTypeLabel);
    
    91
    -            floatingObject.setObjectOperation(objectType);
    
    92
    -
    
    93
    -            return floatingObject;
    
    94
    -
    
    95
    -        }
    
    96
    -
    
    97
    -    }
    
    98
    -
    
    99
    -}

  • pom.xml
    ... ... @@ -24,7 +24,7 @@
    24 24
       <parent>
    
    25 25
         <groupId>io.ultreia.maven</groupId>
    
    26 26
         <artifactId>pom</artifactId>
    
    27
    -    <version>2020.18</version>
    
    27
    +    <version>2020.19</version>
    
    28 28
       </parent>
    
    29 29
     
    
    30 30
       <groupId>fr.ird.observe</groupId>
    
    ... ... @@ -170,7 +170,7 @@
    170 170
     
    
    171 171
         <!--    <lib.version.java4all.topia>1.17</lib.version.java4all.topia>-->
    
    172 172
         <!--<lib.version.java4all.eugene>3.0<-alpha-22</lib.version.java4all.eugene>-->
    
    173
    -<!--        <lib.version.java4all.jaxx>3.0-alpha-66-SNAPSHOT</lib.version.java4all.jaxx>-->
    
    173
    +<!--    <lib.version.java4all.jaxx>3.0-alpha-67-SNAPSHOT</lib.version.java4all.jaxx>-->
    
    174 174
         <!--<lib.version.java4all.application-context>1.0.3-SNAPSHOT</lib.version.java4all.application-context>-->
    
    175 175
         <!--<lib.version.java4all.application-template>1.0.2-SNAPSHOT</lib.version.java4all.application-template>-->
    
    176 176
         <!--<lib.version.java4all.i18n>4.0-beta-3-SNAPSHOT</lib.version.java4all.i18n>-->
    

  • services-local/src/main/java/fr/ird/observe/services/local/service/actions/consolidate/ConsolidateDataServiceLocal.java
    ... ... @@ -375,6 +375,12 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements
    375 375
     
    
    376 376
         private void updateDcp(FloatingObject dcp, ConsolidationActivitySeineDataContext activityContext) {
    
    377 377
     
    
    378
    +        if (dcp.getObjectOperation() == null) {
    
    379
    +            log.warn("**********************");
    
    380
    +            log.warn(String.format("Floating object %s has no object operation....", dcp.getTopiaId()));
    
    381
    +            log.warn("**********************");
    
    382
    +            return;
    
    383
    +        }
    
    378 384
             FloatingObjectConsolidateEngine floatingObjectConsolidateEngine = activityContext.floatingObjectConsolidateEngine;
    
    379 385
     
    
    380 386
             ReferentialLocale referentialLocale = getReferentialLocale();
    

  • services-local/src/main/java/fr/ird/observe/services/local/service/data/ps/observation/FloatingObjectServiceLocal.java
    ... ... @@ -48,7 +48,6 @@ import fr.ird.observe.entities.referential.ps.common.TransmittingBuoyOperation;
    48 48
     import fr.ird.observe.entities.referential.ps.common.TransmittingBuoyOwnership;
    
    49 49
     import fr.ird.observe.entities.referential.ps.common.TransmittingBuoyType;
    
    50 50
     import fr.ird.observe.entities.referential.ps.observation.ObjectMaterial;
    
    51
    -import fr.ird.observe.entities.referential.ps.observation.ObjectMaterialTopiaDao;
    
    52 51
     import fr.ird.observe.entities.referential.ps.observation.ObservedSystem;
    
    53 52
     import fr.ird.observe.services.local.service.ObserveServiceLocal;
    
    54 53
     import fr.ird.observe.services.service.data.ps.observation.FloatingObjectService;
    
    ... ... @@ -76,16 +75,14 @@ public class FloatingObjectServiceLocal extends ObserveServiceLocal implements F
    76 75
     
    
    77 76
         @Override
    
    78 77
         public ObjectMaterialHierarchyDto getObjectMaterialHierarchy() {
    
    79
    -        ObjectMaterialTopiaDao dao = getTopiaPersistenceContext().getPsObservationObjectMaterialDao();
    
    80
    -        List<ObjectMaterial> objectMaterials = dao.findAll();
    
    78
    +        List<ObjectMaterial> objectMaterials = ObjectMaterial.getDao(getTopiaPersistenceContext()).findAll();
    
    81 79
             objectMaterials.sort(Comparator.comparing(ObjectMaterial::getCode));
    
    82 80
             return getObjectMaterialHierarchyDtos(objectMaterials).get(0);
    
    83 81
         }
    
    84 82
     
    
    85 83
         @Override
    
    86 84
         public DataDtoReferenceSet<FloatingObjectReference> getFloatingObjectByActivitySeine(String activitySeineId) {
    
    87
    -        ReferentialLocale referenceLocale = getReferentialLocale();
    
    88
    -        List<FloatingObject> entities = FloatingObject.getDao(getTopiaPersistenceContext()).findAllStubByActivityId(activitySeineId, referenceLocale.ordinal());
    
    85
    +        Set<FloatingObject> entities = Activity.loadEntity(getTopiaPersistenceContext(), activitySeineId).getFloatingObject();
    
    89 86
             return FloatingObject.toReferenceSet(entities, getReferentialLocale());
    
    90 87
         }
    
    91 88
     
    

  • services/src/main/java/fr/ird/observe/services/service/CleanTemporaryFilesTask.java
    ... ... @@ -64,6 +64,9 @@ public class CleanTemporaryFilesTask extends TimerTask {
    64 64
         public void run() {
    
    65 65
     
    
    66 66
             Path temporaryDirectory = configuration.getTemporaryDirectory().toPath();
    
    67
    +        if (Files.notExists(temporaryDirectory)) {
    
    68
    +            return;
    
    69
    +        }
    
    67 70
             Calendar calendar = Calendar.getInstance();
    
    68 71
             calendar.setTime(new Date());
    
    69 72
             calendar.add(Calendar.HOUR_OF_DAY, -configuration.getTemporaryFilesTimeout());
    

  • services/src/main/java/fr/ird/observe/services/service/data/ll/pairing/ActivityLonglinePairingResultItem.java
    ... ... @@ -75,7 +75,7 @@ public class ActivityLonglinePairingResultItem implements SimpleDto {
    75 75
                 long days = TimeUnit.MINUTES.toDays(computedTime);
    
    76 76
                 long hours = TimeUnit.MINUTES.toHours(computedTime) % 24;
    
    77 77
                 long minutes = TimeUnit.MINUTES.toMinutes(computedTime) % 60;
    
    78
    -            computedTimeStr += String.format("%s:%s:%s", days, hours, minutes);
    
    78
    +            computedTimeStr += String.format("%s:%s:%s", Math.abs(days), Math.abs(hours), Math.abs(minutes));
    
    79 79
             }
    
    80 80
             return computedTimeStr;
    
    81 81
         }