Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
17 changed files:
- client-configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
- client-core/src/main/i18n/getters/java-enumeration.getter
- client-core/src/main/i18n/getters/java.getter
- client-core/src/main/i18n/getters/jaxx.getter
- client-core/src/main/java/fr/ird/observe/client/ui/admin/AdminStep.java
- client-core/src/main/java/fr/ird/observe/client/ui/admin/AdminTabUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/admin/AdminUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/admin/AdminUIModel.java
- − client-core/src/main/java/fr/ird/observe/client/ui/admin/resume/ShowResumeModel.java
- − client-core/src/main/java/fr/ird/observe/client/ui/admin/resume/ShowResumeUI.jaxx
- − client-core/src/main/java/fr/ird/observe/client/ui/admin/resume/ShowResumeUI.jcss
- − client-core/src/main/java/fr/ird/observe/client/ui/admin/resume/ShowResumeUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/admin/validate/ValidateUIHandler.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
- services/src/main/java/fr/ird/observe/services/service/CleanTemporaryFilesTask.java
Changes:
| ... | ... | @@ -368,7 +368,7 @@ public class ClientConfig extends GeneratedClientConfig implements NavigationTre |
| 368 | 368 |
}
|
| 369 | 369 |
|
| 370 | 370 |
public File newBackupDataFile() {
|
| 371 |
- return new File(getBackupDirectory(), String.format(BACKUP_DB_PATTERN, getBuildVersion(), new Date()));
|
|
| 371 |
+ return new File(getBackupDirectory(), String.format(BACKUP_DB_PATTERN, getBuildVersion().toString().replaceAll("\\.", "_"), new Date()));
|
|
| 372 | 372 |
}
|
| 373 | 373 |
|
| 374 | 374 |
public void saveForUser() {
|
| ... | ... | @@ -14,8 +14,6 @@ observe.constant.AdminStep.SAVE_LOCAL |
| 14 | 14 |
observe.constant.AdminStep.SAVE_LOCAL.description
|
| 15 | 15 |
observe.constant.AdminStep.SELECT_DATA
|
| 16 | 16 |
observe.constant.AdminStep.SELECT_DATA.description
|
| 17 |
-observe.constant.AdminStep.SHOW_RESUME
|
|
| 18 |
-observe.constant.AdminStep.SHOW_RESUME.description
|
|
| 19 | 17 |
observe.constant.AdminStep.SYNCHRONIZE
|
| 20 | 18 |
observe.constant.AdminStep.SYNCHRONIZE.description
|
| 21 | 19 |
observe.constant.AdminStep.VALIDATE
|
| ... | ... | @@ -247,13 +247,6 @@ observe.actions.validate.validator.message.header |
| 247 | 247 |
observe.actions.validate.validator.message.header.tip
|
| 248 | 248 |
observe.actions.validate.validator.scope.header
|
| 249 | 249 |
observe.actions.validate.validator.scope.header.tip
|
| 250 |
-observe.admin.resume.no.operation.done
|
|
| 251 |
-observe.admin.resume.operation.canceled
|
|
| 252 |
-observe.admin.resume.operation.done
|
|
| 253 |
-observe.admin.resume.operation.failed
|
|
| 254 |
-observe.admin.resume.operation.need.fix
|
|
| 255 |
-observe.admin.resume.operation.not.started
|
|
| 256 |
-observe.admin.resume.operation.running
|
|
| 257 | 250 |
observe.backup.done
|
| 258 | 251 |
observe.backup.start
|
| 259 | 252 |
observe.choice.cancel
|
| ... | ... | @@ -724,7 +724,6 @@ observe.common.directory |
| 724 | 724 |
observe.common.file
|
| 725 | 725 |
observe.common.global.progression.description
|
| 726 | 726 |
observe.common.ocean
|
| 727 |
-observe.common.operation.resume
|
|
| 728 | 727 |
observe.common.resume
|
| 729 | 728 |
observe.common.sizeMeasureType
|
| 730 | 729 |
observe.common.species
|
| ... | ... | @@ -30,7 +30,6 @@ import fr.ird.observe.client.ui.admin.export.ExportModel; |
| 30 | 30 |
import fr.ird.observe.client.ui.admin.export.ExportUI;
|
| 31 | 31 |
import fr.ird.observe.client.ui.admin.report.ReportModel;
|
| 32 | 32 |
import fr.ird.observe.client.ui.admin.report.ReportUI;
|
| 33 |
-import fr.ird.observe.client.ui.admin.resume.ShowResumeUI;
|
|
| 34 | 33 |
import fr.ird.observe.client.ui.admin.save.SaveLocalModel;
|
| 35 | 34 |
import fr.ird.observe.client.ui.admin.save.SaveLocalUI;
|
| 36 | 35 |
import fr.ird.observe.client.ui.admin.synchronize.data.DataSynchroModel;
|
| ... | ... | @@ -218,13 +217,6 @@ public enum AdminStep implements WizardExtStep { |
| 218 | 217 |
DbMode.USE_LOCAL,
|
| 219 | 218 |
DbMode.USE_REMOTE,
|
| 220 | 219 |
DbMode.USE_SERVER
|
| 221 |
- ),
|
|
| 222 |
- |
|
| 223 |
- /** pour afficher après les opération un ecran de résumé */
|
|
| 224 |
- SHOW_RESUME(
|
|
| 225 |
- null,
|
|
| 226 |
- ShowResumeUI.class,
|
|
| 227 |
- false
|
|
| 228 | 220 |
);
|
| 229 | 221 |
|
| 230 | 222 |
private final String iconName;
|
| ... | ... | @@ -24,7 +24,6 @@ package fr.ird.observe.client.ui.admin; |
| 24 | 24 |
import fr.ird.observe.client.ObserveRunner;
|
| 25 | 25 |
import fr.ird.observe.client.ObserveSwingApplicationContext;
|
| 26 | 26 |
import fr.ird.observe.client.db.ObserveSwingDataSource;
|
| 27 |
-import fr.ird.observe.client.ui.admin.resume.ShowResumeUI;
|
|
| 28 | 27 |
import fr.ird.observe.client.ui.content.ref.usage.UsageForDisplayUI;
|
| 29 | 28 |
import fr.ird.observe.client.ui.util.ProgressModel;
|
| 30 | 29 |
import fr.ird.observe.client.ui.util.UIHelper;
|
| ... | ... | @@ -161,13 +160,8 @@ public class AdminTabUIHandler<U extends AdminTabUI> { |
| 161 | 160 |
}
|
| 162 | 161 |
|
| 163 | 162 |
public void sendMessage(String message) {
|
| 164 |
- |
|
| 165 | 163 |
AdminStep step = ui.getStep();
|
| 166 | 164 |
ui.addMessage(step, message);
|
| 167 |
- ShowResumeUI resumeUI = (ShowResumeUI) parentUI.getStepUI(AdminStep.SHOW_RESUME);
|
|
| 168 |
- if (resumeUI != null) {
|
|
| 169 |
- resumeUI.addMessage(step, message);
|
|
| 170 |
- }
|
|
| 171 | 165 |
}
|
| 172 | 166 |
|
| 173 | 167 |
public String getProgressString(int currentStep, int nbStep) {
|
| ... | ... | @@ -28,7 +28,6 @@ import fr.ird.observe.client.ui.admin.config.ConfigUI; |
| 28 | 28 |
import fr.ird.observe.client.ui.admin.config.SelectDataUI;
|
| 29 | 29 |
import fr.ird.observe.client.ui.admin.consolidate.ConsolidateUI;
|
| 30 | 30 |
import fr.ird.observe.client.ui.admin.export.ExportUI;
|
| 31 |
-import fr.ird.observe.client.ui.admin.resume.ShowResumeUI;
|
|
| 32 | 31 |
import fr.ird.observe.client.ui.admin.save.SaveLocalUI;
|
| 33 | 32 |
import fr.ird.observe.client.ui.admin.synchronize.data.DataSynchroUI;
|
| 34 | 33 |
import fr.ird.observe.client.ui.admin.synchronize.referential.legacy.SynchronizeUI;
|
| ... | ... | @@ -36,8 +35,8 @@ import fr.ird.observe.client.ui.admin.synchronize.referential.ng.ReferentialSync |
| 36 | 35 |
import fr.ird.observe.client.ui.admin.validate.ValidateUI;
|
| 37 | 36 |
import fr.ird.observe.client.ui.util.UIHelper;
|
| 38 | 37 |
import fr.ird.observe.dto.I18nEnumHelper;
|
| 39 |
-import org.apache.logging.log4j.Logger;
|
|
| 40 | 38 |
import org.apache.logging.log4j.LogManager;
|
| 39 |
+import org.apache.logging.log4j.Logger;
|
|
| 41 | 40 |
import org.nuiton.jaxx.runtime.spi.UIHandler;
|
| 42 | 41 |
import org.nuiton.jaxx.runtime.swing.wizard.WizardUILancher;
|
| 43 | 42 |
import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardExtUtil;
|
| ... | ... | @@ -302,12 +301,6 @@ public class AdminUIHandler implements UIHandler<AdminUI> { |
| 302 | 301 |
SaveLocalUI tabUI = (SaveLocalUI) ui.getStepUI(AdminStep.SAVE_LOCAL);
|
| 303 | 302 |
tabUI.getHandler().updateText();
|
| 304 | 303 |
}
|
| 305 |
- if (c != null && c.getStep() == AdminStep.SHOW_RESUME) {
|
|
| 306 |
- |
|
| 307 |
- // on met a jour le resumé des opérations
|
|
| 308 |
- ShowResumeUI showResumeUI = (ShowResumeUI) ui.getStepUI(AdminStep.SHOW_RESUME);
|
|
| 309 |
- showResumeUI.getHandler().updateText();
|
|
| 310 |
- }
|
|
| 311 | 304 |
|
| 312 | 305 |
// selection du nouvel onglet
|
| 313 | 306 |
int index = ui.tabs.indexOfComponent(c);
|
| ... | ... | @@ -386,14 +379,6 @@ public class AdminUIHandler implements UIHandler<AdminUI> { |
| 386 | 379 |
itr = UIHelper.newTabbedPaneIterator(ui.getTabs());
|
| 387 | 380 |
}
|
| 388 | 381 |
|
| 389 |
- if (selected != null && selected.getStep() == AdminStep.SHOW_RESUME) {
|
|
| 390 |
- |
|
| 391 |
- // rien a faire sur le dernier onglet
|
|
| 392 |
- if (log.isDebugEnabled()) {
|
|
| 393 |
- log.debug("We are on last step (resume), nothing to do.");
|
|
| 394 |
- }
|
|
| 395 |
- return;
|
|
| 396 |
- }
|
|
| 397 | 382 |
boolean[] accessibleSteps = ui.getModel().getAccessibleSteps();
|
| 398 | 383 |
if (log.isDebugEnabled()) {
|
| 399 | 384 |
log.debug("Accessibles step : " + Arrays.toString(accessibleSteps));
|
| ... | ... | @@ -27,14 +27,13 @@ import fr.ird.observe.client.ui.admin.config.SelectDataModel; |
| 27 | 27 |
import fr.ird.observe.client.ui.admin.consolidate.ConsolidateModel;
|
| 28 | 28 |
import fr.ird.observe.client.ui.admin.export.ExportModel;
|
| 29 | 29 |
import fr.ird.observe.client.ui.admin.report.ReportModel;
|
| 30 |
-import fr.ird.observe.client.ui.admin.resume.ShowResumeModel;
|
|
| 31 | 30 |
import fr.ird.observe.client.ui.admin.save.SaveLocalModel;
|
| 32 | 31 |
import fr.ird.observe.client.ui.admin.synchronize.data.DataSynchroModel;
|
| 33 | 32 |
import fr.ird.observe.client.ui.admin.synchronize.referential.legacy.SynchronizeModel;
|
| 34 | 33 |
import fr.ird.observe.client.ui.admin.synchronize.referential.ng.ReferentialSynchroModel;
|
| 35 | 34 |
import fr.ird.observe.client.ui.admin.validate.ValidateModel;
|
| 36 |
-import org.apache.logging.log4j.Logger;
|
|
| 37 | 35 |
import org.apache.logging.log4j.LogManager;
|
| 36 |
+import org.apache.logging.log4j.Logger;
|
|
| 38 | 37 |
import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardExtModel;
|
| 39 | 38 |
import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState;
|
| 40 | 39 |
|
| ... | ... | @@ -68,8 +67,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> { |
| 68 | 67 |
|
| 69 | 68 |
protected final SelectDataModel selectDataModel = new SelectDataModel();
|
| 70 | 69 |
|
| 71 |
- protected final ShowResumeModel showResumeModel = new ShowResumeModel();
|
|
| 72 |
- |
|
| 73 | 70 |
/** la liste des modes disponibles en entrée */
|
| 74 | 71 |
protected final EnumSet<DbMode> availableIncomingModes;
|
| 75 | 72 |
|
| ... | ... | @@ -158,10 +155,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> { |
| 158 | 155 |
return configModel;
|
| 159 | 156 |
}
|
| 160 | 157 |
|
| 161 |
- public ShowResumeModel getShowResumeModel() {
|
|
| 162 |
- return showResumeModel;
|
|
| 163 |
- }
|
|
| 164 |
- |
|
| 165 | 158 |
public SelectDataModel getSelectDataModel() {
|
| 166 | 159 |
return selectDataModel;
|
| 167 | 160 |
}
|
| ... | ... | @@ -402,8 +395,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> { |
| 402 | 395 |
return getSynchronizeReferentielModel().validate(this, step);
|
| 403 | 396 |
case SAVE_LOCAL:
|
| 404 | 397 |
return getSaveLocalModel().validate(this, step);
|
| 405 |
- case SHOW_RESUME:
|
|
| 406 |
- return getShowResumeModel().validate(this);
|
|
| 407 | 398 |
}
|
| 408 | 399 |
return true;
|
| 409 | 400 |
}
|
| ... | ... | @@ -416,8 +407,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> { |
| 416 | 407 |
// toujours l'onglet de configuration des opérations
|
| 417 | 408 |
universe.add(AdminStep.CONFIG);
|
| 418 | 409 |
|
| 419 |
- // pour savoir si on doit ajouter l'onglet de résumé (cas par défaut)
|
|
| 420 |
- boolean needResume = true;
|
|
| 421 | 410 |
if (!operations.isEmpty()) {
|
| 422 | 411 |
|
| 423 | 412 |
if (needSelect()) {
|
| ... | ... | @@ -457,9 +446,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> { |
| 457 | 446 |
if (containsOperation(AdminStep.REPORT)) {
|
| 458 | 447 |
|
| 459 | 448 |
universe.add(AdminStep.REPORT);
|
| 460 |
- |
|
| 461 |
- // pas de page de resume
|
|
| 462 |
- needResume = false;
|
|
| 463 | 449 |
}
|
| 464 | 450 |
|
| 465 | 451 |
updateSaveLocalOperation();
|
| ... | ... | @@ -475,12 +461,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> { |
| 475 | 461 |
// ajout de l'onglet de sauvegarde de la base distante
|
| 476 | 462 |
universe.add(AdminStep.EXPORT_DATA);
|
| 477 | 463 |
}
|
| 478 |
- |
|
| 479 |
- if (needResume) {
|
|
| 480 |
- |
|
| 481 |
- // ajout d'un onglet de resume
|
|
| 482 |
- universe.add(AdminStep.SHOW_RESUME);
|
|
| 483 |
- }
|
|
| 484 | 464 |
}
|
| 485 | 465 |
return universe.toArray(new AdminStep[0]);
|
| 486 | 466 |
}
|
| ... | ... | @@ -490,6 +470,7 @@ public class AdminUIModel extends WizardExtModel<AdminStep> { |
| 490 | 470 |
for (AdminStep s : operations) {
|
| 491 | 471 |
if (s.isNeedSave()) {
|
| 492 | 472 |
shouldAdd = true;
|
| 473 |
+ break;
|
|
| 493 | 474 |
}
|
| 494 | 475 |
}
|
| 495 | 476 |
if (shouldAdd) {
|
| 1 |
-package fr.ird.observe.client.ui.admin.resume;
|
|
| 2 |
- |
|
| 3 |
-/*-
|
|
| 4 |
- * #%L
|
|
| 5 |
- * ObServe :: Client core
|
|
| 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.ui.admin.AdminActionModel;
|
|
| 26 |
-import fr.ird.observe.client.ui.admin.AdminStep;
|
|
| 27 |
-import fr.ird.observe.client.ui.admin.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 |
-}
|
| 1 |
-<!--
|
|
| 2 |
- #%L
|
|
| 3 |
- ObServe :: Client core
|
|
| 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 |
-<!-- **************************************** -->
|
|
| 24 |
-<!-- L'écran de résumé des opérations passées -->
|
|
| 25 |
-<!-- **************************************** -->
|
|
| 26 |
- |
|
| 27 |
-<fr.ird.observe.client.ui.admin.AdminTabUI>
|
|
| 28 |
- |
|
| 29 |
- <import>
|
|
| 30 |
- fr.ird.observe.client.ui.util.UIHelper
|
|
| 31 |
- fr.ird.observe.client.ui.admin.AdminActionModel
|
|
| 32 |
- fr.ird.observe.client.ui.admin.AdminUI
|
|
| 33 |
- fr.ird.observe.client.ui.admin.AdminStep
|
|
| 34 |
- fr.ird.observe.client.ui.admin.AdminTabUI
|
|
| 35 |
- |
|
| 36 |
- java.awt.Dimension
|
|
| 37 |
- </import>
|
|
| 38 |
- |
|
| 39 |
- <ShowResumeModel id='stepModel' initializer='getModel().getShowResumeModel()'/>
|
|
| 40 |
- |
|
| 41 |
- <script><![CDATA[
|
|
| 42 |
- |
|
| 43 |
-@Override
|
|
| 44 |
-public void destroy() {
|
|
| 45 |
- super.destroy();
|
|
| 46 |
- globalProgression.setText("");
|
|
| 47 |
- resume.setText("");
|
|
| 48 |
-}
|
|
| 49 |
- |
|
| 50 |
-@Override
|
|
| 51 |
-public void addMessage(AdminStep step, String text) {
|
|
| 52 |
- getHandler().addMessage(step, text);
|
|
| 53 |
-}
|
|
| 54 |
-]]>
|
|
| 55 |
- </script>
|
|
| 56 |
- |
|
| 57 |
- <JPanel id='PENDING_content'>
|
|
| 58 |
- <Table constraints='BorderLayout.CENTER' fill='both' weightx='1'
|
|
| 59 |
- weighty='1'>
|
|
| 60 |
- <row>
|
|
| 61 |
- <cell>
|
|
| 62 |
- <JScrollPane id='resumePane'>
|
|
| 63 |
- <JTextArea id='resume'/>
|
|
| 64 |
- </JScrollPane>
|
|
| 65 |
- </cell>
|
|
| 66 |
- </row>
|
|
| 67 |
- <row>
|
|
| 68 |
- <cell>
|
|
| 69 |
- <JScrollPane id='globalProgressionPane' columnHeaderView='{globalProgressionTop}'>
|
|
| 70 |
- <JTextArea id='globalProgression'/>
|
|
| 71 |
- <JToolBar id='globalProgressionTop'>
|
|
| 72 |
- <JLabel id='globalProgressionTopLabel'/>
|
|
| 73 |
- <javax.swing.Box.Filler
|
|
| 74 |
- constructorParams='UIHelper.newMinDimension(), UIHelper.newMinDimension(), UIHelper.newMaxXDimension()'/>
|
|
| 75 |
- <JButton id="globalProgressionCopyToClipBoard"
|
|
| 76 |
- onActionPerformed='UIHelper.copyToClipBoard(globalProgression.getText())'/>
|
|
| 77 |
- </JToolBar>
|
|
| 78 |
- </JScrollPane>
|
|
| 79 |
- </cell>
|
|
| 80 |
- </row>
|
|
| 81 |
- </Table>
|
|
| 82 |
- </JPanel>
|
|
| 83 |
- |
|
| 84 |
-</fr.ird.observe.client.ui.admin.AdminTabUI>
|
| 1 |
-/*
|
|
| 2 |
- * #%L
|
|
| 3 |
- * ObServe :: Client core
|
|
| 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 |
-#globalProgressionCopyToClipBoard {
|
|
| 60 |
- toolTipText:"observe.action.copy.to.clipBoard";
|
|
| 61 |
- actionIcon:"report-copy";
|
|
| 62 |
- mnemonic:C;
|
|
| 63 |
-}
|
|
| 64 |
- |
| 1 |
-/*
|
|
| 2 |
- * #%L
|
|
| 3 |
- * ObServe :: Client core
|
|
| 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.ui.admin.resume;
|
|
| 23 |
- |
|
| 24 |
-import fr.ird.observe.client.ui.admin.AdminStep;
|
|
| 25 |
-import fr.ird.observe.client.ui.admin.AdminTabUIHandler;
|
|
| 26 |
-import fr.ird.observe.client.ui.admin.AdminUIModel;
|
|
| 27 |
-import fr.ird.observe.client.ui.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 |
-}
|
| ... | ... | @@ -475,16 +475,10 @@ public class ValidateUIHandler extends AdminTabUIHandler<ValidateUI> implements |
| 475 | 475 |
|
| 476 | 476 |
private void generateReportFile(ValidateModel validationModel) throws IOException {
|
| 477 | 477 |
File reportFile = validationModel.getReportFile();
|
| 478 |
- if (log.isInfoEnabled()) {
|
|
| 479 |
- log.info("save report in " + reportFile);
|
|
| 480 |
- }
|
|
| 481 |
- |
|
| 478 |
+ log.info(String.format("save report in %s", reportFile));
|
|
| 482 | 479 |
validationModel.setDecoratorService(getDecoratorService());
|
| 483 |
- |
|
| 484 | 480 |
String content = ObserveSwingApplicationContext.get().getTextGenerator().getValidationReport(validationModel);
|
| 485 |
- |
|
| 486 | 481 |
log.debug(content);
|
| 487 |
- addMessage(AdminStep.SHOW_RESUME, content);
|
|
| 488 | 482 |
FileUtils.write(reportFile, content, Charsets.UTF_8.name());
|
| 489 | 483 |
}
|
| 490 | 484 |
|
| ... | ... | @@ -319,13 +319,6 @@ observe.actions.validate.validator.message.header=Message |
| 319 | 319 |
observe.actions.validate.validator.message.header.tip=Message
|
| 320 | 320 |
observe.actions.validate.validator.scope.header=...
|
| 321 | 321 |
observe.actions.validate.validator.scope.header.tip=Type of message
|
| 322 |
-observe.admin.resume.no.operation.done=No operation done.
|
|
| 323 |
-observe.admin.resume.operation.canceled=operation canceled
|
|
| 324 |
-observe.admin.resume.operation.done=operation done
|
|
| 325 |
-observe.admin.resume.operation.failed=operation failed
|
|
| 326 |
-observe.admin.resume.operation.need.fix=operation need fix
|
|
| 327 |
-observe.admin.resume.operation.not.started=operation not started
|
|
| 328 |
-observe.admin.resume.operation.running=operation is running...
|
|
| 329 | 322 |
observe.backup.done=[%s] Auto backup done (in %s)
|
| 330 | 323 |
observe.backup.start=[%s] Start auto backup
|
| 331 | 324 |
observe.choice.cancel=Cancel
|
| ... | ... | @@ -1688,7 +1681,6 @@ observe.common.no.unit=No unit |
| 1688 | 1681 |
observe.common.nocode=Nocode
|
| 1689 | 1682 |
observe.common.none=None
|
| 1690 | 1683 |
observe.common.ocean=Ocean
|
| 1691 |
-observe.common.operation.resume=Summary of operations
|
|
| 1692 | 1684 |
observe.common.resume=Summary
|
| 1693 | 1685 |
observe.common.saveFile.overwrite=file alreayd exists, would you like to overwrite it?
|
| 1694 | 1686 |
observe.common.saveFile.overwrite.cancel=Cancel
|
| ... | ... | @@ -1829,8 +1821,6 @@ observe.constant.AdminStep.SAVE_LOCAL=Save local database |
| 1829 | 1821 |
observe.constant.AdminStep.SAVE_LOCAL.description=Save modifcations on local database
|
| 1830 | 1822 |
observe.constant.AdminStep.SELECT_DATA=Select data
|
| 1831 | 1823 |
observe.constant.AdminStep.SELECT_DATA.description=Select data for operations
|
| 1832 |
-observe.constant.AdminStep.SHOW_RESUME=Summary
|
|
| 1833 |
-observe.constant.AdminStep.SHOW_RESUME.description=Summary of operations
|
|
| 1834 | 1824 |
observe.constant.AdminStep.SYNCHRONIZE=Update referential
|
| 1835 | 1825 |
observe.constant.AdminStep.SYNCHRONIZE.description=Update referential
|
| 1836 | 1826 |
observe.constant.AdminStep.VALIDATE=Validation
|
| ... | ... | @@ -319,13 +319,6 @@ observe.actions.validate.validator.message.header=Mensaje |
| 319 | 319 |
observe.actions.validate.validator.message.header.tip=Texto del mensaje
|
| 320 | 320 |
observe.actions.validate.validator.scope.header=...
|
| 321 | 321 |
observe.actions.validate.validator.scope.header.tip=Tipo de mensaje
|
| 322 |
-observe.admin.resume.no.operation.done=Ninguna operación realizada
|
|
| 323 |
-observe.admin.resume.operation.canceled=Operación cancelada
|
|
| 324 |
-observe.admin.resume.operation.done=Operación realizada
|
|
| 325 |
-observe.admin.resume.operation.failed=Operación no realizada
|
|
| 326 |
-observe.admin.resume.operation.need.fix=La operación necesita correcciones
|
|
| 327 |
-observe.admin.resume.operation.not.started=Operación no iniciada
|
|
| 328 |
-observe.admin.resume.operation.running=Operación en curso...
|
|
| 329 | 322 |
observe.backup.done=[%s] Copia de seguridad automática realizada (en %s)
|
| 330 | 323 |
observe.backup.start=[%s] Inicio de copia de seguridad automática
|
| 331 | 324 |
observe.choice.cancel=Cancelar
|
| ... | ... | @@ -1688,7 +1681,6 @@ observe.common.no.unit=Sin registros |
| 1688 | 1681 |
observe.common.nocode=Código ausente
|
| 1689 | 1682 |
observe.common.none=Ninguno
|
| 1690 | 1683 |
observe.common.ocean=Océano
|
| 1691 |
-observe.common.operation.resume=Resumen de operaciones
|
|
| 1692 | 1684 |
observe.common.resume=Resumen de la configuración
|
| 1693 | 1685 |
observe.common.saveFile.overwrite=El archivo ya existe ¿Quiere reemplazarlo?
|
| 1694 | 1686 |
observe.common.saveFile.overwrite.cancel=Cancelar
|
| ... | ... | @@ -1829,8 +1821,6 @@ observe.constant.AdminStep.SAVE_LOCAL=Copia local de seguridad |
| 1829 | 1821 |
observe.constant.AdminStep.SAVE_LOCAL.description=Guardar las modificaciones realizadas en la base original
|
| 1830 | 1822 |
observe.constant.AdminStep.SELECT_DATA=Selección de datos
|
| 1831 | 1823 |
observe.constant.AdminStep.SELECT_DATA.description=Selección de los datos para la realización de los operaciones
|
| 1832 |
-observe.constant.AdminStep.SHOW_RESUME=Resumen
|
|
| 1833 |
-observe.constant.AdminStep.SHOW_RESUME.description=Ver un resumen de los operaciones realizadas
|
|
| 1834 | 1824 |
observe.constant.AdminStep.SYNCHRONIZE=Actualización del referencial
|
| 1835 | 1825 |
observe.constant.AdminStep.SYNCHRONIZE.description=Actualizar el referencial con una base central
|
| 1836 | 1826 |
observe.constant.AdminStep.VALIDATE=Validación
|
| ... | ... | @@ -319,13 +319,6 @@ observe.actions.validate.validator.message.header=Message |
| 319 | 319 |
observe.actions.validate.validator.message.header.tip=Le texte du message
|
| 320 | 320 |
observe.actions.validate.validator.scope.header=...
|
| 321 | 321 |
observe.actions.validate.validator.scope.header.tip=Le type de message
|
| 322 |
-observe.admin.resume.no.operation.done=Aucune opération réalisée.
|
|
| 323 |
-observe.admin.resume.operation.canceled=opération annulée
|
|
| 324 |
-observe.admin.resume.operation.done=opération réussie
|
|
| 325 |
-observe.admin.resume.operation.failed=opération échouée
|
|
| 326 |
-observe.admin.resume.operation.need.fix=opération nécessitant des corrections
|
|
| 327 |
-observe.admin.resume.operation.not.started=opération non démarrée
|
|
| 328 |
-observe.admin.resume.operation.running=opération en cours...
|
|
| 329 | 322 |
observe.backup.done=[%s] Fin de la sauvegarde automatique (en %s)
|
| 330 | 323 |
observe.backup.start=[%s] Début de la sauvegarde automatique
|
| 331 | 324 |
observe.choice.cancel=Annuler
|
| ... | ... | @@ -1688,7 +1681,6 @@ observe.common.no.unit=Pas d'unité |
| 1688 | 1681 |
observe.common.nocode=code absent
|
| 1689 | 1682 |
observe.common.none=Aucun
|
| 1690 | 1683 |
observe.common.ocean=Océan
|
| 1691 |
-observe.common.operation.resume=Résumé des opérations
|
|
| 1692 | 1684 |
observe.common.resume=Résumé de la configuration
|
| 1693 | 1685 |
observe.common.saveFile.overwrite=Le fichier existe déjà. Voulez-vous le remplacer ?
|
| 1694 | 1686 |
observe.common.saveFile.overwrite.cancel=Annuler
|
| ... | ... | @@ -1829,8 +1821,6 @@ observe.constant.AdminStep.SAVE_LOCAL=Sauvegarde locale |
| 1829 | 1821 |
observe.constant.AdminStep.SAVE_LOCAL.description=Sauver les modifications sur votre base source
|
| 1830 | 1822 |
observe.constant.AdminStep.SELECT_DATA=Sélection des données
|
| 1831 | 1823 |
observe.constant.AdminStep.SELECT_DATA.description=Sélection des données pour effectuer les opérations
|
| 1832 |
-observe.constant.AdminStep.SHOW_RESUME=Résumé
|
|
| 1833 |
-observe.constant.AdminStep.SHOW_RESUME.description=Voir un résumé des opérations effectuées
|
|
| 1834 | 1824 |
observe.constant.AdminStep.SYNCHRONIZE=Mise à jour du référentiel
|
| 1835 | 1825 |
observe.constant.AdminStep.SYNCHRONIZE.description=Mettre à jour le référentiel depuis une base centrale
|
| 1836 | 1826 |
observe.constant.AdminStep.VALIDATE=Validation
|
| ... | ... | @@ -63,6 +63,9 @@ public class CleanTemporaryFilesTask extends TimerTask { |
| 63 | 63 |
public void run() {
|
| 64 | 64 |
|
| 65 | 65 |
Path temporaryDirectory = configuration.getTemporaryDirectory().toPath();
|
| 66 |
+ if (Files.notExists(temporaryDirectory)) {
|
|
| 67 |
+ return;
|
|
| 68 |
+ }
|
|
| 66 | 69 |
Calendar calendar = Calendar.getInstance();
|
| 67 | 70 |
calendar.setTime(new Date());
|
| 68 | 71 |
calendar.add(Calendar.HOUR_OF_DAY, -configuration.getTemporaryFilesTimeout());
|